zhwl/zhwl-business/zhwl-scenic/target/classes/mapper/scenic/ZdyScenicSpotMapper.xml
2025-07-01 17:54:58 +08:00

436 lines
15 KiB
XML

<?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.zhwl.scenic.mapper.ZdyScenicSpotMapper">
<resultMap type="ZdyScenicSpot" id="ZdyScenicSpotResult">
<result property="id" column="id"/>
<result property="deptId" column="dept_id"/>
<result property="scenicCode" column="scenic_code"/>
<result property="scenicName" column="scenic_name"/>
<result property="adjust" column="adjust"/>
<result property="image" column="image"/>
<result property="blurb" column="blurb"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
<result property="flag" column="flag"/>
<result property="tag" column="tag"/>
<result property="scenicId" column="scenic_id"/>
<result property="tagName" column="tagName"/>
<result property="scenicAreaName" column="scenicAreaName"/>
<result property="sort" column="sort"/>
<result property="flagName" column="flagName"/>
<result property="location" column="location"/>
<result property="audioGuideUrl" column="audio_guide_url"/>
<result property="videoUrl" column="video_url"/>
<result property="arVrContentUl" column="ar_vr_content_ul"/>
<result property="address" column="address"/>
<result property="image21" column="image21"/>
<result property="image43" column="image43"/>
<result property="subtitle" column="subtitle"/>
<result property="shareQrcodeUrl" column="share_qrcode_url"/>
<result property="status" column="status"/>
<result property="audioCharge" column="audio_charge"/>
<result property="audioPrice" column="audio_price"/>
<result property="audioGuideTimeLength" column="audio_guide_time_length"/>
</resultMap>
<sql id="selectZdyScenicSpotVo">
SELECT a.id,
a.dept_id,
a.scenic_code,
a.scenic_name,
a.flag,
a.tag,
a.adjust,
a.image,
a.blurb,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.scenic_id,
a.sort,
a.location,
a.audio_guide_url,
a.video_url,
a.ar_vr_content_ul,
a.address,
a.image21,
a.image43,
a.subtitle,
a.share_qrcode_url,
a.status,
a.audio_charge,
a.audio_price,
a.audio_guide_time_length,
scenic.scenic_name AS scenicAreaName
FROM zdy_scenic_spot a
LEFT JOIN zdy_scenic scenic ON scenic.id = a.scenic_id
</sql>
<select id="selectZdyScenicSpotList" parameterType="ZdyScenicSpot" resultMap="ZdyScenicSpotResult">
<include refid="selectZdyScenicSpotVo"/>
<where>
a.del_flag = '0'
<if test="deptId != null ">
and a.dept_id = #{deptId}
</if>
<if test="scenicCode != null and scenicCode != ''">
and a.scenic_code like concat(#{scenicCode}, '%')
</if>
<if test="scenicName != null and scenicName != ''">
and a.scenic_name like concat('%', #{scenicName}, '%')
</if>
<if test="adjust != null and adjust != ''">
and a.adjust = #{adjust}
</if>
<if test="image != null and image != ''">
and a.image = #{image}
</if>
<if test="blurb != null and blurb != ''">
and a.blurb = #{blurb}
</if>
<if test="flag != null and flag != ''">
and FIND_IN_SET(#{flag}, a.flag)
</if>
<if test="scenicId != null">
and a.scenic_id = #{scenicId}
</if>
<if test="audioCharge!=null">
and a.audio_charge = #{audioCharge}
</if>
<if test="status!=null">
and a.status = #{status}
</if>
<if test="spotIds != null ">
and a.id not in
<foreach collection="spotIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
${params.dataScope}
</where>
-- ORDER BY
-- FIELD( a.flag, 'top', 'hot', 'new', 'recommend', '' ),
-- sort
order by a.id desc
</select>
<select id="selectZdyScenicSpotById" parameterType="Long"
resultMap="ZdyScenicSpotResult">
<include refid="selectZdyScenicSpotVo"/>
where a.id = #{id}
</select>
<insert id="insertZdyScenicSpot" parameterType="ZdyScenicSpot" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_scenic_spot
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deptId != null">dept_id,
</if>
<if test="scenicCode != null and scenicCode != ''">scenic_code,
</if>
<if test="scenicName != null and scenicName != ''">scenic_name,
</if>
<if test="adjust != null">adjust,
</if>
<if test="image != null">image,
</if>
<if test="blurb != null">blurb,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="delFlag != null">del_flag,
</if>
<if test="flag != null">flag,
</if>
<if test="tag != null">tag,
</if>
<if test="scenicId != null">scenic_id,
</if>
<if test="sort != null">sort,
</if>
<if test="location != null">location,
</if>
<if test="audioGuideUrl != null">audio_guide_url,
</if>
<if test="videoUrl != null">video_url,
</if>
<if test="arVrContentUl != null">ar_vr_content_ul,
</if>
<if test="address != null">address,
</if>
<if test="image21 != null">image21,
</if>
<if test="image43 != null">image43,
</if>
<if test="subtitle != null">subtitle,
</if>
<if test="shareQrcodeUrl != null">share_qrcode_url,
</if>
<if test="status != null">status,
</if>
<if test="audioCharge != null">audio_charge,
</if>
<if test="audioPrice != null">audio_price,
</if>
<if test="audioGuideTimeLength != null">audio_guide_time_length,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deptId != null">#{deptId},
</if>
<if test="scenicCode != null and scenicCode != ''">#{scenicCode},
</if>
<if test="scenicName != null and scenicName != ''">#{scenicName},
</if>
<if test="adjust != null">#{adjust},
</if>
<if test="image != null">#{image},
</if>
<if test="blurb != null">#{blurb},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="delFlag != null">#{delFlag},
</if>
<if test="flag != null">#{flag},
</if>
<if test="tag != null">#{tag},
</if>
<if test="scenicId != null">#{scenicId},
</if>
<if test="sort != null">#{sort},
</if>
<if test="location != null">#{location},
</if>
<if test="audioGuideUrl != null">#{audioGuideUrl},
</if>
<if test="videoUrl != null">#{videoUrl},
</if>
<if test="arVrContentUl != null">#{arVrContentUl},
</if>
<if test="address != null">#{address},
</if>
<if test="image21 != null">#{image21},
</if>
<if test="image43 != null">#{image43},
</if>
<if test="subtitle != null">#{subtitle},
</if>
<if test="shareQrcodeUrl != null">#{shareQrcodeUrl},
</if>
<if test="status != null">#{status},
</if>
<if test="audioCharge != null">#{audioCharge},
</if>
<if test="audioPrice != null">#{audioPrice},
</if>
<if test="audioGuideTimeLength != null">#{audioGuideTimeLength},
</if>
</trim>
</insert>
<update id="updateZdyScenicSpot" parameterType="ZdyScenicSpot">
update zdy_scenic_spot
<trim prefix="SET" suffixOverrides=",">
<if test="deptId != null">dept_id =
#{deptId},
</if>
<if test="scenicCode != null and scenicCode != ''">scenic_code =
#{scenicCode},
</if>
<if test="scenicName != null and scenicName != ''">scenic_name =
#{scenicName},
</if>
<if test="adjust != null">adjust =
#{adjust},
</if>
<if test="image != null">image =
#{image},
</if>
<if test="blurb != null">blurb =
#{blurb},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="delFlag != null">del_flag =
#{delFlag},
</if>
<if test="flag != null">flag =
#{flag},
</if>
<if test="tag != null">tag =
#{tag},
</if>
<if test="scenicId != null">scenic_id =
#{scenicId},
</if>
<if test="sort != null">sort =
#{sort},
</if>
<if test="location != null">location =
#{location},
</if>
<if test="audioGuideUrl != null">audio_guide_url =
#{audioGuideUrl},
</if>
<if test="videoUrl != null">video_url =
#{videoUrl},
</if>
<if test="arVrContentUl != null">ar_vr_content_ul =
#{arVrContentUl},
</if>
<if test="address != null">address =
#{address},
</if>
<if test="image21 != null">image21 =
#{image21},
</if>
<if test="image43 != null">image43 =
#{image43},
</if>
<if test="subtitle != null">subtitle =
#{subtitle},
</if>
<if test="shareQrcodeUrl != null">share_qrcode_url =
#{shareQrcodeUrl},
</if>
<if test="status != null">status =
#{status},
</if>
<if test="audioCharge != null">audio_charge =
#{audioCharge},
</if>
<if test="audioPrice != null">audio_price =
#{audioPrice},
</if>
<if test="audioGuideTimeLength != null">audio_guide_time_length =
#{audioGuideTimeLength},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyScenicSpotById" parameterType="Long">
delete
from zdy_scenic_spot
where id = #{id}
</delete>
<delete id="deleteZdyScenicSpotByIds" parameterType="String">
delete from zdy_scenic_spot where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectZdyScenicSpotByScenicId" parameterType="Long"
resultType="ZdyScenicSpotVo">
SELECT id,
scenic_code as scenicCode,
scenic_name as scenicName,
flag,
tag,
image,
scenic_id as scenicId,
blurb,
adjust,
location,
audio_guide_url,
video_url,
ar_vr_content_ul,
address,
image43,
image21,
subtitle
FROM zdy_scenic_spot
where scenic_id = #{scenicId}
and del_flag = '0'
</select>
<select id="selectZdyScenicSpotAppList" parameterType="ZdyScenicSpot" resultType="ZdyScenicSpotVo">
SELECT id,
scenic_code as scenicCode,
scenic_name as scenicName,
flag,
tag,
image,
adjust,
scenic_id as scenicId,
blurb,
location,
audio_guide_url,
video_url,
ar_vr_content_ul,
address,
image43,
image21,
subtitle
FROM zdy_scenic_spot
where del_flag = '0'
</select>
<select id="selectZdyScenicSpotListByScenicId" parameterType="Long"
resultMap="ZdyScenicSpotResult">
SELECT id,
scenic_code,
scenic_name,
flag,
tag,
image,
scenic_id,
blurb,
adjust,
location,
audio_guide_url,
video_url,
ar_vr_content_ul,
address,
image43,
image21,
subtitle
FROM zdy_scenic_spot
where scenic_id = #{scenicId}
and del_flag = '0'
</select>
<select id="selectZdyScenicSpotByIds" resultMap="ZdyScenicSpotResult" parameterType="String">
SELECT
id,dept_id,scenic_code,scenic_name,adjust,image,blurb,scenic_id,tag,flag,sort,del_flag,create_by,create_time,update_by,update_time,location,audio_guide_url,video_url,ar_vr_content_ul,address,image43,image21,subtitle
FROM zdy_scenic_spot
where id IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
order by id desc
</select>
</mapper>