<?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.hdkj.lt.bf.mapper.FaultPowerCutPvUsersMapper">

    <select id="countByPlanId" resultType="com.hdkj.lt.core.bizms.modle.po.fault.FaultPowerCutPvUsers">
        SELECT pc.id faultId, count(1) count
        FROM fhzg_fault_power_cut_pv_users cpv
        LEFT JOIN fhzg_fault_power_cut pc on cpv.fault_id = pc.fault_no
        where pc.id in
        <foreach collection="faultIdList" open="(" item="faultId" separator="," close=")">
            #{faultId}
        </foreach>
        GROUP BY pc.id
    </select>
</mapper>
