|  |  | 
 |  |  |         <result property="alarmTime"    column="alarm_time"    /> | 
 |  |  |         <result property="longitude"    column="longitude"    /> | 
 |  |  |         <result property="latitude"    column="latitude"    /> | 
 |  |  |         <result property="recordUrl1"    column="record_url1"    /> | 
 |  |  |         <result property="recordUrl2"    column="record_url2"    /> | 
 |  |  |         <result property="recordUrl"    column="record_url"    /> | 
 |  |  |         <result property="viewTime"    column="view_time"    /> | 
 |  |  |         <result property="createBy"    column="create_by"    /> | 
 |  |  |         <result property="createTime"    column="create_time"    /> | 
 |  |  |         <result property="userId"    column="user_id"    /> | 
 |  |  |         <result property="deptId"    column="dept_id"    /> | 
 |  |  |         <result property="guideFlag"    column="guide_flag"    /> | 
 |  |  |         <result property="guideTime"    column="guide_Time"    /> | 
 |  |  |     </resultMap> | 
 |  |  |  | 
 |  |  |     <sql id="selectArdAlarmRadarMoveVo"> | 
 |  |  |         select id, name, target_id, alarm_type, alarm_time, longitude, latitude, record_url1,record_url2, view_time, create_by, create_time, user_id, dept_id, guide_flag from ard_alarm_radar_move | 
 |  |  |         select id, name, target_id, alarm_type, alarm_time, longitude, latitude, record_url, view_time, create_by, create_time, user_id, dept_id, guide_time from ard_alarm_radar_move | 
 |  |  |     </sql> | 
 |  |  |  | 
 |  |  |     <select id="selectArdAlarmRadarMoveList" parameterType="ArdAlarmRadarMove" resultMap="ArdAlarmRadarMoveResult"> | 
 |  |  | 
 |  |  |             <if test="alarmTime != null "> and alarm_time = #{alarmTime}</if> | 
 |  |  |             <if test="longitude != null "> and longitude = #{longitude}</if> | 
 |  |  |             <if test="latitude != null "> and latitude = #{latitude}</if> | 
 |  |  |             <if test="recordUrl1 != null  and recordUrl1 != ''"> and record_url1 = #{recordUrl1}</if> | 
 |  |  |             <if test="recordUrl != null  and recordUrl != ''"> and record_url = #{recordUrl}</if> | 
 |  |  |             <if test="viewTime != null "> and view_time = #{viewTime}</if> | 
 |  |  |             <if test="userId != null  and userId != ''"> and user_id = #{userId}</if> | 
 |  |  |             <if test="deptId != null "> and dept_id = #{deptId}</if> | 
 |  |  |             <if test="guideFlag != null "> and guide_flag = #{guideFlag}</if> | 
 |  |  |             <if test="guideTime != null "> and guide_time = #{guideTime}</if> | 
 |  |  |             <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> | 
 |  |  |                 AND alarm_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss') | 
 |  |  |             </if> | 
 |  |  |             <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> | 
 |  |  |                 AND alarm_time <= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss') | 
 |  |  |             </if> | 
 |  |  |         </where> | 
 |  |  |         order by alarm_time desc | 
 |  |  |     </select> | 
 |  |  |      | 
 |  |  |     <select id="selectArdAlarmRadarMoveById" parameterType="String" resultMap="ArdAlarmRadarMoveResult"> | 
 |  |  | 
 |  |  |             <if test="alarmTime != null">alarm_time,</if> | 
 |  |  |             <if test="longitude != null">longitude,</if> | 
 |  |  |             <if test="latitude != null">latitude,</if> | 
 |  |  |             <if test="recordUrl1 != null">record_url1,</if> | 
 |  |  |             <if test="recordUrl2 != null">record_url2,</if> | 
 |  |  |             <if test="recordUrl != null">record_url,</if> | 
 |  |  |             <if test="viewTime != null">view_time,</if> | 
 |  |  |             <if test="createBy != null">create_by,</if> | 
 |  |  |             <if test="createTime != null">create_time,</if> | 
 |  |  |             <if test="updateTime != null">update_time,</if> | 
 |  |  |             <if test="userId != null">user_id,</if> | 
 |  |  |             <if test="deptId != null">dept_id,</if> | 
 |  |  |             <if test="guideFlag != null">guide_flag,</if> | 
 |  |  |             <if test="guideTime != null">guide_time,</if> | 
 |  |  |          </trim> | 
 |  |  |         <trim prefix="values (" suffix=")" suffixOverrides=","> | 
 |  |  |             <if test="id != null">#{id},</if> | 
 |  |  | 
 |  |  |             <if test="alarmTime != null">#{alarmTime},</if> | 
 |  |  |             <if test="longitude != null">#{longitude},</if> | 
 |  |  |             <if test="latitude != null">#{latitude},</if> | 
 |  |  |             <if test="recordUrl1 != null">#{recordUrl1},</if> | 
 |  |  |             <if test="recordUrl2 != null">#{recordUrl2},</if> | 
 |  |  |             <if test="recordUrl != null">#{recordUrl},</if> | 
 |  |  |             <if test="viewTime != null">#{viewTime},</if> | 
 |  |  |             <if test="createBy != null">#{createBy},</if> | 
 |  |  |             <if test="createTime != null">#{createTime},</if> | 
 |  |  |             <if test="updateTime != null">#{updateTime},</if> | 
 |  |  |             <if test="userId != null">#{userId},</if> | 
 |  |  |             <if test="deptId != null">#{deptId},</if> | 
 |  |  |             <if test="guideFlag != null">#{guideFlag},</if> | 
 |  |  |             <if test="guideTime != null">#{guideTime},</if> | 
 |  |  |          </trim> | 
 |  |  |     </insert> | 
 |  |  |  | 
 |  |  | 
 |  |  |             <if test="alarmTime != null">alarm_time = #{alarmTime},</if> | 
 |  |  |             <if test="longitude != null">longitude = #{longitude},</if> | 
 |  |  |             <if test="latitude != null">latitude = #{latitude},</if> | 
 |  |  |             <if test="recordUrl1 != null">record_url1 = #{recordUrl1},</if> | 
 |  |  |             <if test="recordUrl2 != null">record_url2 = #{recordUrl2},</if> | 
 |  |  |             <if test="recordUrl != null">record_url = #{recordUrl},</if> | 
 |  |  |             <if test="viewTime != null">view_time = #{viewTime},</if> | 
 |  |  |             <if test="createBy != null">create_by = #{createBy},</if> | 
 |  |  |             <if test="createTime != null">create_time = #{createTime},</if> | 
 |  |  |             <if test="updateTime != null">update_time = #{updateTime},</if> | 
 |  |  |             <if test="userId != null">user_id = #{userId},</if> | 
 |  |  |             <if test="deptId != null">dept_id = #{deptId},</if> | 
 |  |  |             <if test="guideFlag != null">guide_flag = #{guideFlag},</if> | 
 |  |  |             <if test="guideTime != null">guide_time = #{guideTime},</if> | 
 |  |  |         </trim> | 
 |  |  |         where id = #{id} | 
 |  |  |     </update> | 
 |  |  | 
 |  |  |                  count(case when aar.view_time is null THEN 1  END) as count, | 
 |  |  |                 count(aar.id) as total | 
 |  |  |              FROM | 
 |  |  |                  ard_alarm_radar aar | 
 |  |  |                  ard_alarm_radar_move aar | 
 |  |  |              WHERE | 
 |  |  |                  aar.create_time >= ( CURRENT_TIMESTAMP - INTERVAL '%${refreshTime}%' MINUTE ) | 
 |  |  |              GROUP BY aar.NAME | 
 |  |  |             ) r | 
 |  |  |                 INNER JOIN ard_alarm_radar aaar ON r.create_time1 = aaar.create_time | 
 |  |  |                 INNER JOIN ard_alarm_radar_move aaar ON r.create_time1 = aaar.create_time | 
 |  |  |         ORDER BY aaar.create_time desc | 
 |  |  |     </select> | 
 |  |  |     <update id="updateViewTimeByCondition" parameterType="String"> | 
 |  |  |         update ard_alarm_radar_move | 
 |  |  | 
 |  |  |           and alarm_time<=#{alarmTime} | 
 |  |  |           and view_time is null | 
 |  |  |     </update> | 
 |  |  |     <select id="selectArdAlarmRadarLastData" parameterType="String" resultMap="ArdAlarmRadarMoveResult"> | 
 |  |  |         select * from ard_alarm_radar_move where name=#{name} order by update_time desc LIMIT 1 | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <select id="moveYear" resultType="com.ruoyi.statistical.vo.CountVo"> | 
 |  |  |         select to_char(alarm_time::DATE, 'MM') as date,count(id) | 
 |  |  |         from ard_alarm_radar_move | 
 |  |  |         where alarm_time >= #{start} and  alarm_time <= #{end}  group by date order by date | 
 |  |  |     </select> | 
 |  |  |     <select id="moveMonth" resultType="com.ruoyi.statistical.vo.CountVo"> | 
 |  |  |         select to_char(alarm_time::DATE, 'dd') as date,count(id) | 
 |  |  |         from ard_alarm_radar_move | 
 |  |  |         where alarm_time >= #{start} and  alarm_time <= #{end}  group by date order by date | 
 |  |  |     </select> | 
 |  |  |     <select id="ten" resultType="com.ruoyi.statistical.vo.TenVo"> | 
 |  |  |         SELECT name,count(name) as "value" from ard_alarm_radar_move | 
 |  |  |         where (current_timestamp - interval '1024 hour') <= alarm_time GROUP BY name ORDER BY "value" desc LIMIT 10 | 
 |  |  |     </select> | 
 |  |  | </mapper> |