<?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.njcn.device.pms.mapper.majornetwork.RStatZwAlarmCountWMapper">

    <resultMap id="BaseResultMap" type="com.njcn.device.pms.pojo.po.RStatZwAlarmCountW">
            <id property="orgNo" column="org_no" jdbcType="VARCHAR"/>
            <id property="dataDate" column="data_date" jdbcType="DATE"/>
            <result property="monitorEffectiveCount" column="monitor_effective_count" jdbcType="INTEGER"/>
            <result property="warnMonitorCount" column="warn_monitor_count" jdbcType="INTEGER"/>
            <result property="monitorGradeCount" column="monitor_grade_count" jdbcType="INTEGER"/>
        
    </resultMap>

    <sql id="Base_Column_List">
        org_no,data_date,monitor_effective_count,
        warn_monitor_count,monitor_grade_count
    </sql>


    <select id="getRStatZwAlarmCountWList" resultType="com.njcn.device.pms.pojo.vo.RStatZwAlarmCountWVO">
        select <include refid="Base_Column_List"/>
        from r_stat_zw_alarm_count_w rszac
        where 1 = 1
        <if test="rStatZwAlarmCountWParam.orgNo != null and rStatZwAlarmCountWParam.orgNo != ''">
          and rszac.org_no = #{rStatZwAlarmCountWParam.orgNo}
        </if>
        <if test="rStatZwAlarmCountWParam.beginDate != null and rStatZwAlarmCountWParam.beginDate != ''">
          and DATE_FORMAT(rszac.data_date, '%Y-%m-%d') &gt;= #{rStatZwAlarmCountWParam.beginDate}
        </if>
        <if test="rStatZwAlarmCountWParam.endDate != null and rStatZwAlarmCountWParam.endDate != ''">
            and DATE_FORMAT(rszac.data_date, '%Y-%m-%d') &lt;= #{rStatZwAlarmCountWParam.endDate}
        </if>
    </select>


</mapper>
