1
0

MkDistSellStatisMapper.xml 5.5 KB

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