获取人脸对应视频流程,自动删除源视频流程,自动创建任务渲染流程,自动删除人脸数据逻辑

This commit is contained in:
2024-12-11 15:38:18 +08:00
parent ba4c339660
commit 8c81a994c8
47 changed files with 1318 additions and 222 deletions

View File

@ -72,4 +72,14 @@
group by device_id
)b on a.scenic_id = b.scenic_id
</select>
<select id="getConfigByDeviceId" resultType="com.ycwl.basic.model.pc.device.entity.DeviceConfigEntity">
select *
from device_config
where device_id = #{deviceId}
</select>
<select id="getByDeviceId" resultType="com.ycwl.basic.model.pc.device.entity.DeviceEntity">
select *
from device
where id = #{deviceId}
</select>
</mapper>

View File

@ -2,12 +2,15 @@
<!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.FaceMapper">
<insert id="add">
insert into face(id, score, member_id, face_url, match_sample_ids, first_match_rate, match_result)
values (#{id}, #{score}, #{memberId}, #{faceUrl}, #{matchSampleIds}, #{firstMatchRate}, #{matchResult})
insert into face(id, scenic_id, score, member_id, face_url, match_sample_ids, first_match_rate, match_result)
values (#{id}, #{scenicId}, #{score}, #{memberId}, #{faceUrl}, #{matchSampleIds}, #{firstMatchRate}, #{matchResult})
</insert>
<update id="update">
update face
<set>
<if test="scenicId!= null ">
scenic_id = #{scenicId},
</if>
<if test="memberId!= null ">
member_id = #{memberId},
</if>
@ -29,6 +32,9 @@
</set>
where id = #{id}
</update>
<update id="finishedJourney">
update face set finished_journey = 1 where id = #{id}
</update>
<delete id="deleteById">
delete from face where id = #{id}
</delete>
@ -42,7 +48,7 @@
</if>
</delete>
<select id="list" resultType="com.ycwl.basic.model.pc.face.resp.FaceRespVO">
select id, member_id, face_url,score, match_sample_ids, first_match_rate, match_result
select id, scenic_id, member_id, face_url,score, match_sample_ids, first_match_rate, match_result
from face
<where>
<if test="memberId!= null and memberId!= ''">
@ -66,13 +72,18 @@
</where>
</select>
<select id="getById" resultType="com.ycwl.basic.model.pc.face.resp.FaceRespVO">
select id, member_id, face_url,score, match_sample_ids, first_match_rate, match_result
select id, scenic_id, member_id, face_url,score, match_sample_ids, first_match_rate, match_result, create_at, update_at
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
select id, member_id, face_url,score, match_sample_ids, first_match_rate, match_result, create_at, update_at
from face
where member_id = #{memberId}
</select>
<select id="listByScenicIdAndNotFinished" resultType="com.ycwl.basic.model.pc.face.resp.FaceRespVO">
select id, scenic_id, member_id, face_url,score, match_sample_ids, first_match_rate, match_result, create_at, update_at
from face
where scenic_id = #{scenicId} and finished_journey != 1
</select>
</mapper>

View File

@ -85,4 +85,13 @@
from face_sample
where id = #{id}
</select>
<select id="listByIds" resultType="com.ycwl.basic.model.pc.faceSample.resp.FaceSampleRespVO">
select id, scenic_id, device_id, face_url, match_sample_ids, first_match_rate, source_id, match_result,`status`
from face_sample
where id in (
<foreach collection="list" item="id" separator=",">
#{id}
</foreach>
)
</select>
</mapper>

View File

@ -3,6 +3,8 @@
<mapper namespace="com.ycwl.basic.mapper.pc.OrderMapper">
<resultMap id="PCBaseResultMap" type="com.ycwl.basic.model.pc.order.resp.OrderRespVO">
<id column="id" property="id"/>
<result column="scenic_id" property="scenicId"/>
<result column="scenic_name" property="scenicName"/>
<result column="member_id" property="memberId"/>
<result column="nickname" property="memberNickname"/>
<result column="real_name" property="memberRealName"/>
@ -120,10 +122,11 @@
delete from `order` where id = #{id}
</delete>
<select id="list" resultMap="PCBaseResultMap">
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
select distinct o.id, o.scenic_id, s.name as scenic_name, 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` AS o
left join member m on o.member_id = m.id
left join scenic s on o.scenic_id = s.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
@ -131,6 +134,9 @@
<if test="id!= null ">
and o.id = #{id}
</if>
<if test="scenicId != null">
and o.scenic_id = #{scenicId}
</if>
<if test="memberNickname!= null and memberNickname!=''">
and m.nickname like concat('%',#{memberNickname},'%')
</if>
@ -189,11 +195,12 @@
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,
select o.id, o.scenic_id, s.name as scenic_name, 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 scenic s on o.scenic_id = s.id
left join order_item oi on o.id = oi.order_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

View File

@ -2,8 +2,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.ScenicMapper">
<insert id="add">
insert into scenic(id, `name`, introduction,cover_url, longitude, latitude, radius, province, city, area, address)
values (#{id}, #{name}, #{introduction}, #{coverUrl},#{longitude}, #{latitude}, #{radius}, #{province}, #{city}, #{area}, #{address})
insert into scenic(id, `name`, introduction, phone, cover_url, longitude, latitude, radius, province, city, area, address)
values (#{id}, #{name}, #{introduction}, #{phone}, #{coverUrl},#{longitude}, #{latitude}, #{radius}, #{province}, #{city}, #{area}, #{address})
</insert>
<insert id="addConfig">
insert into scenic_config(id, scenic_id, start_time, end_time, is_default)
@ -79,16 +79,14 @@
<delete id="deleteById">
delete from scenic where id = #{id}
</delete>
<delete id="deleteConfigByscenicId">
<delete id="deleteConfigByScenicId">
delete from scenic_config where scenic_id = #{scenicId}
</delete>
<select id="list" resultMap="scenicAndConfig">
<select id="list" resultMap="scenic">
select s.id, `name`, `phone`, introduction,cover_url, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
c.start_time, c.end_time,
(select scenic_account.account from scenic_account where scenic_account.scenic_id = s.id and scenic_account.is_super = 1 limit 1) as account,
c.is_default, c.create_time createTime2,s.price
s.price
from scenic s
left join scenic_config c on s.id = c.id
<where>
<if test="name!=null and name!=''">
and locate(#{name},`name`) > 0
@ -113,11 +111,10 @@
</if>
</where>
</select>
<select id="getById" resultMap="scenicAndConfig">
<select id="getById" resultMap="scenic">
select s.id, `name`, `phone`, introduction,cover_url, 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 createTime2,s.price
s.price
from scenic s
left join scenic_config c on s.id = c.id
where s.id = #{id}
</select>
<select id="appList" resultType="com.ycwl.basic.model.mobile.scenic.ScenicAppVO">
@ -175,8 +172,13 @@
where `status` = 1
ORDER BY distance ASC
</select>
<select id="getConfig" resultType="com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity">
select *
from scenic_config
where scenic_id = #{scenicId}
</select>
<resultMap id="scenicAndConfig" type="com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO">
<resultMap id="scenic" type="com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="phone" column="phone"/>
@ -194,13 +196,5 @@
<result property="price" column="price"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<association property="scenicConfig" javaType="com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity">
<id property="id" column="c.id"/>
<result property="scenicId" column="s.id"/>
<result property="startTime" column="c.start_time"/>
<result property="endTime" column="c.end_time"/>
<result property="isDefault" column="c.is_default"/>
<result property="createTime" column="createTime2"/>
</association>
</resultMap>
</mapper>

View File

@ -10,6 +10,7 @@
<set>
<if test="workerId!= null">worker_id = #{workerId}, </if>
<if test="memberId!= null">member_id = #{memberId}, </if>
<if test="faceId!= null">face_id = #{faceId}, </if>
<if test="templateId!= null">template_id = #{templateId}, </if>
<if test="scenicId!= null">scenic_id = #{scenicId}, </if>
<if test="taskParams!= null">task_params = #{taskParams}, </if>
@ -26,7 +27,7 @@
</update>
<update id="assignToWorker">
update task
set worker_id = #{workerId}
set worker_id = #{workerId}, status = 2
where id = #{taskId}
</update>
<update id="deassign">

View File

@ -5,6 +5,10 @@
insert into template(id, scenic_id, `name`, pid, is_placeholder, source_url, luts, overlays, audios, cover_url, frame_rate, speed, price)
values (#{id}, #{scenicId}, #{name}, #{pid}, #{isPlaceholder}, #{sourceUrl}, #{luts}, #{overlays}, #{audios}, #{coverUrl}, #{frameRate}, #{speed}, #{price})
</insert>
<insert id="addConfig">
insert into template_config(template_id, is_default, minimal_placeholder_fill)
values (#{templateId}, #{isDefault}, #{minimalPlaceholderFill})
</insert>
<update id="update">
update template
<set>
@ -35,6 +39,14 @@
END)
where id = #{id}
</update>
<update id="updateConfigById">
update template_config
<set>
<if test="isDefault!= null">is_default = #{isDefault}, </if>
<if test="minimalPlaceholderFill!= null">minimal_placeholder_fill = #{minimalPlaceholderFill}, </if>
</set>
where id = #{id}
</update>
<delete id="deleteById">
delete from template where id = #{id}
</delete>
@ -44,6 +56,12 @@
<delete id="deleteByScenicId">
delete from template where scenic_id = #{id}
</delete>
<delete id="deleteConfigByTemplateId">
delete from template_config where template_id = #{id}
</delete>
<delete id="deleteConfigById">
delete from template_config where id = #{id}
</delete>
<select id="list" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, t.cover_url, t.status, t.create_time, t.update_time
from template t left join scenic s on s.id = t.scenic_id
@ -55,6 +73,7 @@
and scenic_id = #{scenicId}
</if>
<if test="name!= null">and locate(#{name},t.`name`) > 0 </if>
<if test="scenicId!= null">and t.scenic_id = #{scenicId} </if>
<if test="isPlaceholder!= null">and is_placeholder = #{isPlaceholder} </if>
<if test="status!= null">and t.`status` = #{status} </if>
<if test="startTime!= null">and t.create_time &gt;= #{startTime} </if>
@ -71,4 +90,7 @@
from template t left join scenic s on s.id = t.scenic_id
where pid = #{id}
</select>
<select id="getConfig" resultType="com.ycwl.basic.model.pc.template.entity.TemplateConfigEntity">
select * from template_config where template_id = #{templateId}
</select>
</mapper>

View File

@ -49,4 +49,7 @@
left join template t on v.template_id = t.id
where v.id = #{id}
</select>
<select id="findByTaskId" resultType="com.ycwl.basic.model.pc.video.entity.VideoEntity">
select * from video where task_id = #{taskId} limit 1
</select>
</mapper>