123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <?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.MkActivitiesPresentIntegralDao">
- <resultMap type="com.kmall.admin.entity.mk.MkActivitiesPresentIntegralEntity" id="mkActivitiesPresentIntegralMap">
- <result property="mapId" column="map_id"/>
- <result property="productName" column="product_name"/>
- <result property="activityGiveType" column="activity_give_type"/>
- <result property="activityGiveNum" column="activity_give_num"/>
- <result property="shopSn" column="shop_sn"/>
- <result property="sku" column="sku"/>
- <result property="barcode" column="barcode"/>
- <result property="productBrand" column="product_brand"/>
- <result property="productSeries" column="product_series"/>
- <result property="mkaId" column="mka_id"/>
- <result property="rejectScore" column="reject_score"/>
- <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.mk.MkActivitiesPresentIntegralEntity">
- select
- `map_id`,
- `product_name`,
- `activity_give_type`,
- `activity_give_num`,
- `shop_sn`,
- `sku`,
- `barcode`,
- `product_brand`,
- `product_series`,
- `mka_id`,
- `reject_score`,
- `deadline`,
- `create_time`,
- `creater_sn`,
- `moder_sn`,
- `update_time`
- from mk_activities_present_integral
- where map_id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.mk.MkActivitiesPresentIntegralEntity">
- select
- `map_id`,
- `product_name`,
- `activity_give_type`,
- `activity_give_num`,
- `shop_sn`,
- `sku`,
- `barcode`,
- `product_brand`,
- `product_series`,
- `mka_id`,
- `reject_score`,
- `deadline`,
- `create_time`,
- `creater_sn`,
- `moder_sn`,
- `update_time`
- from mk_activities_present_integral
- 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 map_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_present_integral
- 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.MkActivitiesPresentIntegralEntity" useGeneratedKeys="true" keyProperty="mapId">
- insert into mk_activities_present_integral(
- `product_name`,
- `activity_give_type`,
- `activity_give_num`,
- `shop_sn`,
- `sku`,
- `barcode`,
- `product_brand`,
- `product_series`,
- `mka_id`,
- `reject_score`,
- `deadline`,
- `create_time`,
- `creater_sn`,
- `moder_sn`,
- `update_time`)
- values(
- #{productName},
- #{activityGiveType},
- #{activityGiveNum},
- #{shopSn},
- #{sku},
- #{barcode},
- #{productBrand},
- #{productSeries},
- #{mkaId},
- #{rejectScore},
- #{deadline},
- #{createTime},
- #{createrSn},
- #{moderSn},
- #{updateTime})
- </insert>
-
- <update id="update" parameterType="com.kmall.admin.entity.mk.MkActivitiesPresentIntegralEntity">
- update mk_activities_present_integral
- <set>
- <if test="productName != null">`product_name` = #{productName}, </if>
- <if test="activityGiveType != null">`activity_give_type` = #{activityGiveType}, </if>
- <if test="activityGiveNum != null">`activity_give_num` = #{activityGiveNum}, </if>
- <if test="shopSn != null">`shop_sn` = #{shopSn}, </if>
- <if test="sku != null">`sku` = #{sku}, </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="mkaId != null">`mka_id` = #{mkaId}, </if>
- <if test="rejectScore != null">`reject_score` = #{rejectScore}, </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 map_id = #{mapId}
- </update>
-
- <delete id="delete">
- delete from mk_activities_present_integral where map_id = #{value}
- </delete>
-
- <delete id="deleteBatch">
- delete from mk_activities_present_integral where map_id in
- <foreach item="mapId" collection="array" open="(" separator="," close=")">
- #{mapId}
- </foreach>
- </delete>
- <select id="querySkuByNow" resultMap="mkActivitiesPresentIntegralMap">
- select
- mapi.*
- from mk_activities_present_integral mapi
- left join mk_activities ma on ma.mka_id = mapi.mka_id
- where
- ma.mka_store_id = #{storeId}
- and ma.mka_start_time < #{currentTime}
- and ma.mkd_end_time > #{currentTime}
- and ma.mka_status = 1
- and ma.mka_topic = #{mkaTopic}
- </select>
- </mapper>
|