<?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="vip.xiaonuo.modular.warning.warningInfo.mapper.WarningInfoMapper">

    <select id="listSevenDayWarning" parameterType="string" resultType="vip.xiaonuo.modular.warning.warningInfo.entity.vo.WarningInfoListVo">
        SELECT
            DATE(warning_time) AS 'time',
            COUNT(*) AS 'value'
        FROM
            `warning_info`
        WHERE
            org_id = #{orgId}
            AND warning_time BETWEEN DATE_SUB(CURDATE(), INTERVAL 6 DAY) AND CURDATE()
        GROUP BY
            DATE(warning_time)
        ORDER BY
            DATE(warning_time);
    </select>
</mapper>