<?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.RStatOrgDMapper">
  <resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RStatOrgDPO">
    <!--@mbg.generated-->
    <!--@Table r_stat_org_d-->
    <id column="org_no" jdbcType="VARCHAR" property="orgNo" />
    <id column="data_date" jdbcType="TIMESTAMP" property="dataDate" />
    <id column="measurement_type_class" jdbcType="VARCHAR" property="measurementTypeClass" />
    <id column="data_type" jdbcType="VARCHAR" property="dataType" />
    <result column="all_count" jdbcType="INTEGER" property="allCount" />
    <result column="effective_measurement" jdbcType="INTEGER" property="effectiveMeasurement" />
    <result column="harmonic_measurement" jdbcType="INTEGER" property="harmonicMeasurement" />
    <result column="event_measurement" jdbcType="INTEGER" property="eventMeasurement" />
    <result column="event_count" jdbcType="INTEGER" property="eventCount" />
    <result column="should_count" jdbcType="INTEGER" property="shouldCount" />
    <result column="warn_count" jdbcType="INTEGER" property="warnCount" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    org_no, data_date, measurement_type_class, data_type, all_count, effective_measurement, 
    harmonic_measurement, event_measurement, event_count, should_count, warn_count
  </sql>

    <select id="listAll" resultType="com.njcn.prepare.harmonic.pojo.po.RStatOrgDVO">
      select org_no "orgNo",data_type"dataType",effective_measurement"effectiveMeasurement"
      from r_stat_org_d
      where date_format(data_date, '%y%m%d') = date_format(#{date}, '%y%m%d')
        and org_no = #{orgId}
    </select>

</mapper>