<?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.mapper.weeklyreport.GetVoltageInfoDataMapper">
    <select id="getVoltageData" resultType="DicData">
		select dic_index dicIndex, dic_name dicName
        from pqs_dicdata where dic_type = (select dictype_index from pqs_dictype
        where dictype_name = '电压等级')
	</select>

    <select id="getLineIndex" resultType="java.lang.Integer">
        select line_index from
        pq_line where scale =
        #{scal} and line_index in
        <foreach collection="gdIndex" item="item" open="(" close=")"
                 separator=",">
            #{item}
        </foreach>
    </select>

    <select id="getOnLine" resultType="java.lang.Integer"
            parameterType="java.util.List">
        select count(a.line_index) from pq_line a,pq_device b where
        a.line_index in
        <foreach collection="LineIndexs" item="item" open="(" close=")"
                 separator=",">
            #{item}
        </foreach>
        and a.dev_index = b.dev_index
        and b.status = 1 and b.devmodel = 1 and b.devflag = 0 and
        b.datatype != 1
    </select>

</mapper>