You've already forked FrameTour-BE
逻辑
This commit is contained in:
@ -6,14 +6,14 @@
|
||||
values (#{id}, #{scenicId}, #{deviceId}, #{url}, #{videoUrl}, #{type}, #{faceSampleId}, #{posJson})
|
||||
</insert>
|
||||
<insert id="addRelation">
|
||||
replace member_source(member_id, source_id, is_buy, type, order_id)
|
||||
values (#{memberId}, #{sourceId}, #{isBuy}, #{type}, #{orderId})
|
||||
replace member_source(scenic_id, face_id, member_id, source_id, is_buy, type, order_id)
|
||||
values (#{scenicId}, #{faceId}, #{memberId}, #{sourceId}, #{isBuy}, #{type}, #{orderId})
|
||||
</insert>
|
||||
<insert id="addRelations">
|
||||
replace member_source(member_id, source_id, is_buy, type, order_id)
|
||||
replace member_source(scenic_id, face_id, member_id, source_id, is_buy, type, order_id)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.memberId}, #{item.sourceId}, #{item.isBuy}, #{item.type}, #{orderId})
|
||||
(#{item.scenicId}, #{item.faceId}, #{item.memberId}, #{item.sourceId}, #{item.isBuy}, #{item.type}, #{item.orderId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="update">
|
||||
@ -54,14 +54,13 @@
|
||||
and is_buy = #{isBuy}
|
||||
</if>
|
||||
<if test="type!=null">and so.type = #{type} </if>
|
||||
<if test="faceId!=null">and FIND_IN_SET(so.face_sample_id, (select face.match_sample_ids from face where id = #{faceId})) </if>
|
||||
<if test="startTime!= null">and so.create_time >= #{startTime} </if>
|
||||
<if test="endTime!= null">and so.create_time <= #{endTime} </if>
|
||||
</where>
|
||||
order by so.create_time desc
|
||||
</select>
|
||||
<select id="userGetById" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
|
||||
select so.id, scenic_id, device_id, ms.member_id, url, so.create_time, so.update_time,sc.`name` as scenicName
|
||||
select so.id, ms.scenic_id, device_id, ms.member_id, url, so.create_time, so.update_time,sc.`name` as scenicName
|
||||
from member_source ms
|
||||
left join source so on ms.source_id = so.id
|
||||
left join scenic sc on sc.id = so.scenic_id
|
||||
@ -74,7 +73,7 @@
|
||||
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,so.is_buy
|
||||
select so.id, ms.scenic_id,sc.name scenicName, sc.longitude ,sc.latitude,so.type,so.is_buy
|
||||
from member_source ms
|
||||
left join source so on ms.source_id = so.id
|
||||
left join scenic sc on sc.id = so.scenic_id
|
||||
@ -121,7 +120,7 @@
|
||||
<if test="scenicId!= null">and ms.scenic_id = #{scenicId} </if>
|
||||
<if test="isBuy!=null">and ms.is_buy = #{isBuy}</if>
|
||||
<if test="type!=null">and ms.type = #{type} </if>
|
||||
<if test="faceId!=null">and FIND_IN_SET(so.face_sample_id, (select face.match_sample_ids from face where id = #{faceId})) </if>
|
||||
<if test="faceId!=null">and ms.face_id = #{faceId} </if>
|
||||
order by so.create_time desc
|
||||
</select>
|
||||
<select id="queryByRelation" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
|
||||
@ -135,4 +134,15 @@
|
||||
<if test="scenicId!= null">and ms.scenic_id = #{scenicId} </if>
|
||||
<if test="isBuy!=null">and ms.is_buy = #{isBuy}</if>
|
||||
</select>
|
||||
<select id="querySameVideo" resultType="com.ycwl.basic.model.pc.source.entity.SourceEntity">
|
||||
select *
|
||||
from source
|
||||
where device_id = #{deviceId} and face_sample_id = #{faceSampleId} and type = 1
|
||||
limit 1
|
||||
</select>
|
||||
<select id="hasRelationTo" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from member_source
|
||||
where member_id = #{memberId} and source_id = #{sourceId} and type = #{type}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -99,9 +99,7 @@
|
||||
</select>
|
||||
<select id="listFor" resultType="com.ycwl.basic.model.mobile.scenic.content.ContentPageVO">
|
||||
select t.id templateId, t.scenic_id, s.name as scenic_name, t.`name`, pid, t.cover_url templateCoverUrl,
|
||||
1 as sourceType,
|
||||
(select IF(count(1) > 0,1,0) from video left join task on video.task_id = task.id where video.template_id=t.id and task.face_id = #{faceId}) contentType,
|
||||
(select count(1) from video left join task on video.task_id = task.id where video.template_id=t.id and task.face_id = #{faceId} and video.is_buy = 1) isBuy,
|
||||
0 as sourceType,
|
||||
t.create_time, t.price
|
||||
from template t left join scenic s on s.id = t.scenic_id
|
||||
where t.scenic_id = #{scenicId} and pid = 0 and t.status = 1
|
||||
|
@ -102,4 +102,7 @@
|
||||
</where>
|
||||
order by v.create_time desc
|
||||
</select>
|
||||
<select id="userFaceTemplateVideo" resultType="com.ycwl.basic.model.pc.video.entity.MemberVideoEntity">
|
||||
select * from member_video where member_id = #{userId} and face_id = #{faceId} and template_id = #{templateId} order by id desc
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user