You've already forked FrameTour-BE
修改bug
This commit is contained in:
@ -68,7 +68,7 @@
|
||||
left join (
|
||||
select count(1) shotDeviceCount,scenic_id
|
||||
from source
|
||||
where scenic_id = #{scenicId}
|
||||
where scenic_id = #{scenicId} and member_id=#{userId}
|
||||
group by device_id
|
||||
)b on a.scenic_id = b.scenic_id
|
||||
</select>
|
||||
|
@ -47,9 +47,9 @@
|
||||
<result column="create_at" property="createAt"/>
|
||||
<result column="update_at" property="updateAt"/>
|
||||
<result column="cover_url" property="coverUrl"/>
|
||||
<collection property="orderItemList" ofType="com.ycwl.basic.model.pc.order.resp.OrderItemVO">
|
||||
<collection property="orderItemList" select="getOrderItemList" column="id" ofType="com.ycwl.basic.model.pc.order.resp.OrderItemVO">
|
||||
<result column="oiId" property="id"/>
|
||||
<result column="id" property="orderId"/>
|
||||
<result column="orderId" property="orderId"/>
|
||||
<result column="goods_id" property="goodsId"/>
|
||||
<result column="scenicName" property="scenicName"/>
|
||||
<result column="goodsName" property="goodsName"/>
|
||||
@ -58,14 +58,29 @@
|
||||
<result column="sourceType" property="sourceType"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<select id="getOrderItemList" parameterType="java.lang.Integer" resultType="com.ycwl.basic.model.pc.order.resp.OrderItemVO">
|
||||
select oi.id oiId,oi.order_id orderId,oi.goods_id,
|
||||
sc.name scenicName,t.cover_url coverUrl,
|
||||
if(oi.goods_type='1',t.name,(select count(1) from order_item oi2 where oi2.order_id=oi.order_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_item oi
|
||||
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 oi.order_id=#{id}
|
||||
</select>
|
||||
|
||||
<insert id="add">
|
||||
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_id) VALUES
|
||||
insert into order_item(id, order_id,goods_type, goods_id) VALUES
|
||||
<foreach collection="orderItems" item="item" index="index" separator=",">
|
||||
(#{item.id}, #{item.orderId}, #{item.goodsId})
|
||||
(#{item.id}, #{item.orderId}, #{item.goodsType},#{item.goodsId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="update">
|
||||
@ -107,7 +122,7 @@
|
||||
<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, o.goods_type, oi.goods_id
|
||||
from `order` o
|
||||
from `order` AS 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 o.goods_type='2' and oi.goods_id = sr.id
|
||||
@ -207,7 +222,7 @@
|
||||
and m.real_name like concat('%',#{memberRealName},'%')
|
||||
</if>
|
||||
<if test="price!= null ">
|
||||
and price = #{price}
|
||||
and o.price = #{price}
|
||||
</if>
|
||||
<if test="payPrice!= null ">
|
||||
and pay_price = #{payPrice}
|
||||
@ -257,20 +272,16 @@
|
||||
</where>
|
||||
</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, o.goods_type, oi.goods_id,
|
||||
sc.name scenicName,t.cover_url coverUrl,
|
||||
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
|
||||
select DISTINCT 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, o.goods_type,
|
||||
t.cover_url coverUrl
|
||||
from `order` AS 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 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)
|
||||
left join template t on o.goods_type='1' and vd.template_id=t.id
|
||||
|
||||
<where>
|
||||
<if test="memberId!=null">
|
||||
and o.member_id=#{memberId}
|
||||
@ -290,14 +301,10 @@
|
||||
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, o.goods_type, oi.goods_id,
|
||||
sc.name scenicName,
|
||||
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
|
||||
select distinct 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,o.goods_type
|
||||
,t.cover_url coverUrl
|
||||
from `order` AS 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 o.goods_type='2' and oi.goods_id = sr.id
|
||||
|
Reference in New Issue
Block a user