feat(video-review): 支持机位多维度评价功能
All checks were successful
ZhenTu-BE/pipeline/head This commit looks good

- 新增NestedMapTypeHandler处理嵌套Map与JSON互转
- 修改VideoReview相关实体类和DTO以支持嵌套Map结构
- 更新数据库查询逻辑以适配新的评价数据结构
- 优化平均分计算方法以处理多机位多维度评分
- 完善MyBatis配置中的typeHandler引用
- 补充视频查询接口返回任务开始结束时间字段
- 修正SQL关联查询条件确保数据准确性
This commit is contained in:
2025-11-18 10:14:42 +08:00
parent 3d361200b0
commit bb2367c5a6
9 changed files with 118 additions and 28 deletions

View File

@@ -76,17 +76,17 @@
)
</delete>
<select id="list" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select v.id, v.scenic_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl,
tk.task_params taskParams
select v.id, v.scenic_id, v.template_id, task_id, tk.worker_id, v.video_url, v.create_time, v.update_time,
t.name templateName, t.cover_url templateCoverUrl,
tk.task_params taskParams, tk.start_time, tk.end_time
from video v
left join template t on v.template_id = t.id
left join task tk on v.task_id = tk.id
<where>
<if test="scenicId!= null">and v.scenic_id = #{scenicId} </if>
<if test="templateId!= null">and template_id = #{templateId} </if>
<if test="templateId!= null">and v.template_id = #{templateId} </if>
<if test="taskId!=null">and task_id = #{taskId}</if>
<if test="workerId!= null">and worker_id = #{workerId} </if>
<if test="workerId!= null">and t.worker_id = #{workerId} </if>
<if test="startTime!= null">and v.create_time &gt;= #{startTime} </if>
<if test="endTime!= null">and v.create_time &lt;= #{endTime} </if>
<if test="faceId!= null">
@@ -98,10 +98,9 @@
order by v.create_time desc
</select>
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select v.id, v.scenic_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
t.name templateName,t.price templatePrice, t.cover_url templateCoverUrl, t.slash_price slashPrice,
v.height, v.width, v.duration,
tk.task_params taskParams
select v.id, v.scenic_id, v.template_id, task_id, tk.worker_id, v.video_url, v.create_time, v.update_time,
t.name templateName, t.cover_url templateCoverUrl,
tk.task_params taskParams, tk.start_time, tk.end_time
from video v
left join template t on v.template_id = t.id
left join task tk on v.task_id = tk.id
@@ -111,7 +110,7 @@
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, mv.face_id, worker_id, video_url, v.create_time, v.update_time,
select v.id, mv.scenic_id, v.template_id, mv.task_id, mv.face_id, tk.worker_id, v.video_url, v.create_time, v.update_time,
t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl, mv.is_buy,
tk.task_params taskParams
from member_video mv

View File

@@ -14,7 +14,7 @@
<result property="rating" column="rating"/>
<result property="content" column="content"/>
<result property="cameraPositionRating" column="camera_position_rating"
typeHandler="com.ycwl.basic.handler.MapTypeHandler"/>
typeHandler="com.ycwl.basic.handler.NestedMapTypeHandler"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
@@ -38,7 +38,7 @@
FROM video_review vr
LEFT JOIN video v ON vr.video_id = v.id
LEFT JOIN scenic s ON vr.scenic_id = s.id
LEFT JOIN sys_user u ON vr.creator = u.id
LEFT JOIN admin_user u ON vr.creator = u.id
<where>
<if test="videoId != null">
AND vr.video_id = #{videoId}