zhwl/zhwl-business/zhwl-scenic/target/classes/mapper/scenic/ZdyPointDataMapper.xml

285 lines
12 KiB
XML
Raw Normal View History

2025-07-01 17:54:58 +08:00
<?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.ZdyPointDataMapper">
<resultMap type="ZdyPointData" id="ZdyPointDataResult">
<result property="id" column="id"/>
<result property="pointMapId" column="point_map_id"/>
<result property="pointTypeId" column="point_type_id"/>
<result property="pointName" column="point_name"/>
<result property="spotId" column="spot_id"/>
<result property="image" column="image"/>
<result property="longitude" column="longitude"/>
<result property="latitude" column="latitude"/>
<result property="blurb" column="blurb"/>
<result property="audioGuideUrl" column="audio_guide_url"/>
<result property="association" column="association"/>
<result property="associationType" column="association_type"/>
<result property="ticketId" column="ticket_id"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<sql id="selectZdyPointDataVo">
select id,point_map_id, point_type_id, point_name, spot_id,image, longitude, latitude, blurb, audio_guide_url,association, association_type, ticket_id, create_time, create_by, update_time, update_by, del_flag
from zdy_point_data
</sql>
<select id="selectZdyPointDataList" parameterType="ZdyPointData" resultMap="ZdyPointDataResult">
<include refid="selectZdyPointDataVo"/>
<where>
<if test="pointMapId != null ">
and point_map_id = #{pointMapId}
</if>
<if test="pointTypeId != null ">
and point_type_id = #{pointTypeId}
</if>
<if test="pointName != null and pointName != ''">
and point_name like concat('%', #{pointName}, '%')
</if>
<if test="image != null and image != ''">
and image = #{image}
</if>
<if test="spotId != null">
and spot_id = #{spotId}
</if>
<if test="longitude != null and longitude != ''">
and longitude = #{longitude}
</if>
<if test="latitude != null and latitude != ''">
and latitude = #{latitude}
</if>
<if test="blurb != null and blurb != ''">
and blurb = #{blurb}
</if>
<if test="audioGuideUrl != null and audioGuideUrl != ''">
and audio_guide_url = #{audioGuideUrl}
</if>
<if test="association != null and association != ''">
and association = #{association}
</if>
<if test="associationType != null and associationType != ''">
and association_type = #{associationType}
</if>
<if test="ticketId != null ">
and ticket_id = #{ticketId}
</if>
and del_flag = '0'
</where>
</select>
<select id="selectZdyPointDataByPointTypeIds" parameterType="String" resultMap="ZdyPointDataResult">
<include refid="selectZdyPointDataVo"/>
where del_flag = '0' and point_type_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectZdyPointDataByPointMapIds" parameterType="String" resultMap="ZdyPointDataResult">
<include refid="selectZdyPointDataVo"/>
where del_flag = '0' and point_map_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectZdyPointDataById" parameterType="Long" resultMap="ZdyPointDataResult">
<include refid="selectZdyPointDataVo"/>
where id = #{id} and del_flag = '0'
</select>
<select id="selectZdyPointDataBySpotIds" parameterType="String" resultMap="ZdyPointDataResult">
<include refid="selectZdyPointDataVo"/>
where del_flag = '0' and spot_id in
<foreach item="spotId" collection="array" open="(" separator="," close=")">
#{spotId}
</foreach>
</select>
<select id="selectZdyPointDataBySpotId" parameterType="Long" resultMap="ZdyPointDataResult">
<include refid="selectZdyPointDataVo"/>
where del_flag = '0' and spot_id = #{spotId}
</select>
<select id="selectZdyPointDataByName" parameterType="String" resultMap="ZdyPointDataResult">
<include refid="selectZdyPointDataVo"/>
where point_name = #{pointName} and del_flag = '0'
</select>
<select id="selectZdyPointDataIsSpot" resultMap="ZdyPointDataResult">
select *
from zdy_point_data zpd
left join zdy_point_type zpt on zpd.point_type_id = zpt.id
where zpt.dept_id = #{deptId}
and zpt.type = #{scenicSpotType}
and zpd.del_flag = '0'
</select>
<select id="selectZdyPointDataColumnList" parameterType="ZdyPointData" resultMap="ZdyPointDataResult">
select
a.id,
a.point_name,
a.point_type_id,
a.longitude,
a.latitude,
b.potype_name as pointTypName
from zdy_point_data a
left join zdy_point_type b on b.id = a.point_type_id
<where>
<if test="pointName != null and pointName != ''">
and a.point_name like concat('%', #{pointName}, '%')
</if>
<if test="pointTypeId != null ">
and a.point_type_id = #{pointTypeId}
</if>
<if test="pointIds != null ">
and a.id not in
<foreach collection="pointIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
and a.del_flag = '0'
and (a.longitude is not null and a.longitude !='')
and (a.latitude is not null and a.latitude !='')
${params.dataScope}
</where>
</select>
<insert id="insertZdyPointData" parameterType="ZdyPointData" useGeneratedKeys="true" keyProperty="id">
insert into zdy_point_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="pointMapId != null and pointMapId != ''">point_map_id,
</if>
<if test="pointTypeId != null and pointTypeId != ''">point_type_id,
</if>
<if test="pointName != null and pointName != ''">point_name,
</if>
<if test="spotId != null">spot_id,
</if>
<if test="image != null and image != ''">image,
</if>
<if test="longitude != null and longitude != ''">longitude,
</if>
<if test="latitude != null and latitude != ''">latitude,
</if>
<if test="blurb != null">blurb,
</if>
<if test="audioGuideUrl != null and audioGuideUrl != ''">
audio_guide_url,
</if>
<if test="association != null and association != ''">association,
</if>
<if test="associationType != null">association_type,
</if>
<if test="ticketId != null">ticket_id,
</if>
<if test="createBy != null">create_by,
</if>
create_time,del_flag,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pointMapId != null and pointMapId != ''">#{pointMapId},
</if>
<if test="pointTypeId != null and pointTypeId != ''">#{pointTypeId},
</if>
<if test="pointName != null and pointName != ''">#{pointName},
</if>
<if test="spotId != null">#{spotId},
</if>
<if test="image != null and image != ''">#{image},
</if>
<if test="longitude != null and longitude != ''">#{longitude},
</if>
<if test="latitude != null and latitude != ''">#{latitude},
</if>
<if test="blurb != null">#{blurb},
</if>
<if test="audioGuideUrl != null and audioGuideUrl != ''">
#{audioGuideUrl},
</if>
<if test="association != null and association != ''">#{association},
</if>
<if test="associationType != null">#{associationType},
</if>
<if test="ticketId != null">#{ticketId},
</if>
<if test="createBy != null">#{createBy},
</if>
sysdate(), '0',
</trim>
</insert>
<update id="updateZdyPointData" parameterType="ZdyPointData">
update zdy_point_data
<trim prefix="SET" suffixOverrides=",">
<if test="pointMapId != null">point_map_id =
#{pointMapId},
</if>
<if test="pointTypeId != null">point_type_id =
#{pointTypeId},
</if>
<if test="pointName != null">point_name =
#{pointName},
</if>
<if test="spotId != null">spot_id =
#{spotId},
</if>
<if test="image != null">image =
#{image},
</if>
<if test="longitude != null">longitude =
#{longitude},
</if>
<if test="latitude != null">latitude =
#{latitude},
</if>
<if test="blurb != null">blurb =
#{blurb},
</if>
<if test="audioGuideUrl != null and audioGuideUrl != ''">
audio_guide_url = #{audioGuideUrl},
</if>
<if test="association != null">association =
#{association},
</if>
<if test="associationType != null">association_type =
#{associationType},
</if>
<if test="ticketId != null">ticket_id =
#{ticketId},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
update_time = sysdate(),
</trim>
where id = #{id}
</update>
<delete id="deleteZdyPointDataById" parameterType="Long">
delete from zdy_point_data where id = #{id}
</delete>
<delete id="deleteZdyPointDataByIds" parameterType="String">
delete from zdy_point_data where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="checkPointNameUnique" resultMap="ZdyPointDataResult">
<include refid="selectZdyPointDataVo"/>
where
del_flag = '0'
and point_type_id = #{pointTypeId}
and point_name = #{name}
</select>
</mapper>