OutSyncInfoMapper.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.jjt.out.mapper.OutSyncInfoMapper">
  6. <resultMap type="OutSyncInfo" id="OutSyncInfoResult">
  7. <result property="infoId" column="INFO_ID"/>
  8. <result property="syncType" column="SYNC_TYPE"/>
  9. <result property="syncFileName" column="SYNC_FILE_NAME"/>
  10. <result property="syncFileMd5" column="SYNC_FILE_MD5"/>
  11. <result property="syncFileSize" column="SYNC_FILE_SIZE"/>
  12. <result property="syncSort" column="SYNC_SORT"/>
  13. <result property="costTime" column="COST_TIME"/>
  14. <result property="uploadTime" column="UPLOAD_TIME"/>
  15. <result property="uploadStatus" column="UPLOAD_STATUS"/>
  16. </resultMap>
  17. <sql id="selectOutSyncInfoVo">
  18. select INFO_ID,
  19. SYNC_TYPE,
  20. SYNC_FILE_NAME,
  21. SYNC_FILE_MD5,
  22. SYNC_FILE_SIZE,
  23. SYNC_SORT,
  24. COST_TIME,
  25. UPLOAD_TIME,
  26. UPLOAD_STATUS
  27. from out_sync_info
  28. </sql>
  29. <select id="selectOutSyncInfoList" parameterType="OutSyncInfo" resultMap="OutSyncInfoResult">
  30. <include refid="selectOutSyncInfoVo"/>
  31. <where>
  32. <if test="syncType != null and syncType != ''">and SYNC_TYPE = #{syncType}</if>
  33. <if test="syncFileName != null and syncFileName != ''">and SYNC_FILE_NAME like concat('%', #{syncFileName},
  34. '%')
  35. </if>
  36. <if test="syncFileMd5 != null and syncFileMd5 != ''">and SYNC_FILE_MD5 = #{syncFileMd5}</if>
  37. <if test="syncFileSize != null ">and SYNC_FILE_SIZE = #{syncFileSize}</if>
  38. <if test="syncSort != null ">and SYNC_SORT = #{syncSort}</if>
  39. <if test="costTime != null ">and COST_TIME = #{costTime}</if>
  40. <if test="uploadTime != null ">and UPLOAD_TIME = #{uploadTime}</if>
  41. <if test="uploadStatus != null and uploadStatus != ''">and UPLOAD_STATUS = #{uploadStatus}</if>
  42. </where>
  43. order by UPLOAD_TIME desc
  44. </select>
  45. <select id="selectOutSyncInfoByInfoId" parameterType="Long" resultMap="OutSyncInfoResult">
  46. <include refid="selectOutSyncInfoVo"/>
  47. where INFO_ID = #{infoId}
  48. </select>
  49. <insert id="insertOutSyncInfo" parameterType="OutSyncInfo" useGeneratedKeys="true" keyProperty="infoId">
  50. insert into out_sync_info
  51. <trim prefix="(" suffix=")" suffixOverrides=",">
  52. <if test="syncType != null">SYNC_TYPE,</if>
  53. <if test="syncFileName != null">SYNC_FILE_NAME,</if>
  54. <if test="syncFileMd5 != null">SYNC_FILE_MD5,</if>
  55. <if test="syncFileSize != null">SYNC_FILE_SIZE,</if>
  56. <if test="syncSort != null">SYNC_SORT,</if>
  57. <if test="costTime != null">COST_TIME,</if>
  58. <if test="uploadTime != null">UPLOAD_TIME,</if>
  59. <if test="uploadStatus != null">UPLOAD_STATUS,</if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides=",">
  62. <if test="syncType != null">#{syncType},</if>
  63. <if test="syncFileName != null">#{syncFileName},</if>
  64. <if test="syncFileMd5 != null">#{syncFileMd5},</if>
  65. <if test="syncFileSize != null">#{syncFileSize},</if>
  66. <if test="syncSort != null">#{syncSort},</if>
  67. <if test="costTime != null">#{costTime},</if>
  68. <if test="uploadTime != null">#{uploadTime},</if>
  69. <if test="uploadStatus != null">#{uploadStatus},</if>
  70. </trim>
  71. </insert>
  72. <update id="updateOutSyncInfo" parameterType="OutSyncInfo">
  73. update out_sync_info
  74. <trim prefix="SET" suffixOverrides=",">
  75. <if test="syncType != null">SYNC_TYPE = #{syncType},</if>
  76. <if test="syncFileName != null">SYNC_FILE_NAME = #{syncFileName},</if>
  77. <if test="syncFileMd5 != null">SYNC_FILE_MD5 = #{syncFileMd5},</if>
  78. <if test="syncFileSize != null">SYNC_FILE_SIZE = #{syncFileSize},</if>
  79. <if test="syncSort != null">SYNC_SORT = #{syncSort},</if>
  80. <if test="costTime != null">COST_TIME = #{costTime},</if>
  81. <if test="uploadTime != null">UPLOAD_TIME = #{uploadTime},</if>
  82. <if test="uploadStatus != null">UPLOAD_STATUS = #{uploadStatus},</if>
  83. </trim>
  84. where INFO_ID = #{infoId}
  85. </update>
  86. <delete id="deleteOutSyncInfoByInfoId" parameterType="Long">
  87. delete
  88. from out_sync_info
  89. where INFO_ID = #{infoId}
  90. </delete>
  91. <delete id="deleteOutSyncInfoByInfoIds" parameterType="String">
  92. delete from out_sync_info where INFO_ID in
  93. <foreach item="infoId" collection="array" open="(" separator="," close=")">
  94. #{infoId}
  95. </foreach>
  96. </delete>
  97. </mapper>