Merge branch 'notify_v2'

This commit is contained in:
2026-01-06 11:30:52 +08:00
61 changed files with 3655 additions and 9 deletions

View File

@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-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.TemplateV2Mapper">
<select id="list" resultType="com.ycwl.basic.template.model.entity.TemplateV2Entity">
select *
from template_v2
<where>
deleted = 0
<if test="scenicId != null">
and scenic_id = #{scenicId}
</if>
<if test="status != null">
and status = #{status}
</if>
<if test="name != null and name != ''">
and locate(#{name}, `name`) &gt; 0
</if>
</where>
order by update_time desc, id desc
</select>
<select id="getById" resultType="com.ycwl.basic.template.model.entity.TemplateV2Entity">
select *
from template_v2
where id = #{id} and deleted = 0
</select>
<insert id="insert">
insert into template_v2(
id, scenic_id, `name`, version, status,
output_width, output_height, output_fps,
bgm_url, total_duration_ms,
deleted, create_time, update_time
)
values (
#{id}, #{scenicId}, #{name}, #{version}, #{status},
#{outputWidth}, #{outputHeight}, #{outputFps},
#{bgmUrl}, #{totalDurationMs},
0, now(), now()
)
</insert>
<update id="updateById">
update template_v2
<set>
update_time = now(),
<if test="scenicId != null">scenic_id = #{scenicId},</if>
<if test="name != null">`name` = #{name},</if>
<if test="version != null">version = #{version},</if>
<if test="status != null">status = #{status},</if>
<if test="outputWidth != null">output_width = #{outputWidth},</if>
<if test="outputHeight != null">output_height = #{outputHeight},</if>
<if test="outputFps != null">output_fps = #{outputFps},</if>
<if test="bgmUrl != null">bgm_url = #{bgmUrl},</if>
<if test="totalDurationMs != null">total_duration_ms = #{totalDurationMs},</if>
</set>
where id = #{id} and deleted = 0
</update>
<update id="updateStatus">
update template_v2
set status = #{status}, update_time = now()
where id = #{id} and deleted = 0
</update>
<update id="softDelete">
update template_v2
set deleted = 1, update_time = now()
where id = #{id} and deleted = 0
</update>
</mapper>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-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.TemplateV2SegmentMapper">
<select id="listByTemplateId" resultType="com.ycwl.basic.template.model.entity.TemplateV2SegmentEntity">
select *
from template_v2_segment
where template_id = #{templateId}
order by segment_index
</select>
<delete id="deleteByTemplateId">
delete from template_v2_segment where template_id = #{templateId}
</delete>
<insert id="batchInsert">
insert into template_v2_segment(
id, template_id, segment_index,
duration_ms, segment_type,
source_type, source_ref,
only_if_expr, render_spec_json, audio_spec_json,
create_time, update_time
)
values
<foreach collection="segments" item="item" separator=",">
(
#{item.id}, #{item.templateId}, #{item.segmentIndex},
#{item.durationMs}, #{item.segmentType},
#{item.sourceType}, #{item.sourceRef},
#{item.onlyIfExpr}, #{item.renderSpecJson}, #{item.audioSpecJson},
now(), now()
)
</foreach>
</insert>
</mapper>