Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -43,6 +43,7 @@ id, vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, nu
|
||||
inRecord.full_amount as fullAmount,
|
||||
inRecord.discount_amount as discountAmount,
|
||||
inRecord.coupon_id as couponId,
|
||||
inRecord.shop_id as shopId,
|
||||
pro.id as proId,
|
||||
CASE
|
||||
WHEN inRecord.type = 1 THEN inRecord.NAME
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
|
||||
from tb_activate
|
||||
where shop_id = #{shopId}
|
||||
and amount = #{amount}
|
||||
order by id desc
|
||||
and amount <= #{amount}
|
||||
order by amount desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
@@ -68,6 +68,14 @@
|
||||
group by tb_coupon_product.product_id
|
||||
</select>
|
||||
|
||||
<select id="queryProInfoByActivateId" resultType="com.chaozhanggui.system.cashierservice.entity.TbCouponProduct" >
|
||||
select tb_coupon_product.*,tb_product name as proName,tb_product.cover_img as proImg SUM(tb_coupon_product.num)*#{num} as num
|
||||
from tb_coupon_product
|
||||
LEFT JOIN tb_product ON tb_coupon_product.product_id = tb_product.id
|
||||
where coupon_id = #{couponId}
|
||||
group by tb_coupon_product.product_id
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into tb_coupon_product(coupon_id, product_id, num, create_time, update_time)
|
||||
|
||||
@@ -92,6 +92,45 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="statisticsRecord" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SUM(CASE WHEN (`method` = 'get' AND `status`= 2 ) OR ( `method` = 'use' AND `status`= 3 ) THEN 1 ELSE 0 END) AS isSuccess,
|
||||
SUM(CASE WHEN (`method` = 'get' AND `status`!= 2 ) OR ( `method` = 'use' AND `status`!= 3 ) THEN 1 ELSE 0 END) AS isFail
|
||||
FROM
|
||||
tb_shop_share_record
|
||||
WHERE
|
||||
share_id = #{shareId}
|
||||
AND invited_id = #{invitedId}
|
||||
ORDER BY
|
||||
create_time DESC;
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryIsSuccess" resultMap="TbShopShareRecordMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
|
||||
from tb_shop_share_record
|
||||
where
|
||||
share_id = #{shareId}
|
||||
and invited_id = #{invitedId}
|
||||
and (`method` = 'get' and status = 2 )
|
||||
or (`method` = 'use' and status = 3 )
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="queryIsNoSuccess" resultMap="TbShopShareRecordMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
|
||||
from tb_shop_share_record
|
||||
where
|
||||
share_id = #{shareId}
|
||||
and invited_id = #{invitedId}
|
||||
and (`method` = 'get' and status != 2 )
|
||||
or (`method` = 'use' and status != 3 )
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
|
||||
Reference in New Issue
Block a user