zhangnaisong
2024-01-20 7f6033c2b60979a9566b33440b716d17803e18aa
ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
@@ -31,7 +31,13 @@
    <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>
@@ -163,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>