BkProcessMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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.BkProcessMapper">
  6. <resultMap type="BkProcess" id="BkProcessResult">
  7. <result property="id" column="id" />
  8. <result property="customerName" column="customer_name" />
  9. <result property="customerId" column="customer_id" />
  10. <result property="productId" column="product_id" />
  11. <result property="productName" column="product_name" />
  12. <result property="cardUserNo" column="card_user_no" />
  13. <result property="carNo" column="car_no" />
  14. <result property="indate" column="indate" />
  15. <result property="firstWeight" column="firstWeight" />
  16. <result property="firstWeightdate" column="firstWeightdate" />
  17. <result property="secondWeight" column="secondWeight" />
  18. <result property="secondWeightdate" column="secondWeightdate" />
  19. <result property="netweight" column="netweight" />
  20. <result property="outdate" column="outdate" />
  21. <result property="type" column="type" />
  22. <result property="loadingendtime" column="loadingendtime" />
  23. <result property="loadingstarttime" column="loadingstarttime" />
  24. <result property="contacts" column="contacts" />
  25. <result property="telephone" column="telephone" />
  26. <result property="nodecode" column="nodecode" />
  27. <result property="deltag" column="deltag" />
  28. <result property="createBy" column="create_by" />
  29. <result property="createTime" column="create_time" />
  30. <result property="updateBy" column="update_by" />
  31. <result property="updateTime" column="update_time" />
  32. <result property="remark" column="remark" />
  33. </resultMap>
  34. <resultMap type="BkProcess" id="BkProcessAppResult">
  35. <result property="id" column="id" />
  36. <result property="customerName" column="customer_name" />
  37. <result property="customerId" column="customer_id" />
  38. <result property="productId" column="product_id" />
  39. <result property="productName" column="product_name" />
  40. <result property="cardUserNo" column="card_user_no" />
  41. <result property="carNo" column="car_no" />
  42. <result property="indate" column="indate" />
  43. <result property="firstWeight" column="firstWeight" />
  44. <result property="firstWeightdate" column="firstWeightdate" />
  45. <result property="secondWeight" column="secondWeight" />
  46. <result property="secondWeightdate" column="secondWeightdate" />
  47. <result property="netweight" column="netweight" />
  48. <result property="outdate" column="outdate" />
  49. <result property="type" column="type" />
  50. <result property="loadingendtime" column="loadingendtime" />
  51. <result property="loadingstarttime" column="loadingstarttime" />
  52. <result property="contacts" column="contacts" />
  53. <result property="telephone" column="telephone" />
  54. <result property="nodecode" column="nodecode" />
  55. <result property="deltag" column="deltag" />
  56. <result property="createBy" column="create_by" />
  57. <result property="createTime" column="create_time" />
  58. <result property="updateBy" column="update_by" />
  59. <result property="updateTime" column="update_time" />
  60. <result property="remark" column="remark" />
  61. <result property="fenceStartAddress" column="fence_start_address" />
  62. <result property="fenceEndAddress" column="fence_end_address" />
  63. </resultMap>
  64. <sql id="selectBkProcessVo">
  65. select id, customer_name,customer_id ,product_id,product_name, card_user_no, car_no, indate, firstWeight, firstWeightdate, secondWeight, secondWeightdate, netweight, outdate, type, loadingendtime, loadingstarttime, contacts, telephone, nodecode, deltag, create_by, create_time, update_by, update_time, remark from bk_process
  66. </sql>
  67. <sql id="selectBkProcessVo1">
  68. select a.id, a.customer_name,a.customer_id,a.product_id,a.product_name,a.card_user_no, a.car_no, a.indate, a.firstWeight, a.firstWeightdate, a.secondWeight, a.secondWeightdate, a.netweight, a.outdate, a.type, a.loadingendtime, a.loadingstarttime, a.contacts, a.telephone, a.nodecode, a.deltag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark from bk_process a
  69. </sql>
  70. <select id="selectBkProcessList" parameterType="BkProcess" resultMap="BkProcessResult">
  71. <include refid="selectBkProcessVo"/>
  72. <where>
  73. <if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
  74. <if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
  75. <if test="cardUserNo != null and cardUserNo != ''"> and card_user_no = #{cardUserNo}</if>
  76. <if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
  77. <if test="indate != null "> and indate = #{indate}</if>
  78. <if test="firstWeight != null and firstWeight != ''"> and firstWeight = #{firstWeight}</if>
  79. <if test="firstWeightdate != null "> and firstWeightdate = #{firstWeightdate}</if>
  80. <if test="secondWeight != null and secondWeight != ''"> and secondWeight = #{secondWeight}</if>
  81. <if test="secondWeightdate != null "> and secondWeightdate = #{secondWeightdate}</if>
  82. <if test="netweight != null and netweight != ''"> and netweight = #{netweight}</if>
  83. <if test="outdate != null "> and outdate = #{outdate}</if>
  84. <if test="type != null and type != ''"> and type = #{type}</if>
  85. <if test="loadingendtime != null "> and loadingendtime = #{loadingendtime}</if>
  86. <if test="loadingstarttime != null "> and loadingstarttime = #{loadingstarttime}</if>
  87. <if test="contacts != null and contacts != ''"> and contacts = #{contacts}</if>
  88. <if test="telephone != null and telephone != ''"> and telephone = #{telephone}</if>
  89. <if test="nodecode != null and nodecode != ''"> and nodecode = #{nodecode}</if>
  90. <if test="deltag != null and deltag != ''"> and deltag = #{deltag}</if>
  91. </where>
  92. </select>
  93. <select id="selectBkProcessById" parameterType="Long" resultMap="BkProcessResult">
  94. <include refid="selectBkProcessVo1"/>
  95. where id = #{id}
  96. </select>
  97. <select id="selectBkProcessByUserId" parameterType="Long" resultMap="BkProcessAppResult">
  98. select
  99. a.id, a.customer_name,a.customer_id,a.product_id,a.product_name,a.card_user_no, a.car_no, a.indate, a.firstWeight, a.firstWeightdate, a.secondWeight, a.secondWeightdate, a.netweight, a.outdate, a.type, a.loadingendtime, a.loadingstarttime, a.contacts, a.telephone, a.nodecode, a.deltag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
  100. c.fence_start_address, c.fence_end_address
  101. from
  102. bk_user_process b
  103. left join bk_process a on b.process_id = a.id
  104. left join bk_fence c on b.fence_id = c.id
  105. where b.user_id = #{id}
  106. </select>
  107. <insert id="insertBkProcess" parameterType="BkProcess">
  108. insert into bk_process
  109. <trim prefix="(" suffix=")" suffixOverrides=",">
  110. <if test="id != null">id,</if>
  111. <if test="customerName != null and customerName != ''">customer_name,</if>
  112. <if test="productName != null and productName != ''">product_name,</if>
  113. <if test="cardUserNo != null and cardUserNo != ''">card_user_no,</if>
  114. <if test="carNo != null and carNo != ''">car_no,</if>
  115. <if test="indate != null ">indate,</if>
  116. <if test="firstWeight != null and firstWeight != ''">firstWeight,</if>
  117. <if test="firstWeightdate != null ">firstWeightdate,</if>
  118. <if test="secondWeight != null and secondWeight != ''">secondWeight,</if>
  119. <if test="secondWeightdate != null">secondWeightdate,</if>
  120. <if test="netweight != null and netweight != ''">netweight,</if>
  121. <if test="outdate != null ">outdate,</if>
  122. <if test="type != null and type != ''">type,</if>
  123. <if test="loadingendtime != null ">loadingendtime,</if>
  124. <if test="loadingstarttime != null">loadingstarttime,</if>
  125. <if test="contacts != null and contacts != ''">contacts,</if>
  126. <if test="telephone != null and telephone != ''">telephone,</if>
  127. <if test="nodecode != null and nodecode != ''">nodecode,</if>
  128. <if test="deltag != null and deltag != ''">deltag,</if>
  129. <if test="createBy != null and createBy != ''">create_by,</if>
  130. <if test="createTime != null">create_time,</if>
  131. <if test="updateBy != null and updateBy != ''">update_by,</if>
  132. <if test="updateTime != null ">update_time,</if>
  133. <if test="remark != null and remark != ''">remark,</if>
  134. <if test="customerId != null and customerId != ''">customer_id,</if>
  135. <if test="productId != null and productId != ''">product_id,</if>
  136. </trim>
  137. <trim prefix="values (" suffix=")" suffixOverrides=",">
  138. <if test="id != null">#{id},</if>
  139. <if test="customerName != null and customerName != ''">#{customerName},</if>
  140. <if test="productName != null and productName != ''">#{productName},</if>
  141. <if test="cardUserNo != null and cardUserNo != ''">#{cardUserNo},</if>
  142. <if test="carNo != null and carNo != ''">#{carNo},</if>
  143. <if test="indate != null ">#{indate},</if>
  144. <if test="firstWeight != null and firstWeight != ''">#{firstWeight},</if>
  145. <if test="firstWeightdate != null ">#{firstWeightdate},</if>
  146. <if test="secondWeight != null and secondWeight != ''">#{secondWeight},</if>
  147. <if test="secondWeightdate != null">#{secondWeightdate},</if>
  148. <if test="netweight != null and netweight != ''">#{netweight},</if>
  149. <if test="outdate != null ">#{outdate},</if>
  150. <if test="type != null and type != ''">#{type},</if>
  151. <if test="loadingendtime != null ">#{loadingendtime},</if>
  152. <if test="loadingstarttime != null ">#{loadingstarttime},</if>
  153. <if test="contacts != null and contacts != ''">#{contacts},</if>
  154. <if test="telephone != null and telephone != ''">#{telephone},</if>
  155. <if test="nodecode != null and nodecode != ''">#{nodecode},</if>
  156. <if test="deltag != null and deltag != ''">#{deltag},</if>
  157. <if test="createBy != null and createBy != ''">#{createBy},</if>
  158. <if test="createTime != null ">#{createTime},</if>
  159. <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
  160. <if test="updateTime != null ">#{updateTime},</if>
  161. <if test="remark != null and remark != ''">#{remark},</if>
  162. <if test="customerId != null and customerId != ''">#{customerId},</if>
  163. <if test="productId != null and productId != ''">#{productId},</if>
  164. </trim>
  165. </insert>
  166. <update id="updateBkProcess" parameterType="BkProcess">
  167. update bk_process
  168. <trim prefix="SET" suffixOverrides=",">
  169. <if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
  170. <if test="productName != null and productName != ''">product_name = #{productName},</if>
  171. <if test="cardUserNo != null and cardUserNo != ''">card_user_no = #{cardUserNo},</if>
  172. <if test="carNo != null and carNo != ''">car_no = #{carNo},</if>
  173. <if test="indate != null">indate = #{indate},</if>
  174. <if test="firstWeight != null and firstWeight != ''">firstWeight = #{firstWeight},</if>
  175. <if test="firstWeightdate != null ">firstWeightdate = #{firstWeightdate},</if>
  176. <if test="secondWeight != null and secondWeight != ''">secondWeight = #{secondWeight},</if>
  177. <if test="secondWeightdate != null">secondWeightdate = #{secondWeightdate},</if>
  178. <if test="netweight != null and netweight != ''">netweight = #{netweight},</if>
  179. <if test="outdate != null">outdate = #{outdate},</if>
  180. <if test="type != null and type != ''">type = #{type},</if>
  181. <if test="loadingendtime != null ">loadingendtime = #{loadingendtime},</if>
  182. <if test="loadingstarttime != null ">loadingstarttime = #{loadingstarttime},</if>
  183. <if test="contacts != null and contacts != ''">contacts = #{contacts},</if>
  184. <if test="telephone != null and telephone != ''">telephone = #{telephone},</if>
  185. <if test="nodecode != null and nodecode != ''">nodecode = #{nodecode},</if>
  186. <if test="deltag != null and deltag != ''">deltag = #{deltag},</if>
  187. <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
  188. <if test="createTime != null ">create_time = #{createTime},</if>
  189. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  190. <if test="updateTime != null">update_time = #{updateTime},</if>
  191. <if test="remark != null and remark != ''">remark = #{remark},</if>
  192. <if test="customerId != null and customerId != ''">customer_id = #{customerId},</if>
  193. <if test="productId != null and productId != ''">product_id = #{productId},</if>
  194. </trim>
  195. where id = #{id}
  196. </update>
  197. <delete id="deleteBkProcessById" parameterType="Long">
  198. delete from bk_process where id = #{id}
  199. </delete>
  200. <delete id="deleteBkProcessByIds" parameterType="String">
  201. delete from bk_process where id in
  202. <foreach item="id" collection="array" open="(" separator="," close=")">
  203. #{id}
  204. </foreach>
  205. </delete>
  206. </mapper>