会员 充值活动 奖励 赠送商品

This commit is contained in:
2024-08-21 09:29:50 +08:00
parent 9fcee207d5
commit fbb69e60d9
15 changed files with 856 additions and 56 deletions

View File

@@ -0,0 +1,123 @@
<?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.TbActivateGiveRecordMapper">
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbActivateGiveRecord" id="TbActivateGiveRecordMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="vipUserId" column="vip_user_id" jdbcType="INTEGER"/>
<result property="proId" column="pro_id" jdbcType="INTEGER"/>
<result property="num" column="num" jdbcType="INTEGER"/>
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
<result property="sourceActId" column="source_act_id" jdbcType="INTEGER"/>
<result property="sourceFlowId" column="source_flow_id" 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
, vip_user_id, pro_id, num, shop_id, source_flow_id,source_act_id, create_time, update_time </sql>
<!--查询单个-->
<select id="queryById" resultMap="TbActivateGiveRecordMap">
select
<include refid="Base_Column_List"/>
from tb_activate_give_record
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAll" resultMap="TbActivateGiveRecordMap">
select
<include refid="Base_Column_List"/>
from tb_activate_give_record
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="vipUserId != null">
and vip_user_id = #{vipUserId}
</if>
<if test="proId != null">
and pro_id = #{proId}
</if>
<if test="num != null">
and num = #{num}
</if>
<if test="shopId != null">
and shop_id = #{shopId}
</if>
<if test="sourceActId != null">
and source_act_id = #{sourceActId}
</if>
<if test="sourceFlowId != null">
and source_flow_id = #{sourceFlowId}
</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_give_record(vip_user_id, pro_id, num, shop_id, source_act_id, source_flow_id, create_time, update_time)
values (#{vipUserId}, #{proId}, #{num}, #{shopId}, #{sourceActId}, #{sourceFlowId}, #{createTime}, #{updateTime})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate_give_record(vip_user_id, pro_id, num, shop_id, source_act_id, source_flow_id, create_time, update_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.vipUserId}, #{entity.proId}, #{entity.num}, #{entity.shopId}, #{entity.sourceActId},
#{entity.sourceFlowId},#{entity.createTime}, #{entity.updateTime})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update tb_activate_give_record
<set>
<if test="vipUserId != null">
vip_user_id = #{vipUserId},
</if>
<if test="proId != null">
pro_id = #{proId},
</if>
<if test="num != null">
num = #{num},
</if>
<if test="shopId != null">
shop_id = #{shopId},
</if>
<if test="sourceActId != null">
source_act_id = #{sourceActId},
</if>
<if test="sourceFlowId != null">
source_flow_id = #{sourceFlowId},
</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_give_record
where id = #{id}
</delete>
</mapper>

View File

@@ -9,9 +9,10 @@
<result column="handsel_num" jdbcType="DECIMAL" property="handselNum" />
<result column="handsel_type" jdbcType="VARCHAR" property="handselType" />
<result column="is_del" jdbcType="VARCHAR" property="isDel" />
<result column="is_gift_pro" jdbcType="INTEGER" property="isGiftPro" />
</resultMap>
<sql id="Base_Column_List">
id, shop_id, min_num, max_num, handsel_num, handsel_type, is_del
id, shop_id, min_num, max_num, handsel_num, handsel_type, is_del,is_gift_pro
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
@@ -116,10 +117,16 @@
</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}
</select>
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
</select>
<select id="selectByShpopId" resultMap="BaseResultMap">
<select id="selectByShopId" resultMap="BaseResultMap">
select * from tb_activate where shop_id=#{shopId}
</select>
</mapper>

View File

@@ -0,0 +1,105 @@
<?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.TbActivateProductMapper">
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbActivateProduct" id="TbActivateProductMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="activateId" column="activate_id" jdbcType="INTEGER"/>
<result property="productId" column="product_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, activate_id, product_id, num, create_time, update_time </sql>
<!--查询单个-->
<select id="queryById" resultMap="TbActivateProductMap">
select
<include refid="Base_Column_List"/>
from tb_activate_product
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAll" resultMap="TbActivateProductMap">
select
<include refid="Base_Column_List"/>
from tb_activate_product
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="activateId != null">
and activate_id = #{activateId}
</if>
<if test="productId != null">
and product_id = #{productId}
</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>
<select id="queryAllByActivateId" resultMap="TbActivateProductMap">
select
<include refid="Base_Column_List"/>
from tb_activate_product
where
activate_id = #{activateId}
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate_product(activate_id, product_id, num, create_time, update_time)
values (#{activateId}, #{productId}, #{num}, #{createTime}, #{updateTime})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate_product(activate_id, product_id, num, create_time, update_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.activateId}, #{entity.productId}, #{entity.num}, #{entity.createTime}, #{entity.updateTime})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update tb_activate_product
<set>
<if test="activateId != null">
activate_id = #{activateId},
</if>
<if test="productId != null">
product_id = #{productId},
</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_product where id = #{id}
</delete>
</mapper>

View File

@@ -24,7 +24,7 @@
delete from tb_shop_user_flow
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUserFlow">
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUserFlow" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
insert into tb_shop_user_flow (id, shop_user_id, amount,
balance, biz_code, biz_name,
create_time, type)