cus-acq-inventory-info.xml 9.4 KB

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