<?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.ard.work.point.tower.mapper.ArdTowerMapper">
|
|
<resultMap type="ArdTower" id="ArdTowerResult">
|
<result property="id" column="id" />
|
<result property="name" column="name" />
|
<result property="longitude" column="longitude" />
|
<result property="latitude" column="latitude" />
|
<result property="altitude" column="altitude" />
|
<result property="userId" column="user_id" />
|
<result property="deptId" column="dept_id" />
|
<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="direction" column="direction" />
|
<result property="towerScale" column="tower_scale" />
|
<result property="towerPath" column="tower_path" />
|
<result property="peOffset" column="pe_offset" />
|
<result property="peScale" column="pe_scale" />
|
<result property="pePath" column="pe_path" />
|
<result property="radarOffset" column="radar_offset" />
|
<result property="radarScale" column="radar_scale" />
|
<result property="radarPath" column="radar_path" />
|
</resultMap>
|
|
<sql id="selectArdTowerVo">
|
select c.id,
|
c.name,
|
c.longitude,
|
c.latitude,
|
c.altitude,
|
c.user_id,
|
c.dept_id,
|
c.create_by,
|
c.create_time,
|
c.update_by,
|
c.update_time,
|
c.direction,
|
c.tower_scale,
|
c.tower_path,
|
c.pe_offset,
|
c.pe_scale,
|
c.pe_path,
|
c.radar_offset,
|
c.radar_scale,
|
c.radar_path
|
from ard_tower c
|
left join sys_dept d on d.dept_id = c.dept_id
|
left join sys_user u on u.user_id = c.user_id
|
</sql>
|
|
<select id="selectArdTowerList" parameterType="ArdTower" resultMap="ArdTowerResult">
|
<include refid="selectArdTowerVo"/>
|
<where>
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
<if test="longitude != null "> and longitude = #{longitude}</if>
|
<if test="latitude != null "> and latitude = #{latitude}</if>
|
<if test="altitude != null "> and altitude = #{altitude}</if>
|
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
|
<if test="direction != null and direction != ''"> and direction = #{direction}</if>
|
<if test="towerScale != null and towerScale != ''"> and tower_scale = #{towerScale}</if>
|
<if test="towerPath != null and towerPath != ''"> and tower_path = #{towerPath}</if>
|
<if test="peOffset != null and peOffset != ''"> and pe_offset = #{peOffset}</if>
|
<if test="peScale != null and peScale != ''"> and pe_scale = #{peScale}</if>
|
<if test="pePath != null and pePath != ''"> and pe_path = #{pePath}</if>
|
<if test="radarOffset != null and radarOffset != ''"> and radar_offset = #{radarOffset}</if>
|
<if test="radarScale != null and radarScale != ''"> and radar_scale = #{radarScale}</if>
|
<if test="radarPath != null and radarPath != ''"> and radar_path = #{radarPath}</if>
|
<if test="deptId != null and deptId != 0">
|
AND (c.dept_id = #{deptId} OR c.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
</if>
|
<!-- 数据范围过滤 -->
|
${params.dataScope}
|
</where>
|
</select>
|
|
<select id="selectArdTowerById" parameterType="String" resultMap="ArdTowerResult">
|
<include refid="selectArdTowerVo"/>
|
where c.id = #{id}
|
</select>
|
|
<insert id="insertArdTower" parameterType="ArdTower">
|
insert into ard_tower
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="name != null">name,</if>
|
<if test="longitude != null">longitude,</if>
|
<if test="latitude != null">latitude,</if>
|
<if test="altitude != null">altitude,</if>
|
<if test="userId != null">user_id,</if>
|
<if test="deptId != null">dept_id,</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="direction != null">direction,</if>
|
<if test="towerScale != null">tower_scale,</if>
|
<if test="towerPath != null">tower_path,</if>
|
<if test="peOffset != null">pe_offset,</if>
|
<if test="peScale != null">pe_scale,</if>
|
<if test="pePath != null">pe_path,</if>
|
<if test="radarOffset != null">radar_offset,</if>
|
<if test="radarScale != null">radar_scale,</if>
|
<if test="radarPath != null">radar_path,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="name != null">#{name},</if>
|
<if test="longitude != null">#{longitude},</if>
|
<if test="latitude != null">#{latitude},</if>
|
<if test="altitude != null">#{altitude},</if>
|
<if test="userId != null">#{userId},</if>
|
<if test="deptId != null">#{deptId},</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="direction != null">#{direction},</if>
|
<if test="towerScale != null">#{towerScale},</if>
|
<if test="towerPath != null">#{towerPath},</if>
|
<if test="peOffset != null">#{peOffset},</if>
|
<if test="peScale != null">#{peScale},</if>
|
<if test="pePath != null">#{pePath},</if>
|
<if test="radarOffset != null">#{radarOffset},</if>
|
<if test="radarScale != null">#{radarScale},</if>
|
<if test="radarPath != null">#{radarPath},</if>
|
</trim>
|
</insert>
|
|
<update id="updateArdTower" parameterType="ArdTower">
|
update ard_tower
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="name != null">name = #{name},</if>
|
<if test="longitude != null">longitude = #{longitude},</if>
|
<if test="latitude != null">latitude = #{latitude},</if>
|
<if test="altitude != null">altitude = #{altitude},</if>
|
<if test="userId != null">user_id = #{userId},</if>
|
<if test="deptId != null">dept_id = #{deptId},</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="direction != null">direction = #{direction},</if>
|
<if test="towerScale != null">tower_scale = #{towerScale},</if>
|
<if test="towerPath != null">tower_path = #{towerPath},</if>
|
<if test="peOffset != null">pe_offset = #{peOffset},</if>
|
<if test="peScale != null">pe_scale = #{peScale},</if>
|
<if test="pePath != null">pe_path = #{pePath},</if>
|
<if test="radarOffset != null">radar_offset = #{radarOffset},</if>
|
<if test="radarScale != null">radar_scale = #{radarScale},</if>
|
<if test="radarPath != null">radar_path = #{radarPath},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteArdTowerById" parameterType="String">
|
delete from ard_tower where id = #{id}
|
</delete>
|
|
<delete id="deleteArdTowerByIds" parameterType="String">
|
delete from ard_tower where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|