|
|
@ -35,17 +35,17 @@ |
|
|
|
<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 |
|
|
|
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 and sl.del_flag = '0' |
|
|
|
left join pli_power_axis_leader l on l.ID = sl.LEADER_ID and l.del_flag = '0' |
|
|
@ -66,16 +66,16 @@ |
|
|
|
|
|
|
|
<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 |
|
|
|
CUSTOMER_ID, |
|
|
|
NAME, |
|
|
|
AGENCY_ID, |
|
|
|
AGENCY_NAME, |
|
|
|
AGENCY_TYPE, |
|
|
|
PID, |
|
|
|
PIDS, |
|
|
|
CATEGORY_CODE |
|
|
|
FROM |
|
|
|
pli_power_axis_struct |
|
|
|
pli_power_axis_struct |
|
|
|
<where> |
|
|
|
1 = 1 |
|
|
|
<if test="name != null and name != ''"> |
|
|
@ -84,38 +84,38 @@ |
|
|
|
<if test="agencyId != null and agencyId != ''"> |
|
|
|
and AGENCY_ID = #{agencyId} |
|
|
|
</if> |
|
|
|
and del_flag = 0 |
|
|
|
and customer_id = #{customerId} |
|
|
|
and del_flag = 0 |
|
|
|
and customer_id = #{customerId} |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="countRepeatStructByName" resultType="java.lang.Integer"> |
|
|
|
SELECT |
|
|
|
count(*) |
|
|
|
count(*) |
|
|
|
FROM |
|
|
|
pli_power_axis_struct s |
|
|
|
pli_power_axis_struct s |
|
|
|
WHERE |
|
|
|
s.CUSTOMER_ID = #{customerId} |
|
|
|
AND s.`NAME` = #{name} |
|
|
|
<choose> |
|
|
|
<when test="agencyId != null and agencyId != ''">AND s.AGENCY_ID = #{agencyId}</when> |
|
|
|
<otherwise> |
|
|
|
<if test="pid != null and pid != '' and pid != '0'"> |
|
|
|
AND s.AGENCY_ID = (SELECT t.agency_id FROM pli_power_axis_struct t WHERE t.ID = #{pid}) |
|
|
|
</if> |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
<if test="id != null and id != ''">AND s.ID != #{id}</if> |
|
|
|
<if test="pid != null and pid != ''">AND s.pid = #{pid}</if> |
|
|
|
s.CUSTOMER_ID = #{customerId} |
|
|
|
AND s.`NAME` = #{name} |
|
|
|
<choose> |
|
|
|
<when test="agencyId != null and agencyId != ''">AND s.AGENCY_ID = #{agencyId}</when> |
|
|
|
<otherwise> |
|
|
|
<if test="pid != null and pid != '' and pid != '0'"> |
|
|
|
AND s.AGENCY_ID = (SELECT t.agency_id FROM pli_power_axis_struct t WHERE t.ID = #{pid}) |
|
|
|
</if> |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
<if test="id != null and id != ''">AND s.ID != #{id}</if> |
|
|
|
<if test="pid != null and pid != ''">AND s.pid = #{pid}</if> |
|
|
|
</select> |
|
|
|
<select id="countRepeatStructByCategory" resultType="java.lang.Integer"> |
|
|
|
SELECT |
|
|
|
count(*) |
|
|
|
count(*) |
|
|
|
FROM |
|
|
|
pli_power_axis_struct |
|
|
|
pli_power_axis_struct |
|
|
|
WHERE |
|
|
|
AGENCY_ID = #{agencyId} and CUSTOMER_ID = #{customerId} and CATEGORY_CODE = #{categoryCode} |
|
|
|
<if test="id != null and id != ''">AND id != #{id}</if> |
|
|
|
AGENCY_ID = #{agencyId} and CUSTOMER_ID = #{customerId} and CATEGORY_CODE = #{categoryCode} |
|
|
|
<if test="id != null and id != ''">AND id != #{id}</if> |
|
|
|
</select> |
|
|
|
<select id="getIdsByAgencyId" resultType="java.lang.String"> |
|
|
|
select id from pli_power_axis_struct where agency_id = #{agencyId} and customer_id = #{customerId} |
|
|
@ -131,6 +131,7 @@ |
|
|
|
CATEGORY_CODE = #{gridCateGoryCode} |
|
|
|
AND |
|
|
|
customer_id = #{customerId} |
|
|
|
AND del_flag = '0' |
|
|
|
</select> |
|
|
|
<select id="queryGroupParty" resultType="java.lang.Integer"> |
|
|
|
SELECT |
|
|
@ -143,17 +144,20 @@ |
|
|
|
CATEGORY_CODE = #{groupCateGoryCode} |
|
|
|
AND |
|
|
|
customer_id = #{customerId} |
|
|
|
AND del_flag = '0' |
|
|
|
</select> |
|
|
|
<select id="getKernelHouseHold" resultType="java.lang.Integer"> |
|
|
|
|
|
|
|
<select id="getServiceStation" resultType="java.lang.Integer"> |
|
|
|
SELECT |
|
|
|
count( DISTINCT HOUSE_ID ) |
|
|
|
count(*) |
|
|
|
FROM |
|
|
|
pli_power_kernel_household |
|
|
|
pli_power_service_station h |
|
|
|
LEFT JOIN pli_power_axis_struct s ON h.STRUCT_REFERENCE_ID = s.ID |
|
|
|
AND s.DEL_FLAG = '0' |
|
|
|
WHERE |
|
|
|
del_flag = '0' |
|
|
|
</select> |
|
|
|
<select id="getServiceStation" resultType="java.lang.Integer"> |
|
|
|
select count(*) from pli_power_service_station where del_flag = '0' |
|
|
|
h.del_flag = '0' |
|
|
|
AND s.AGENCY_ID = #{agencyId} |
|
|
|
AND h.CUSTOMER_ID = #{customerId} |
|
|
|
</select> |
|
|
|
<select id="getStructTree" |
|
|
|
resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructTreeResultDTO"> |
|
|
@ -228,6 +232,18 @@ |
|
|
|
AND |
|
|
|
STRUCT_LEVEL = #{level} |
|
|
|
</select> |
|
|
|
<select id="getKernelHouseHold" resultType="java.lang.Integer"> |
|
|
|
SELECT |
|
|
|
count( DISTINCT HOUSE_ID ) |
|
|
|
FROM |
|
|
|
pli_power_kernel_household h |
|
|
|
LEFT JOIN pli_power_axis_struct s ON h.STRUCT_REFERENCE_ID = s.ID |
|
|
|
AND s.DEL_FLAG = '0' |
|
|
|
WHERE |
|
|
|
h.del_flag = '0' |
|
|
|
AND s.AGENCY_ID = #{agencyId} |
|
|
|
AND h.CUSTOMER_ID = #{customerId} |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |