a-tuoheng-airline/src/main/resources/mapper/airline/AirlineMarkerMapper.xml

121 lines
5.4 KiB
XML
Raw Normal View History

2026-03-12 14:04:39 +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.ruoyi.airline.mapper.AirlineMarkerMapper">
<!-- 结果映射 -->
<resultMap id="AirlineMarkerResult" type="com.ruoyi.airline.mapper.entity.AirlineMarkerEntity">
<id property="id" column="id" />
<result property="markerName" column="marker_name" />
<result property="markerType" column="marker_type" />
<result property="status" column="status" />
<result property="color" column="color" />
<result property="icon" column="icon" />
<result property="fontSize" column="font_size" />
<result property="coordinates" column="coordinates" />
<result property="description" column="description" />
<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="remark" column="remark" />
</resultMap>
<!-- 插入标注 -->
<insert id="insertMarker" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerEntity" useGeneratedKeys="true" keyProperty="id">
insert into airline_marker (marker_name, marker_type, status, color, icon, font_size, coordinates, description, create_by, create_time, update_by, update_time, remark)
values (#{markerName}, #{markerType}, #{status}, #{color}, #{icon}, #{fontSize}, #{coordinates}, #{description}, #{createBy}, now(), #{updateBy}, now(), #{remark})
</insert>
<!-- 更新标注 -->
<update id="updateMarker" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerEntity">
update airline_marker
set marker_name = #{markerName},
marker_type = #{markerType},
status = #{status},
color = #{color},
icon = #{icon},
font_size = #{fontSize},
coordinates = #{coordinates},
description = #{description},
update_by = #{updateBy},
update_time = now(),
remark = #{remark}
where id = #{id}
</update>
<!-- 删除标注 -->
<update id="deleteMarker" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerEntity">
update airline_marker
set status = 0,
update_by = #{updateBy},
update_time = now()
where id = #{id}
</update>
<!-- 查询标注列表 -->
<select id="selectMarkerList" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerEntity" resultMap="AirlineMarkerResult">
select id, marker_name, marker_type, status, color, icon, font_size, coordinates, description, create_by, create_time, update_by, update_time, remark
from airline_marker
<where>
2026-03-16 08:31:36 +08:00
status = 1
<if test="id != null">
and id = #{id}
</if>
2026-03-12 14:04:39 +08:00
<if test="markerName != null and markerName != ''">
and marker_name like concat('%', #{markerName}, '%')
</if>
<if test="markerType != null and markerType != ''">
and marker_type = #{markerType}
</if>
<if test="status != null">
and status = #{status}
</if>
</where>
</select>
<!-- 根据ID查询标注 -->
<select id="selectMarkerById" parameterType="java.lang.Long" resultMap="AirlineMarkerResult">
select id, marker_name, marker_type, status, color, icon, font_size, coordinates, description, create_by, create_time, update_by, update_time, remark
from airline_marker
where id = #{id}
</select>
<!-- 根据ID列表查询标注 -->
<select id="selectMarkerListByIds" parameterType="java.util.List" resultMap="AirlineMarkerResult">
select id, marker_name, marker_type, status, color, icon, font_size, coordinates, description, create_by, create_time, update_by, update_time, remark
from airline_marker
where id in
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
2026-03-16 08:31:36 +08:00
and status = 1
2026-03-12 14:04:39 +08:00
</select>
<!-- 根据用户ID查询标注列表 -->
<select id="selectMarkerListByUserId" parameterType="com.ruoyi.airline.mapper.entity.AirlineMarkerEntity" resultMap="AirlineMarkerResult">
select distinct am.id, am.marker_name, am.marker_type, am.status, am.color, am.icon, am.font_size, am.coordinates, am.description, am.create_by, am.create_time, am.update_by, am.update_time, am.remark
from airline_marker am
left join airline_marker_group_info amgi on am.id = amgi.marker_id
left join airline_area_group aag on amgi.group_id = aag.group_id
<where>
amgi.del_flag = 0
and aag.del_flag = 0
<if test="createBy != null and createBy != ''">
and am.create_by = #{createBy}
</if>
<if test="markerName != null and markerName != ''">
and am.marker_name like concat('%', #{markerName}, '%')
</if>
<if test="markerType != null and markerType != ''">
and am.marker_type = #{markerType}
</if>
<if test="status != null">
and am.status = #{status}
</if>
</where>
</select>
</mapper>