123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <?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.GoodsHistoryPriceDao">
- <resultMap type="com.kmall.admin.entity.GoodsHistoryPriceEntity" id="goodsHistoryPriceMap">
- <result property="id" column="id"/>
- <result property="goodsSn" column="goods_sn"/>
- <result property="sku" column="sku"/>
- <result property="plu" column="PLU"/>
- <result property="thirdMerchSn" column="third_merch_sn"/>
- <result property="merchSn" column="merch_sn"/>
- <result property="storeNumber" column="store_number"/>
- <result property="batchSn" column="batch_sn"/>
- <result property="dailyPrice" column="daily_price"/>
- <result property="activeityPrice" column="activeity_price"/>
- <result property="priceTime" column="price_time"/>
- <result property="retailPriceDate" column="retail_price_date"/>
- <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.GoodsHistoryPriceEntity">
- select
- `id`,
- `goods_sn`,
- `sku`,
- `PLU`,
- `third_merch_sn`,
- `merch_sn`,
- `store_number`,
- `batch_sn`,
- `daily_price`,
- `activeity_price`,
- `price_time`,
- `retail_price_date`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from mall_goods_history_price
- where id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.GoodsHistoryPriceEntity">
- select
- `id`,
- `goods_sn`,
- `sku`,
- `PLU`,
- `third_merch_sn`,
- `merch_sn`,
- `store_number`,
- `batch_sn`,
- `daily_price`,
- `activeity_price`,
- `price_time`,
- `retail_price_date`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from mall_goods_history_price
- WHERE 1=1
- <if test="sku != null and sku.trim() != ''">
- AND sku LIKE concat('%',#{sku},'%')
- </if>
- <if test="goodsSn != null and goodsSn.trim() != ''">
- AND goods_sn LIKE concat('%',#{goodsSn},'%')
- </if>
- <if test="plu != null and plu.trim() != ''">
- AND PLU LIKE concat('%',#{plu},'%')
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(*) from mall_goods_history_price
- WHERE 1=1
- <if test="sku != null and sku.trim() != ''">
- AND sku LIKE concat('%',#{sku},'%')
- </if>
- <if test="goodsSn != null and goodsSn.trim() != ''">
- AND goods_sn LIKE concat('%',#{goodsSn},'%')
- </if>
- <if test="plu != null and plu.trim() != ''">
- AND PLU LIKE concat('%',#{plu},'%')
- </if>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.GoodsHistoryPriceEntity" useGeneratedKeys="true" keyProperty="id">
- insert into mall_goods_history_price(
- `goods_sn`,
- `sku`,
- `PLU`,
- `third_merch_sn`,
- `merch_sn`,
- `store_number`,
- `batch_sn`,
- `daily_price`,
- `activeity_price`,
- `price_time`,
- `retail_price_date`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`)
- values(
- #{goodsSn},
- #{sku},
- #{plu},
- #{thirdMerchSn},
- #{merchSn},
- #{storeNumber},
- #{batchSn},
- #{dailyPrice},
- #{activeityPrice},
- #{priceTime},
- #{retailPriceDate},
- #{createrSn},
- #{createTime},
- #{moderSn},
- #{modTime},
- #{tstm})
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.GoodsHistoryPriceEntity">
- update mall_goods_history_price
- <set>
- <if test="goodsSn != null">`goods_sn` = #{goodsSn}, </if>
- <if test="sku != null">`sku` = #{sku}, </if>
- <if test="plu != null">`PLU` = #{plu}, </if>
- <if test="thirdMerchSn != null">`third_merch_sn` = #{thirdMerchSn}, </if>
- <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
- <if test="storeNumber != null">`store_number` = #{storeNumber}, </if>
- <if test="batchSn != null">`batch_sn` = #{batchSn}, </if>
- <if test="dailyPrice != null">`daily_price` = #{dailyPrice}, </if>
- <if test="activeityPrice != null">`activeity_price` = #{activeityPrice}, </if>
- <if test="priceTime != null">`price_time` = #{priceTime}, </if>
- <if test="retailPriceDate != null">`retail_price_date` = #{retailPriceDate}, </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 id = #{id}
- </update>
-
- <delete id="delete">
- delete from mall_goods_history_price where id = #{value}
- </delete>
-
- <delete id="deleteBatch">
- delete from mall_goods_history_price where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|