拼团 订单

This commit is contained in:
2025-12-16 18:06:04 +08:00
parent 48f368c1b1
commit 01ca38079b
38 changed files with 1485 additions and 116 deletions

View File

@@ -0,0 +1,7 @@
<?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.czg.service.order.mapper.GbOrderDetailMapper">
</mapper>

View File

@@ -0,0 +1,69 @@
<?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.czg.service.order.mapper.GbOrderMapper">
<select id="getGbOrderPage" resultType="com.czg.order.vo.GbOrderDetailVO">
SELECT
detail.* ,`order`.ware_json as wareJson,`user`.nick_name as userName,
`user`.phone as userPhone,shop.shop_name as shopName,shop.address as shopAddress
FROM
`gb_order_detail` detail
LEFT JOIN gb_order `order` on detail.group_order_no = `order`.group_order_no and `order`.shop_id = #{shopId}
left join tb_shop_user `user` on `user`.main_shop_id = #{mainShopId} and `user`.user_id = detail.user_id
LEFT JOIN tb_shop_info shop on detail.shop_id = shop.id
WHERE
detail.shop_id = #{shopId}
and detail.is_del = 0
<if test="param.orderNo != null">
and detail.order_no = #{param.orderNo}
</if>
<if test="param.groupOrderNo != null">
AND detail.group_order_no = #{param.groupOrderNo}
</if>
<if test="param.status != null">
<if test="param.status == '退款'">
AND (detail.STATUS = '退款中' or detail.STATUS = '已退款')
</if>
<if test="param.status != '退款'">
AND detail.STATUS = #{param.status}
</if>
</if>
<if test="param.userId != null">
AND detail.user_id = #{param.userId}
</if>
<if test="param.orderStartTime != null and param.orderEndTime != null ">
and detail.pay_time BETWEEN #{param.orderStartTime} and #{param.orderEndTime}
</if>
<if test="param.verifyStartTime != null and param.verifyEndTime != null ">
and detail.verify_time BETWEEN #{param.verifyStartTime} and #{param.verifyEndTime}
</if>
order by detail.create_time desc
</select>
<select id="getGbOrderDetail" resultType="com.czg.order.vo.GbOrderDetailVO">
SELECT
detail.* ,`order`.ware_json as wareJson,`user`.nick_name as userName,
`user`.phone as userPhone,shop.shop_name as shopName,shop.address as shopAddress
FROM
`gb_order_detail` detail
LEFT JOIN gb_order `order` on detail.group_order_no = `order`.group_order_no and `order`.shop_id = #{shopId}
left join tb_shop_user `user` on `user`.main_shop_id = #{mainShopId} and `user`.user_id = detail.user_id
LEFT JOIN tb_shop_info shop on detail.shop_id = shop.id
WHERE
detail.shop_id = #{shopId} and detail.id=#{id}
order by detail.create_time desc
</select>
<select id="getGbOrderDetailUsers" resultType="com.czg.order.vo.GbOrderUserVO">
select `user`.nick_name as userName, `user`.phone as userPhone, `user`.head_img as userAvatar
from gb_order_detail detail
left join tb_shop_user `user`
on `user`.main_shop_id = #{mainShopId} and `user`.user_id = detail.user_id
where detail.shop_id = #{shopId}
and detail.group_order_no = #{groupOrderNo}
and (detail.status = '待成团' or detail.status = '待核销' or detail.status = '退款中')
order by detail.pay_time
limit 10
</select>
</mapper>