|  |  |  | 
|---|
|  |  |  | <?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"> | 
|---|
|  |  |  | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 
|---|
|  |  |  | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 
|---|
|  |  |  | <mapper namespace="com.ruoyi.device.radar.mapper.ArdEquipRadarMapper"> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <resultMap type="ArdEquipRadar" id="ArdEquipRadarResult"> | 
|---|
|  |  |  | <result property="id"    column="id"    /> | 
|---|
|  |  |  | <result property="name"    column="name"    /> | 
|---|
|  |  |  | <result property="createBy"    column="create_by"    /> | 
|---|
|  |  |  | <result property="port"    column="port"    /> | 
|---|
|  |  |  | <result property="operate"    column="operate"    /> | 
|---|
|  |  |  | <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="userId"    column="user_id"    /> | 
|---|
|  |  |  | <result property="longitude"    column="longitude"    /> | 
|---|
|  |  |  | <result property="latitude"    column="latitude"    /> | 
|---|
|  |  |  | <result property="altitude"    column="altitude"    /> | 
|---|
|  |  |  | <result property="radarDate"    column="radar_date"    /> | 
|---|
|  |  |  | <result property="deptId"    column="dept_id"    /> | 
|---|
|  |  |  | <result property="pitch"    column="pitch"    /> | 
|---|
|  |  |  | <result property="towerId"    column="tower_id"    /> | 
|---|
|  |  |  | <result property="imageWidth"    column="image_width"    /> | 
|---|
|  |  |  | <result property="imageHeight"    column="image_height"    /> | 
|---|
|  |  |  | <result property="type"    column="type"    /> | 
|---|
|  |  |  | <result property="ip"    column="ip"    /> | 
|---|
|  |  |  | <result property="towerName"    column="name"    /> | 
|---|
|  |  |  | <result property="id" column="id"/> | 
|---|
|  |  |  | <result property="name" column="name"/> | 
|---|
|  |  |  | <result property="createBy" column="create_by"/> | 
|---|
|  |  |  | <result property="port" column="port"/> | 
|---|
|  |  |  | <result property="operate" column="operate"/> | 
|---|
|  |  |  | <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="userId" column="user_id"/> | 
|---|
|  |  |  | <result property="longitude" column="longitude"/> | 
|---|
|  |  |  | <result property="latitude" column="latitude"/> | 
|---|
|  |  |  | <result property="altitude" column="altitude"/> | 
|---|
|  |  |  | <result property="radarDate" column="radar_date"/> | 
|---|
|  |  |  | <result property="deptId" column="dept_id"/> | 
|---|
|  |  |  | <result property="pitch" column="pitch"/> | 
|---|
|  |  |  | <result property="towerId" column="tower_id"/> | 
|---|
|  |  |  | <result property="imageWidth" column="image_width"/> | 
|---|
|  |  |  | <result property="imageHeight" column="image_height"/> | 
|---|
|  |  |  | <result property="type" column="type"/> | 
|---|
|  |  |  | <result property="ip" column="ip"/> | 
|---|
|  |  |  | <result property="towerName" column="name"/> | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <sql id="selectArdEquipRadarVo"> | 
|---|
|  |  |  | 
|---|
|  |  |  | left join sys_user u on u.user_id = c.user_id | 
|---|
|  |  |  | left join ard_towers t on t.id = c.tower_id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | <if test="towerId != null  and towerId != ''"> and c.tower_id = #{towerId}</if> | 
|---|
|  |  |  | <if test="towerId != null  and towerId != ''">and c.tower_id = #{towerId}</if> | 
|---|
|  |  |  | <if test="ip != null  and ip != ''">and c.ip = #{ip}</if> | 
|---|
|  |  |  | <if test="type != null  and type != ''">and c.type = #{type}</if> | 
|---|
|  |  |  | <if test="userId != null  and userId != ''">and c.user_id = #{userId}</if> | 
|---|
|  |  |  | <if test="deptId != null ">and (c.dept_id = #{deptId} OR c.dept_id IN ( SELECT t.dept_id FROM sys_dept t | 
|---|
|  |  |  | WHERE cast(#{deptId} as varchar) = any(string_to_array(ancestors,',')) )) | 
|---|
|  |  |  | 
|---|
|  |  |  | ${params.dataScope} | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectArdEquipRadarById" parameterType="String" resultMap="ArdEquipRadarResult"> | 
|---|
|  |  |  | <include refid="selectArdEquipRadarVo"/> | 
|---|
|  |  |  | where id = #{id} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <insert id="insertArdEquipRadar" parameterType="ArdEquipRadar"> | 
|---|
|  |  |  | insert into ard_equip_radar | 
|---|
|  |  |  | <trim prefix="(" suffix=")" suffixOverrides=","> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="imageHeight != null">image_height,</if> | 
|---|
|  |  |  | <if test="type != null">type,</if> | 
|---|
|  |  |  | <if test="ip != null">ip,</if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | <trim prefix="values (" suffix=")" suffixOverrides=","> | 
|---|
|  |  |  | <if test="id != null">#{id},</if> | 
|---|
|  |  |  | <if test="name != null">#{name},</if> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="imageHeight != null">#{imageHeight},</if> | 
|---|
|  |  |  | <if test="type != null">#{type},</if> | 
|---|
|  |  |  | <if test="ip != null">#{ip},</if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | </insert> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <update id="updateArdEquipRadar" parameterType="ArdEquipRadar"> | 
|---|
|  |  |  | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <delete id="deleteArdEquipRadarById" parameterType="String"> | 
|---|
|  |  |  | delete from ard_equip_radar where id = #{id} | 
|---|
|  |  |  | delete | 
|---|
|  |  |  | from ard_equip_radar | 
|---|
|  |  |  | where id = #{id} | 
|---|
|  |  |  | </delete> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <delete id="deleteArdEquipRadarByIds" parameterType="String"> | 
|---|
|  |  |  | delete from ard_equip_radar where id in | 
|---|
|  |  |  | delete from ard_equip_radar where id in | 
|---|
|  |  |  | <foreach item="id" collection="array" open="(" separator="," close=")"> | 
|---|
|  |  |  | #{id} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </delete> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="getCameraByRadar" resultType="ArdCameras"> | 
|---|
|  |  |  | select ac.* from ard_equip_radar aer | 
|---|
|  |  |  | INNER JOIN ard_towers at on aer.tower_id= at.id | 
|---|
|  |  |  | INNER JOIN ard_cameras ac on aer.tower_id=ac.tower_id | 
|---|
|  |  |  | where aer.id=#{radarId} limit 1 | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | <select id="selectArdRadarsByDeptId" parameterType="Long" resultMap="ArdEquipRadarResult"> | 
|---|
|  |  |  | select * from ard_equip_radar where dept_id = #{deptId} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </mapper> | 
|---|