<?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.RStatMeasurementAccountDetailMapper">

    <!--获取主网数据质量-台账类数据指标核查详情-监测点台账数据质量问题-->
    <select id="getQualityProblemsOfMonitoringPointAccountData"
            resultType="com.njcn.device.pms.pojo.po.RStatMeasurementAccountDetailPO">
        SELECT
        data_date AS dataDate,
        check_rules AS checkRules,
        measurement_point_id AS measurementPointId
        FROM
        r_stat_measurement_account_detail
        <where>
        measurement_point_id IN
            <foreach collection="monitorIdList" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
            <if test="param.checkRules != null and param.checkRules.size() > 0 ">
                AND check_rules IN
                <foreach collection="param.checkRules" item="item" open="(" close=")" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="param.startTime != null and param.startTime != ''">
                AND DATE_FORMAT(data_date, '%Y-%m-%d') &gt;= DATE_FORMAT(#{param.startTime}, '%Y-%m-%d')
            </if>
            <if test="param.endTime != null and param.endTime != ''">
                AND DATE_FORMAT(data_date, '%Y-%m-%d') &lt;= DATE_FORMAT(#{param.endTime}, '%Y-%m-%d')
            </if>
        </where>
    </select>
</mapper>