1
0

MallShopInveMngMapper.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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.emato.biz.mapper.mall.MallShopInveMngMapper">
  6. <resultMap type="MallShopInveMng" id="MallShopInveMngResult">
  7. <result property="shopInveSn" column="shop_inve_sn" />
  8. <result property="shopSn" column="shop_sn" />
  9. <result property="shopName" column="shop_name" />
  10. <result property="merchSn" column="merch_sn" />
  11. <result property="merchName" column="merch_name" />
  12. <result property="thirdPartyMerchCode" column="third_party_merch_code" />
  13. <result property="thirdPartyMerchName" column="third_party_merch_name" />
  14. <result property="sku" column="sku" />
  15. <result property="cusCode" column="cus_code" />
  16. <result property="goodsBizType" column="goods_biz_type" />
  17. <result property="shopInve" column="shop_inve" />
  18. <result property="shopValid" column="shop_valid" />
  19. <result property="shopFreezeNum" column="shop_freeze_num" />
  20. <result property="shopDamageNum" column="shop_damage_num" />
  21. <result property="shopDestroyLostNum" column="shop_destroy_lost_num" />
  22. <result property="shopExpireNum" column="shop_expire_num" />
  23. <result property="shopSampleFreezeNum" column="shop_sample_freeze_num" />
  24. <result property="shopMinus" column="shop_minus" />
  25. <result property="shopSupp" column="shop_supp" />
  26. <result property="inQty" column="in_qty" />
  27. <result property="outQty" column="out_qty" />
  28. <result property="returnQty" column="return_qty" />
  29. <result property="saleQty" column="sale_qty" />
  30. <result property="locInQty" column="loc_in_qty" />
  31. <result property="locOutQty" column="loc_out_qty" />
  32. <result property="isValid" column="is_valid" />
  33. <result property="createrSn" column="creater_sn" />
  34. <result property="createTime" column="create_time" />
  35. <result property="moderSn" column="moder_sn" />
  36. <result property="modTime" column="mod_time" />
  37. <result property="tstm" column="tstm" />
  38. </resultMap>
  39. <sql id="selectMallShopInveMngVo">
  40. SELECT
  41. t1.shop_inve_sn,
  42. t1.shop_sn,
  43. t2.store_name as shop_name,
  44. t1.merch_sn,
  45. t2.merch_name ,
  46. t2.third_party_merch_code,
  47. t2.third_party_merch_name,
  48. t1.sku,
  49. t1.cus_code,
  50. t1.goods_biz_type,
  51. t1.shop_inve,
  52. t1.shop_valid,
  53. t1.shop_freeze_num,
  54. t1.shop_damage_num,
  55. t1.shop_destroy_lost_num,
  56. t1.shop_expire_num,
  57. t1.shop_sample_freeze_num,
  58. t1.shop_minus,
  59. t1.shop_supp,
  60. t1.in_qty,
  61. t1.out_qty,
  62. t1.return_qty,
  63. t1.sale_qty,
  64. t1.loc_in_qty,
  65. t1.loc_out_qty,
  66. t1.is_valid
  67. FROM
  68. mall_shop_inve_mng t1,
  69. mall_store t2
  70. </sql>
  71. <select id="selectMallShopInveMngList" parameterType="MallShopInveMng" resultMap="MallShopInveMngResult">
  72. <include refid="selectMallShopInveMngVo"/>
  73. <where>
  74. t1.shop_sn = t2.id
  75. <if test="shopName != null and shopName != ''"> and t2.store_name like concat('%', #{shopName}, '%')</if>
  76. <if test="merchName != null and merchName != ''"> and t2.third_party_merch_name like concat('%', #{merchName}, '%')</if>
  77. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode != ''"> and t2.third_party_merch_code = #{thirdPartyMerchCode}</if>
  78. <if test="thirdPartyMerchName != null and thirdPartyMerchName != ''"> and t2.third_party_merch_name like concat('%', #{thirdPartyMerchName}, '%')</if>
  79. <if test="sku != null and sku != ''"> and t1.sku = #{sku}</if>
  80. <if test="cusCode != null and cusCode != ''"> and t1.cus_code = #{cusCode}</if>
  81. <if test="goodsBizType != null and goodsBizType != ''"> and t1.goods_biz_type = #{goodsBizType}</if>
  82. <if test="isValid != null and isValid != ''"> and t1.is_valid = #{isValid}</if>
  83. </where>
  84. </select>
  85. <select id="selectMallShopInveMngById" parameterType="String" resultMap="MallShopInveMngResult">
  86. <include refid="selectMallShopInveMngVo"/>
  87. where shop_inve_sn = #{shopInveSn} and t1.shop_sn = t2.id
  88. </select>
  89. <insert id="insertMallShopInveMng" parameterType="MallShopInveMng">
  90. insert into mall_shop_inve_mng
  91. <trim prefix="(" suffix=")" suffixOverrides=",">
  92. <if test="shopInveSn != null">shop_inve_sn,</if>
  93. <if test="shopSn != null">shop_sn,</if>
  94. <if test="shopName != null">shop_name,</if>
  95. <if test="merchSn != null">merch_sn,</if>
  96. <if test="merchName != null">merch_name,</if>
  97. <if test="thirdPartyMerchCode != null">third_party_merch_code,</if>
  98. <if test="thirdPartyMerchName != null">third_party_merch_name,</if>
  99. <if test="sku != null">sku,</if>
  100. <if test="cusCode != null">cus_code,</if>
  101. <if test="goodsBizType != null">goods_biz_type,</if>
  102. <if test="shopInve != null">shop_inve,</if>
  103. <if test="shopValid != null">shop_valid,</if>
  104. <if test="shopFreezeNum != null">shop_freeze_num,</if>
  105. <if test="shopDamageNum != null">shop_damage_num,</if>
  106. <if test="shopDestroyLostNum != null">shop_destroy_lost_num,</if>
  107. <if test="shopExpireNum != null">shop_expire_num,</if>
  108. <if test="shopSampleFreezeNum != null">shop_sample_freeze_num,</if>
  109. <if test="shopMinus != null">shop_minus,</if>
  110. <if test="shopSupp != null">shop_supp,</if>
  111. <if test="inQty != null">in_qty,</if>
  112. <if test="outQty != null">out_qty,</if>
  113. <if test="returnQty != null">return_qty,</if>
  114. <if test="saleQty != null">sale_qty,</if>
  115. <if test="locInQty != null">loc_in_qty,</if>
  116. <if test="locOutQty != null">loc_out_qty,</if>
  117. <if test="isValid != null">is_valid,</if>
  118. <if test="createrSn != null">creater_sn,</if>
  119. <if test="createTime != null">create_time,</if>
  120. <if test="moderSn != null">moder_sn,</if>
  121. <if test="modTime != null">mod_time,</if>
  122. <if test="tstm != null">tstm,</if>
  123. </trim>
  124. <trim prefix="values (" suffix=")" suffixOverrides=",">
  125. <if test="shopInveSn != null">#{shopInveSn},</if>
  126. <if test="shopSn != null">#{shopSn},</if>
  127. <if test="shopName != null">#{shopName},</if>
  128. <if test="merchSn != null">#{merchSn},</if>
  129. <if test="merchName != null">#{merchName},</if>
  130. <if test="thirdPartyMerchCode != null">#{thirdPartyMerchCode},</if>
  131. <if test="thirdPartyMerchName != null">#{thirdPartyMerchName},</if>
  132. <if test="sku != null">#{sku},</if>
  133. <if test="cusCode != null">#{cusCode},</if>
  134. <if test="goodsBizType != null">#{goodsBizType},</if>
  135. <if test="shopInve != null">#{shopInve},</if>
  136. <if test="shopValid != null">#{shopValid},</if>
  137. <if test="shopFreezeNum != null">#{shopFreezeNum},</if>
  138. <if test="shopDamageNum != null">#{shopDamageNum},</if>
  139. <if test="shopDestroyLostNum != null">#{shopDestroyLostNum},</if>
  140. <if test="shopExpireNum != null">#{shopExpireNum},</if>
  141. <if test="shopSampleFreezeNum != null">#{shopSampleFreezeNum},</if>
  142. <if test="shopMinus != null">#{shopMinus},</if>
  143. <if test="shopSupp != null">#{shopSupp},</if>
  144. <if test="inQty != null">#{inQty},</if>
  145. <if test="outQty != null">#{outQty},</if>
  146. <if test="returnQty != null">#{returnQty},</if>
  147. <if test="saleQty != null">#{saleQty},</if>
  148. <if test="locInQty != null">#{locInQty},</if>
  149. <if test="locOutQty != null">#{locOutQty},</if>
  150. <if test="isValid != null">#{isValid},</if>
  151. <if test="createrSn != null">#{createrSn},</if>
  152. <if test="createTime != null">#{createTime},</if>
  153. <if test="moderSn != null">#{moderSn},</if>
  154. <if test="modTime != null">#{modTime},</if>
  155. <if test="tstm != null">#{tstm},</if>
  156. </trim>
  157. </insert>
  158. <update id="updateMallShopInveMng" parameterType="MallShopInveMng">
  159. update mall_shop_inve_mng
  160. <trim prefix="SET" suffixOverrides=",">
  161. <if test="shopSn != null">shop_sn = #{shopSn},</if>
  162. <if test="shopName != null">shop_name = #{shopName},</if>
  163. <if test="merchSn != null">merch_sn = #{merchSn},</if>
  164. <if test="merchName != null">merch_name = #{merchName},</if>
  165. <if test="thirdPartyMerchCode != null">third_party_merch_code = #{thirdPartyMerchCode},</if>
  166. <if test="thirdPartyMerchName != null">third_party_merch_name = #{thirdPartyMerchName},</if>
  167. <if test="sku != null">sku = #{sku},</if>
  168. <if test="cusCode != null">cus_code = #{cusCode},</if>
  169. <if test="goodsBizType != null">goods_biz_type = #{goodsBizType},</if>
  170. <if test="shopInve != null">shop_inve = #{shopInve},</if>
  171. <if test="shopValid != null">shop_valid = #{shopValid},</if>
  172. <if test="shopFreezeNum != null">shop_freeze_num = #{shopFreezeNum},</if>
  173. <if test="shopDamageNum != null">shop_damage_num = #{shopDamageNum},</if>
  174. <if test="shopDestroyLostNum != null">shop_destroy_lost_num = #{shopDestroyLostNum},</if>
  175. <if test="shopExpireNum != null">shop_expire_num = #{shopExpireNum},</if>
  176. <if test="shopSampleFreezeNum != null">shop_sample_freeze_num = #{shopSampleFreezeNum},</if>
  177. <if test="shopMinus != null">shop_minus = #{shopMinus},</if>
  178. <if test="shopSupp != null">shop_supp = #{shopSupp},</if>
  179. <if test="inQty != null">in_qty = #{inQty},</if>
  180. <if test="outQty != null">out_qty = #{outQty},</if>
  181. <if test="returnQty != null">return_qty = #{returnQty},</if>
  182. <if test="saleQty != null">sale_qty = #{saleQty},</if>
  183. <if test="locInQty != null">loc_in_qty = #{locInQty},</if>
  184. <if test="locOutQty != null">loc_out_qty = #{locOutQty},</if>
  185. <if test="isValid != null">is_valid = #{isValid},</if>
  186. <if test="createrSn != null">creater_sn = #{createrSn},</if>
  187. <if test="createTime != null">create_time = #{createTime},</if>
  188. <if test="moderSn != null">moder_sn = #{moderSn},</if>
  189. <if test="modTime != null">mod_time = #{modTime},</if>
  190. <if test="tstm != null">tstm = #{tstm},</if>
  191. </trim>
  192. where shop_inve_sn = #{shopInveSn}
  193. </update>
  194. <delete id="deleteMallShopInveMngById" parameterType="String">
  195. delete from mall_shop_inve_mng where shop_inve_sn = #{shopInveSn}
  196. </delete>
  197. <delete id="deleteMallShopInveMngByIds" parameterType="String">
  198. delete from mall_shop_inve_mng where shop_inve_sn in
  199. <foreach item="shopInveSn" collection="array" open="(" separator="," close=")">
  200. #{shopInveSn}
  201. </foreach>
  202. </delete>
  203. <insert id="saveOrUpdate" parameterType="MallShopInveMng">
  204. insert into mall_shop_inve_mng
  205. <trim prefix="(" suffix=")" suffixOverrides=",">
  206. <if test="shopInveSn != null">shop_inve_sn,</if>
  207. <if test="shopSn != null">shop_sn,</if>
  208. <if test="shopName != null">shop_name,</if>
  209. <if test="merchSn != null">merch_sn,</if>
  210. <if test="merchName != null">merch_name,</if>
  211. <if test="thirdPartyMerchCode != null">third_party_merch_code,</if>
  212. <if test="thirdPartyMerchName != null">third_party_merch_name,</if>
  213. <if test="sku != null">sku,</if>
  214. <if test="cusCode != null">cus_code,</if>
  215. <if test="goodsBizType != null">goods_biz_type,</if>
  216. <if test="shopInve != null">shop_inve,</if>
  217. <if test="shopValid != null">shop_valid,</if>
  218. <if test="shopFreezeNum != null">shop_freeze_num,</if>
  219. <if test="shopDamageNum != null">shop_damage_num,</if>
  220. <if test="shopDestroyLostNum != null">shop_destroy_lost_num,</if>
  221. <if test="shopExpireNum != null">shop_expire_num,</if>
  222. <if test="shopSampleFreezeNum != null">shop_sample_freeze_num,</if>
  223. <if test="shopMinus != null">shop_minus,</if>
  224. <if test="shopSupp != null">shop_supp,</if>
  225. <if test="inQty != null">in_qty,</if>
  226. <if test="outQty != null">out_qty,</if>
  227. <if test="returnQty != null">return_qty,</if>
  228. <if test="saleQty != null">sale_qty,</if>
  229. <if test="locInQty != null">loc_in_qty,</if>
  230. <if test="locOutQty != null">loc_out_qty,</if>
  231. <if test="isValid != null">is_valid,</if>
  232. <if test="createrSn != null">creater_sn,</if>
  233. <if test="createTime != null">create_time,</if>
  234. <if test="moderSn != null">moder_sn,</if>
  235. <if test="modTime != null">mod_time,</if>
  236. </trim>
  237. <trim prefix="values (" suffix=")" suffixOverrides=",">
  238. <if test="shopInveSn != null">#{shopInveSn},</if>
  239. <if test="shopSn != null">#{shopSn},</if>
  240. <if test="shopName != null">#{shopName},</if>
  241. <if test="merchSn != null">#{merchSn},</if>
  242. <if test="merchName != null">#{merchName},</if>
  243. <if test="thirdPartyMerchCode != null">#{thirdPartyMerchCode},</if>
  244. <if test="thirdPartyMerchName != null">#{thirdPartyMerchName},</if>
  245. <if test="sku != null">#{sku},</if>
  246. <if test="cusCode != null">#{cusCode},</if>
  247. <if test="goodsBizType != null">#{goodsBizType},</if>
  248. <if test="shopInve != null">#{shopInve},</if>
  249. <if test="shopValid != null">#{shopValid},</if>
  250. <if test="shopFreezeNum != null">#{shopFreezeNum},</if>
  251. <if test="shopDamageNum != null">#{shopDamageNum},</if>
  252. <if test="shopDestroyLostNum != null">#{shopDestroyLostNum},</if>
  253. <if test="shopExpireNum != null">#{shopExpireNum},</if>
  254. <if test="shopSampleFreezeNum != null">#{shopSampleFreezeNum},</if>
  255. <if test="shopMinus != null">#{shopMinus},</if>
  256. <if test="shopSupp != null">#{shopSupp},</if>
  257. <if test="inQty != null">#{inQty},</if>
  258. <if test="outQty != null">#{outQty},</if>
  259. <if test="returnQty != null">#{returnQty},</if>
  260. <if test="saleQty != null">#{saleQty},</if>
  261. <if test="locInQty != null">#{locInQty},</if>
  262. <if test="locOutQty != null">#{locOutQty},</if>
  263. <if test="isValid != null">#{isValid},</if>
  264. <if test="createrSn != null">#{createrSn},</if>
  265. <if test="createTime != null">#{createTime},</if>
  266. <if test="moderSn != null">#{moderSn},</if>
  267. <if test="modTime != null">#{modTime},</if>
  268. </trim>
  269. ON DUPLICATE KEY UPDATE
  270. <trim prefix="" suffixOverrides=",">
  271. <if test="shopSn != null">shop_sn = #{shopSn},</if>
  272. <if test="shopName != null">shop_name = #{shopName},</if>
  273. <if test="merchSn != null">merch_sn = #{merchSn},</if>
  274. <if test="merchName != null">merch_name = #{merchName},</if>
  275. <if test="thirdPartyMerchCode != null">third_party_merch_code = #{thirdPartyMerchCode},</if>
  276. <if test="thirdPartyMerchName != null">third_party_merch_name = #{thirdPartyMerchName},</if>
  277. <if test="sku != null">sku = #{sku},</if>
  278. <if test="cusCode != null">cus_code = #{cusCode},</if>
  279. <if test="goodsBizType != null">goods_biz_type = #{goodsBizType},</if>
  280. <if test="shopInve != null">shop_inve = #{shopInve},</if>
  281. <if test="shopValid != null">shop_valid = #{shopValid},</if>
  282. <if test="shopFreezeNum != null">shop_freeze_num = #{shopFreezeNum},</if>
  283. <if test="shopDamageNum != null">shop_damage_num = #{shopDamageNum},</if>
  284. <if test="shopDestroyLostNum != null">shop_destroy_lost_num = #{shopDestroyLostNum},</if>
  285. <if test="shopExpireNum != null">shop_expire_num = #{shopExpireNum},</if>
  286. <if test="shopSampleFreezeNum != null">shop_sample_freeze_num = #{shopSampleFreezeNum},</if>
  287. <if test="shopMinus != null">shop_minus = #{shopMinus},</if>
  288. <if test="shopSupp != null">shop_supp = #{shopSupp},</if>
  289. <if test="inQty != null">in_qty = #{inQty},</if>
  290. <if test="outQty != null">out_qty = #{outQty},</if>
  291. <if test="returnQty != null">return_qty = #{returnQty},</if>
  292. <if test="saleQty != null">sale_qty = #{saleQty},</if>
  293. <if test="locInQty != null">loc_in_qty = #{locInQty},</if>
  294. <if test="locOutQty != null">loc_out_qty = #{locOutQty},</if>
  295. <if test="isValid != null">is_valid = #{isValid},</if>
  296. <if test="createrSn != null">creater_sn = #{createrSn},</if>
  297. <if test="createTime != null">create_time = #{createTime},</if>
  298. <if test="moderSn != null">moder_sn = #{moderSn},</if>
  299. <if test="modTime != null">mod_time = #{modTime},</if>
  300. </trim>
  301. </insert>
  302. </mapper>