Mk2GoodsTopicPriceDao.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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.Mk2GoodsTopicPriceDao">
  4. <resultMap type="com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity" id="mk2GoodsTopicPriceMap">
  5. <result property="mgthpId" column="mgthp_id"/>
  6. <result property="topicId" column="topic_id"/>
  7. <result property="topicType" column="topic_type"/>
  8. <result property="topicPrice" column="topic_price"/>
  9. <result property="topicName" column="topic_name"/>
  10. <result property="topicContent" column="topic_content"/>
  11. <result property="topicGoodsSku" column="topic_goods_sku"/>
  12. <result property="topicBeginTime" column="topic_begin_time"/>
  13. <result property="topicEndTime" column="topic_end_time"/>
  14. <result property="importTime" column="import_time"/>
  15. <result property="createrSn" column="creater_sn"/>
  16. <result property="createTime" column="create_time"/>
  17. <result property="moderSn" column="moder_sn"/>
  18. <result property="modTime" column="mod_time"/>
  19. <result property="tstm" column="tstm"/>
  20. </resultMap>
  21. <select id="queryObject" resultType="com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity">
  22. select
  23. `mgthp_id`,
  24. `topic_id`,
  25. `topic_type`,
  26. `topic_price`,
  27. `topic_name`,
  28. `topic_content`,
  29. `topic_goods_sku`,
  30. `topic_begin_time`,
  31. `topic_end_time`,
  32. `import_time`,
  33. `creater_sn`,
  34. `create_time`,
  35. `moder_sn`,
  36. `mod_time`,
  37. `tstm`
  38. from mk2_goods_topic_price
  39. where mgthp_id = #{id}
  40. </select>
  41. <select id="queryList" resultType="com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity">
  42. select
  43. `mgthp_id`,
  44. `topic_id`,
  45. `topic_type`,
  46. `topic_price`,
  47. `topic_name`,
  48. `topic_content`,
  49. `topic_goods_sku`,
  50. `topic_begin_time`,
  51. `topic_end_time`,
  52. `import_time`,
  53. `creater_sn`,
  54. `create_time`,
  55. `moder_sn`,
  56. `mod_time`,
  57. `tstm`
  58. from mk2_goods_topic_price
  59. WHERE 1=1
  60. <if test="name != null and name.trim() != ''">
  61. AND name LIKE concat('%',#{name},'%')
  62. </if>
  63. <choose>
  64. <when test="sidx != null and sidx.trim() != ''">
  65. order by ${sidx} ${order}
  66. </when>
  67. <otherwise>
  68. order by mgthp_id desc
  69. </otherwise>
  70. </choose>
  71. <if test="offset != null and limit != null">
  72. limit #{offset}, #{limit}
  73. </if>
  74. </select>
  75. <select id="queryTotal" resultType="int">
  76. select count(*) from mk2_goods_topic_price
  77. WHERE 1=1
  78. <if test="name != null and name.trim() != ''">
  79. AND name LIKE concat('%',#{name},'%')
  80. </if>
  81. </select>
  82. <insert id="save" parameterType="com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity" useGeneratedKeys="true" keyProperty="id">
  83. insert into mk2_goods_topic_price(
  84. `mgthp_id`,
  85. `topic_id`,
  86. `topic_type`,
  87. `topic_price`,
  88. `topic_name`,
  89. `topic_content`,
  90. `topic_goods_sku`,
  91. `topic_begin_time`,
  92. `topic_end_time`,
  93. `import_time`,
  94. `creater_sn`,
  95. `create_time`,
  96. `moder_sn`,
  97. `mod_time`,
  98. `tstm`)
  99. values(
  100. #{mgthpId},
  101. #{topicId},
  102. #{topicType},
  103. #{topicPrice},
  104. #{topicName},
  105. #{topicContent},
  106. #{topicGoodsSku},
  107. #{topicBeginTime},
  108. #{topicEndTime},
  109. #{importTime},
  110. #{createrSn},
  111. #{createTime},
  112. #{moderSn},
  113. #{modTime},
  114. #{tstm})
  115. </insert>
  116. <update id="update" parameterType="com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity">
  117. update mk2_goods_topic_price
  118. <set>
  119. <if test="topicId != null">`topic_id` = #{topicId}, </if>
  120. <if test="topicType != null">`topic_type` = #{topicType}, </if>
  121. <if test="topicPrice != null">`topic_price` = #{topicPrice}, </if>
  122. <if test="topicName != null">`topic_name` = #{topicName}, </if>
  123. <if test="topicContent != null">`topic_content` = #{topicContent}, </if>
  124. <if test="topicGoodsSku != null">`topic_goods_sku` = #{topicGoodsSku}, </if>
  125. <if test="topicBeginTime != null">`topic_begin_time` = #{topicBeginTime}, </if>
  126. <if test="topicEndTime != null">`topic_end_time` = #{topicEndTime}, </if>
  127. <if test="importTime != null">`import_time` = #{importTime}, </if>
  128. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  129. <if test="createTime != null">`create_time` = #{createTime}, </if>
  130. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  131. <if test="modTime != null">`mod_time` = #{modTime}, </if>
  132. <if test="tstm != null">`tstm` = #{tstm}</if>
  133. </set>
  134. where mgthp_id = #{mgthpId}
  135. </update>
  136. <delete id="delete">
  137. delete from mk2_goods_topic_price where mgthp_id = #{value}
  138. </delete>
  139. <delete id="deleteBatch">
  140. delete from mk2_goods_topic_price where mgthp_id in
  141. <foreach item="mgthpId" collection="array" open="(" separator="," close=")">
  142. #{mgthpId}
  143. </foreach>
  144. </delete>
  145. <select id="queryByTopicIdAndGoodsId" resultType="com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity">
  146. select
  147. `mgthp_id`,
  148. `topic_id`,
  149. `topic_type`,
  150. `topic_price`,
  151. `topic_name`,
  152. `topic_content`,
  153. `topic_goods_sku`,
  154. `topic_begin_time`,
  155. `topic_end_time`,
  156. `import_time`,
  157. `creater_sn`,
  158. `create_time`,
  159. `moder_sn`,
  160. `mod_time`,
  161. `tstm`
  162. from mk2_goods_topic_price
  163. where topic_id = #{mgthpId} and topic_goods_sku = #{sku}
  164. </select>
  165. <insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
  166. insert into mk2_goods_topic_price(
  167. `mgthp_id`,
  168. `topic_id`,
  169. `topic_type`,
  170. `topic_price`,
  171. `topic_name`,
  172. `topic_content`,
  173. `topic_goods_sku`,
  174. `topic_begin_time`,
  175. `topic_end_time`,
  176. `import_time`,
  177. `creater_sn`,
  178. `create_time`,
  179. `moder_sn`,
  180. `mod_time`,
  181. `tstm`)
  182. values
  183. <foreach collection="list" index="index" item="item" separator=",">
  184. (
  185. #{item.mgthpId},
  186. #{item.topicId},
  187. #{item.topicType},
  188. #{item.topicPrice},
  189. #{item.topicName},
  190. #{item.topicContent},
  191. #{item.topicGoodsSku},
  192. #{item.topicBeginTime},
  193. #{item.topicEndTime},
  194. #{item.importTime},
  195. #{item.createrSn},
  196. #{item.createTime},
  197. #{item.moderSn},
  198. #{item.modTime},
  199. #{item.tstm}
  200. )
  201. </foreach>
  202. </insert>
  203. </mapper>