from esua_epdc_party_group.epdc_party_user_group eu
where eu.DEL_FLAG=0
group by GROUP_ID)group_user on group_user.GROUP_ID = eg.id
group by PARTY_GROUP_ID)group_user on group_user.PARTY_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
group by eg.DEPT_ID)dg on dg.GRID_ID=gr.id
where gr.del_flag=0
AND gr.`id` NOT IN( SELECT t.`dept_id`
FROM `esua_epdc_admin`.`sys_dept_config` t
@ -1357,17 +1356,17 @@ select gr.id as orgId,
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,
(select eg.DEPT_ID as 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,
from esua_epdc_party_group.epdc_party_group eg
left join (select PARTY_GROUP_ID,
count(STATE = 10 OR NULL) AS userCount
from esua_epdc_group.epdc_user_group eu
from esua_epdc_party_group.epdc_party_user_group eu
where eu.DEL_FLAG=0
group by GROUP_ID)group_user on group_user.GROUP_ID = eg.id
group by PARTY_GROUP_ID)group_user on group_user.PARTY_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
group by eg.DEPT_ID)dg on dg.GRID_ID=gr.id
where gr.del_flag=0
and co.del_flag=0
AND co.`id` NOT IN( SELECT t.`dept_id`
@ -1390,17 +1389,17 @@ select gr.id as orgId,
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,
(select eg.DEPT_ID as 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,
from esua_epdc_party_group.epdc_party_group eg
left join (select PARTY_GROUP_ID,
count(STATE = 10 OR NULL) AS userCount
from esua_epdc_group.epdc_user_group eu
from esua_epdc_party_group.epdc_party_user_group eu
where eu.DEL_FLAG=0
group by GROUP_ID)group_user on group_user.GROUP_ID = eg.id
group by PARTY_GROUP_ID)group_user on group_user.PARTY_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
group by eg.DEPT_ID)dg on dg.GRID_ID=gr.id
where gr.del_flag=0
and co.del_flag=0
and st.del_flag=0
@ -1422,17 +1421,17 @@ select gr.id as orgId,
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,
(select eg.DEPT_ID as 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,
from esua_epdc_party_group.epdc_party_group eg
left join (select PARTY_GROUP_ID,
count(STATE = 10 OR NULL) AS userCount
from esua_epdc_group.epdc_user_group eu
from esua_epdc_party_group.epdc_party_user_group eu
where eu.DEL_FLAG=0
group by GROUP_ID)group_user on group_user.GROUP_ID = eg.id
group by PARTY_GROUP_ID)group_user on group_user.PARTY_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
group by eg.DEPT_ID)dg on dg.GRID_ID=gr.id
where gr.del_flag=0
and co.del_flag=0
and st.del_flag=0
@ -1477,10 +1476,10 @@ select gr.id as orgId,
(
select
count(*) groupTotal
from esua_epdc_group.epdc_group ws
from esua_epdc_party_group.epdc_party_group ws
where ws.DEL_FLAG = '0' and date_format(ws.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ),'%Y-%m' )
) groupTotal,
(select count(*) topicTotal from esua_epdc_group.epdc_topic top where top.DEL_FLAG = '0' and date_format(top.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) ) topicTotal,
(select count(*) topicTotal from esua_epdc_party_group.epdc_party_topic top where top.DEL_FLAG = '0' and date_format(top.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) ) topicTotal,
(
SELECT
count( t.a ) issueTotal
@ -1554,11 +1553,11 @@ select gr.id as orgId,
from (
SELECT
sum( info.STATE = 10 ) as num,
info.GRID_ID
info.DEPT_ID as GRID_ID
FROM
esua_epdc_group.epdc_group info
esua_epdc_party_group.epdc_party_group info
GROUP BY
info.GRID_ID
info.DEPT_ID
) daily
left join esua_epdc_admin.sys_dept dept on dept.id = daily.GRID_ID
left join esua_epdc_admin.sys_dept dept2 on dept2.id = dept.PID
@ -1568,7 +1567,7 @@ select gr.id as orgId,
) tto on tto.DEPT_ID = sd.ID
left join (
select sum(topn.topNum) topNum ,d2.PID DEPT_ID from
( select top.GRID_ID ,count(*) topNum from esua_epdc_group.epdc_topic top where top.DEL_FLAG = '0'
( select top.GRID_ID ,count(*) topNum from esua_epdc_party_group.epdc_party_topic top where top.DEL_FLAG = '0'
and date_format(top.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) group by top.GRID_ID ) topn
left join esua_epdc_admin.sys_dept d1 on d1.ID = topn.GRID_ID
left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID
@ -1687,11 +1686,11 @@ select gr.id as orgId,
from (
SELECT
sum( info.STATE = 10 ) as num,
info.GRID_ID
info.DEPT_ID as GRID_ID
FROM
esua_epdc_group.epdc_group info
esua_epdc_party_group.epdc_party_group info
GROUP BY
info.GRID_ID
info.DEPT_ID
) daily
left join esua_epdc_admin.sys_dept dept on dept.id = daily.GRID_ID
left join esua_epdc_admin.sys_dept parent on parent.id = dept.PID and parent.type_key= 'community_party'
@ -1700,7 +1699,7 @@ select gr.id as orgId,
) tto on tto.DEPT_ID = sd.ID
left join (
select sum(topn.topNum) topNum ,d1.PID DEPT_ID from
( select top.GRID_ID ,count(*) topNum from esua_epdc_group.epdc_topic top where top.DEL_FLAG = '0'
( select top.GRID_ID ,count(*) topNum from esua_epdc_party_group.epdc_party_topic top where top.DEL_FLAG = '0'
and date_format(top.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) group by top.GRID_ID ) topn
left join esua_epdc_admin.sys_dept d1 on d1.ID = topn.GRID_ID group by d1.PID
) topCount on topCount.DEPT_ID = sd.ID
@ -1805,12 +1804,12 @@ select gr.id as orgId,
left join (
select
count(*) as TIMES_TOTAL,
ws.GRID_ID as DEPT_ID
from esua_epdc_group.epdc_group ws
ws.DEPT_ID as DEPT_ID
from esua_epdc_party_group.epdc_party_group ws
where ws.DEL_FLAG = '0' and date_format(ws.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ),'%Y-%m' )
GROUP BY ws.GRID_ID
GROUP BY ws.DEPT_ID
) tto on tto.DEPT_ID = sd.ID
left join (select top.GRID_ID DEPT_ID ,count(*) topNum from esua_epdc_group.epdc_topic top where top.DEL_FLAG = '0' and date_format(top.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) group by top.GRID_ID) topCount on topCount.DEPT_ID = sd.ID
left join (select top.GRID_ID DEPT_ID ,count(*) topNum from esua_epdc_party_group.epdc_party_topic top where top.DEL_FLAG = '0' and date_format(top.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) group by top.GRID_ID) topCount on topCount.DEPT_ID = sd.ID
left join (
SELECT
count( t.a ) issueNum,
@ -2001,7 +2000,12 @@ select gr.id as orgId,
count( behavior.GROUP_OPPOSE_FLAG = 1 OR NULL ) AS groupOpposeFlag,
count( behavior.GROUP_JOIN_FLAG = 1 OR NULL ) AS groupJoinFlag,
count( behavior.GROUP_COMMENT_FLAG = 1 OR NULL ) AS groupCommentFlag,
count( behavior.GROUP_CREATE_FLAG = 1 OR NULL ) groupCreateFlag