cus-acq-goods-seat.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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.emato.cus.supervise.mapperCus.CusAcqGoodsSeatMapper06">
  4. <resultMap id="cusAcqGoodsSeat" type="com.emato.cus.supervise.domainCus.CusAcqGoodsSeat06">
  5. <id property="id" column="id"/>
  6. <result property="seatNo" column="seat_no"/>
  7. <result property="goodsName" column="goods_name"/>
  8. <result property="codeTs" column="code_ts"/>
  9. <result property="formNoDec" column="form_no_dec"/>
  10. <result property="formNo" column="form_no"/>
  11. <result property="skuNo" column="sku_no"/>
  12. <result property="goodsId" column="goods_id"/>
  13. <result property="gUnit" column="g_unit"/>
  14. <result property="gQty" column="g_qyt"/>
  15. <result property="legalUnit" column="legal_unit"/>
  16. <result property="legalQty" column="legal_qyt"/>
  17. <result property="goodsModel" column="goods_model"/>
  18. <result property="localEmsNo" column="local_ems_no"/>
  19. <result property="ownerCode" column="owner_code"/>
  20. <result property="ownerName" column="owner_name"/>
  21. <result property="storeCompanyName" column="store_company_name"/>
  22. <result property="storeUscCode" column="store_usc_code"/>
  23. <result property="storeCustomsCode" column="store_customs_code"/>
  24. <result property="storeCode" column="store_code"/>
  25. <result property="createrSn" column="creater_sn"/>
  26. <result property="createTime" column="create_time"/>
  27. <result property="moderSn" column="moder_sn"/>
  28. <result property="modTime" column="mod_time"/>
  29. </resultMap>
  30. <select id="listCusAcqGoodsSeat" resultMap="cusAcqGoodsSeat" parameterType="List">
  31. select * from acq_goods_on_seat
  32. <where>
  33. <foreach collection="list" item="i" index="idx" open="(" separator="or" close=")">
  34. <if test="i.seatNo !=null and i.seatNo !=''">
  35. sku_no=#{i.skuNo} and seat_no=#{i.seatNo}
  36. </if>
  37. </foreach>
  38. </where>
  39. </select>
  40. <!-- 库位货物数据 -->
  41. <insert id="addCusAcqGoodsSeat06" parameterType="List">
  42. INSERT INTO acq_goods_on_seat (
  43. seat_no, goods_name, code_ts,
  44. form_no_dec, form_no, sku_no, goods_id,
  45. g_unit, g_qyt, legal_unit, legal_qyt,
  46. goods_model, local_ems_no, owner_code, owner_name,
  47. store_company_name, store_usc_code, store_customs_code, store_code,
  48. creater_sn, create_time, moder_sn, mod_time)
  49. VALUES
  50. <foreach collection="list" item="item" index="idx" separator="," close=";">
  51. (
  52. #{item.seatNo, jdbcType=VARCHAR},
  53. #{item.goodsName, jdbcType=VARCHAR}, #{item.codeTs, jdbcType=VARCHAR},
  54. #{item.formNoDec, jdbcType=VARCHAR}, #{item.formNo, jdbcType=VARCHAR},
  55. #{item.skuNo, jdbcType=VARCHAR}, #{item.goodsId, jdbcType=VARCHAR},
  56. #{item.gUnit, jdbcType=VARCHAR}, #{item.gQty, jdbcType=NUMERIC}, #{item.legalUnit, jdbcType=VARCHAR}, #{item.legalQty, jdbcType=NUMERIC},
  57. #{item.goodsModel, jdbcType=VARCHAR}, #{item.localEmsNo, jdbcType=VARCHAR},
  58. #{item.ownerCode, jdbcType=VARCHAR}, #{item.ownerName, jdbcType=VARCHAR},
  59. #{item.storeCompanyName, jdbcType=VARCHAR}, #{item.storeUscCode, jdbcType=VARCHAR}, #{item.storeCustomsCode, jdbcType=VARCHAR}, #{item.storeCode, jdbcType=VARCHAR},
  60. #{item.createrSn, jdbcType=VARCHAR}, #{item.createTime, jdbcType=DATE}, #{item.moderSn, jdbcType=VARCHAR}, #{item.modTime, jdbcType=DATE}
  61. )
  62. </foreach>
  63. </insert>
  64. <update id="updateCusAcqGoodsSeat06" parameterType="List">
  65. UPDATE acq_goods_on_seat
  66. <trim prefix="set" suffixOverrides=",">
  67. <trim prefix="goods_name =case" suffix="end,">
  68. <foreach collection="list" item="i" index="idx">
  69. <if test="i.goodsName !=null and i.goodsName !=''">
  70. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.goodsName, jdbcType=VARCHAR}
  71. </if>
  72. </foreach>
  73. </trim>
  74. <trim prefix="code_ts =case" suffix="end,">
  75. <foreach collection="list" item="i" index="idx">
  76. <if test="i.codeTs !=null and i.codeTs !=''">
  77. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.codeTs, jdbcType=VARCHAR}
  78. </if>
  79. </foreach>
  80. </trim>
  81. <trim prefix="form_no_dec =case" suffix="end,">
  82. <foreach collection="list" item="i" index="idx">
  83. <if test="i.formNoDec !=null and i.formNoDec !=''">
  84. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.formNoDec, jdbcType=VARCHAR}
  85. </if>
  86. </foreach>
  87. </trim>
  88. <trim prefix="form_no =case" suffix="end,">
  89. <foreach collection="list" item="i" index="idx">
  90. <if test="i.formNo !=null and i.formNo !=''">
  91. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.formNo, jdbcType=VARCHAR}
  92. </if>
  93. </foreach>
  94. </trim>
  95. <trim prefix="g_unit =case" suffix="end,">
  96. <foreach collection="list" item="i" index="idx">
  97. <if test="i.gUnit !=null and i.gUnit !=''">
  98. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.gUnit, jdbcType=VARCHAR}
  99. </if>
  100. </foreach>
  101. </trim>
  102. <trim prefix="g_qyt =case" suffix="end,">
  103. <foreach collection="list" item="i" index="idx">
  104. <if test="i.gQty !=null and i.gQty !=''">
  105. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.gQty, jdbcType=VARCHAR}
  106. </if>
  107. </foreach>
  108. </trim>
  109. <trim prefix="legal_unit =case" suffix="end,">
  110. <foreach collection="list" item="i" index="idx">
  111. <if test="i.legalUnit !=null and i.legalUnit !=''">
  112. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.legalUnit, jdbcType=VARCHAR}
  113. </if>
  114. </foreach>
  115. </trim>
  116. <trim prefix="legal_qyt =case" suffix="end,">
  117. <foreach collection="list" item="i" index="idx">
  118. <if test="i.legalQty !=null and i.legalQty !=''">
  119. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.legalQty, jdbcType=VARCHAR}
  120. </if>
  121. </foreach>
  122. </trim>
  123. <trim prefix="goods_model =case" suffix="end,">
  124. <foreach collection="list" item="i" index="idx">
  125. <if test="i.goodsModel !=null and i.goodsModel !=''">
  126. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.goodsModel, jdbcType=DATE}
  127. </if>
  128. </foreach>
  129. </trim>
  130. <trim prefix="owner_code =case" suffix="end,">
  131. <foreach collection="list" item="i" index="idx">
  132. <if test="i.ownerCode !=null and i.ownerCode !=''">
  133. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.ownerCode, jdbcType=DATE}
  134. </if>
  135. </foreach>
  136. </trim>
  137. <trim prefix="owner_name =case" suffix="end,">
  138. <foreach collection="list" item="i" index="idx">
  139. <if test="i.ownerName !=null and i.ownerName !=''">
  140. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.ownerName, jdbcType=DATE}
  141. </if>
  142. </foreach>
  143. </trim>
  144. <trim prefix="store_company_name =case" suffix="end,">
  145. <foreach collection="list" item="i" index="idx">
  146. <if test="i.storeCompanyName !=null and i.storeCompanyName !=''">
  147. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.storeCompanyName, jdbcType=DATE}
  148. </if>
  149. </foreach>
  150. </trim>
  151. <trim prefix="store_usc_code =case" suffix="end,">
  152. <foreach collection="list" item="i" index="idx">
  153. <if test="i.storeUscCode !=null and i.storeUscCode !=''">
  154. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.storeUscCode, jdbcType=DATE}
  155. </if>
  156. </foreach>
  157. </trim>
  158. <trim prefix="store_customs_code =case" suffix="end,">
  159. <foreach collection="list" item="i" index="idx">
  160. <if test="i.storeCustomsCode !=null and i.storeCustomsCode !=''">
  161. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.storeCustomsCode, jdbcType=DATE}
  162. </if>
  163. </foreach>
  164. </trim>
  165. <trim prefix="store_code =case" suffix="end,">
  166. <foreach collection="list" item="i" index="idx">
  167. <if test="i.storeCode !=null and i.storeCode !=''">
  168. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.storeCode, jdbcType=DATE}
  169. </if>
  170. </foreach>
  171. </trim>
  172. <trim prefix="moder_sn =case" suffix="end,">
  173. <foreach collection="list" item="i" index="idx">
  174. <if test="i.moderSn !=null and i.moderSn !=''">
  175. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.moderSn, jdbcType=DATE}
  176. </if>
  177. </foreach>
  178. </trim>
  179. <trim prefix="mod_time =case" suffix="end,">
  180. <foreach collection="list" item="i" index="idx">
  181. <if test="i.modTime !=null">
  182. when sku_no=#{i.skuNo} and seat_no=#{i.seatNo} then #{i.modTime, jdbcType=DATE}
  183. </if>
  184. </foreach>
  185. </trim>
  186. </trim>
  187. <where>
  188. <if test="list != null and list.size()>0">
  189. <foreach collection="list" item="i" index="index" open="(" separator="or" close=")">
  190. sku_no=#{i.skuNo} and seat_no=#{i.seatNo}
  191. </foreach>
  192. </if>
  193. </where>
  194. </update>
  195. <delete id="deleteCusAcqGoodsSeat06" parameterType="List">
  196. DELETE FROM acq_goods_on_seat
  197. <where>
  198. <if test="list != null and list.size()>0">
  199. <foreach collection="list" item="i" index="index" open="id IN (" separator="," close=")">
  200. #{i.id}
  201. </foreach>
  202. </if>
  203. </where>
  204. </delete>
  205. </mapper>