修改mapper文件路径

添加“MessageRecordMapper”
This commit is contained in:
longbinbin
2024-12-13 11:35:42 +08:00
parent 0145110b28
commit b544639b11
62 changed files with 94 additions and 89 deletions

View File

@@ -0,0 +1,94 @@
<?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.TemplateMapper">
<insert id="add">
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(id, template_id, create_time)
values (#{id}, #{templateId}, now())
</insert>
<update id="update">
update template
<set>
<if test="name!= null">`name` = #{name}, </if>
<if test="scenicId!= null">`scenic_id` = #{scenicId}, </if>
<if test="pid!= null">pid = #{pid}, </if>
<if test="isPlaceholder!= null">is_placeholder = #{isPlaceholder}, </if>
<if test="sourceUrl!= null">source_url = #{sourceUrl}, </if>
<if test="luts!= null">luts = #{luts}, </if>
<if test="overlays!= null">overlays = #{overlays}, </if>
<if test="audios!= null">audios = #{audios}, </if>
<if test="frameRate!= null">frame_rate = #{frameRate}, </if>
<if test="coverUrl!= null">cover_url = #{coverUrl}, </if>
<if test="price!= null">price = #{price}, </if>
<if test="speed!= null">speed = #{speed}, </if>
</set>
where id = #{id}
</update>
<update id="updateStatus">
update template
set status =
(CASE
status
WHEN 1 THEN
0
WHEN 0 THEN
1
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>
<delete id="deleteByPid">
delete from template where pid = #{id}
</delete>
<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
<where>
pid = 0
<if test="scenicId!=null" >
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>
<if test="endTime!= null">and t.create_time &lt;= #{endTime} </if>
</where>
</select>
<select id="getById" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, pid, is_placeholder, source_url, luts, overlays, audios, frame_rate, speed, t.cover_url, t.status, t.create_time, t.update_time
from template t left join scenic s on s.id = t.scenic_id
where t.id = #{id}
</select>
<select id="getByPid" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
select t.id, t.scenic_id, s.name as scenic_name, t.`name`, pid, is_placeholder, source_url, luts, overlays, audios, frame_rate, speed, t.cover_url, t.status, t.create_time, t.update_time
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>