订单类型由订单明细移动至订单本体中

This commit is contained in:
longbinbin
2024-12-10 14:17:01 +08:00
parent c5977252fc
commit 4c51e1be08
16 changed files with 206 additions and 71 deletions

View File

@ -70,4 +70,9 @@
from face
where id = #{id}
</select>
<select id="getByMemberId" resultType="com.ycwl.basic.model.pc.face.resp.FaceRespVO">
select id, member_id, face_url,score, match_sample_ids, first_match_rate, match_result
from face
where member_id = #{memberId}
</select>
</mapper>

View File

@ -12,6 +12,7 @@
<result column="remark" property="remark"/>
<result column="broker_id" property="brokerId"/>
<result column="promo_code" property="promoCode"/>
<result column="goods_type" property="goodsType"/>
<result column="refund_reason" property="refundReason"/>
<result column="refund_status" property="refundStatus"/>
<result column="status" property="status"/>
@ -23,7 +24,6 @@
<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"/>
@ -37,6 +37,7 @@
<result column="price" property="price"/>
<result column="pay_price" property="payPrice"/>
<result column="remark" property="remark"/>
<result column="goods_type" property="goodsType"/>
<result column="refund_reason" property="refundReason"/>
<result column="refund_status" property="refundStatus"/>
<result column="status" property="status"/>
@ -48,7 +49,6 @@
<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"/>
@ -58,13 +58,13 @@
</collection>
</resultMap>
<insert id="add">
insert into `order`(id, member_id, openid,price, pay_price, remark, broker_id, promo_code)
VALUES (#{id}, #{memberId}, #{openid},#{price}, #{payPrice}, #{remark}, #{brokerId}, #{promoCode})
insert into `order`(id, member_id, openid,price, pay_price, remark, broker_id, promo_code,goods_type,scenic_id)
VALUES (#{id}, #{memberId}, #{openid},#{price}, #{payPrice}, #{remark}, #{brokerId}, #{promoCode},#{goodsType},#{scenicId})
</insert>
<insert id="addOrderItems">
insert into order_item(id, order_id, goods_type, goods_id) VALUES
insert into order_item(id, order_id, goods_id) VALUES
<foreach collection="orderItems" item="item" index="index" separator=",">
(#{item.id}, #{item.orderId}, #{item.goodsType}, #{item.goodsId})
(#{item.id}, #{item.orderId}, #{item.goodsId})
</foreach>
</insert>
<update id="update">
@ -105,12 +105,12 @@
</delete>
<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
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,oi.id oiId, o.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
left join source sr on o.goods_type='2' and oi.goods_id = sr.id
left join video vd on o.goods_type='1' and oi.goods_id = vd.id
<where>
<if test="id!= null ">
and o.id = #{id}
@ -179,9 +179,9 @@
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
left join template t on o.goods_type='3' and oi.goods_id = t.id
left join source sr on o.goods_type='2' and oi.goods_id = sr.id
left join video vd on o.goods_type='1' and oi.goods_id = vd.id
where o.id = #{id}
</select>
<select id="getOrderCount" resultType="java.lang.Integer">
@ -189,9 +189,9 @@
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 o.goods_type='3' and oi.goods_id = t.id
left join source sr on o.goods_type='2' and oi.goods_id = sr.id
left join video vd on o.goods_type='1' and oi.goods_id = vd.id
<where>
<if test="id!= null ">
and o.id = #{id}
@ -257,20 +257,23 @@
</select>
<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,
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,oi.id oiId, o.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
if(o.goods_type='1',t.name,(select count(1) from order_item oi2 where oi2.order_id=o.id)) as goodsName,
if(o.goods_type='1',vd.video_url,sr.video_url) videoUrl,
if(o.goods_type='2',sr.url,null) imgUrl,
if(o.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)
left join source sr on o.goods_type='2' and oi.goods_id = sr.id
left join video vd on o.goods_type='1' and oi.goods_id = vd.id
left join template t on o.goods_type='1' and vd.template_id=t.id
left join scenic sc on (o.goods_type='1' and vd.scenic_id=sc.id) or (o.goods_type='2' and sr.scenic_id=sc.id)
<where>
<if test="memberId!=null">
and o.member_id=#{memberId}
</if>
<if test="memberNickname!= null and memberNickname!=''">
and m.nickname like concat('%',#{memberNickname},'%')
</if>
@ -327,13 +330,13 @@
</if>
<if test="type!= null ">
<if test="type== 0 ">
and oi.goods_type = 1
and o.goods_type = 1
</if>
<if test="type== 1 ">
and oi.goods_type = 2 and sr.type = 1
and o.goods_type = 2 and sr.type = 1
</if>
<if test="type== 2 ">
and oi.goods_type = 2 and sr.type = 2
and o.goods_type = 2 and sr.type = 2
</if>
</if>
</where>
@ -341,19 +344,19 @@
</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,
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,oi.id oiId, o.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
if(o.goods_type='1',t.name,(select count(1) from order_item oi2 where oi2.order_id=o.id)) as goodsName,
if(o.goods_type='1',vd.video_url,sr.video_url) videoUrl,
if(o.goods_type='2',sr.url,null) imgUrl,
if(o.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)
left join source sr on o.goods_type='2' and oi.goods_id = sr.id
left join video vd on o.goods_type='1' and oi.goods_id = vd.id
left join template t on o.goods_type='1' and vd.template_id=t.id
left join scenic sc on (o.goods_type='1' and vd.scenic_id=sc.id) or (o.goods_type='2' and sr.scenic_id=sc.id)
where o.id = #{id}
</select>
</mapper>