Mk2GoodsTopicPriceDao.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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.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="topicGoodsId" column="topic_goods_id"/>
  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_id`,
  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_id`,
  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">
  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_id`,
  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. #{topicGoodsId},
  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="topicGoodsId != null">`topic_goods_id` = #{topicGoodsId}, </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. </mapper>