| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.alarm.access.mapper.ArdAlarmAccessMapper"> |
| | | |
| | | |
| | | <resultMap type="ArdAlarmAccess" id="ArdAlarmAccessResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="serialNo" column="serial_no" /> |
| | |
| | | <select id="selectArdAlarmAccessList" parameterType="ArdAlarmAccess" resultMap="ArdAlarmAccessResult"> |
| | | <include refid="selectArdAlarmAccessVo"/> |
| | | <where> |
| | | <if test="acsName!=null and acsName!=''"> |
| | | AND acs_name like concat('%', #{acsName}, '%') |
| | | </if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| | | AND alarm_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss') |
| | | </if> |
| | |
| | | </where> |
| | | order by alarm_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="selectArdAlarmAccessById" parameterType="String" resultMap="ArdAlarmAccessResult"> |
| | | <include refid="selectArdAlarmAccessVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertArdAlarmAccess" parameterType="ArdAlarmAccess"> |
| | | insert into ard_alarm_access |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | </delete> |
| | | |
| | | <delete id="deleteArdAlarmAccessByIds" parameterType="String"> |
| | | delete from ard_alarm_access where id in |
| | | delete from ard_alarm_access where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | |
| | | and alarm_time <= #{alarmTime} |
| | | and view_time is null |
| | | </update> |
| | | </mapper> |
| | | |
| | | <select id="accessYear" resultType="com.ruoyi.statistical.vo.CountVo"> |
| | | select to_char(alarm_time::DATE, 'MM') as date,count(id) |
| | | from ard_alarm_access |
| | | where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date |
| | | </select> |
| | | <select id="accessMonth" resultType="com.ruoyi.statistical.vo.CountVo"> |
| | | select to_char(alarm_time::DATE, 'dd') as date,count(id) |
| | | from ard_alarm_access |
| | | where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date |
| | | </select> |
| | | </mapper> |