You've already forked FrameTour-BE
关联关系修改
This commit is contained in:
@ -5,6 +5,17 @@
|
||||
insert into video(id, scenic_id, member_id, template_id, task_id, worker_id, video_url)
|
||||
values (#{id}, #{scenicId}, #{memberId}, #{templateId}, #{taskId}, #{workerId}, #{videoUrl})
|
||||
</insert>
|
||||
<insert id="addRelation">
|
||||
replace member_video(member_id, task_id, video_id, is_buy, order_id)
|
||||
values (#{memberId}, #{taskId}, #{videoId}, #{isBuy}, #{orderId})
|
||||
</insert>
|
||||
<insert id="addRelations">
|
||||
replace member_video(member_id, task_id, video_id, is_buy, order_id)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.memberId}, #{item.taskId}, #{item.videoId}, #{item.isBuy}, #{orderId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="update">
|
||||
update video
|
||||
<set>
|
||||
@ -18,6 +29,14 @@
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateRelation">
|
||||
update member_video
|
||||
<set>
|
||||
<if test="isBuy!= null">is_buy = #{isBuy}, </if>
|
||||
<if test="orderId!= null">order_id = #{orderId}, </if>
|
||||
</set>
|
||||
where member_id = #{memberId} and video_id = #{videoId}
|
||||
</update>
|
||||
<delete id="deleteById">
|
||||
delete from video where id = #{id}
|
||||
</delete>
|
||||
@ -60,4 +79,27 @@
|
||||
<select id="findByTaskId" resultType="com.ycwl.basic.model.pc.video.entity.VideoEntity">
|
||||
select * from video where task_id = #{taskId} limit 1
|
||||
</select>
|
||||
<select id="queryByRelation" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||
select v.id, mv.scenic_id, v.template_id, mv.task_id, worker_id, video_url, v.create_time, v.update_time,
|
||||
s.name scenicName, t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl,mv.is_buy
|
||||
from member_video mv
|
||||
left join video v on mv.video_id = v.id
|
||||
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 mv.scenic_id = #{scenicId} </if>
|
||||
<if test="memberId!= null">and mv.member_id = #{memberId} </if>
|
||||
<if test="templateId!= null">and template_id = #{templateId} </if>
|
||||
<if test="taskId!=null">and mv.task_id = #{taskId} </if>
|
||||
<if test="isBuy!=null">and mv.is_buy = #{isBuy}</if>
|
||||
<if test="startTime!= null">and v.create_time >= #{startTime} </if>
|
||||
<if test="endTime!= null">and v.create_time <= #{endTime} </if>
|
||||
<if test="faceId!= null">
|
||||
and mv.task_id in (
|
||||
select id from task where face_id = #{faceId}
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by v.create_time desc
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user