123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?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.alarm.Mall2LowPriceWarningDao">
- <resultMap type="com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity" id="mall2LowPriceWarningMap">
- <result property="mlrwId" column="mlrw_id"/>
- <result property="salePrice" column="sale_price"/>
- <result property="warningPrice" column="warning_price"/>
- <result property="warningType" column="warning_type"/>
- <result property="sku" column="sku"/>
- <result property="storeId" column="store_id"/>
- <result property="activityId" column="activity_id"/>
- <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"/>
- <result property="viewed" column="viewed"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity">
- select
- `mlrw_id`,
- `sale_price`,
- `warning_price`,
- `warning_type`,
- `sku`,
- `store_id`,
- `activity_id`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`,
- `viewed`
- from mall2_low_price_warning
- where mlrw_id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity">
- select
- warning.mlrw_id,
- warning.sale_price,
- warning.warning_price,
- warning.warning_type,
- warning.sku,
- warning.store_id,
- warning.activity_id,
- warning.creater_sn,
- warning.create_time,
- warning.moder_sn,
- warning.mod_time,
- warning.tstm,
- warning.viewed,
- goods.name as goodsName,
- store.store_name as storeName,
- p.title as storeTopicName
- from mall2_low_price_warning warning
- left join mall_goods goods on goods.sku = warning.sku
- left join mall_store store on store.id = warning.store_id
- LEFT JOIN mall_store_topic p ON p.id = warning.activity_id
- 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 mlrw_id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(*) from mall2_low_price_warning
- 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.alarm.Mall2LowPriceWarningEntity" useGeneratedKeys="true" keyProperty="mlrwId">
- insert into mall2_low_price_warning(
- `sale_price`,
- `warning_price`,
- `warning_type`,
- `sku`,
- `store_id`,
- `activity_id`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`,
- `viewed`)
- values(
- #{salePrice},
- #{warningPrice},
- #{warningType},
- #{sku},
- #{storeId},
- #{activityId},
- #{createrSn},
- #{createTime},
- #{moderSn},
- #{modTime},
- #{tstm},
- #{viewed})
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity">
- update mall2_low_price_warning
- <set>
- <if test="salePrice != null">`sale_price` = #{salePrice}, </if>
- <if test="warningPrice != null">`warning_price` = #{warningPrice}, </if>
- <if test="warningType != null">`warning_type` = #{warningType}, </if>
- <if test="sku != null">`sku` = #{sku}, </if>
- <if test="storeId != null">`store_id` = #{storeId}, </if>
- <if test="activityId != null">`activity_id` = #{activityId}, </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>
- <if test="viewed != null">`viewed` = #{viewed}</if>
- </set>
- where mlrw_id = #{mlrwId}
- </update>
- <delete id="delete">
- delete from mall2_low_price_warning where mlrw_id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mall2_low_price_warning where mlrw_id in
- <foreach item="mlrwId" collection="array" open="(" separator="," close=")">
- #{mlrwId}
- </foreach>
- </delete>
- </mapper>
|