MkDistSellAllocationHistoryDao.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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.kmall.admin.dao.mk.dist.MkDistSellAllocationHistoryDao">
  4. <resultMap type="com.kmall.admin.entity.mk.dist.MkDistSellAllocationHistoryEntity" id="mkDistSellAllocationHistoryMap">
  5. <result property="sellAllocHistoryId" column="sell_alloc_history_id"/>
  6. <result property="distChnlId" column="dist_chnl_id"/>
  7. <result property="distFlag" column="dist_flag"/>
  8. <result property="thirdMerchSn" column="third_merch_sn"/>
  9. <result property="supplierId" column="supplier_id"/>
  10. <result property="distId" column="dist_id"/>
  11. <result property="storeId" column="store_id"/>
  12. <result property="goodsId" column="goods_id"/>
  13. <result property="allocType" column="alloc_type"/>
  14. <result property="expendDistIds" column="expend_dist_ids"/>
  15. <result property="expendDistLines" column="expend_dist_lines"/>
  16. <result property="isValid" column="is_valid"/>
  17. <result property="note" column="note"/>
  18. <result property="createrSn" column="creater_sn"/>
  19. <result property="createTime" column="create_time"/>
  20. <result property="moderSn" column="moder_sn"/>
  21. <result property="modTime" column="mod_time"/>
  22. <result property="tstm" column="tstm"/>
  23. </resultMap>
  24. <select id="queryObject" resultType="com.kmall.admin.entity.mk.dist.MkDistSellAllocationHistoryEntity">
  25. select
  26. `sell_alloc_history_id`,
  27. `dist_chnl_id`,
  28. `dist_flag`,
  29. `third_merch_sn`,
  30. `supplier_id`,
  31. `dist_id`,
  32. `store_id`,
  33. `goods_id`,
  34. `alloc_type`,
  35. `expend_dist_ids`,
  36. `expend_dist_lines`,
  37. `is_valid`,
  38. `note`,
  39. `creater_sn`,
  40. `create_time`,
  41. `moder_sn`,
  42. `mod_time`,
  43. `tstm`
  44. from mk_dist_sell_allocation_history
  45. where sell_alloc_history_id = #{id}
  46. </select>
  47. <select id="queryList" resultType="com.kmall.admin.entity.mk.dist.MkDistSellAllocationHistoryEntity">
  48. select
  49. `sell_alloc_history_id`,
  50. `dist_chnl_id`,
  51. `dist_flag`,
  52. `third_merch_sn`,
  53. `supplier_id`,
  54. `dist_id`,
  55. `store_id`,
  56. `goods_id`,
  57. `alloc_type`,
  58. `expend_dist_ids`,
  59. `expend_dist_lines`,
  60. `is_valid`,
  61. `note`,
  62. `creater_sn`,
  63. `create_time`,
  64. `moder_sn`,
  65. `mod_time`,
  66. `tstm`
  67. from mk_dist_sell_allocation_history
  68. WHERE 1=1
  69. <if test="name != null and name.trim() != ''">
  70. AND name LIKE concat('%',#{name},'%')
  71. </if>
  72. <choose>
  73. <when test="sidx != null and sidx.trim() != ''">
  74. order by ${sidx} ${order}
  75. </when>
  76. <otherwise>
  77. order by sell_alloc_history_id desc
  78. </otherwise>
  79. </choose>
  80. <if test="offset != null and limit != null">
  81. limit #{offset}, #{limit}
  82. </if>
  83. </select>
  84. <select id="queryTotal" resultType="int">
  85. select count(*) from mk_dist_sell_allocation_history
  86. WHERE 1=1
  87. <if test="name != null and name.trim() != ''">
  88. AND name LIKE concat('%',#{name},'%')
  89. </if>
  90. </select>
  91. <insert id="save" parameterType="com.kmall.admin.entity.mk.dist.MkDistSellAllocationHistoryEntity" useGeneratedKeys="true" keyProperty="sellAllocHistoryId">
  92. insert into mk_dist_sell_allocation_history(
  93. `dist_chnl_id`,
  94. `dist_flag`,
  95. `third_merch_sn`,
  96. `supplier_id`,
  97. `dist_id`,
  98. `store_id`,
  99. `goods_id`,
  100. `alloc_type`,
  101. `expend_dist_ids`,
  102. `expend_dist_lines`,
  103. `is_valid`,
  104. `note`,
  105. `creater_sn`,
  106. `create_time`,
  107. `moder_sn`,
  108. `mod_time`,
  109. `tstm`)
  110. values(
  111. #{distChnlId},
  112. #{distFlag},
  113. #{thirdMerchSn},
  114. #{supplierId},
  115. #{distId},
  116. #{storeId},
  117. #{goodsId},
  118. #{allocType},
  119. #{expendDistIds},
  120. #{expendDistLines},
  121. #{isValid},
  122. #{note},
  123. #{createrSn},
  124. #{createTime},
  125. #{moderSn},
  126. #{modTime},
  127. #{tstm})
  128. </insert>
  129. <update id="update" parameterType="com.kmall.admin.entity.mk.dist.MkDistSellAllocationHistoryEntity">
  130. update mk_dist_sell_allocation_history
  131. <set>
  132. <if test="distChnlId != null">`dist_chnl_id` = #{distChnlId}, </if>
  133. <if test="distFlag != null">`dist_flag` = #{distFlag}, </if>
  134. <if test="thirdMerchSn != null">`third_merch_sn` = #{thirdMerchSn}, </if>
  135. <if test="supplierId != null">`supplier_id` = #{supplierId}, </if>
  136. <if test="distId != null">`dist_id` = #{distId}, </if>
  137. <if test="storeId != null">`store_id` = #{storeId}, </if>
  138. <if test="goodsId != null">`goods_id` = #{goodsId}, </if>
  139. <if test="allocType != null">`alloc_type` = #{allocType}, </if>
  140. <if test="expendDistIds != null">`expend_dist_ids` = #{expendDistIds}, </if>
  141. <if test="expendDistLines != null">`expend_dist_lines` = #{expendDistLines}, </if>
  142. <if test="isValid != null">`is_valid` = #{isValid}, </if>
  143. <if test="note != null">`note` = #{note}, </if>
  144. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  145. <if test="createTime != null">`create_time` = #{createTime}, </if>
  146. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  147. <if test="modTime != null">`mod_time` = #{modTime}, </if>
  148. <if test="tstm != null">`tstm` = #{tstm}</if>
  149. </set>
  150. where sell_alloc_history_id = #{sellAllocHistoryId}
  151. </update>
  152. <delete id="delete">
  153. delete from mk_dist_sell_allocation_history where sell_alloc_history_id = #{value}
  154. </delete>
  155. <delete id="deleteBatch">
  156. delete from mk_dist_sell_allocation_history where sell_alloc_history_id in
  157. <foreach item="sellAllocHistoryId" collection="array" open="(" separator="," close=")">
  158. #{sellAllocHistoryId}
  159. </foreach>
  160. </delete>
  161. </mapper>