分享好友 进入页面 领取优惠券
This commit is contained in:
@@ -21,10 +21,11 @@
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="couponJson" column="coupon_json" jdbcType="VARCHAR"/>
|
||||
<result property="source" column="source" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, num, over_num, shop_id, source_act_id, source_flow_id, use_start_time, use_end_time, create_time, update_time, coupon_json </sql>
|
||||
id, vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, num, over_num, shop_id, source_act_id, source_flow_id, use_start_time, use_end_time, create_time, update_time, coupon_json,source </sql>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="TbActivateInRecordMap">
|
||||
@@ -173,15 +174,15 @@ id, vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, nu
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into tb_activate_in_record(vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, num, over_num, shop_id, source_act_id, source_flow_id, use_start_time, use_end_time, create_time, update_time, coupon_json)
|
||||
values (#{vipUserId}, #{couponId}, #{name}, #{type}, #{proId}, #{fullAmount}, #{discountAmount}, #{num}, #{overNum}, #{shopId}, #{sourceActId}, #{sourceFlowId}, #{useStartTime}, #{useEndTime}, #{createTime}, #{updateTime}, #{couponJson})
|
||||
insert into tb_activate_in_record(vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, num, over_num, shop_id, source_act_id, source_flow_id, use_start_time, use_end_time, create_time, update_time, coupon_json,source)
|
||||
values (#{vipUserId}, #{couponId}, #{name}, #{type}, #{proId}, #{fullAmount}, #{discountAmount}, #{num}, #{overNum}, #{shopId}, #{sourceActId}, #{sourceFlowId}, #{useStartTime}, #{useEndTime}, #{createTime}, #{updateTime}, #{couponJson} , #{source})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into tb_activate_in_record(vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, num, over_num, shop_id, source_act_id, source_flow_id, use_start_time, use_end_time, create_time, update_time, coupon_json)
|
||||
insert into tb_activate_in_record(vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, num, over_num, shop_id, source_act_id, source_flow_id, use_start_time, use_end_time, create_time, update_time, coupon_json, source)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.vipUserId}, #{entity.couponId}, #{entity.name}, #{entity.type}, #{entity.proId}, #{entity.fullAmount}, #{entity.discountAmount}, #{entity.num}, #{entity.overNum}, #{entity.shopId}, #{entity.sourceActId}, #{entity.sourceFlowId}, #{entity.useStartTime}, #{entity.useEndTime}, #{entity.createTime}, #{entity.updateTime}, #{entity.couponJson})
|
||||
(#{entity.vipUserId}, #{entity.couponId}, #{entity.name}, #{entity.type}, #{entity.proId}, #{entity.fullAmount}, #{entity.discountAmount}, #{entity.num}, #{entity.overNum}, #{entity.shopId}, #{entity.sourceActId}, #{entity.sourceFlowId}, #{entity.useStartTime}, #{entity.useEndTime}, #{entity.createTime}, #{entity.updateTime}, #{entity.couponJson}, #{entity.source})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
from tb_shop_share
|
||||
where shop_id = #{shopId}
|
||||
and status = 1
|
||||
AND now() > start_time
|
||||
AND now() < end_time
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
|
||||
160
src/main/resources/mapper/TbShopShareRecordMapper.xml
Normal file
160
src/main/resources/mapper/TbShopShareRecordMapper.xml
Normal file
@@ -0,0 +1,160 @@
|
||||
<?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.TbShopShareRecordMapper">
|
||||
|
||||
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbShopShareRecord" id="TbShopShareRecordMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="shareId" column="share_id" jdbcType="INTEGER"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="invitedId" column="invited_id" jdbcType="INTEGER"/>
|
||||
<result property="invitedName" column="invited_name" jdbcType="VARCHAR"/>
|
||||
<result property="beInvitedId" column="be_invited_id" jdbcType="INTEGER"/>
|
||||
<result property="method" column="method" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="rewardTime" column="reward_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, share_id, shop_id, invited_id, invited_name, be_invited_id, method, status, reward_time, create_time, update_time </sql>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="TbShopShareRecordMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
|
||||
from tb_shop_share_record
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="queryByData" resultMap="TbShopShareRecordMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
|
||||
from tb_shop_share_record
|
||||
where share_id = #{shareId}
|
||||
and shop_id = #{shopId}
|
||||
and invited_id = #{invitedId}
|
||||
and be_invited_id = #{beInvitedId}
|
||||
</select>
|
||||
|
||||
<select id="queryByDataByBeInvited" resultMap="TbShopShareRecordMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
|
||||
from tb_shop_share_record
|
||||
where share_id = #{shareId}
|
||||
and shop_id = #{shopId}
|
||||
and be_invited_id = #{beInvitedId}
|
||||
</select>
|
||||
|
||||
<select id="query" resultMap="TbShopShareRecordMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
|
||||
from tb_shop_share_record
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="shareId != null">
|
||||
and share_id = #{shareId}
|
||||
</if>
|
||||
<if test="shopId != null">
|
||||
and shop_id = #{shopId}
|
||||
</if>
|
||||
<if test="invitedId != null">
|
||||
and invited_id = #{invitedId}
|
||||
</if>
|
||||
<if test="invitedName != null and invitedName != ''">
|
||||
and invited_name = #{invitedName}
|
||||
</if>
|
||||
<if test="beInvitedId != null">
|
||||
and be_invited_id = #{beInvitedId}
|
||||
</if>
|
||||
<if test="method != null and method != ''">
|
||||
and method = #{method}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="rewardTime != null">
|
||||
and reward_time = #{rewardTime}
|
||||
</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_shop_share_record(share_id, shop_id, invited_id, invited_name, be_invited_id, method, status,
|
||||
reward_time, create_time, update_time)
|
||||
values (#{shareId}, #{shopId}, #{invitedId}, #{invitedName}, #{beInvitedId}, #{method}, #{status},
|
||||
#{rewardTime}, #{createTime}, #{updateTime})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into tb_shop_share_record(share_id, shop_id, invited_id, invited_name, be_invited_id, method, status,
|
||||
reward_time, create_time, update_time)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.shareId}, #{entity.shopId}, #{entity.invitedId}, #{entity.invitedName}, #{entity.beInvitedId},
|
||||
#{entity.method}, #{entity.status}, #{entity.rewardTime}, #{entity.createTime}, #{entity.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update tb_shop_share_record
|
||||
<set>
|
||||
<if test="shareId != null">
|
||||
share_id = #{shareId},
|
||||
</if>
|
||||
<if test="shopId != null">
|
||||
shop_id = #{shopId},
|
||||
</if>
|
||||
<if test="invitedId != null">
|
||||
invited_id = #{invitedId},
|
||||
</if>
|
||||
<if test="invitedName != null and invitedName != ''">
|
||||
invited_name = #{invitedName},
|
||||
</if>
|
||||
<if test="beInvitedId != null">
|
||||
be_invited_id = #{beInvitedId},
|
||||
</if>
|
||||
<if test="method != null and method != ''">
|
||||
method = #{method},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="rewardTime != null">
|
||||
reward_time = #{rewardTime},
|
||||
</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_shop_share_record
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -67,6 +67,14 @@
|
||||
from tb_user_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<select id="selectNameByPrimaryKey" parameterType="java.lang.Integer" resultType="string">
|
||||
select
|
||||
nick_name
|
||||
from tb_user_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from tb_user_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
|
||||
Reference in New Issue
Block a user