| | |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="userId != null">user_id,</if> |
| | | <if test="deptId != null">dept_id,</if> |
| | | <if test="guideFlag != null">guide_flag,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="userId != null">#{userId},</if> |
| | | <if test="deptId != null">#{deptId},</if> |
| | | <if test="guideFlag != null">#{guideFlag},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="createTime != null">create_time = #{createTime},</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> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | WHERE aar.alarm_time >= CURRENT_TIMESTAMP - INTERVAL '%${refreshTime}%' MINUTE |
| | | and aar.alarm_type = #{alarmType} |
| | | </select> |
| | | <select id="getCameraByRadar" resultType="String"> |
| | | select ac.id |
| | | 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 |
| | | </select> |
| | | <select id="getArdAlarmRadarWithGuide" resultMap="ArdAlarmRadarResult"> |
| | | select * |
| | | from ard_alarm_radar |
| | | where create_time > current_timestamp - interval '5' minute |
| | | and guide_flag = #{guideFlag} |
| | | and alarm_type =#{alarmType} |
| | | and name = #{name} |
| | | ORDER BY create_time desc limit 1 |
| | | </select> |
| | | <select id="getArdAlarmRadarWithNotGuide" resultType="Integer"> |
| | | select count(*) |
| | | from ard_alarm_radar |
| | | where create_time >= #{guideTime} |
| | | and guide_flag = #{ardAlarmRadar.guideFlag} |
| | | and alarm_type =#{ardAlarmRadar.alarmType} |
| | | and name = #{ardAlarmRadar.name} |
| | | </select> |
| | | </mapper> |