BkDestinationRecordMapper.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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.miniapp.bus.mapper.BkDestinationRecordMapper">
  6. <resultMap type="BkDestinationRecord" id="BkDestinationRecordResult">
  7. <result property="id" column="id" />
  8. <result property="processId" column="process_id" />
  9. <result property="outTime" column="out_time" />
  10. <result property="outPic" column="out_pic" />
  11. <result property="outLocation" column="out_location" />
  12. <result property="destinationTime" column="destination_time" />
  13. <result property="destinationPic" column="destination_pic" />
  14. <result property="destinationLocation" column="destination_location" />
  15. <result property="createBy" column="create_by" />
  16. <result property="createTime" column="create_time" />
  17. <result property="updateBy" column="update_by" />
  18. <result property="updateTime" column="update_time" />
  19. <result property="recordStatus" column="record_status" />
  20. <result property="remark" column="remark" />
  21. <result property="outAddress" column="out_address" />
  22. <result property="destinationAddress" column="destination_address" />
  23. </resultMap>
  24. <sql id="selectBkDestinationRecordVo">
  25. select id, process_id, out_time, out_pic, out_location, destination_time, destination_pic, destination_location, create_by, create_time, update_by,record_status, update_time, remark,out_address,destination_address from bk_destination_record
  26. </sql>
  27. <select id="selectBkDestinationRecordList" parameterType="BkDestinationRecord" resultMap="BkDestinationRecordResult">
  28. <include refid="selectBkDestinationRecordVo"/>
  29. <where>
  30. <if test="processId != null "> and process_id = #{processId}</if>
  31. <if test="outTime != null "> and out_time = #{outTime}</if>
  32. <if test="recordStatus != null "> and record_status = #{recordStatus}</if>
  33. <if test="outPic != null and outPic != ''"> and out_pic = #{outPic}</if>
  34. <if test="outLocation != null and outLocation != ''"> and out_location = #{outLocation}</if>
  35. <if test="destinationTime != null "> and destination_time = #{destinationTime}</if>
  36. <if test="destinationPic != null and destinationPic != ''"> and destination_pic = #{destinationPic}</if>
  37. <if test="destinationLocation != null and destinationLocation != ''"> and destination_location = #{destinationLocation}</if>
  38. </where>
  39. </select>
  40. <select id="selectBkDestinationRecordById" parameterType="Long" resultMap="BkDestinationRecordResult">
  41. <include refid="selectBkDestinationRecordVo"/>
  42. where id = #{id}
  43. </select>
  44. <select id="selectBkDestinationRecordByprocessId" parameterType="Long" resultMap="BkDestinationRecordResult">
  45. <include refid="selectBkDestinationRecordVo"/>
  46. where process_id = #{id}
  47. </select>
  48. <insert id="insertBkDestinationRecord" parameterType="BkDestinationRecord" useGeneratedKeys="true" keyProperty="id">
  49. <selectKey keyProperty="fileId" resultType="Long" order="AFTER">
  50. select LAST_INSERT_ID()
  51. </selectKey>
  52. insert into bk_destination_record
  53. <trim prefix="(" suffix=")" suffixOverrides=",">
  54. <if test="id != null">id,</if>
  55. <if test="processId != null">process_id,</if>
  56. <if test="outTime != null">out_time,</if>
  57. <if test="outPic != null">out_pic,</if>
  58. <if test="outLocation != null">out_location,</if>
  59. <if test="destinationTime != null">destination_time,</if>
  60. <if test="recordStatus != null ">record_status,</if>
  61. <if test="destinationPic != null">destination_pic,</if>
  62. <if test="destinationLocation != null">destination_location,</if>
  63. <if test="createBy != null">create_by,</if>
  64. <if test="createTime != null">create_time,</if>
  65. <if test="updateBy != null">update_by,</if>
  66. <if test="updateTime != null">update_time,</if>
  67. <if test="remark != null">remark,</if>
  68. <if test="outAddress != null">out_address,</if>
  69. <if test="destinationAddress != null">destination_address,</if>
  70. </trim>
  71. <trim prefix="values (" suffix=")" suffixOverrides=",">
  72. <if test="id != null">#{id},</if>
  73. <if test="processId != null">#{processId},</if>
  74. <if test="outTime != null">#{outTime},</if>
  75. <if test="outPic != null">#{outPic},</if>
  76. <if test="outLocation != null">#{outLocation},</if>
  77. <if test="destinationTime != null">#{destinationTime},</if>
  78. <if test="recordStatus != null "> #{recordStatus},</if>
  79. <if test="destinationPic != null">#{destinationPic},</if>
  80. <if test="destinationLocation != null">#{destinationLocation},</if>
  81. <if test="createBy != null">#{createBy},</if>
  82. <if test="createTime != null">#{createTime},</if>
  83. <if test="updateBy != null">#{updateBy},</if>
  84. <if test="updateTime != null">#{updateTime},</if>
  85. <if test="remark != null">#{remark},</if>
  86. <if test="outAddress != null">#{outAddress},</if>
  87. <if test="destinationAddress != null">#{destinationAddress},</if>
  88. </trim>
  89. </insert>
  90. <update id="updateBkDestinationRecord" parameterType="BkDestinationRecord">
  91. update bk_destination_record
  92. <trim prefix="SET" suffixOverrides=",">
  93. <if test="processId != null">process_id = #{processId},</if>
  94. <if test="outTime != null">out_time = #{outTime},</if>
  95. <if test="outPic != null">out_pic = #{outPic},</if>
  96. <if test="outLocation != null">out_location = #{outLocation},</if>
  97. <if test="recordStatus != null "> record_status = #{recordStatus},</if>
  98. <if test="destinationTime != null">destination_time = #{destinationTime},</if>
  99. <if test="destinationPic != null">destination_pic = #{destinationPic},</if>
  100. <if test="destinationLocation != null">destination_location = #{destinationLocation},</if>
  101. <if test="createBy != null">create_by = #{createBy},</if>
  102. <if test="createTime != null">create_time = #{createTime},</if>
  103. <if test="updateBy != null">update_by = #{updateBy},</if>
  104. <if test="updateTime != null">update_time = #{updateTime},</if>
  105. <if test="remark != null">remark = #{remark},</if>
  106. <if test="outAddress != null">out_address = #{outAddress},</if>
  107. <if test="destinationAddress != null">destination_address = #{destinationAddress},</if>
  108. </trim>
  109. where id = #{id}
  110. </update>
  111. <delete id="deleteBkDestinationRecordById" parameterType="Long">
  112. delete from bk_destination_record where id = #{id}
  113. </delete>
  114. <delete id="deleteBkDestinationRecordByIds" parameterType="String">
  115. delete from bk_destination_record where id in
  116. <foreach item="id" collection="array" open="(" separator="," close=")">
  117. #{id}
  118. </foreach>
  119. </delete>
  120. </mapper>