123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <?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.MkActivitiesFullGiftDao">
- <resultMap type="com.kmall.admin.entity.MkActivitiesFullGiftEntity" id="mkActivitiesFullGiftMap">
- <result property="mafrId" column="mafr_id"/>
- <result property="productName" column="product_name"/>
- <result property="shopSn" column="shop_sn"/>
- <result property="goodsSn" column="goods_sn"/>
- <result property="barcode" column="barcode"/>
- <result property="productBrand" column="product_brand"/>
- <result property="productSeries" column="product_series"/>
- <result property="qualifiedAmount" column="qualified_amount"/>
- <result property="giftBarcode" column="gift_barcode"/>
- <result property="giftGoodsSn" column="gift_goods_sn"/>
- <result property="mkaId" column="mka_id"/>
- <result property="deadline" column="deadline"/>
- <result property="createTime" column="create_time"/>
- <result property="createrSn" column="creater_sn"/>
- <result property="moderSn" column="moder_sn"/>
- <result property="updateTime" column="update_time"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.MkActivitiesFullGiftEntity">
- select
- mafr_id,
- product_name,
- shop_sn,
- goods_sn,
- barcode,
- product_brand,
- product_series,
- qualified_amount,
- gift_barcode,
- gift_goods_sn,
- mka_id,
- deadline,
- create_time,
- creater_sn,
- moder_sn,
- update_time
- from mk_activities_full_gift
- where mafr_id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.MkActivitiesFullGiftEntity">
- select
- mafr_id,
- product_name,
- shop_sn,
- goods_sn,
- barcode,
- product_brand,
- product_series,
- qualified_amount,
- gift_barcode,
- gift_goods_sn,
- mka_id,
- deadline,
- create_time,
- creater_sn,
- moder_sn,
- update_time
- from mk_activities_full_gift
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- <if test="storeId != null and storeId.trim() != ''">
- AND shop_sn = #{storeId}
- </if>
- <if test="mkaId != null">
- AND mka_id = #{mkaId}
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by mafr_id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(*) from mk_activities_full_gift
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- <if test="storeId != null and storeId.trim() != ''">
- AND shop_sn = #{storeId}
- </if>
- <if test="mkaId != null">
- AND mka_id = #{mkaId}
- </if>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.MkActivitiesFullGiftEntity" useGeneratedKeys="true" keyProperty="mafrId">
- insert into mk_activities_full_gift(
- product_name,
- shop_sn,
- goods_sn,
- barcode,
- product_brand,
- product_series,
- qualified_amount,
- gift_barcode,
- gift_goods_sn,
- mka_id,
- deadline,
- create_time,
- creater_sn,
- moder_sn,
- update_time)
- values(
- #{productName},
- #{shopSn},
- #{goodsSn},
- #{barcode},
- #{productBrand},
- #{productSeries},
- #{qualifiedAmount},
- #{giftBarcode},
- #{giftGoodsSn},
- #{mkaId},
- #{deadline},
- #{createTime},
- #{createrSn},
- #{moderSn},
- #{updateTime})
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.MkActivitiesFullGiftEntity">
- update mk_activities_full_gift
- <set>
- <if test="productName != null">product_name = #{productName}, </if>
- <if test="shopSn != null">shop_sn = #{shopSn}, </if>
- <if test="goodsSn != null">goods_sn = #{goodsSn}, </if>
- <if test="barcode != null">barcode = #{barcode}, </if>
- <if test="productBrand != null">product_brand = #{productBrand}, </if>
- <if test="productSeries != null">product_series = #{productSeries}, </if>
- <if test="qualifiedAmount != null">qualified_amount = #{qualifiedAmount}, </if>
- <if test="giftBarcode != null">gift_barcode = #{giftBarcode}, </if>
- <if test="giftGoodsSn != null">gift_goods_sn = #{giftGoodsSn}, </if>
- <if test="mkaId != null">mka_id = #{mkaId}, </if>
- <if test="deadline != null">deadline = #{deadline}, </if>
- <if test="createTime != null">create_time = #{createTime}, </if>
- <if test="createrSn != null">creater_sn = #{createrSn}, </if>
- <if test="moderSn != null">moder_sn = #{moderSn}, </if>
- <if test="updateTime != null">update_time = #{updateTime}</if>
- </set>
- where mafr_id = #{mafrId}
- </update>
- <delete id="delete">
- delete from mk_activities_full_gift where mafr_id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mk_activities_full_gift where mafr_id in
- <foreach item="mafrId" collection="array" open="(" separator="," close=")">
- #{mafrId}
- </foreach>
- </delete>
- <select id="queryByCodeOrBrand" resultType="com.kmall.admin.entity.MkActivitiesFullGiftEntity">
- select
- mafr_id,
- product_name,
- shop_sn,
- goods_sn,
- barcode,
- product_brand,
- product_series,
- qualified_amount,
- gift_barcode,
- gift_goods_sn,
- mka_id,
- deadline,
- create_time,
- creater_sn,
- moder_sn,
- update_time
- from mk_activities_full_gift
- where
- mka_id = #{mkaId}
- and (barcode = #{prodBarcode} or product_brand = #{brandName})
- and deadline >= #{nowTime}
- </select>
- </mapper>
|