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.MkActivitiesAssociationDao">
- <resultMap type="com.kmall.admin.entity.mk.MkActivitiesAssociationEntity" id="mkActivitiesAssociationMap">
- <result property="mkaaId" column="mkaa_id"/>
- <result property="mkCode" column="mk_code"/>
- <result property="mkaId" column="mka_id"/>
- <result property="merchSn" column="merch_sn"/>
- <result property="thirdMerchSn" column="third_merch_sn"/>
- <result property="mkaStoreId" column="mka_store_id"/>
- <result property="mkaStatus" column="mka_status"/>
- <result property="mkaStartTime" column="mka_start_time"/>
- <result property="mkdEndTime" column="mkd_end_time"/>
- <result property="mkaEndEarly" column="mka_end_early"/>
- <result property="mkdEndEarlyTime" column="mkd_end_early_time"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.mk.MkActivitiesAssociationEntity">
- select
- `mkaa_id`,
- `mk_code`,
- `mka_id`,
- `mka_store_id`,
- `mka_status`,
- `mka_start_time`,
- `mkd_end_time`,
- `mka_end_early`,
- `mkd_end_early_time`
- from mk_activities_association
- where mkaa_id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.mk.MkActivitiesAssociationEntity">
- select
- `mkaa_id`,
- `mk_code`,
- `mka_id`,
- `mka_store_id`,
- `mka_status`,
- `mka_start_time`,
- `mkd_end_time`,
- `mka_end_early`,
- `mkd_end_early_time`
- from mk_activities_association
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- <if test="mkCode != null and mkCode != ''">
- AND mk_code=#{mkCode}
- </if>
- <if test="mkaStatus != null and mkaStatus != ''">
- AND mka_status=#{mkaStatus}
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by mkaa_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_association
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- </select>
- <select id="queryByMkCodeAndTopic" resultType="com.kmall.admin.entity.mk.MkActivitiesAssociationEntity">
- select
- maa.mkaa_id,
- maa.mk_code,
- maa.mka_id,
- maa.mka_store_id,
- maa.mka_status,
- maa.mka_start_time,
- maa.mkd_end_time,
- maa.mka_end_early,
- maa.mkd_end_early_time
- from mk_activities_association maa,
- mk_activities ma
- <where>
- maa.mka_id = ma.mka_id
- and maa.mk_code = #{mkCode}
- and ma.mka_topic = #{mkaTopic}
- and maa.mka_store_id = #{mkaStoreId}
- </where>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.mk.MkActivitiesAssociationEntity" useGeneratedKeys="true" keyProperty="mkaaId">
- insert into mk_activities_association(
- `mk_code`,
- `mka_id`,
- `merch_sn`,
- `third_merch_sn`,
- `mka_store_id`,
- `mka_status`,
- `mka_start_time`,
- `mkd_end_time`,
- `mka_end_early`,
- `mkd_end_early_time`)
- values(
- #{mkCode},
- #{mkaId},
- #{merchSn},
- #{thirdMerchSn},
- #{mkaStoreId},
- #{mkaStatus},
- #{mkaStartTime},
- #{mkdEndTime},
- #{mkaEndEarly},
- #{mkdEndEarlyTime})
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.mk.MkActivitiesAssociationEntity">
- update mk_activities_association
- <set>
- <if test="mkCode != null">`mk_code` = #{mkCode}, </if>
- <if test="mkaId != null">`mka_id` = #{mkaId}, </if>
- <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
- <if test="thirdMerchSn != null">`third_merch_sn` = #{thirdMerchSn}, </if>
- <if test="mkaStoreId != null">`mka_store_id` = #{mkaStoreId}, </if>
- <if test="mkaStatus != null">`mka_status` = #{mkaStatus}, </if>
- <if test="mkaStartTime != null">`mka_start_time` = #{mkaStartTime}, </if>
- <if test="mkdEndTime != null">`mkd_end_time` = #{mkdEndTime}, </if>
- <if test="mkaEndEarly != null">`mka_end_early` = #{mkaEndEarly}, </if>
- <if test="mkdEndEarlyTime != null">`mkd_end_early_time` = #{mkdEndEarlyTime}</if>
- </set>
- where mkaa_id = #{mkaaId}
- </update>
- <delete id="delete">
- delete from mk_activities_association where mkaa_id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mk_activities_association where mka_id in
- <foreach item="mkaId" collection="array" open="(" separator="," close=")">
- #{mkaId}
- </foreach>
- </delete>
- <delete id="deleteByMkaId">
- delete from mk_activities_association where mka_id = #{mkaId}
- </delete>
- <update id="updateByMkaId" parameterType="com.kmall.admin.entity.mk.MkActivitiesAssociationEntity">
- update mk_activities_association
- <set>
- <if test="mkCode != null">`mk_code` = #{mkCode}, </if>
- <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
- <if test="thirdMerchSn != null">`third_merch_sn` = #{thirdMerchSn}, </if>
- <if test="mkaStoreId != null">`mka_store_id` = #{mkaStoreId}, </if>
- <if test="mkaStatus != null">`mka_status` = #{mkaStatus}, </if>
- <if test="mkaStartTime != null">`mka_start_time` = #{mkaStartTime}, </if>
- <if test="mkdEndTime != null">`mkd_end_time` = #{mkdEndTime}, </if>
- <if test="mkaEndEarly != null">`mka_end_early` = #{mkaEndEarly}, </if>
- <if test="mkdEndEarlyTime != null">`mkd_end_early_time` = #{mkdEndEarlyTime}</if>
- </set>
- where `mka_id` = #{mkaId}
- </update>
- </mapper>
|