31
aijinhui
2024-03-26 82f8f0065a27acf9f7e1558b04fa75ce68a7fa50
ard-work/src/main/resources/mapper/alarm/ArdAlarmStealelecMapper.xml
@@ -1,6 +1,6 @@
<?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.ruoyi.alarm.stealAlarm.mapper.ArdAlarmStealelecMapper">
<mapper namespace="com.ruoyi.alarm.steal.mapper.ArdAlarmStealelecMapper">
    <resultMap id="BaseResultMap" type="ArdAlarmStealelec">
        <id column="id" property="id"/>
        <result column="name" property="name"/>
@@ -24,6 +24,9 @@
        <include refid="Base_Column_List"/>
        from ard_alarm_stealelec
        <where>
            <if test="name != null  and name != ''">
                AND name like concat('%', #{name}, '%')
            </if>
            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
                AND start_time &gt;= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss')
            </if>
@@ -31,6 +34,7 @@
                AND start_time &lt;= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss')
            </if>
        </where>
        order by start_time desc
    </select>
    <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
        select
@@ -96,6 +100,7 @@
        select count(DISTINCT aas."describe")
        from ard_alarm_stealelec aas
        where aas.start_time >= (CURRENT_TIMESTAMP - INTERVAL '%${refreshTime}%' MINUTE)
        and aas.view_time is null
    </select>
    <update id="updateViewTimeByDescribe" parameterType="String">
        update ard_alarm_stealelec
@@ -126,4 +131,16 @@
        values (#{id}, #{name},#{describe},#{catalogText},#{description}, #{startTime}, #{endTime},
        #{viewTime},#{longitude},#{latitude},#{altitude},#{createBy},#{createTime},#{userId},#{deptId})
    </insert>
</mapper>
    <select id="stealelecYear" resultType="com.ruoyi.statistical.vo.CountVo">
        select to_char(start_time::DATE, 'MM') as date,count(id)
        from ard_alarm_stealelec
        where start_time &gt;= #{start} and  start_time &lt;= #{end}  group by date order by date
    </select>
    <select id="stealelecMonth" resultType="com.ruoyi.statistical.vo.CountVo">
        select to_char(start_time::DATE, 'dd') as date,count(id)
        from ard_alarm_stealelec
        where start_time &gt;= #{start} and  start_time &lt;= #{end}  group by date order by date
    </select>
</mapper>