cus-acq-goods-seat.xml 11 KB

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