<?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.ruoyi.shop.mapper.shop.ShopMarketingMapper">
|
|
<resultMap type="ShopMarketing" id="ShopMarketingResult">
|
<result property="shopId" column="shop_id" />
|
<result property="delFlag" column="del_flag" />
|
<result property="shopBirthdayFlag" column="shop_birthday_flag" />
|
<result property="shopCouponCount" column="shop_coupon_count" />
|
<result property="shopMarketingTotal" column="shop_marketing_total" />
|
</resultMap>
|
|
<sql id="selectShopMarketingVo">
|
select shop_id, del_flag, shop_birthday_flag, shop_coupon_count, shop_marketing_total from t_shop_marketing
|
</sql>
|
|
<select id="selectShopMarketingList" parameterType="ShopMarketing" resultMap="ShopMarketingResult">
|
<include refid="selectShopMarketingVo"/>
|
<where>
|
<if test="shopBirthdayFlag != null "> and shop_birthday_flag = #{shopBirthdayFlag}</if>
|
<if test="shopCouponCount != null "> and shop_coupon_count = #{shopCouponCount}</if>
|
<if test="shopMarketingTotal != null "> and shop_marketing_total = #{shopMarketingTotal}</if>
|
</where>
|
</select>
|
|
<select id="selectShopMarketingByShopId" parameterType="Long" resultMap="ShopMarketingResult">
|
<include refid="selectShopMarketingVo"/>
|
where shop_id = #{shopId}
|
</select>
|
|
<insert id="insertShopMarketing" parameterType="ShopMarketing" useGeneratedKeys="true" keyProperty="shopId">
|
insert into t_shop_marketing
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="delFlag != null">del_flag,</if>
|
<if test="shopBirthdayFlag != null">shop_birthday_flag,</if>
|
<if test="shopCouponCount != null">shop_coupon_count,</if>
|
<if test="shopMarketingTotal != null">shop_marketing_total,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="delFlag != null">#{delFlag},</if>
|
<if test="shopBirthdayFlag != null">#{shopBirthdayFlag},</if>
|
<if test="shopCouponCount != null">#{shopCouponCount},</if>
|
<if test="shopMarketingTotal != null">#{shopMarketingTotal},</if>
|
</trim>
|
</insert>
|
|
<update id="updateShopMarketing" parameterType="ShopMarketing">
|
update t_shop_marketing
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="shopBirthdayFlag != null">shop_birthday_flag = #{shopBirthdayFlag},</if>
|
<if test="shopCouponCount != null">shop_coupon_count = #{shopCouponCount},</if>
|
<if test="shopMarketingTotal != null">shop_marketing_total = #{shopMarketingTotal},</if>
|
</trim>
|
where shop_id = #{shopId}
|
</update>
|
|
<delete id="deleteShopMarketingByShopId" parameterType="Long">
|
delete from t_shop_marketing where shop_id = #{shopId}
|
</delete>
|
|
<delete id="deleteShopMarketingByShopIds" parameterType="String">
|
delete from t_shop_marketing where shop_id in
|
<foreach item="shopId" collection="array" open="(" separator="," close=")">
|
#{shopId}
|
</foreach>
|
</delete>
|
|
</mapper>
|