‘liusuyi’
2023-12-04 6c47588406827fa706e4068c692de3be0ae0188e
ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
@@ -31,8 +31,15 @@
    <select id="selectArdAlarmAccessList" parameterType="ArdAlarmAccess" resultMap="ArdAlarmAccessResult">
        <include refid="selectArdAlarmAccessVo"/>
        <where>
        <where>
            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
                AND alarm_time &gt;= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss')
            </if>
            <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
                AND alarm_time &lt;= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss')
            </if>
        </where>
        order by alarm_time desc
    </select>
    
    <select id="selectArdAlarmAccessById" parameterType="String" resultMap="ArdAlarmAccessResult">
@@ -162,4 +169,15 @@
          and alarm_time &lt;= #{alarmTime}
          and view_time is null
    </update>
    <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 &gt;= #{start} and  alarm_time &lt;= #{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 &gt;= #{start} and  alarm_time &lt;= #{end}  group by date order by date
    </select>
</mapper>