Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/ycwl/basic/service/impl/pc/OrderServiceImpl.java
#	src/main/java/com/ycwl/basic/service/pc/OrderService.java
This commit is contained in:
songmingsong
2024-12-05 17:34:37 +08:00
29 changed files with 773 additions and 32 deletions

View File

@ -1,7 +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.ycwl.basic.mapper.pc.OrderMapper">
<resultMap id="BaseResultMap" type="com.ycwl.basic.model.pc.order.resp.OrderRespVO">
<resultMap id="PCBaseResultMap" type="com.ycwl.basic.model.pc.order.resp.OrderRespVO">
<id column="id" property="id"/>
<result column="member_id" property="memberId"/>
<result column="nickname" property="memberNickname"/>
@ -25,6 +25,36 @@
<result column="id" property="orderId"/>
<result column="goods_type" property="goodsType"/>
<result column="goods_id" property="goodsId"/>
<result column="scenicName" property="scenicName"/>
<result column="goodsName" property="goodsName"/>
<result column="videoUrl" property="videoUrl"/>
<result column="imgUrl" property="imgUrl"/>
<result column="sourceType" property="sourceType"/>
</collection>
</resultMap>
<resultMap id="AppBaseResultMap" type="com.ycwl.basic.model.pc.order.resp.OrderAppRespVO">
<id column="id" property="id"/>
<result column="price" property="price"/>
<result column="pay_price" property="payPrice"/>
<result column="remark" property="remark"/>
<result column="refund_reason" property="refundReason"/>
<result column="refund_status" property="refundStatus"/>
<result column="status" property="status"/>
<result column="refund_at" property="refundAt"/>
<result column="pay_at" property="payAt"/>
<result column="cancel_at" property="cancelAt"/>
<result column="create_at" property="createAt"/>
<result column="update_at" property="updateAt"/>
<collection property="orderItemList" ofType="com.ycwl.basic.model.pc.order.resp.OrderItemVO">
<result column="oiId" property="id"/>
<result column="id" property="orderId"/>
<result column="goods_type" property="goodsType"/>
<result column="goods_id" property="goodsId"/>
<result column="scenicName" property="scenicName"/>
<result column="goodsName" property="goodsName"/>
<result column="videoUrl" property="videoUrl"/>
<result column="imgUrl" property="imgUrl"/>
<result column="sourceType" property="sourceType"/>
</collection>
</resultMap>
<insert id="add">
@ -73,12 +103,92 @@
<delete id="deleteById">
delete from `order` where id = #{id}
</delete>
<select id="list" resultMap="BaseResultMap">
select o.id, o.member_id,m.nickname ,m.real_name , o.openid, price, pay_price, remark, o.broker_id, o.promo_code,
<select id="list" resultMap="PCBaseResultMap">
select o.id, o.member_id,m.nickname ,m.real_name , o.openid, o.price, pay_price, remark, o.broker_id, o.promo_code,
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,oi.id oiId, oi.goods_type, oi.goods_id
from `order` o
left join member m on o.member_id = m.id
left join order_item oi on o.id = oi.order_id
left join source sr on oi.goods_type='2' and oi.goods_id = sr.id
left join video vd on oi.goods_type='1' and oi.goods_id = vd.id
<where>
<if test="id!= null ">
and o.id = #{id}
</if>
<if test="memberNickname!= null and memberNickname!=''">
and m.nickname like concat('%',#{memberNickname},'%')
</if>
<if test="memberRealName!= null and memberRealName!=''">
and m.real_name like concat('%',#{memberRealName},'%')
</if>
<if test="price!= null ">
and o.price = #{price}
</if>
<if test="payPrice!= null ">
and pay_price = #{payPrice}
</if>
<if test="remark!= null and remark!= ''">
and remark like concat('%',#{remark},'%')
</if>
<if test="brokerId!= null ">
and o.broker_id = #{brokerId}
</if>
<if test="promoCode!= null and promoCode!= ''">
and o.promo_code like concat('%',#{promoCode},'%')
</if>
<if test="refundReason!= null and refundReason!= ''">
and refund_reason like concat('%',#{refundReason},'%')
</if>
<if test="refundStatus!= null ">
and refund_status = #{refundStatus}
</if>
<if test="status!= null ">
and o.`status` = #{status}
</if>
<if test="startCreateTime!= null ">
and o.create_at >= #{startCreateTime}
</if>
<if test="endCreateTime!= null ">
and o.create_at &lt;= #{endCreateTime}
</if>
<if test="startPayTime!= null ">
and pay_at &gt;= #{startPayTime}
</if>
<if test="endPayTime!= null ">
and pay_at &lt;= #{endPayTime}
</if>
<if test="startRefundTime!= null ">
and refund_at &gt;= #{startRefundTime}
</if>
<if test="endRefundTime!= null ">
and refund_at &lt;= #{endRefundTime}
</if>
<if test="startCancelTime!= null ">
and cancel_at &gt;= #{startCancelTime}
</if>
<if test="endCancelTime!= null ">
and cancel_at &lt;= #{endCancelTime}
</if>
</where>
order by o.create_at desc
</select>
<select id="getById" resultMap="PCBaseResultMap">
select o.id, o.member_id, o.openid, o.price, o.pay_price, o.remark, o.broker_id, o.promo_code, o.refund_reason,
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
left join member m on m.id = o.member_id
left join order_item oi on o.id = oi.order_id
left join template t on oi.goods_type='3' and oi.goods_id = t.id
left join source sr on oi.goods_type='2' and oi.goods_id = sr.id
left join video vd on oi.goods_type='1' and oi.goods_id = vd.id
where o.id = #{id}
</select>
<select id="getOrderCount" resultType="com.ycwl.basic.utils.ApiResponse">
select count(1) num
from `order` o
left join member m on o.member_id = m.id
left join order_item oi on o.id = oi.order_id
left join template t on oi.goods_type='3' and oi.goods_id = t.id
left join source sr on oi.goods_type='2' and oi.goods_id = sr.id
left join video vd on oi.goods_type='1' and oi.goods_id = vd.id
@ -86,6 +196,9 @@
<if test="id!= null ">
and o.id = #{id}
</if>
<if test="memberId!= null ">
and o.member_id = #{memberId}
</if>
<if test="memberNickname!= null and memberNickname!=''">
and m.nickname like concat('%',#{memberNickname},'%')
</if>
@ -141,18 +254,95 @@
and cancel_at &lt;= #{endCancelTime}
</if>
</where>
order by o.create_at desc
</select>
<select id="getById" resultMap="BaseResultMap">
select o.id, o.member_id, o.openid, o.price, o.pay_price, o.remark, o.broker_id, o.promo_code, o.refund_reason,
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
left join member m on m.id = o.member_id
<select id="appList" resultMap="AppBaseResultMap">
select o.id, o.member_id,m.nickname ,m.real_name , o.openid, o.price, pay_price, remark, o.broker_id, o.promo_code,
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,oi.id oiId, oi.goods_type, oi.goods_id,
sc.name scenicName,
if(oi.goods_type='1',t.name,(select count(1) from order_item oi2 where oi2.order_id=o.id)) as goodsName,
if(oi.goods_type='1',vd.video_url,sr.video_url) videoUrl,
if(oi.goods_type='2',sr.url,null) imgUrl,
if(oi.goods_type='2',sr.type,null) sourceType
from `order` o
left join member m on o.member_id = m.id
left join order_item oi on o.id = oi.order_id
left join template t on oi.goods_type='3' and oi.goods_id = t.id
left join source sr on oi.goods_type='2' and oi.goods_id = sr.id
left join video vd on oi.goods_type='1' and oi.goods_id = vd.id
left join template t on oi.goods_type='1' and vd.template_id=t.id
left join scenic sc on (oi.goods_type='1' and vd.scenic_id=sc.id) or (oi.goods_type='2' and sr.scenic_id=sc.id)
<where>
<if test="memberNickname!= null and memberNickname!=''">
and m.nickname like concat('%',#{memberNickname},'%')
</if>
<if test="memberRealName!= null and memberRealName!=''">
and m.real_name like concat('%',#{memberRealName},'%')
</if>
<if test="price!= null ">
and o.price = #{price}
</if>
<if test="payPrice!= null ">
and pay_price = #{payPrice}
</if>
<if test="remark!= null and remark!= ''">
and remark like concat('%',#{remark},'%')
</if>
<if test="brokerId!= null ">
and o.broker_id = #{brokerId}
</if>
<if test="promoCode!= null and promoCode!= ''">
and o.promo_code like concat('%',#{promoCode},'%')
</if>
<if test="refundReason!= null and refundReason!= ''">
and refund_reason like concat('%',#{refundReason},'%')
</if>
<if test="refundStatus!= null ">
and refund_status = #{refundStatus}
</if>
<if test="status!= null ">
and o.`status` = #{status}
</if>
<if test="startCreateTime!= null ">
and o.create_at >= #{startCreateTime}
</if>
<if test="endCreateTime!= null ">
and o.create_at &lt;= #{endCreateTime}
</if>
<if test="startPayTime!= null ">
and pay_at &gt;= #{startPayTime}
</if>
<if test="endPayTime!= null ">
and pay_at &lt;= #{endPayTime}
</if>
<if test="startRefundTime!= null ">
and refund_at &gt;= #{startRefundTime}
</if>
<if test="endRefundTime!= null ">
and refund_at &lt;= #{endRefundTime}
</if>
<if test="startCancelTime!= null ">
and cancel_at &gt;= #{startCancelTime}
</if>
<if test="endCancelTime!= null ">
and cancel_at &lt;= #{endCancelTime}
</if>
</where>
order by o.create_at desc
</select>
<select id="appDetail" resultMap="AppBaseResultMap">
select o.id, o.member_id,m.nickname ,m.real_name , o.openid, o.price, pay_price, remark, o.broker_id, o.promo_code,
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,oi.id oiId, oi.goods_type, oi.goods_id,
sc.name scenicName,
if(oi.goods_type='1',t.name,(select count(1) from order_item oi2 where oi2.order_id=o.id)) as goodsName,
if(oi.goods_type='1',vd.video_url,sr.video_url) videoUrl,
if(oi.goods_type='2',sr.url,null) imgUrl,
if(oi.goods_type='2',sr.type,null) sourceType
from `order` o
left join member m on o.member_id = m.id
left join order_item oi on o.id = oi.order_id
left join source sr on oi.goods_type='2' and oi.goods_id = sr.id
left join video vd on oi.goods_type='1' and oi.goods_id = vd.id
left join template t on oi.goods_type='1' and vd.template_id=t.id
left join scenic sc on (oi.goods_type='1' and vd.scenic_id=sc.id) or (oi.goods_type='2' and sr.scenic_id=sc.id)
where o.id = #{id}
</select>
</mapper>

View File

@ -107,7 +107,7 @@
</select>
<select id="getById" resultMap="scenicAndConfig">
select s.id, `name`, introduction, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
c.start_time, c.end_time, c.is_default, c.create_time
c.start_time, c.end_time, c.is_default, c.create_time,s.price
from scenic s
left join scenic_config c on s.id = c.id
where s.id = #{id}

View File

@ -27,6 +27,10 @@
<if test="deviceId!= null">and device_id = #{deviceId} </if>
<if test="memberId!= null">and member_id = #{memberId} </if>
<if test="url!= null">and url = #{url} </if>
<if test="isBuy!=null">
and is_buy = #{isBuy}
</if>
<if test="type!=null">and so.type = #{type} </if>
<if test="startTime!= null">and so.create_time &gt;= #{startTime} </if>
<if test="endTime!= null">and so.create_time &lt;= #{endTime} </if>
</where>
@ -35,6 +39,19 @@
select so.id, scenic_id, device_id, member_id, url, so.create_time, so.update_time,sc.`name` as scenicName
from source so
left join scenic sc on sc.id = so.scenic_id
where id = #{id}
where so.id = #{id}
</select>
<select id="listGroupByType" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
select so.id, scenic_id,sc.name scenicName, sc.longitude ,sc.latitude,so.type
from source so
left join scenic sc on sc.id = so.scenic_id
<where>
<if test="scenicId!= null">and scenic_id = #{scenicId} </if>
<if test="memberId!= null">and member_id = #{memberId} </if>
<if test="isBuy!=null">
and is_buy = #{isBuy}
</if>
</where>
group by so.type
</select>
</mapper>

View File

@ -21,8 +21,11 @@
delete from video where id = #{id}
</delete>
<select id="list" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select id, scenic_id, member_id, template_id, task_id, worker_id, video_url, create_time, update_time
from video
select v.id, scenic_id, member_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
s.name scenicName, s.latitude, s.longitude, t.name templateName, t.price templatePrice
from video v
left join scenic s on s.id = v.scenic_id
left join template t on v.template_id = t.id
<where>
<if test="scenicId!= null">and scenic_id = #{scenicId} </if>
<if test="memberId!= null">and member_id = #{memberId} </if>
@ -31,13 +34,18 @@
and task_id = #{taskId}
</if>
<if test="workerId!= null">and worker_id = #{workerId} </if>
<if test="startTime!= null">and create_time &gt;= #{startTime} </if>
<if test="endTime!= null">and create_time &lt;= #{endTime} </if>
<if test="isBuy!=null">
and is_buy = #{isBuy}
</if>
<if test="startTime!= null">and v.create_time &gt;= #{startTime} </if>
<if test="endTime!= null">and v.create_time &lt;= #{endTime} </if>
</where>
</select>
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select id, scenic_id, member_id, template_id, task_id, worker_id, video_url, create_time, update_time
from video
where id = #{id}
select v.id, scenic_id, member_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
t.name templateName,t.price templatePrice
from video v
left join template t on v.template_id = t.id
where v.id = #{id}
</select>
</mapper>