SyncDatMapper.xml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.persagy.dmp.rwd.migrate.SyncDataMapper">
  4. <resultMap id="BaseResultMap" type="com.persagy.dmp.rwd.migrate.entity.SyncData">
  5. <id column="id" jdbcType="VARCHAR" property="id" />
  6. <id column="table_name" jdbcType="VARCHAR" property="tableName" />
  7. <result column="target_id" jdbcType="VARCHAR" property="targetId" />
  8. <result column="obj_type" jdbcType="VARCHAR" property="objType" />
  9. <result column="type" jdbcType="VARCHAR" property="type" />
  10. <result column="project_id" jdbcType="VARCHAR" property="projectId" />
  11. <result column="sign" jdbcType="INTEGER" property="sign" />
  12. <result column="ops" jdbcType="VARCHAR" property="ops" />
  13. <result column="ops_name" jdbcType="VARCHAR" property="opsName" />
  14. <result column="from_id" jdbcType="VARCHAR" property="fromId" />
  15. <result column="to_id" jdbcType="VARCHAR" property="toId" />
  16. <result column="error" jdbcType="VARCHAR" property="error" />
  17. <result column="class_code" jdbcType="VARCHAR" property="classCode" />
  18. <result column="local_name" jdbcType="VARCHAR" property="localName" />
  19. <result column="local_id" jdbcType="VARCHAR" property="localId" />
  20. <result column="name" jdbcType="VARCHAR" property="name" />
  21. <result column="code" jdbcType="VARCHAR" property="code" />
  22. <result column="obj_name" jdbcType="VARCHAR" property="objName" />
  23. <result column="creator" jdbcType="VARCHAR" property="creator" />
  24. <result column="creation_time" jdbcType="CHAR" property="creationTime" />
  25. <result column="modifier" jdbcType="VARCHAR" property="modifier" />
  26. <result column="modified_time" jdbcType="CHAR" property="modifiedTime" />
  27. <result column="valid" jdbcType="TINYINT" property="valid" />
  28. <result column="ts" jdbcType="TIMESTAMP" property="ts" />
  29. </resultMap>
  30. <sql id="Base_Column_List">
  31. id, table_name, target_id, obj_type, `type`, project_id, sign, ops, ops_name, from_id, to_id,
  32. error, class_code, local_name, local_id, `name`, code, obj_name, creator, creation_time,
  33. modifier, modified_time, `valid`, ts
  34. </sql>
  35. <insert id="save">
  36. insert into dt_sync_data (id,table_name,target_id, obj_type, `type`,
  37. project_id, sign, ops,
  38. ops_name, from_id, to_id,
  39. error, class_code, local_name,
  40. local_id, `name`, code,
  41. obj_name, creator, creation_time,
  42. modifier, modified_time, `valid`,
  43. ts)
  44. <foreach collection="vos" item="vo" open="(" close=")" separator="),(">
  45. #{vo.id},#{vo.tableName},#{vo.targetId},#{vo.objType},#{vo.type},#{vo.projectId},
  46. #{vo.sign},#{vo.ops},#{vo.opsName},#{vo.fromId},#{vo.toId},
  47. #{vo.error},#{vo.classCode},#{vo.localName},
  48. #{vo.localId},#{vo.name},#{vo.code},
  49. #{vo.creator},#{vo.creationTime},#{vo.modifier},#{vo.modifiedTime},#{vo.valid}
  50. </foreach>
  51. ON DUPLICATE KEY UPDATE
  52. type = VALUES(type), ops = VALUES(ops), opsName = VALUES(opsName),
  53. from_id = VALUES(from_id), to_id = VALUES(to_id), error = VALUES(error),
  54. class_code = VALUES(class_code), local_name = VALUES(local_name), local_id = VALUES(local_id),
  55. `name` = VALUES(name), code_name = VALUES(local_name), obj_name = VALUES(obj_name),code = VALUES(code),
  56. modifier = VALUES(modifier), modified_time = VALUES(modified_time)
  57. </insert>
  58. </mapper>