@ -66,6 +66,9 @@
WHERE
d.DEL_FLAG = '0'
and d.type_key='grid_party'
and d.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
) t
GROUP BY
t.orgId
@ -142,6 +145,9 @@
co.DEL_FLAG = '0'
and gr.DEL_FLAG = '0'
and co.type_key='community_party'
and co.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
) t
GROUP BY
t.orgId
@ -220,6 +226,9 @@
and co.DEL_FLAG = '0'
and gr.DEL_FLAG = '0'
and st.type_key='street_party'
and st.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
) t
GROUP BY
t.orgId
@ -375,6 +384,9 @@
and ei.DEL_FLAG=0
and ei.ITEM_STATE=0
and i.DEL_FLAG=0
and d.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
order by ei.CREATED_TIME desc,i.id
</select>
<select id= "partylinkmassesdata" resultType= "com.elink.esua.epdc.dto.screen.result.PartylinkmassesdataResultDTO" >
@ -398,6 +410,9 @@
where eg.DEL_FLAG=0 and eg.STATE=10
group by eg.GRID_ID)dg on dg.GRID_ID=gr.id
where gr.del_flag=0 and gr.type_key='grid_party'
and gr.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
union all
@ -424,6 +439,89 @@
where gr.del_flag=0
and co.del_flag=0
and co.type_key='community_party'
and co.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
group by co.id
union all
select st.id as orgId,
st.name as orgName,
st.pid as parentId,
'department' as orgType,
sum(IFNULL(dg.createGroupTotal,0)) AS createGroupTotal,
sum(IFNULL(dg.groupUserTotal,0)) AS groupUserTotal
from esua_epdc_admin.sys_dept st
left join esua_epdc_admin.sys_dept co on st.id=co.pid
left join esua_epdc_admin.sys_dept gr on co.id=gr.pid
left join
(select eg.GRID_ID,
count(eg.id) as createGroupTotal,
sum(group_user.userCount) as groupUserTotal
from esua_epdc_group.epdc_group eg
left join (select GROUP_ID,
count(STATE = 10 OR NULL) AS userCount
from esua_epdc_group.epdc_user_group eu
where eu.DEL_FLAG=0
group by GROUP_ID)group_user on group_user.GROUP_ID = eg.id
where eg.DEL_FLAG=0 and eg.STATE=10
group by eg.GRID_ID)dg on dg.GRID_ID=gr.id
where gr.del_flag=0
and co.del_flag=0
and st.del_flag=0
and st.type_key='street_party'select gr.id as orgId,
gr.name as orgName,
gr.pid as parentId,
'grid' as orgType,
IFNULL(dg.createGroupTotal,0) AS createGroupTotal,
IFNULL(dg.groupUserTotal,0) AS groupUserTotal
from esua_epdc_admin.sys_dept gr
left join
(select eg.GRID_ID,
count(eg.id) as createGroupTotal,
sum(group_user.userCount) as groupUserTotal
from esua_epdc_group.epdc_group eg
left join (select GROUP_ID,
count(STATE = 10 OR NULL) AS userCount
from esua_epdc_group.epdc_user_group eu
where eu.DEL_FLAG=0
group by GROUP_ID)group_user on group_user.GROUP_ID = eg.id
where eg.DEL_FLAG=0 and eg.STATE=10
group by eg.GRID_ID)dg on dg.GRID_ID=gr.id
where gr.del_flag=0 and gr.type_key='grid_party'
and gr.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
union all
select co.id as orgId,
co.name as orgName,
co.pid as parentId,
'department' as orgType,
sum(IFNULL(dg.createGroupTotal,0)) AS createGroupTotal,
sum(IFNULL(dg.groupUserTotal,0)) AS groupUserTotal
from esua_epdc_admin.sys_dept co
left join esua_epdc_admin.sys_dept gr on co.id=gr.pid
left join
(select eg.GRID_ID,
count(eg.id) as createGroupTotal,
sum(group_user.userCount) as groupUserTotal
from esua_epdc_group.epdc_group eg
left join (select GROUP_ID,
count(STATE = 10 OR NULL) AS userCount
from esua_epdc_group.epdc_user_group eu
where eu.DEL_FLAG=0
group by GROUP_ID)group_user on group_user.GROUP_ID = eg.id
where eg.DEL_FLAG=0 and eg.STATE=10
group by eg.GRID_ID)dg on dg.GRID_ID=gr.id
where gr.del_flag=0
and co.del_flag=0
and co.type_key='community_party'
and co.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
group by co.id
union all
@ -453,6 +551,44 @@
and co.del_flag=0
and st.del_flag=0
and st.type_key='street_party'
and st.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
group by st.id
union all
select city.id as orgId,
city.name as orgName,
city.pid as parentId,
'department' as orgType,
sum(IFNULL(dg.createGroupTotal,0)) AS createGroupTotal,
sum(IFNULL(dg.groupUserTotal,0)) AS groupUserTotal
from esua_epdc_admin.sys_dept city
left join esua_epdc_admin.sys_dept st on city.id=st.pid
left join esua_epdc_admin.sys_dept co on st.id=co.pid
left join esua_epdc_admin.sys_dept gr on co.id=gr.pid
left join
(select eg.GRID_ID,
count(eg.id) as createGroupTotal,
sum(group_user.userCount) as groupUserTotal
from esua_epdc_group.epdc_group eg
left join (select GROUP_ID,
count(STATE = 10 OR NULL) AS userCount
from esua_epdc_group.epdc_user_group eu
where eu.DEL_FLAG=0
group by GROUP_ID)group_user on group_user.GROUP_ID = eg.id
where eg.DEL_FLAG=0 and eg.STATE=10
group by eg.GRID_ID)dg on dg.GRID_ID=gr.id
where gr.del_flag=0
and co.del_flag=0
and st.del_flag=0
and city.del_flag=0
and city.type_key='district_party' and city.party_code='shibei'
group by city.id
and st.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
group by st.id
union all
@ -559,6 +695,9 @@
group by total.GRID_ID)t on gr.id=t.GRID_ID
where gr.del_flag=0
and gr.type_key='grid_party'
and gr.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
UNION ALL
@ -637,6 +776,9 @@
where gr.del_flag=0
and co.del_flag=0
and co.type_key='community_party'
and co.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
GROUP BY co.id
union all
@ -717,6 +859,9 @@
and co.del_flag=0
and st.del_flag=0
and st.type_key='street_party'
and st.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
GROUP BY st.id
union all
@ -893,6 +1038,9 @@
group by total.GRID_ID)t on gr.id=t.GRID_ID
where gr.del_flag=0
and gr.type_key='grid_party'
and gr.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
UNION ALL
@ -989,6 +1137,9 @@
where gr.del_flag=0
and co.del_flag=0
and co.type_key='community_party'
and co.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
GROUP BY co.id
union all
@ -1088,6 +1239,9 @@
and co.del_flag=0
and st.del_flag=0
and st.type_key='street_party'
and st.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
GROUP BY st.id
union all
@ -1191,4 +1345,336 @@
and city.type_key='district_party' and city.party_code='shibei'
GROUP BY city.id
</select>
<select id= "meetdata" resultType= "com.elink.esua.epdc.dto.screen.result.MeetdataResultDTO" >
select d.id as orgId,
d.name as orgName,
d.pid as parentId,
date_format( now( ), '%Y' ) as yearId,
date_format( now( ), '%Y-%m' ) as monthId,
(CASE WHEN ed.DAILY_TYPE='10' THEN 'party'
WHEN ed.DAILY_TYPE='20' THEN 'union'
WHEN ed.DAILY_TYPE='30' THEN 'voluntaryservice' end) as type,
ed.MEET_TYPE as meetCategoryId,
me.RESOURCE_LABEL as meetCategoryName,
count(ed.id) as organizeCount,
IFNULL(sum(ed.JOIN_NUM),0) as joinUserCount,
IFNULL(round(IFNULL(sum(ed.JOIN_NUM),0)/count(ed.id),0),0) as averageJoinUserCount
FROM esua_epdc_admin.sys_dept d
left join (select id,
DAILY_TYPE,
if(DAILY_TYPE='30','30',MEET_TYPE) as MEET_TYPE,
DEPT_ID,
JOIN_NUM,
DEL_FLAG
from esua_epdc_workrecord.epdc_daily_record_info
where date_format( CREATED_TIME, '%Y-%m' ) = date_format( now( ), '%Y-%m' ) )ed on ed.DEPT_ID=d.id
left join esua_epdc_workrecord.epdc_resources_dictionary me on me.RESOURCE_CODE=ed.MEET_TYPE
WHERE d.DEL_FLAG=0
and ed.DEL_FLAG=0
and d.type_key='grid_party'
and d.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
group by ed.DEPT_ID,ed.DAILY_TYPE,ed.MEET_TYPE
union all -- 社区
select community.orgId,
community.orgName,
community.parentId,
community.yearId,
community.monthId,
community.type,
community.meetCategoryId,
community.meetCategoryName,
SUM(community.organizeCount) AS organizeCount,
SUM(community.joinUserCount) AS joinUserCount,
IFNULL(round(SUM(community.joinUserCount)/SUM(community.organizeCount),0),0) as averageJoinUserCount
from
(select co.id as orgId,
co.name as orgName,
co.pid as parentId,
date_format( now( ), '%Y' ) as yearId,
date_format( now( ), '%Y-%m' ) as monthId,
ed.DAILY_TYPE,
(CASE WHEN ed.DAILY_TYPE='10' THEN 'party'
WHEN ed.DAILY_TYPE='20' THEN 'union'
WHEN ed.DAILY_TYPE='30' THEN 'voluntaryservice' end) as type,
ed.MEET_TYPE as meetCategoryId,
me.RESOURCE_LABEL as meetCategoryName,
count(ed.id) as organizeCount,
IFNULL(sum(ed.JOIN_NUM),0) as joinUserCount
FROM esua_epdc_admin.sys_dept co
left join esua_epdc_admin.sys_dept gr on co.id=gr.pid
left join (select id,
DAILY_TYPE,
if(DAILY_TYPE='30','30',MEET_TYPE) as MEET_TYPE,
DEPT_ID,
JOIN_NUM,
DEL_FLAG
from esua_epdc_workrecord.epdc_daily_record_info
where date_format( CREATED_TIME, '%Y-%m' ) = date_format( now( ), '%Y-%m' ) )ed on ed.DEPT_ID=gr.id
left join esua_epdc_workrecord.epdc_resources_dictionary me on me.RESOURCE_CODE=ed.MEET_TYPE
WHERE gr.DEL_FLAG=0
and co.DEL_FLAG=0
and ed.DEL_FLAG=0
and co.type_key='community_party'
and co.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
group by co.id,ed.DAILY_TYPE,ed.MEET_TYPE
union all
select d.id as orgId,
d.name as orgName,
d.pid as parentId,
date_format( now( ), '%Y' ) as yearId,
date_format( now( ), '%Y-%m' ) as monthId,
ed.DAILY_TYPE,
(CASE WHEN ed.DAILY_TYPE='10' THEN 'party'
WHEN ed.DAILY_TYPE='20' THEN 'union'
WHEN ed.DAILY_TYPE='30' THEN 'voluntaryservice' end) as type,
ed.MEET_TYPE as meetCategoryId,
me.RESOURCE_LABEL as meetCategoryName,
count(ed.id) as organizeCount,
IFNULL(sum(ed.JOIN_NUM),0) as joinUserCount
FROM esua_epdc_admin.sys_dept d
left join (select id,
DAILY_TYPE,
if(DAILY_TYPE='30','30',MEET_TYPE) as MEET_TYPE,
DEPT_ID,
JOIN_NUM,
DEL_FLAG
from esua_epdc_workrecord.epdc_daily_record_info
where date_format( CREATED_TIME, '%Y-%m' ) = date_format( now( ), '%Y-%m' ) )ed on ed.DEPT_ID=d.id
left join esua_epdc_workrecord.epdc_resources_dictionary me on me.RESOURCE_CODE=ed.MEET_TYPE
WHERE d.DEL_FLAG=0
and ed.DEL_FLAG=0
and d.type_key='community_party'
and d.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
group by ed.DEPT_ID,ed.DAILY_TYPE,ed.MEET_TYPE)community
group by community.orgId,community.DAILY_TYPE,community.meetCategoryId
union all -- 街道
select street.orgId,
street.orgName,
street.parentId,
street.yearId,
street.monthId,
street.type,
street.meetCategoryId,
street.meetCategoryName,
SUM(street.organizeCount) AS organizeCount,
SUM(street.joinUserCount) AS joinUserCount,
IFNULL(round(SUM(street.joinUserCount)/SUM(street.organizeCount),0),0) as averageJoinUserCount
from
(select st.id as orgId,
st.name as orgName,
st.pid as parentId,
date_format( now( ), '%Y' ) as yearId,
date_format( now( ), '%Y-%m' ) as monthId,
ed.DAILY_TYPE,
(CASE WHEN ed.DAILY_TYPE='10' THEN 'party'
WHEN ed.DAILY_TYPE='20' THEN 'union'
WHEN ed.DAILY_TYPE='30' THEN 'voluntaryservice' end) as type,
ed.MEET_TYPE as meetCategoryId,
me.RESOURCE_LABEL as meetCategoryName,
count(ed.id) as organizeCount,
IFNULL(sum(ed.JOIN_NUM),0) as joinUserCount
FROM esua_epdc_admin.sys_dept st
left join esua_epdc_admin.sys_dept co on co.pid=st.id
left join esua_epdc_admin.sys_dept gr on co.id=gr.pid
left join (select id,
DAILY_TYPE,
if(DAILY_TYPE='30','30',MEET_TYPE) as MEET_TYPE,
DEPT_ID,
JOIN_NUM,
DEL_FLAG
from esua_epdc_workrecord.epdc_daily_record_info
where date_format( CREATED_TIME, '%Y-%m' ) = date_format( now( ), '%Y-%m' ) )ed on ed.DEPT_ID=gr.id
left join esua_epdc_workrecord.epdc_resources_dictionary me on me.RESOURCE_CODE=ed.MEET_TYPE
WHERE gr.DEL_FLAG=0
and co.DEL_FLAG=0
and ed.DEL_FLAG=0
and st.DEL_FLAG=0
and st.type_key='street_party'
and st.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
group by st.id,ed.DAILY_TYPE,ed.MEET_TYPE
union all
select d.id as orgId,
d.name as orgName,
d.pid as parentId,
date_format( now( ), '%Y' ) as yearId,
date_format( now( ), '%Y-%m' ) as monthId,
ed.DAILY_TYPE,
(CASE WHEN ed.DAILY_TYPE='10' THEN 'party'
WHEN ed.DAILY_TYPE='20' THEN 'union'
WHEN ed.DAILY_TYPE='30' THEN 'voluntaryservice' end) as type,
ed.MEET_TYPE as meetCategoryId,
me.RESOURCE_LABEL as meetCategoryName,
count(ed.id) as organizeCount,
IFNULL(sum(ed.JOIN_NUM),0) as joinUserCount
FROM esua_epdc_admin.sys_dept d
left join (select id,
DAILY_TYPE,
if(DAILY_TYPE='30','30',MEET_TYPE) as MEET_TYPE,
DEPT_ID,
JOIN_NUM,
DEL_FLAG
from esua_epdc_workrecord.epdc_daily_record_info
where date_format( CREATED_TIME, '%Y-%m' ) = date_format( now( ), '%Y-%m' ) )ed on ed.DEPT_ID=d.id
left join esua_epdc_workrecord.epdc_resources_dictionary me on me.RESOURCE_CODE=ed.MEET_TYPE
WHERE d.DEL_FLAG=0
and ed.DEL_FLAG=0
and d.type_key='street_party'
and d.id not in ('1191534129122230274','1191534416067149825','1191535301279203329','1191535501527859202',
'1191535697380884481','1192004624745586689','1230704850994528257',
'1201319745506598913','1201687651826360321','1201689212329746433')
group by ed.DEPT_ID,ed.DAILY_TYPE,ed.MEET_TYPE)street
group by street.orgId,street.DAILY_TYPE,street.meetCategoryId
union all -- 市北区
select city.orgId,
city.orgName,
city.parentId,
city.yearId,
city.monthId,
city.type,
city.meetCategoryId,
city.meetCategoryName,
SUM(city.organizeCount) AS organizeCount,
SUM(city.joinUserCount) AS joinUserCount,
IFNULL(round(SUM(city.joinUserCount)/SUM(city.organizeCount),0),0) as averageJoinUserCount
from
(select city.id as orgId,
city.name as orgName,
city.pid as parentId,
date_format( now( ), '%Y' ) as yearId,
date_format( now( ), '%Y-%m' ) as monthId,
ed.DAILY_TYPE,
(CASE WHEN ed.DAILY_TYPE='10' THEN 'party'
WHEN ed.DAILY_TYPE='20' THEN 'union'
WHEN ed.DAILY_TYPE='30' THEN 'voluntaryservice' end) as type,
ed.MEET_TYPE as meetCategoryId,
me.RESOURCE_LABEL as meetCategoryName,
count(ed.id) as organizeCount,
IFNULL(sum(ed.JOIN_NUM),0) as joinUserCount
FROM esua_epdc_admin.sys_dept city
left join esua_epdc_admin.sys_dept st on st.pid=city.id
left join esua_epdc_admin.sys_dept co on co.pid=st.id
left join esua_epdc_admin.sys_dept gr on co.id=gr.pid
left join (select id,
DAILY_TYPE,
if(DAILY_TYPE='30','30',MEET_TYPE) as MEET_TYPE,
DEPT_ID,
JOIN_NUM,
DEL_FLAG
from esua_epdc_workrecord.epdc_daily_record_info
where date_format( CREATED_TIME, '%Y-%m' ) = date_format( now( ), '%Y-%m' ) )ed on ed.DEPT_ID=gr.id
left join esua_epdc_workrecord.epdc_resources_dictionary me on me.RESOURCE_CODE=ed.MEET_TYPE
WHERE gr.DEL_FLAG=0
and co.DEL_FLAG=0
and ed.DEL_FLAG=0
and st.DEL_FLAG=0
and city.type_key='district_party' and city.party_code='shibei'
group by city.id,ed.DAILY_TYPE,ed.MEET_TYPE
union all
select d.id as orgId,
d.name as orgName,
d.pid as parentId,
date_format( now( ), '%Y' ) as yearId,
date_format( now( ), '%Y-%m' ) as monthId,
ed.DAILY_TYPE,
(CASE WHEN ed.DAILY_TYPE='10' THEN 'party'
WHEN ed.DAILY_TYPE='20' THEN 'union'
WHEN ed.DAILY_TYPE='30' THEN 'voluntaryservice' end) as type,
ed.MEET_TYPE as meetCategoryId,
me.RESOURCE_LABEL as meetCategoryName,
count(ed.id) as organizeCount,
IFNULL(sum(ed.JOIN_NUM),0) as joinUserCount
FROM esua_epdc_admin.sys_dept d
left join (select id,
DAILY_TYPE,
if(DAILY_TYPE='30','30',MEET_TYPE) as MEET_TYPE,
DEPT_ID,
JOIN_NUM,
DEL_FLAG
from esua_epdc_workrecord.epdc_daily_record_info
where date_format( CREATED_TIME, '%Y-%m' ) = date_format( now( ), '%Y-%m' ) )ed on ed.DEPT_ID=d.id
left join esua_epdc_workrecord.epdc_resources_dictionary me on me.RESOURCE_CODE=ed.MEET_TYPE
WHERE d.DEL_FLAG=0
and ed.DEL_FLAG=0
and d.type_key='district_party' and d.party_code='shibei'
group by ed.DEPT_ID,ed.DAILY_TYPE,ed.MEET_TYPE)city
group by city.orgId,city.DAILY_TYPE,city.meetCategoryId
</select>
<select id= "customergrid" resultType= "com.elink.esua.epdc.dto.screen.result.CustomergridResultDTO" >
select
sd.ID gridId,
sd.NAME gridName,
sd.PID parentAgencyId,
sd.area_marks areaMarks,
sd.center_mark centerMark,
'' partyMark
from esua_epdc_admin.sys_dept_temp sd
left join esua_epdc_admin.sys_dept d1 on d1.ID = sd.ID
left join esua_epdc_admin.sys_dept d2 on d2.ID = d1.PID
left join esua_epdc_admin.sys_dept d3 on d3.ID = d2.PID
left join esua_epdc_admin.sys_dept d4 on d4.ID = d3.PID
where
sd.DEL_FLAG = '0'
and sd.type_key in ('grid_party')
and sd.ID not in ('1191534129122230274',
'1191534416067149825',
'1191535301279203329',
'1191535501527859202',
'1191535697380884481',
'1192004624745586689',
'1230704850994528257',
'1201319745506598913',
'1201687651826360321',
'1201689212329746433')
</select>
<select id= "customeragency" resultType= "com.elink.esua.epdc.dto.screen.result.CustomeragencyResultDTO" >
select
sd.ID agencyId,
sd.NAME agencyName,
sd.PID pid,
sd.pids pids,
concat(if(d4.name is null,'',concat(IFNULL(d4.name,''),'-')),if(d3.name is null,'',concat(IFNULL(d3.name,''),'-')),IFNULL(d2.name,'')) allParentNames ,
sd.area_marks areaMarks,
sd.center_mark centerMark,
'' partyMark,
sd.type_key level,
'' areaCode
from esua_epdc_admin.sys_dept_temp sd
left join esua_epdc_admin.sys_dept d1 on d1.ID = sd.ID
left join esua_epdc_admin.sys_dept d2 on d2.ID = d1.PID
left join esua_epdc_admin.sys_dept d3 on d3.ID = d2.PID
left join esua_epdc_admin.sys_dept d4 on d4.ID = d3.PID
where
sd.DEL_FLAG = '0'
and sd.type_key in ('district_party','street_party','community_party')
and sd.party_code != '001'
and sd.ID not in ('1191534129122230274',
'1191534416067149825',
'1191535301279203329',
'1191535501527859202',
'1191535697380884481',
'1192004624745586689',
'1230704850994528257',
'1201319745506598913',
'1201687651826360321',
'1201689212329746433')
</select>
</mapper>