123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <?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.Mall2ShippingReminderAlarmDao">
- <resultMap type="com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity" id="mall2ShippingReminderAlarmMap">
- <result property="msraId" column="msra_id"/>
- <result property="goodsId" column="goods_id"/>
- <result property="goodsName" column="goods_name"/>
- <result property="averageSales" column="average_sales"/>
- <result property="storeId" column="store_id"/>
- <result property="sku" column="sku"/>
- <result property="storeName" column="store_name"/>
- <result property="stockNum" column="stock_num"/>
- <result property="alarmType" column="alarm_type"/>
- <result property="alarmTime" column="alarm_time"/>
- <result property="isWarning" column="is_warning"/>
- <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.alarm.Mall2ShippingReminderAlarmEntity">
- select
- `msra_id`,
- `goods_id`,
- `goods_name`,
- `average_sales`,
- `store_id`,
- `sku`,
- `store_name`,
- `stock_num`,
- `alarm_type`,
- `alarm_time`,
- `is_warning`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from mall2_shipping_reminder_alarm
- where msra_id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity">
- select
- `msra_id`,
- `goods_id`,
- `goods_name`,
- `average_sales`,
- `store_id`,
- `sku`,
- `store_name`,
- `stock_num`,
- `alarm_type`,
- `alarm_time`,
- `is_warning`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from mall2_shipping_reminder_alarm
- WHERE 1=1
- and is_warning = 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 msra_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_shipping_reminder_alarm
- WHERE 1=1
- and is_warning = 1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity" useGeneratedKeys="true" keyProperty="id">
- insert into mall2_shipping_reminder_alarm(
- `msra_id`,
- `goods_id`,
- `goods_name`,
- `average_sales`,
- `store_id`,
- `sku`,
- `store_name`,
- `stock_num`,
- `alarm_type`,
- `alarm_time`,
- `is_warning`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`)
- values(
- #{msraId},
- #{goodsId},
- #{goodsName},
- #{averageSales},
- #{storeId},
- #{sku},
- #{storeName},
- #{stockNum},
- #{alarmType},
- #{alarmTime},
- #{isWarning},
- #{createrSn},
- #{createTime},
- #{moderSn},
- #{modTime},
- #{tstm})
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity">
- update mall2_shipping_reminder_alarm
- <set>
- <if test="goodsId != null">`goods_id` = #{goodsId}, </if>
- <if test="goodsName != null">`goods_name` = #{goodsName}, </if>
- <if test="averageSales != null">`average_sales` = #{averageSales}, </if>
- <if test="storeId != null">`store_id` = #{storeId}, </if>
- <if test="sku != null">`sku` = #{sku}, </if>
- <if test="storeName != null">`store_name` = #{storeName}, </if>
- <if test="stockNum != null">`stock_num` = #{stockNum}, </if>
- <if test="alarmType != null">`alarm_type` = #{alarmType}, </if>
- <if test="alarmTime != null">`alarm_time` = #{alarmTime}, </if>
- <if test="isWarning != null">`is_warning` = #{isWarning}, </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 msra_id = #{msraId}
- </update>
- <delete id="delete">
- delete from mall2_shipping_reminder_alarm where msra_id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mall2_shipping_reminder_alarm where msra_id in
- <foreach item="msraId" collection="array" open="(" separator="," close=")">
- #{msraId}
- </foreach>
- </delete>
- <select id="queryByGoodsIdAndStoreId" resultType="com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity">
- select
- `msra_id`,
- `goods_id`,
- `goods_name`,
- `average_sales`,
- `store_id`,
- `sku`,
- `store_name`,
- `stock_num`,
- `alarm_type`,
- `alarm_time`,
- `is_warning`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from mall2_shipping_reminder_alarm
- where goods_id = #{goodsId} and store_id = #{storeId}
- </select>
- <insert id="insertBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
- insert into mall2_shipping_reminder_alarm(
- `msra_id`,
- `goods_id`,
- `goods_name`,
- `average_sales`,
- `store_id`,
- `sku`,
- `store_name`,
- `stock_num`,
- `alarm_type`,
- `alarm_time`,
- `is_warning`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`)
- values
- <foreach collection="list" index="index" item="item" separator=",">
- (
- #{item.msraId},
- #{item.goodsId},
- #{item.goodsName},
- #{item.averageSales},
- #{item.storeId},
- #{item.sku},
- #{item.storeName},
- #{item.stockNum},
- #{item.alarmType},
- #{item.alarmTime},
- #{item.isWarning},
- #{item.createrSn},
- #{item.createTime},
- #{item.moderSn},
- #{item.modTime},
- #{item.tstm}
- )
- </foreach>
- </insert>
- <update id="updateBatch" parameterType="java.util.List">
- <foreach collection="list" item="item" index="index" open="" close="" separator=";">
- update mall2_shipping_reminder_alarm
- <set>
- <if test="item.goodsId != null">`goods_id` = #{item.goodsId}, </if>
- <if test="item.goodsName != null">`goods_name` = #{item.goodsName}, </if>
- <if test="item.averageSales != null">`average_sales` = #{item.averageSales}, </if>
- <if test="item.storeId != null">`store_id` = #{item.storeId}, </if>
- <if test="item.sku != null">`sku` = #{item.sku}, </if>
- <if test="item.storeName != null">`store_name` = #{item.storeName}, </if>
- <if test="item.stockNum != null">`stock_num` = #{item.stockNum}, </if>
- <if test="item.alarmType != null">`alarm_type` = #{item.alarmType}, </if>
- <if test="item.alarmTime != null">`alarm_time` = #{item.alarmTime}, </if>
- <if test="item.isWarning != null">`is_warning` = #{item.isWarning}, </if>
- <if test="item.createrSn != null">`creater_sn` = #{item.createrSn}, </if>
- <if test="item.createTime != null">`create_time` = #{item.createTime}, </if>
- <if test="item.moderSn != null">`moder_sn` = #{item.moderSn}, </if>
- <if test="item.modTime != null">`mod_time` = #{item.modTime}, </if>
- <if test="item.tstm != null">`tstm` = #{item.tstm}</if>
- </set>
- where msra_id = #{item.msraId}
- </foreach>
- </update>
- </mapper>
|