<?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.harmonic.mapper.StatHarmonicOrgDMapper">

    <select id="listDayRatio" resultType="StatHarmonicOrgVO">
        SELECT
        r.`org_no` `id`,
        r.over_limit_measurement_ratio_average `ratio`,
        r.over_limit_measurement_average `count`
        FROM
        r_stat_harmonic_org_d r
        where 1=1
        and org_no in
        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
            #{item.id}
        </foreach>
        <if test="startTime!=null and endTime!=null">
            and DATE_FORMAT(data_date,'%Y-%m-%d') between #{startTime} and #{endTime}
        </if>
    </select>

</mapper>
