Mk2GoodsTopicHistoryPriceDao.xml 5.5 KB

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