930 lines
28 KiB
XML
930 lines
28 KiB
XML
<?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.configuration.TreeMapper'>
|
|
|
|
|
|
<resultMap type="Tree" id="gdResultMap" autoMapping="true">
|
|
<id column="Gd_index" property="nodeIndex"/>
|
|
<result column="province_index" property="pId"/>
|
|
</resultMap>
|
|
<select id='getGdInfo' resultMap='gdResultMap' >
|
|
select
|
|
gd_index,name
|
|
from pq_gdinformation
|
|
where
|
|
gd_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=") order by gd_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<resultMap type="Tree" id="subResultMap" autoMapping="true">
|
|
<id column="Sub_index" property="nodeIndex"/>
|
|
<result column="gd_index" property="pId"/>
|
|
</resultMap>
|
|
<select id='getSubInfo' resultMap='subResultMap'>
|
|
select
|
|
gd_index, name,sub_index
|
|
from pq_substation
|
|
where
|
|
gd_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=") order by sub_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<resultMap type="Tree" id="transResultMap" autoMapping="true">
|
|
<id column="TFLGASS_INDEX" property="nodeTf"/>
|
|
<result column="Sub_index" property="pId"/>
|
|
</resultMap>
|
|
<select id='getTransInfo' resultMap='transResultMap'>
|
|
select ts.sub_index,ts.tfname as name,ts.tf_index
|
|
from pqs_transformer ts
|
|
where ts.sub_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
order by updatetime desc
|
|
</select>
|
|
|
|
<resultMap type="Tree" id="devResultMap" autoMapping="true">
|
|
<id column="Dev_index" property="nodeIndex"/>
|
|
<result column="sub_index" property="pId"/>
|
|
</resultMap>
|
|
<select id='getDevInfo' resultMap='devResultMap'>
|
|
select
|
|
sub_index, name,dev_index,gd_index
|
|
from pq_device
|
|
where
|
|
DEVMODEL = 1
|
|
and datatype in (1,2)
|
|
and gd_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=") order by dev_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<resultMap type="Tree" id="devicetMap" autoMapping="true">
|
|
<id column="Dev_index" property="nodeIndex"/>
|
|
<result column="sub_index" property="pId"/>
|
|
</resultMap>
|
|
<select id='getDevice' resultMap='devicetMap'>
|
|
select
|
|
sub_index, name,dev_index,gd_index
|
|
from pq_device
|
|
where
|
|
gd_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=") order by dev_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<resultMap type="Tree" id="subvResultMap" autoMapping="true">
|
|
<id column="subv_index" property="nodeIndex"/>
|
|
<result column="Dev_index" property="pId"/>
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="Tree" id="lineResultMap" autoMapping="true">
|
|
<id column="line_index" property="nodeIndex"/>
|
|
<result column="subv_index" property="pId"/>
|
|
</resultMap>
|
|
<select id='getLineInfo' resultMap='lineResultMap'>
|
|
select
|
|
a.subv_index, a.name,a.line_index,b.devflag as state,b.status
|
|
from pq_line a,pq_device b
|
|
where
|
|
a.dev_index = b.dev_index
|
|
and a.line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=") order by a.line_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id='getTreeGdInfo' resultMap='gdResultMap' >
|
|
select
|
|
gd_index,name,province_index
|
|
from pq_gdinformation
|
|
where
|
|
gd_index in
|
|
(select gd_index
|
|
from pq_line
|
|
where line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")) order by gd_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id='getTreeSubInfo' resultMap='subResultMap'>
|
|
select
|
|
gd_index, name,sub_index
|
|
from pq_substation
|
|
where
|
|
sub_index in
|
|
(select sub_index
|
|
from pq_line
|
|
where line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")) order by sub_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id='getZTTreeDevInfo' resultMap='devResultMap'>
|
|
select
|
|
sub_index, name,dev_index,gd_index,ip
|
|
from pq_device
|
|
where DEVMODEL = 1
|
|
and datatype in (0, 2)
|
|
and dev_index in
|
|
(select dev_index
|
|
from pq_line
|
|
where line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")) order by dev_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id='getWTTreeDevInfo' resultMap='devResultMap'>
|
|
select
|
|
sub_index, name,dev_index,gd_index
|
|
from pq_device
|
|
where DEVMODEL = 1
|
|
and datatype in (1, 2)
|
|
and dev_index in
|
|
(select dev_index
|
|
from pq_line
|
|
where line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")) order by dev_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id='getWTTreeDevInfoOffline' resultMap='devResultMap'>
|
|
select
|
|
sub_index, name,dev_index,gd_index
|
|
from pq_device
|
|
where DEVMODEL = 2
|
|
and datatype in (1, 2)
|
|
and dev_index in
|
|
(select dev_index
|
|
from pq_line
|
|
where line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")) order by dev_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id='getTreeSubvInfo' resultMap='subvResultMap'>
|
|
select
|
|
dev_index, name,subv_index,sub_index
|
|
from pq_subvoltage
|
|
where
|
|
subv_index in
|
|
(select subv_index
|
|
from pq_line
|
|
where line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")) order by subv_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<resultMap type="Tree" id="proJResultMap" autoMapping="true">
|
|
<id column="project_index" property="nodeIndex"/>
|
|
</resultMap>
|
|
<select id='getOffTreeProJInfo' resultMap='proJResultMap' >
|
|
select distinct a.project_index, a.name
|
|
from pq_project a,
|
|
pq_province b,
|
|
pq_gdinformation c,
|
|
pq_device d,
|
|
pq_line e
|
|
where b.project_index = a.project_index
|
|
and c.province_index = b.province_index
|
|
and e.gd_index = c.gd_index
|
|
and d.dev_index = e.dev_index
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=") order by project_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<resultMap type="Tree" id="proVResultMap" autoMapping="true">
|
|
<id column="province_index" property="nodeIndex"/>
|
|
<id column="project_index" property="pId"/>
|
|
</resultMap>
|
|
<select id='getOffTreeProVInfo' resultMap='proVResultMap' >
|
|
select
|
|
province_index,name,project_index
|
|
from pq_province
|
|
where
|
|
province_index in
|
|
(select province_index from pq_gdinformation where gd_index in
|
|
(select gd_index
|
|
from pq_line
|
|
where line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close="))) order by province_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
|
|
|
|
<resultMap type="Tree" id="offsubResultMap" autoMapping="true">
|
|
<id column="Sub_index" property="nodeIndex"/>
|
|
<result column="province_index" property="pId"/>
|
|
</resultMap>
|
|
<select id='getOffTreeSubInfo' resultMap='offsubResultMap'>
|
|
select b.province_index, a.name, a.sub_index
|
|
from pq_substation a, pq_province b, pq_gdinformation c
|
|
where a.gd_index = c.gd_index
|
|
and c.province_index = b.province_index
|
|
and a.sub_index in
|
|
(select sub_index
|
|
from pq_line
|
|
where line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")) order by sub_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
|
|
|
|
<resultMap type="Tree" id="offlineResultMap" autoMapping="true">
|
|
<id column="line_index" property="nodeIndex"/>
|
|
<result column="sub_index" property="pId"/>
|
|
</resultMap>
|
|
<select id='getOffTreeLineInfo' resultMap='offlineResultMap'>
|
|
select
|
|
a.sub_index, a.name,a.line_index,b.devflag as state,b.status,d.pttype
|
|
from pq_line a,pq_device b,pq_substation c,pq_linedetail d
|
|
where
|
|
a.sub_index = c.sub_index
|
|
and a.line_index = d.line_index
|
|
and a.dev_index = b.dev_index
|
|
and a.line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=") order by a.line_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id='getDeviceWT' resultMap='devicetMap'>
|
|
select
|
|
sub_index, name,dev_index,gd_index
|
|
from pq_device
|
|
where
|
|
datatype in (1, 2) and
|
|
gd_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by dev_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id='getDeviceZT' resultMap='devicetMap'>
|
|
select
|
|
sub_index, name,dev_index,gd_index
|
|
from pq_device
|
|
where
|
|
datatype in (0, 2) and
|
|
gd_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by dev_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id='getProInfo' resultType='tree'>
|
|
SELECT
|
|
pro.province_index nodeIndex,
|
|
dic.DIC_NAME name
|
|
FROM
|
|
pq_province pro,
|
|
pqs_dicdata dic
|
|
WHERE
|
|
pro.name = dic.DIC_INDEX
|
|
</select>
|
|
<select id='getGdByPro' resultType='tree'>
|
|
select
|
|
gd_index nodeIndex,name,province_index pId
|
|
from pq_gdinformation
|
|
where
|
|
province_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by gd_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id='getOffLineDevice' resultType="Tree">
|
|
select
|
|
sub_index pId, name,dev_index nodeIndex,gd_index
|
|
from pq_device
|
|
where
|
|
DEVMODEL = #{devModel}
|
|
and datatype in
|
|
<foreach collection="dataType" index="index" item="item" open="("
|
|
separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
and gd_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by dev_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getProInfoByDevice" resultType="Tree">
|
|
SELECT
|
|
t5.PROVINCE_INDEX nodeIndex,
|
|
dic.DIC_NAME name
|
|
FROM
|
|
PQ_PROVINCE t5,
|
|
pqs_dicdata dic
|
|
WHERE
|
|
T5.PROVINCE_INDEX IN (
|
|
SELECT
|
|
T4.PROVINCE_INDEX
|
|
FROM
|
|
PQ_GDINFORMATION t4
|
|
WHERE
|
|
T4.GD_INDEX IN (
|
|
SELECT DISTINCT
|
|
(t3.GD_INDEX)
|
|
FROM
|
|
PQ_LINE t3
|
|
WHERE
|
|
T3.DEV_INDEX IN (
|
|
SELECT
|
|
T2.DEV_INDEX
|
|
FROM
|
|
PQ_DEVICE t2
|
|
WHERE
|
|
T2.DATATYPE IN
|
|
<foreach collection="dataType" index="index" item="item" open="("
|
|
separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
)
|
|
)
|
|
and
|
|
t5.name = dic.DIC_INDEX
|
|
</select>
|
|
|
|
<select id="getGDInfoByDevice" resultType="Tree">
|
|
SELECT
|
|
T4.GD_INDEX nodeIndex,
|
|
T4.NAME
|
|
FROM
|
|
PQ_GDINFORMATION t4
|
|
WHERE
|
|
T4.GD_INDEX IN (
|
|
SELECT DISTINCT
|
|
(t3.GD_INDEX)
|
|
FROM
|
|
PQ_LINE t3
|
|
WHERE
|
|
T3.DEV_INDEX IN (
|
|
SELECT
|
|
T2.DEV_INDEX
|
|
FROM
|
|
PQ_DEVICE t2
|
|
WHERE
|
|
T2.DATATYPE IN
|
|
<foreach collection="dataType" index="index" item="item" open="("
|
|
separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
)
|
|
AND
|
|
T4.PROVINCE_INDEX=#{nodeIndex}
|
|
</select>
|
|
|
|
<select id="getSubInfoByDevice" resultType="Tree">
|
|
SELECT
|
|
T4.SUB_INDEX nodeIndex,
|
|
T4.NAME
|
|
FROM
|
|
PQ_SUBSTATION t4
|
|
WHERE
|
|
T4.GD_INDEX IN (
|
|
SELECT DISTINCT
|
|
(t3.GD_INDEX)
|
|
FROM
|
|
PQ_LINE t3
|
|
WHERE
|
|
T3.DEV_INDEX IN (
|
|
SELECT
|
|
T2.DEV_INDEX
|
|
FROM
|
|
PQ_DEVICE t2
|
|
WHERE
|
|
T2.DATATYPE IN
|
|
<foreach collection="dataType" index="index" item="item" open="("
|
|
separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
)
|
|
AND T4.GD_INDEX = #{nodeIndex}
|
|
</select>
|
|
|
|
<select id="getDevInfoByDevice" resultType="Tree">
|
|
SELECT
|
|
T1.DEV_INDEX nodeIndex,
|
|
T1.NAME
|
|
FROM
|
|
PQ_DEVICE t1
|
|
WHERE
|
|
T1.DATATYPE IN
|
|
<foreach collection="dataType" index="index" item="item" open="("
|
|
separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
AND T1.SUB_INDEX = #{nodeIndex}
|
|
</select>
|
|
|
|
<select id="getSubvInfoByDevice" resultType="Tree">
|
|
SELECT
|
|
T1.SUBV_INDEX nodeIndex,
|
|
T1.NAME
|
|
FROM
|
|
PQ_SUBVOLTAGE t1
|
|
WHERE
|
|
T1.DEV_INDEX=#{nodeIndex}
|
|
</select>
|
|
|
|
<select id="getLineInfoByDevice" resultType="Tree">
|
|
SELECT
|
|
T1.subv_index,
|
|
T1.NAME,
|
|
T1.line_index nodeIndex,
|
|
T2.devflag state,
|
|
T2.status
|
|
FROM
|
|
pq_line t1,PQ_DEVICE t2
|
|
WHERE
|
|
T1.dev_index=T2.dev_index
|
|
AND
|
|
T1.SUBV_INDEX =#{nodeIndex}
|
|
</select>
|
|
<select id="getOffYearProJInfo" resultMap="proJResultMap">
|
|
select distinct a.project_index nodeIndex, a.name name
|
|
from pq_project a,
|
|
pq_province b,
|
|
pq_gdinformation c,
|
|
pq_device d,
|
|
pq_line e,
|
|
offl_log f
|
|
where b.project_index = a.project_index
|
|
and c.province_index = b.province_index
|
|
and e.gd_index = c.gd_index
|
|
and f.line_index = e.line_index
|
|
and f.year in
|
|
<foreach collection="year" index="index" item="item" open="("
|
|
separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getOffYearProVInfo" resultMap="proVResultMap">
|
|
select distinct a.province_index nodeIndex,
|
|
(select dic_name
|
|
from pqs_dicdata
|
|
where dic_index = a.name
|
|
and state = 1) || e.year name,
|
|
a.project_index pId
|
|
from pq_province a,
|
|
pq_gdinformation b,
|
|
pq_line c,
|
|
pq_device d,
|
|
offl_log e
|
|
where b.province_index = a.province_index
|
|
and c.gd_index = b.gd_index
|
|
and e.line_index = c.line_index
|
|
and e.year = #{year}
|
|
and c.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getOffYearSubInfo" resultMap="offsubResultMap">
|
|
select distinct b.province_index pId, a.name name, a.sub_index nodeIndex
|
|
from pq_substation a, pq_province b, pq_gdinformation c ,pq_line d,offl_log e,pq_device f
|
|
where a.gd_index = c.gd_index
|
|
and c.province_index = b.province_index
|
|
and d.sub_index = a.sub_index
|
|
and e.line_index = d.line_index
|
|
and e.year = #{year}
|
|
and d.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getOffYearLineInfo" resultMap="offlineResultMap">
|
|
select
|
|
distinct a.sub_index pId, a.name name,a.line_index nodeIndex,e.pttype
|
|
from pq_line a,pq_device b,pq_substation c,offl_log d,pq_linedetail e
|
|
where
|
|
a.sub_index = c.sub_index
|
|
and d.line_index = a.line_index
|
|
and a.line_index = e.line_index
|
|
and d.year = #{year}
|
|
and a.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getOffTypeProJInfo" resultMap="proJResultMap">
|
|
select distinct a.project_index nodeIndex, a.name
|
|
from pq_project a,
|
|
pq_province b,
|
|
pq_gdinformation c,
|
|
pq_device d,
|
|
pq_line e,
|
|
pq_linedetail f
|
|
where b.project_index = a.project_index
|
|
and c.province_index = b.province_index
|
|
and e.gd_index = c.gd_index
|
|
and f.line_index = e.line_index
|
|
and f.loadtype = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getOffTypeProVInfo" resultMap="proVResultMap">
|
|
select distinct a.province_index nodeIndex, a.name name, a.project_index pId
|
|
from pq_province a,
|
|
pq_gdinformation b,
|
|
pq_line c,
|
|
pq_device d,
|
|
pq_linedetail e
|
|
where b.province_index = a.province_index
|
|
and c.gd_index = b.gd_index
|
|
and e.line_index = c.line_index
|
|
and e.loadtype = #{type}
|
|
and c.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getOffTypeSubInfo" resultMap="offsubResultMap">
|
|
select distinct b.province_index pId, a.name name, a.sub_index nodeIndex
|
|
from pq_substation a, pq_province b, pq_gdinformation c ,pq_line d,pq_linedetail e,pq_device f
|
|
where a.gd_index = c.gd_index
|
|
and c.province_index = b.province_index
|
|
and d.sub_index = a.sub_index
|
|
and e.line_index = d.line_index
|
|
and e.loadtype = #{type}
|
|
and d.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getOffTypeLineInfo" resultMap="offlineResultMap">
|
|
select distinct
|
|
a.sub_index pId, a.name name,a.line_index nodeIndex,d.pttype
|
|
from pq_line a,pq_device b,pq_substation c,pq_linedetail d
|
|
where
|
|
a.sub_index = c.sub_index
|
|
and d.line_index = a.line_index
|
|
and d.loadtype = #{type}
|
|
and a.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
<resultMap type="Tree" id="proResultMap" autoMapping="true">
|
|
<id column="province_index" property="nodeIndex"/>
|
|
</resultMap>
|
|
<select id='getTreeProInfo' resultMap='proResultMap' >
|
|
select province_index, name
|
|
from pq_province
|
|
where province_index in
|
|
(select province_index
|
|
from pq_gdinformation
|
|
where gd_index in
|
|
(select gd_index
|
|
from pq_line
|
|
where line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close="))) order by province_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getScaleProVInfo" resultMap="proVResultMap">
|
|
select distinct b.province_index nodeIndex, b.name
|
|
from pq_province b,
|
|
pq_gdinformation c,
|
|
pq_subvoltage d,
|
|
pq_line e
|
|
where c.province_index = b.province_index
|
|
and e.gd_index = c.gd_index
|
|
and e.subv_index = d.subv_index
|
|
and d.scale = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getScaleGdInfo" resultMap="gdResultMap">
|
|
select distinct b.province_index pId,a.gd_index nodeIndex, a.name
|
|
from pq_province b,
|
|
pq_gdinformation a,
|
|
pq_subvoltage d,
|
|
pq_line e
|
|
where b.province_index = a.province_index
|
|
and e.gd_index = a.gd_index
|
|
and e.subv_index = d.subv_index
|
|
and d.scale = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getScaleSubInfo" resultMap="subResultMap">
|
|
select distinct b.gd_index pId,a.sub_index nodeIndex, a.name
|
|
from pq_gdinformation b,
|
|
pq_substation a,
|
|
pq_subvoltage d,
|
|
pq_line e
|
|
where b.gd_index = a.gd_index
|
|
and e.sub_index = a.sub_index
|
|
and e.subv_index = d.subv_index
|
|
and d.scale = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getScaleDevInfo" resultMap="devResultMap">
|
|
select distinct a.sub_index pId,d.dev_index nodeIndex, d.name
|
|
from pq_substation a,
|
|
pq_subvoltage b,
|
|
pq_device d,
|
|
pq_line e
|
|
where d.sub_index = a.sub_index
|
|
and e.dev_index = d.dev_index
|
|
and e.subv_index = b.subv_index
|
|
and b.scale = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getScaleSubvInfo" resultMap="subvResultMap">
|
|
select distinct b.sub_index pId,a.subv_index nodeIndex, a.name
|
|
from pq_subvoltage a,
|
|
pq_substation b,
|
|
pq_device d,
|
|
pq_line e
|
|
where b.sub_index = e.sub_index
|
|
and d.dev_index = a.dev_index
|
|
and e.subv_index = a.subv_index
|
|
and a.scale = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getMancProVInfo" resultMap="proVResultMap">
|
|
select distinct b.province_index nodeIndex, b.name
|
|
from pq_province b,
|
|
pq_devicedetail a,
|
|
pq_gdinformation c,
|
|
pq_subvoltage d,
|
|
pq_line e
|
|
where c.province_index = b.province_index
|
|
and e.gd_index = c.gd_index
|
|
and e.subv_index = d.subv_index
|
|
and a.dev_index = e.dev_index
|
|
and a.manufacturer = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getMancGdInfo" resultMap="gdResultMap">
|
|
select distinct b.province_index pId,a.gd_index nodeIndex, a.name
|
|
from pq_province b,
|
|
pq_gdinformation a,
|
|
pq_devicedetail c,
|
|
pq_subvoltage d,
|
|
pq_line e
|
|
where b.province_index = a.province_index
|
|
and e.gd_index = a.gd_index
|
|
and e.subv_index = d.subv_index
|
|
and c.dev_index = e.dev_index
|
|
and c.manufacturer = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getMancSubInfo" resultMap="subResultMap">
|
|
select distinct b.gd_index pId,a.sub_index nodeIndex, a.name
|
|
from pq_gdinformation b,
|
|
pq_substation a,
|
|
pq_devicedetail c,
|
|
pq_subvoltage d,
|
|
pq_line e
|
|
where b.gd_index = a.gd_index
|
|
and e.sub_index = a.sub_index
|
|
and e.subv_index = d.subv_index
|
|
and c.dev_index = e.dev_index
|
|
and c.manufacturer = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getMancDevInfo" resultMap="devResultMap">
|
|
select distinct a.sub_index pId,d.dev_index nodeIndex, d.name
|
|
from pq_substation a,
|
|
pq_subvoltage b,
|
|
pq_devicedetail c,
|
|
pq_device d,
|
|
pq_line e
|
|
where d.sub_index = a.sub_index
|
|
and e.dev_index = d.dev_index
|
|
and e.subv_index = b.subv_index
|
|
and c.dev_index = e.dev_index
|
|
and c.manufacturer = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getMancSubvInfo" resultMap="subvResultMap">
|
|
select distinct b.sub_index pId,a.subv_index nodeIndex, a.name
|
|
from pq_subvoltage a,
|
|
pq_substation b,
|
|
pq_devicedetail c,
|
|
pq_device d,
|
|
pq_line e
|
|
where b.sub_index = e.sub_index
|
|
and d.dev_index = a.dev_index
|
|
and e.subv_index = a.subv_index
|
|
and c.dev_index = e.dev_index
|
|
and c.manufacturer = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getLoadTypeProVInfo" resultMap="proVResultMap">
|
|
select distinct b.province_index nodeIndex, b.name
|
|
from pq_province b,
|
|
pq_linedetail a,
|
|
pq_gdinformation c,
|
|
pq_subvoltage d,
|
|
pq_line e
|
|
where c.province_index = b.province_index
|
|
and e.gd_index = c.gd_index
|
|
and e.subv_index = d.subv_index
|
|
and a.line_index = e.line_index
|
|
and a.loadtype = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getLoadTypeGdInfo" resultMap="gdResultMap">
|
|
select distinct b.province_index pId,a.gd_index nodeIndex, a.name
|
|
from pq_province b,
|
|
pq_gdinformation a,
|
|
pq_linedetail c,
|
|
pq_subvoltage d,
|
|
pq_line e
|
|
where b.province_index = a.province_index
|
|
and e.gd_index = a.gd_index
|
|
and e.subv_index = d.subv_index
|
|
and c.line_index = e.line_index
|
|
and c.loadtype = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getLoadTypeSubInfo" resultMap="subResultMap">
|
|
select distinct b.gd_index pId,a.sub_index nodeIndex, a.name
|
|
from pq_gdinformation b,
|
|
pq_substation a,
|
|
pq_linedetail c,
|
|
pq_subvoltage d,
|
|
pq_line e
|
|
where b.gd_index = a.gd_index
|
|
and e.sub_index = a.sub_index
|
|
and e.subv_index = d.subv_index
|
|
and c.line_index = e.line_index
|
|
and c.loadtype = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getLoadTypeDevInfo" resultMap="devResultMap">
|
|
select distinct a.sub_index pId,d.dev_index nodeIndex, d.name
|
|
from pq_substation a,
|
|
pq_subvoltage b,
|
|
pq_linedetail c,
|
|
pq_device d,
|
|
pq_line e
|
|
where d.sub_index = a.sub_index
|
|
and e.dev_index = d.dev_index
|
|
and e.subv_index = b.subv_index
|
|
and c.line_index = e.line_index
|
|
and c.loadtype = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getLoadTypeSubvInfo" resultMap="subvResultMap">
|
|
select distinct b.sub_index pId,a.subv_index nodeIndex, a.name
|
|
from pq_subvoltage a,
|
|
pq_substation b,
|
|
pq_linedetail c,
|
|
pq_device d,
|
|
pq_line e
|
|
where b.sub_index = e.sub_index
|
|
and d.dev_index = a.dev_index
|
|
and e.subv_index = a.subv_index
|
|
and c.line_index = e.line_index
|
|
and c.loadtype = #{type}
|
|
and e.line_index in
|
|
<foreach collection="list" index="index" item="item" open="("
|
|
separator="," close=") order by nodeIndex">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<resultMap type="Tree" id="nodesubvResultMap" autoMapping="true">
|
|
<id column="subv_index" property="nodeIndex"/>
|
|
<result column="Sub_index" property="pId"/>
|
|
</resultMap>
|
|
<select id='getNodeTreeSubvInfo' resultMap='nodesubvResultMap'>
|
|
select
|
|
sub_index, name,subv_index,sub_index
|
|
from pq_subvoltage
|
|
where
|
|
subv_index in
|
|
(select subv_index
|
|
from pq_line
|
|
where line_index in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")) order by subv_index">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
</mapper>
|