设备、模板、景区设置

This commit is contained in:
2024-12-12 09:58:35 +08:00
parent 8c81a994c8
commit 68dbd6c38b
13 changed files with 131 additions and 7 deletions

View File

@ -4,6 +4,10 @@
<insert id="add">
insert into device(id, scenic_id, name, no, latitude, longitude) values (#{id}, #{scenicId}, #{name}, #{no}, #{latitude}, #{longitude})
</insert>
<insert id="addConfig">
insert into device_config(id, device_id, create_time)
values (#{id}, #{deviceId}, now())
</insert>
<update id="update">
update device set scenic_id = #{scenicId}, name = #{name}, no = #{no}, longitude = #{longitude}, latitude = #{latitude}, update_at = now() where id = #{id}
</update>
@ -19,6 +23,17 @@
END)
where id = #{id}
</update>
<update id="updateConfig">
update device_config
set store_type = #{storeType},
store_config_json = #{storeConfigJson},
store_expire_day = #{storeExpireDay},
online_check = #{onlineCheck},
online_max_interval = #{onlineMaxInterval},
cut_pre = #{cutPre},
cut_post = #{cutPost}
where id = #{id}
</update>
<delete id="deleteById">
delete from device where id = #{id}
</delete>

View File

@ -6,8 +6,8 @@
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)
values (#{id}, #{scenicId}, #{startTime}, #{endTime}, #{isDefault})
insert into scenic_config(id, scenic_id, create_time)
values (#{id}, #{scenicId}, now())
</insert>
<update id="update">
update
@ -73,6 +73,10 @@
<if test="isDefault!=null">
is_default=#{isDefault},
</if>
book_routine=#{bookRoutine},
sample_store_day=#{sampleStoreDay},
video_store_day=#{videoStoreDay},
max_journey_hour=#{maxJourneyHour},
</set>
where id = #{id}
</update>

View File

@ -6,8 +6,8 @@
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 into template_config(id, template_id, create_time)
values (#{id}, #{templateId}, now())
</insert>
<update id="update">
update template
@ -66,9 +66,7 @@
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>
<if test="pid!=null" >
pid = #{pid}
</if>
pid = 0
<if test="scenicId!=null" >
and scenic_id = #{scenicId}
</if>