123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.kmall.admin.dao.mk.Mk2GoodsTopicPriceDao">
- <resultMap type="com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity" id="mk2GoodsTopicPriceMap">
- <result property="mgthpId" column="mgthp_id"/>
- <result property="topicId" column="topic_id"/>
- <result property="topicType" column="topic_type"/>
- <result property="topicPrice" column="topic_price"/>
- <result property="topicName" column="topic_name"/>
- <result property="topicContent" column="topic_content"/>
- <result property="topicGoodsSku" column="topic_goods_sku"/>
- <result property="topicBeginTime" column="topic_begin_time"/>
- <result property="topicEndTime" column="topic_end_time"/>
- <result property="importTime" column="import_time"/>
- <result property="createrSn" column="creater_sn"/>
- <result property="createTime" column="create_time"/>
- <result property="moderSn" column="moder_sn"/>
- <result property="modTime" column="mod_time"/>
- <result property="tstm" column="tstm"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity">
- select
- `mgthp_id`,
- `topic_id`,
- `topic_type`,
- `topic_price`,
- `topic_name`,
- `topic_content`,
- `topic_goods_sku`,
- `topic_begin_time`,
- `topic_end_time`,
- `import_time`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from mk2_goods_topic_price
- where mgthp_id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity">
- select
- `mgthp_id`,
- `topic_id`,
- `topic_type`,
- `topic_price`,
- `topic_name`,
- `topic_content`,
- `topic_goods_sku`,
- `topic_begin_time`,
- `topic_end_time`,
- `import_time`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from mk2_goods_topic_price
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by mgthp_id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(*) from mk2_goods_topic_price
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity" useGeneratedKeys="true" keyProperty="id">
- insert into mk2_goods_topic_price(
- `mgthp_id`,
- `topic_id`,
- `topic_type`,
- `topic_price`,
- `topic_name`,
- `topic_content`,
- `topic_goods_sku`,
- `topic_begin_time`,
- `topic_end_time`,
- `import_time`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`)
- values(
- #{mgthpId},
- #{topicId},
- #{topicType},
- #{topicPrice},
- #{topicName},
- #{topicContent},
- #{topicGoodsSku},
- #{topicBeginTime},
- #{topicEndTime},
- #{importTime},
- #{createrSn},
- #{createTime},
- #{moderSn},
- #{modTime},
- #{tstm})
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity">
- update mk2_goods_topic_price
- <set>
- <if test="topicId != null">`topic_id` = #{topicId}, </if>
- <if test="topicType != null">`topic_type` = #{topicType}, </if>
- <if test="topicPrice != null">`topic_price` = #{topicPrice}, </if>
- <if test="topicName != null">`topic_name` = #{topicName}, </if>
- <if test="topicContent != null">`topic_content` = #{topicContent}, </if>
- <if test="topicGoodsSku != null">`topic_goods_sku` = #{topicGoodsSku}, </if>
- <if test="topicBeginTime != null">`topic_begin_time` = #{topicBeginTime}, </if>
- <if test="topicEndTime != null">`topic_end_time` = #{topicEndTime}, </if>
- <if test="importTime != null">`import_time` = #{importTime}, </if>
- <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
- <if test="createTime != null">`create_time` = #{createTime}, </if>
- <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
- <if test="modTime != null">`mod_time` = #{modTime}, </if>
- <if test="tstm != null">`tstm` = #{tstm}</if>
- </set>
- where mgthp_id = #{mgthpId}
- </update>
- <delete id="delete">
- delete from mk2_goods_topic_price where mgthp_id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mk2_goods_topic_price where mgthp_id in
- <foreach item="mgthpId" collection="array" open="(" separator="," close=")">
- #{mgthpId}
- </foreach>
- </delete>
- <select id="queryByTopicIdAndGoodsId" resultType="com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity">
- select
- `mgthp_id`,
- `topic_id`,
- `topic_type`,
- `topic_price`,
- `topic_name`,
- `topic_content`,
- `topic_goods_sku`,
- `topic_begin_time`,
- `topic_end_time`,
- `import_time`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from mk2_goods_topic_price
- where topic_id = #{mgthpId} and topic_goods_sku = #{sku}
- </select>
- <insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
- insert into mk2_goods_topic_price(
- `mgthp_id`,
- `topic_id`,
- `topic_type`,
- `topic_price`,
- `topic_name`,
- `topic_content`,
- `topic_goods_sku`,
- `topic_begin_time`,
- `topic_end_time`,
- `import_time`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`)
- values
- <foreach collection="list" index="index" item="item" separator=",">
- (
- #{item.mgthpId},
- #{item.topicId},
- #{item.topicType},
- #{item.topicPrice},
- #{item.topicName},
- #{item.topicContent},
- #{item.topicGoodsSku},
- #{item.topicBeginTime},
- #{item.topicEndTime},
- #{item.importTime},
- #{item.createrSn},
- #{item.createTime},
- #{item.moderSn},
- #{item.modTime},
- #{item.tstm}
- )
- </foreach>
- </insert>
- </mapper>
|