优惠券、通知加参数

This commit is contained in:
2025-03-29 11:50:11 +08:00
parent 4b03bfb871
commit 938f9702ea
23 changed files with 440 additions and 44 deletions

View File

@ -29,4 +29,7 @@
</where>
ORDER BY create_time DESC
</select>
<select id="getById" resultType="com.ycwl.basic.model.pc.coupon.entity.CouponEntity">
select * from coupon where id = #{id}
</select>
</mapper>

View File

@ -0,0 +1,8 @@
<?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.ycwl.basic.mapper.CouponRecordMapper">
<select id="queryByUserWithGoodsId"
resultType="com.ycwl.basic.model.pc.couponRecord.entity.CouponRecordEntity">
select * from coupon_record where member_id = #{memberId} and coupon_id in (select id from coupon where scenic_id = #{scenicId} and FIND_IN_SET(#{goodsId},config_ids))
</select>
</mapper>

View File

@ -144,8 +144,8 @@
</select>
<insert id="add">
insert into `order`(id, member_id, openid, face_id, `type`, `price_config_id`, slash_price, price, pay_price, remark, broker_id, promo_code, scenic_id, status)
VALUES (#{id}, #{memberId}, #{openId}, #{faceId}, #{type}, #{priceConfigId}, #{slashPrice}, #{price}, #{payPrice}, #{remark}, #{brokerId}, #{promoCode}, #{scenicId}, #{status})
insert into `order`(id, member_id, openid, face_id, `type`, `price_config_id`, slash_price, price, pay_price, remark, broker_id, promo_code, scenic_id, status, coupon_price, coupon_id, coupon_record_id)
VALUES (#{id}, #{memberId}, #{openId}, #{faceId}, #{type}, #{priceConfigId}, #{slashPrice}, #{price}, #{payPrice}, #{remark}, #{brokerId}, #{promoCode}, #{scenicId}, #{status}, #{couponPrice}, #{couponId}, #{couponRecordId})
</insert>
<insert id="addOrderItems">
insert into order_item(order_id,goods_type, goods_id) VALUES
@ -186,6 +186,7 @@
</set>
where id = #{id}
</update>
<update id="updateOrder">
update `order`
<set>
@ -213,11 +214,21 @@
</set>
where id = #{id}
</update>
<update id="updateOrderPrice">
update `order`
set
coupon_price = #{couponPrice},
coupon_id = #{couponId},
coupon_record_id = #{couponRecordId},
pay_price = `price` - `coupon_price`
where id = #{id}
</update>
<delete id="deleteById">
delete from `order` where id = #{id}
</delete>
<select id="list" resultMap="PCBaseResultListMap">
select o.id, o.scenic_id, s.name as scenic_name, o.member_id,m.nickname ,m.real_name, o.type, o.openid, o.face_id, f.face_url, o.price, pay_price, remark, o.broker_id, o.promo_code,
o.coupon_price,
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at, o.create_at
from `order` AS o
left join face f on o.face_id = f.id
@ -289,6 +300,7 @@
</select>
<select id="listDetail" resultMap="PCBaseResultMap">
select o.id, o.scenic_id, s.name as scenic_name, o.member_id,m.nickname ,m.real_name, o.type, o.openid, o.face_id, f.face_url, o.price, pay_price, remark, o.broker_id, o.promo_code,
o.coupon_price,
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at, o.create_at
from `order` AS o
left join face f on o.face_id = f.id
@ -360,6 +372,7 @@
</select>
<select id="getById" resultMap="PCBaseResultMap">
select o.id, o.scenic_id, s.name as scenic_name, o.member_id, o.type, o.openid, o.face_id, f.face_url, o.price, o.pay_price, o.remark, o.broker_id, o.promo_code, o.refund_reason,
o.coupon_price,
o.refund_status, o.status, o.create_at, o.update_at, o.pay_at, o.cancel_at, o.refund_at,
m.nickname , m.real_name
from `order` o
@ -375,6 +388,7 @@
</select>
<select id="appList" resultMap="AppBaseResultMap">
select o.id, o.member_id,o.openid, o.type, o.face_id, f.face_url, o.price, pay_price, remark, o.broker_id, o.promo_code,
o.coupon_price,
refund_reason, refund_status, o.`status`, o.create_at, refund_at, pay_at, cancel_at,
sc.name scenicName
from `order` AS o
@ -389,6 +403,7 @@
</select>
<select id="appDetail" resultMap="AppBaseResultMap">
select o.id, o.member_id,o.openid, o.type, o.price, o.slash_price, pay_price, remark, o.broker_id, o.promo_code,
o.coupon_price,
refund_reason, refund_status, o.`status`, o.create_at, refund_at, pay_at, cancel_at,
o.scenic_id, sc.name scenicName
from `order` AS o
@ -487,4 +502,19 @@
select * from `order` where member_id = #{userId} and type = #{orderType} and price_config_id = #{priceConfigId}
limit 1
</select>
<select id="getUserOrderItem" resultType="com.ycwl.basic.model.pc.order.entity.OrderEntity">
select o.*
from order_item oi
left join `order` o on o.id = oi.order_id
where o.member_id = #{userId} and o.scenic_id = #{scenicId} and o.type = #{orderType}
<if test="configId != null">
and o.price_config_id = #{configId}
</if>
<if test="goodsType != null">
and oi.goods_type = #{goodsType}
</if>
<if test="goodsId != null">
and oi.goods_id = #{goodsId}
</if>
</select>
</mapper>