<?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.prepare.harmonic.mapper.mysql.area.RStatOrgMMapper">
    <resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RStatOrgMPO">
        <!--@mbg.generated-->
        <!--@Table r_stat_org_m-->
        <id column="org_no" jdbcType="VARCHAR" property="orgNo"/>
        <result column="data_date" jdbcType="TIMESTAMP" property="dataDate"/>
        <result column="measurement_type_class" jdbcType="VARCHAR" property="measurementTypeClass"/>
        <result column="all_count" jdbcType="INTEGER" property="allCount"/>
        <result column="effective_measurement_average" jdbcType="INTEGER" property="effectiveMeasurementAverage"/>
        <result column="effective_measurement_accrued" jdbcType="INTEGER" property="effectiveMeasurementAccrued"/>
        <result column="harmonic_measurement_average" jdbcType="INTEGER" property="harmonicMeasurementAverage"/>
        <result column="harmonic_measurement_accrued" jdbcType="INTEGER" property="harmonicMeasurementAccrued"/>
        <result column="harmonic_measurement_ratio_average" jdbcType="FLOAT"
                property="harmonicMeasurementRatioAverage"/>
        <result column="over_day_accrued" jdbcType="INTEGER" property="overDayAccrued"/>
        <result column="freq_pass_rate" jdbcType="FLOAT" property="freqPassRate"/>
        <result column="v_dev_pass_rate" jdbcType="FLOAT" property="vDevPassRate"/>
        <result column="flicker_pass_rate" jdbcType="FLOAT" property="flickerPassRate"/>
        <result column="event_measurement_average" jdbcType="INTEGER" property="eventMeasurementAverage"/>
        <result column="event_measurement_accrued" jdbcType="INTEGER" property="eventMeasurementAccrued"/>
        <result column="event_measurement_ratio_average" jdbcType="FLOAT" property="eventMeasurementRatioAverage"/>
        <result column="event_freq" jdbcType="FLOAT" property="eventFreq"/>
        <result column="event_count" jdbcType="INTEGER" property="eventCount"/>
        <result column="should_count" jdbcType="INTEGER" property="shouldCount"/>
        <result column="warn_count" jdbcType="INTEGER" property="warnCount"/>
        <result column="data_type" jdbcType="VARCHAR" property="dataType"/>
    </resultMap>
    <sql id="Base_Column_List">
        <!--@mbg.generated-->
        org_no, data_date, measurement_type_class, all_count, effective_measurement_average,
        effective_measurement_accrued, harmonic_measurement_average, harmonic_measurement_accrued,
        harmonic_measurement_ratio_average, over_day_accrued, freq_pass_rate, v_dev_pass_rate,
        flicker_pass_rate, event_measurement_average, event_measurement_accrued, event_measurement_ratio_average,
        event_freq, event_count, should_count, warn_count, data_type
    </sql>

    <select id="selectMlist" resultType="java.util.Map">
        SELECT sum(effective_measurement_accrued) "efSum"
        FROM r_stat_org_m
        WHERE date_format(data_date, '%y%m%d') &gt;= date_format(#{startTime}, '%y%m%d')
          AND date_format(data_date, '%y%m%d') &lt;= date_format(#{endTime}, '%y%m%d')
          AND org_no = #{orgId}
          AND data_type = #{dataTypeId}
        GROUP BY org_no
    </select>

</mapper>