储值送积分
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
<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="giftPoints" column="gift_points" 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"/>
|
||||
@@ -16,7 +17,7 @@
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, shop_id, amount, gift_amount, is_use_coupon, coupon_id, num, create_time, update_time </sql>
|
||||
, shop_id, amount, gift_amount, gift_points, is_use_coupon, coupon_id, num, create_time, update_time </sql>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="selectByShopId" resultMap="TbActivateMap">
|
||||
@@ -46,6 +47,20 @@
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectByAmountScope" resultMap="TbActivateMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
|
||||
from tb_activate
|
||||
where shop_id = #{shopId}
|
||||
<![CDATA[
|
||||
and amount > 0
|
||||
and amount <= #{amount}
|
||||
]]>
|
||||
order by amount desc,gift_points desc,id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAll" resultMap="TbActivateMap">
|
||||
@@ -87,15 +102,15 @@
|
||||
|
||||
<!--新增所有列-->
|
||||
<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 into tb_activate(shop_id, amount, gift_amount, gift_points, is_use_coupon, coupon_id, num, create_time, update_time)
|
||||
values (#{shopId}, #{amount}, #{giftAmount}, #{giftPoints}, #{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)
|
||||
insert into tb_activate(shop_id, amount, gift_amount, gift_points, 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.shopId}, #{entity.amount}, #{entity.giftAmount}, #{entity.giftPoints}, #{entity.isUseCoupon}, #{entity.couponId},
|
||||
#{entity.num}, #{entity.createTime}, #{entity.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -113,6 +128,9 @@
|
||||
<if test="giftAmount != null">
|
||||
gift_amount = #{giftAmount},
|
||||
</if>
|
||||
<if test="giftPoints != null">
|
||||
gift_points = #{giftPoints},
|
||||
</if>
|
||||
<if test="isUseCoupon != null">
|
||||
is_use_coupon = #{isUseCoupon},
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user