|
|
|
<?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.epmet.plugin.power.modules.axis.dao.PowerAxisStructDao">
|
|
|
|
|
|
|
|
<resultMap type="com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity" id="powerAxisStructMap">
|
|
|
|
<result property="id" column="ID"/>
|
|
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
|
|
<result property="name" column="NAME"/>
|
|
|
|
<result property="agencyId" column="AGENCY_ID"/>
|
|
|
|
<result property="agencyName" column="AGENCY_NAME"/>
|
|
|
|
<result property="agencyType" column="AGENCY_TYPE"/>
|
|
|
|
<result property="pid" column="PID"/>
|
|
|
|
<result property="pids" column="PIDS"/>
|
|
|
|
<result property="categoryCode" column="CATEGORY_CODE"/>
|
|
|
|
<result property="sort" column="SORT"/>
|
|
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
|
|
<result property="revision" column="REVISION"/>
|
|
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
|
|
</resultMap>
|
|
|
|
<delete id="delete">
|
|
|
|
DELETE
|
|
|
|
FROM
|
|
|
|
pli_power_axis_struct
|
|
|
|
WHERE
|
|
|
|
id = #{id}
|
|
|
|
AND
|
|
|
|
del_flag = 0
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectAllForTree"
|
|
|
|
resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructLeaderResultDTO">
|
|
|
|
select
|
|
|
|
s.ID,
|
|
|
|
s.NAME,
|
|
|
|
s.PID,
|
|
|
|
s.PIDS,
|
|
|
|
s.CATEGORY_CODE,
|
|
|
|
s.SORT,
|
|
|
|
s.CREATED_TIME,
|
|
|
|
sl.LEADER_ID,
|
|
|
|
l.NAME as LEADER_NAME,
|
|
|
|
l.MOBILE as LEADER_MOBILE,
|
|
|
|
t.STRUCT_LEVEL
|
|
|
|
from pli_power_axis_struct s
|
|
|
|
left join pli_power_axis_struct_leader sl on s.ID = sl.STRUCT_REFERENCE_ID
|
|
|
|
left join pli_power_axis_leader l on l.ID = sl.LEADER_ID
|
|
|
|
left join pli_power_axis_tag t on s.CATEGORY_CODE = t.CATEGORY_CODE
|
|
|
|
where s.DEL_FLAG = '0'
|
|
|
|
<if test="agencyId != null and agencyId != ''">
|
|
|
|
and s.AGENCY_ID = #{agencyId}
|
|
|
|
</if>
|
|
|
|
<if test="axisName != null and axisName != ''">
|
|
|
|
and s.NAME like '%${axisName}%'
|
|
|
|
</if>
|
|
|
|
<if test="leaderName != null and leaderName != ''">
|
|
|
|
and l.NAME like '%${leaderName}%'
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="queryDeptByName" resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO">
|
|
|
|
SELECT
|
|
|
|
CUSTOMER_ID,
|
|
|
|
NAME,
|
|
|
|
AGENCY_ID,
|
|
|
|
AGENCY_NAME,
|
|
|
|
AGENCY_TYPE,
|
|
|
|
PID,
|
|
|
|
PIDS,
|
|
|
|
CATEGORY_CODE
|
|
|
|
FROM
|
|
|
|
pli_power_axis_struct
|
|
|
|
<where>
|
|
|
|
1 = 1
|
|
|
|
<if test="name != null and name != ''">
|
|
|
|
and NAME = #{name}
|
|
|
|
</if>
|
|
|
|
<if test="agencyId != null and agencyId != ''">
|
|
|
|
and AGENCY_ID = #{agencyId}
|
|
|
|
</if>
|
|
|
|
and del_flag = 0
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="queryList" resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructListResultDTO">
|
|
|
|
SELECT
|
|
|
|
*
|
|
|
|
FROM
|
|
|
|
pli_power_axis_struct
|
|
|
|
where del_flag = 0
|
|
|
|
</select>
|
|
|
|
<select id="getGridPartyBranchList"
|
|
|
|
resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructGridPartyBranchResultDTO">
|
|
|
|
SELECT
|
|
|
|
id,
|
|
|
|
NAME
|
|
|
|
FROM
|
|
|
|
pli_power_axis_struct
|
|
|
|
WHERE
|
|
|
|
CATEGORY_CODE = 'grid_party'
|
|
|
|
AND
|
|
|
|
del_flag = 0
|
|
|
|
</select>
|
|
|
|
<select id="getPid" resultType="java.lang.String">
|
|
|
|
SELECT
|
|
|
|
id AS pid
|
|
|
|
FROM
|
|
|
|
( SELECT
|
|
|
|
id
|
|
|
|
FROM
|
|
|
|
pli_power_axis_struct
|
|
|
|
WHERE
|
|
|
|
CATEGORY_CODE = 'community_party' )
|
|
|
|
AS a
|
|
|
|
</select>
|
|
|
|
<select id="getPartyCommList"
|
|
|
|
resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructPartyCommResultDTO">
|
|
|
|
SELECT
|
|
|
|
id,
|
|
|
|
NAME
|
|
|
|
FROM
|
|
|
|
pli_power_axis_struct
|
|
|
|
WHERE
|
|
|
|
CATEGORY_CODE = 'community_party'
|
|
|
|
AND
|
|
|
|
del_flag = 0
|
|
|
|
</select>
|
|
|
|
<select id="queryName" resultType="java.lang.Integer">
|
|
|
|
SELECT
|
|
|
|
count(*)
|
|
|
|
FROM
|
|
|
|
pli_power_axis_struct
|
|
|
|
WHERE
|
|
|
|
NAME = #{name}
|
|
|
|
AND
|
|
|
|
pid = #{pid}
|
|
|
|
</select>
|
|
|
|
<select id="queryCategory" resultType="java.lang.Integer">
|
|
|
|
SELECT
|
|
|
|
count(*)
|
|
|
|
FROM
|
|
|
|
pli_power_axis_struct
|
|
|
|
WHERE
|
|
|
|
AGENCY_ID = #{agencyId}
|
|
|
|
</select>
|
|
|
|
<select id="getIdsByAgencyId" resultType="java.lang.String">
|
|
|
|
select id from pli_power_axis_struct where agency_id = #{agencyId}
|
|
|
|
</select>
|
|
|
|
<select id="getListByCategoryCode"
|
|
|
|
resultType="com.epmet.plugin.power.dto.axis.result.PowerAixsStructListByCategoryResultDTO">
|
|
|
|
SELECT
|
|
|
|
id,
|
|
|
|
NAME
|
|
|
|
FROM
|
|
|
|
pli_power_axis_struct
|
|
|
|
WHERE
|
|
|
|
AGENCY_ID = #{agencyId}
|
|
|
|
and
|
|
|
|
CATEGORY_CODE = #{categoryCode}
|
|
|
|
</select>
|
|
|
|
<select id="queryGridParty" resultType="java.lang.Integer">
|
|
|
|
SELECT
|
|
|
|
count(*)
|
|
|
|
FROM
|
|
|
|
pli_power_axis_struct
|
|
|
|
WHERE
|
|
|
|
AGENCY_ID = #{agencyId}
|
|
|
|
AND
|
|
|
|
CATEGORY_CODE = 'grid_party'
|
|
|
|
</select>
|
|
|
|
<select id="queryGroupParty" resultType="java.lang.Integer">
|
|
|
|
SELECT
|
|
|
|
count(*)
|
|
|
|
FROM
|
|
|
|
pli_power_axis_struct
|
|
|
|
WHERE
|
|
|
|
AGENCY_ID = #{agencyId}
|
|
|
|
AND
|
|
|
|
CATEGORY_CODE = 'group_party'
|
|
|
|
</select>
|
|
|
|
<select id="getKernelHouseHold" resultType="java.lang.Integer">
|
|
|
|
select count(*) from pli_power_kernel_household
|
|
|
|
</select>
|
|
|
|
<select id="getServiceStation" resultType="java.lang.Integer">
|
|
|
|
select count(*) from pli_power_service_station
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|