多余内容删除

充值会员优惠券赠送
店铺信息增加字段
This commit is contained in:
2024-10-24 16:53:37 +08:00
parent 0831cb5ace
commit cbdbe16cd0
66 changed files with 2370 additions and 5240 deletions

View File

@@ -1,127 +1,133 @@
<?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.chaozhanggui.system.cashierservice.dao.TbActivateMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbActivate">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
<result column="min_num" jdbcType="INTEGER" property="minNum" />
<result column="max_num" jdbcType="INTEGER" property="maxNum" />
<result column="handsel_num" jdbcType="DECIMAL" property="handselNum" />
<result column="handsel_type" jdbcType="VARCHAR" property="handselType" />
<result column="is_del" jdbcType="VARCHAR" property="isDel" />
</resultMap>
<sql id="Base_Column_List">
id, shop_id, min_num, max_num, handsel_num, handsel_type, is_del
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_activate
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_activate
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbActivate">
insert into tb_activate (id, shop_id, min_num,
max_num, handsel_num, handsel_type,
is_del)
values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, #{minNum,jdbcType=INTEGER},
#{maxNum,jdbcType=INTEGER}, #{handselNum,jdbcType=DECIMAL}, #{handselType,jdbcType=VARCHAR},
#{isDel,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbActivate">
insert into tb_activate
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="shopId != null">
shop_id,
</if>
<if test="minNum != null">
min_num,
</if>
<if test="maxNum != null">
max_num,
</if>
<if test="handselNum != null">
handsel_num,
</if>
<if test="handselType != null">
handsel_type,
</if>
<if test="isDel != null">
is_del,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="shopId != null">
#{shopId,jdbcType=INTEGER},
</if>
<if test="minNum != null">
#{minNum,jdbcType=INTEGER},
</if>
<if test="maxNum != null">
#{maxNum,jdbcType=INTEGER},
</if>
<if test="handselNum != null">
#{handselNum,jdbcType=DECIMAL},
</if>
<if test="handselType != null">
#{handselType,jdbcType=VARCHAR},
</if>
<if test="isDel != null">
#{isDel,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbActivate">
update tb_activate
<set>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=INTEGER},
</if>
<if test="minNum != null">
min_num = #{minNum,jdbcType=INTEGER},
</if>
<if test="maxNum != null">
max_num = #{maxNum,jdbcType=INTEGER},
</if>
<if test="handselNum != null">
handsel_num = #{handselNum,jdbcType=DECIMAL},
</if>
<if test="handselType != null">
handsel_type = #{handselType,jdbcType=VARCHAR},
</if>
<if test="isDel != null">
is_del = #{isDel,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbActivate">
update tb_activate
set shop_id = #{shopId,jdbcType=INTEGER},
min_num = #{minNum,jdbcType=INTEGER},
max_num = #{maxNum,jdbcType=INTEGER},
handsel_num = #{handselNum,jdbcType=DECIMAL},
handsel_type = #{handselType,jdbcType=VARCHAR},
is_del = #{isDel,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByAmount" resultMap="BaseResultMap">
select *
from tb_activate
where shop_id = #{shopId}
and is_del = 0
and min_num &lt;= #{amount}
and max_num &gt;= #{amount}
ORDER BY max_num desc limit 1
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbActivate" id="TbActivateMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
<result property="amount" column="amount" jdbcType="INTEGER"/>
<result property="giftAmount" column="gift_amount" jdbcType="INTEGER"/>
<result property="isUseCoupon" column="is_use_coupon" jdbcType="INTEGER"/>
<result property="couponId" column="coupon_id" jdbcType="INTEGER"/>
<result property="num" column="num" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id
, shop_id, amount, gift_amount, is_use_coupon, coupon_id, num, create_time, update_time </sql>
<select id="selectByAmount" resultMap="TbActivateMap">
select *
from tb_activate
where shop_id = #{shopId}
and amount = #{amount}
ORDER BY amount desc
limit 1
</select>
</mapper>
<!--查询单个-->
<select id="queryById" resultMap="TbActivateMap">
select
<include refid="Base_Column_List"/>
from tb_activate
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAll" resultMap="TbActivateMap">
select
<include refid="Base_Column_List"/>
from tb_activate
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="shopId != null">
and shop_id = #{shopId}
</if>
<if test="amount != null">
and amount = #{amount}
</if>
<if test="giftAmount != null">
and gift_amount = #{giftAmount}
</if>
<if test="isUseCoupon != null">
and is_use_coupon = #{isUseCoupon}
</if>
<if test="couponId != null">
and coupon_id = #{couponId}
</if>
<if test="num != null">
and num = #{num}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate(shop_id, amount, gift_amount, is_use_coupon, coupon_id, num, create_time, update_time)
values (#{shopId}, #{amount}, #{giftAmount}, #{isUseCoupon}, #{couponId}, #{num}, #{createTime}, #{updateTime})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate(shop_id, amount, gift_amount, is_use_coupon, coupon_id, num, create_time, update_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.shopId}, #{entity.amount}, #{entity.giftAmount}, #{entity.isUseCoupon}, #{entity.couponId},
#{entity.num}, #{entity.createTime}, #{entity.updateTime})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update tb_activate
<set>
<if test="shopId != null">
shop_id = #{shopId},
</if>
<if test="amount != null">
amount = #{amount},
</if>
<if test="giftAmount != null">
gift_amount = #{giftAmount},
</if>
<if test="isUseCoupon != null">
is_use_coupon = #{isUseCoupon},
</if>
<if test="couponId != null">
coupon_id = #{couponId},
</if>
<if test="num != null">
num = #{num},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from tb_activate
where id = #{id}
</delete>
</mapper>