|
@@ -1,11 +1,11 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
-<mapper namespace="com.persagy.dmp.rwd.migrate.SyncDataMapper">
|
|
|
+<mapper namespace="com.persagy.dmp.rwd.migrate.dao.SyncDataMapper">
|
|
|
<resultMap id="BaseResultMap" type="com.persagy.dmp.rwd.migrate.entity.SyncData">
|
|
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
|
|
<id column="table_name" jdbcType="VARCHAR" property="tableName" />
|
|
|
<result column="target_id" jdbcType="VARCHAR" property="targetId" />
|
|
|
- <result column="obj_type" jdbcType="VARCHAR" property="objType" />
|
|
|
+ <result column="object_type" jdbcType="VARCHAR" property="objectType" />
|
|
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
|
|
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
|
|
|
<result column="sign" jdbcType="INTEGER" property="sign" />
|
|
@@ -28,32 +28,38 @@
|
|
|
<result column="ts" jdbcType="TIMESTAMP" property="ts" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
- id, table_name, target_id, obj_type, `type`, project_id, sign, ops, ops_name, from_id, to_id,
|
|
|
+ id, table_name, target_id, object_type, `type`, project_id, sign, ops, ops_name, from_id, to_id,
|
|
|
error, class_code, local_name, local_id, `name`, code, obj_name, creator, creation_time,
|
|
|
modifier, modified_time, `valid`, ts
|
|
|
</sql>
|
|
|
|
|
|
<insert id="save">
|
|
|
- insert into dt_sync_data (id,table_name,target_id, obj_type, `type`,
|
|
|
+ <selectKey keyProperty="id" resultType="java.lang.String" order="BEFORE">
|
|
|
+ select uuid()
|
|
|
+ </selectKey>
|
|
|
+ insert into dt_sync_data
|
|
|
+ (id,table_name,target_id, object_type, `type`,
|
|
|
project_id, sign, ops,
|
|
|
ops_name, from_id, to_id,
|
|
|
error, class_code, local_name,
|
|
|
local_id, `name`, code,
|
|
|
obj_name, creator, creation_time,
|
|
|
- modifier, modified_time, `valid`,
|
|
|
- ts)
|
|
|
+ modifier, modified_time)
|
|
|
+ VALUES
|
|
|
<foreach collection="vos" item="vo" open="(" close=")" separator="),(">
|
|
|
- #{vo.id},#{vo.tableName},#{vo.targetId},#{vo.objType},#{vo.type},#{vo.projectId},
|
|
|
- #{vo.sign},#{vo.ops},#{vo.opsName},#{vo.fromId},#{vo.toId},
|
|
|
+ #{vo.id},#{vo.tableName},#{vo.targetId},#{vo.objectType},#{vo.type},
|
|
|
+ #{vo.projectId},#{vo.sign},#{vo.ops},
|
|
|
+ #{vo.opsName},#{vo.fromId},#{vo.toId},
|
|
|
#{vo.error},#{vo.classCode},#{vo.localName},
|
|
|
#{vo.localId},#{vo.name},#{vo.code},
|
|
|
- #{vo.creator},#{vo.creationTime},#{vo.modifier},#{vo.modifiedTime},#{vo.valid}
|
|
|
+ #{vo.objName},#{vo.creator},#{vo.creationTime},
|
|
|
+ #{vo.modifier},#{vo.modifiedTime}
|
|
|
</foreach>
|
|
|
ON DUPLICATE KEY UPDATE
|
|
|
- type = VALUES(type), ops = VALUES(ops), opsName = VALUES(opsName),
|
|
|
+ type = VALUES(type), ops = VALUES(ops), ops_name = VALUES(ops_name),
|
|
|
from_id = VALUES(from_id), to_id = VALUES(to_id), error = VALUES(error),
|
|
|
class_code = VALUES(class_code), local_name = VALUES(local_name), local_id = VALUES(local_id),
|
|
|
- `name` = VALUES(name), code_name = VALUES(local_name), obj_name = VALUES(obj_name),code = VALUES(code),
|
|
|
+ `name` = VALUES(name), obj_name = VALUES(obj_name),code = VALUES(code),
|
|
|
modifier = VALUES(modifier), modified_time = VALUES(modified_time)
|
|
|
</insert>
|
|
|
|