Browse Source

【大屏展示】-【中央区各类总数】-(王童)-2020/8/21

feature/dangjian
Jackwang 5 years ago
parent
commit
57d57e4ca1
  1. 67
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/result/UsertotaldataResultDTO.java
  2. 12
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/controller/DataStatsScreencollController.java
  3. 9
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/DataStatsScreencollDao.java
  4. 9
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/DataStatsScreencollService.java
  5. 6
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/DataStatsScreencollServiceImpl.java
  6. 390
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/DataStatsScreencollDao.xml

67
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/result/UsertotaldataResultDTO.java

@ -0,0 +1,67 @@
package com.elink.esua.epdc.dto.screen.result;
import lombok.Data;
import java.io.Serializable;
/**
* @program: esua-epdc
* @description: 中央区各类总数
* @author: wangtong
* @create: 2020-08-21 10:34
**/
@Data
public class UsertotaldataResultDTO implements Serializable {
private static final long serialVersionUID = 4308356025431997272L;
/**
*组织类别 agency组织部门department网格grid
*/
private String orgType;
/**
*组织Id 可以为网格机关id
*/
private String orgId;
/**
*上级组织Id
*/
private String parentId;
/**
*组织名称
*/
private String orgName;
/**
*用户总数
*/
private Integer userTotal;
/**
*注册党员数
*/
private Integer partyTotal;
/**
*小组党群总数
*/
private Integer groupTotal;
/**
*议事数
*/
private Integer issueTotal;
/**
*话题总数
*/
private Integer topicTotal;
/**
*项目总数
*/
private Integer projectTotal;
}

12
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/controller/DataStatsScreencollController.java

@ -68,4 +68,16 @@ public class DataStatsScreencollController {
public Result pioneerdata() {
return dataStatsScreencollService.pioneerdata();
}
/**
* @describe: 中央区各类总数
* @author wangtong
* @date 2020/8/21 10:32
* @params []
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
@PostMapping("usertotaldata")
public Result usertotaldata() {
return dataStatsScreencollService.usertotaldata();
}
}

9
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/DataStatsScreencollDao.java

@ -66,4 +66,13 @@ public interface DataStatsScreencollDao extends BaseDao<DataStatsScreencollResul
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.PioneerdataResultDTO>
*/
List<PioneerdataResultDTO> pioneerdata();
/**
* @describe:
* @author wangtong
* @date 2020/8/21 10:38
* @params []
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.UsertotaldataResultDTO>
*/
List<UsertotaldataResultDTO> usertotaldata();
}

9
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/DataStatsScreencollService.java

@ -47,4 +47,13 @@ public interface DataStatsScreencollService {
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
Result pioneerdata();
/**
* @describe: 中央区各类总数
* @author wangtong
* @date 2020/8/21 10:33
* @params []
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
Result usertotaldata();
}

6
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/DataStatsScreencollServiceImpl.java

@ -52,4 +52,10 @@ public class DataStatsScreencollServiceImpl extends BaseServiceImpl<DataStatsScr
List<PioneerdataResultDTO> resultList = baseDao.pioneerdata();
return null;
}
@Override
public Result usertotaldata() {
List<UsertotaldataResultDTO> resultList = baseDao.usertotaldata();
return null;
}
}

390
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/DataStatsScreencollDao.xml

@ -757,4 +757,394 @@
and city.type_key='district_party' and city.party_code='shibei'
GROUP BY city.id
</select>
<select id="usertotaldata" resultType="com.elink.esua.epdc.dto.screen.result.UsertotaldataResultDTO">
SELECT gr.id as orgId,
gr.name as orgName,
gr.pid as parentId,
'grid' as orgType,
IFNULL(t.userTotal,0) AS userTotal,
IFNULL(t.partyTotal,0) AS partyTotal,
IFNULL(t.groupTotal,0) AS groupTotal,
IFNULL(t.issueTotal,0) AS issueTotal,
IFNULL(t.topicTotal,0) AS topicTotal,
IFNULL(t.projectTotal,0) AS projectTotal
FROM esua_epdc_admin.sys_dept gr
left join
(select total.GRID_ID,
sum(total.userTotal) as userTotal,
sum(total.partyTotal) as partyTotal,
sum(total.groupTotal) as groupTotal,
sum(total.issueTotal) as issueTotal,
sum(total.topicTotal) as topicTotal,
sum(total.projectTotal) as projectTotal
from
(select ifnull(if(eu.DEPT_ID = 0, NULL, eu.DEPT_ID), (
SELECT GRID_ID FROM esua_epdc_user.epdc_user_grid_relation
WHERE DEL_FLAG = '0' AND USER_ID = eu.ID
ORDER BY
CREATED_TIME,id
LIMIT 1 )
) AS GRID_ID,
count(eu.id) as userTotal,
count(eu.PARTY_FLAG = '1' OR NULL ) AS partyTotal,
0 as groupTotal,
0 as issueTotal,
0 as topicTotal,
0 as projectTotal
from esua_epdc_user.epdc_user eu
where eu.DEL_FLAG=0
group by eu.DEPT_ID
UNION ALL
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
count(id) as groupTotal,
0 as issueTotal,
0 as topicTotal,
0 as projectTotal
from esua_epdc_group.epdc_group
where DEL_FLAG=0 and STATE=10
group by GRID_ID
union all
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
0 as groupTotal,
count(id) as issueTotal,
0 as topicTotal,
0 as projectTotal
from esua_epdc_events.epdc_issue
where DEL_FLAG=0
group by GRID_ID
UNION ALL
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
0 as groupTotal,
0 as issueTotal,
count(id) as topicTotal,
0 as projectTotal
from esua_epdc_group.epdc_topic
where DEL_FLAG=0
group by GRID_ID
UNION ALL
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
0 as groupTotal,
0 as issueTotal,
0 as topicTotal,
count(id) as projectTotal
from esua_epdc_events.epdc_item
where DEL_FLAG=0
group by GRID_ID)total
group by total.GRID_ID)t on gr.id=t.GRID_ID
where gr.del_flag=0
and gr.type_key='grid_party'
UNION ALL
SELECT co.id as orgId,
co.name as orgName,
co.pid as parentId,
'department' as orgType,
SUM(IFNULL(t.userTotal,0)) AS userTotal,
SUM(IFNULL(t.partyTotal,0)) AS partyTotal,
SUM(IFNULL(t.groupTotal,0)) AS groupTotal,
SUM(IFNULL(t.issueTotal,0)) AS issueTotal,
SUM(IFNULL(t.topicTotal,0)) AS topicTotal,
SUM(IFNULL(t.projectTotal,0)) AS projectTotal
FROM esua_epdc_admin.sys_dept co
LEFT JOIN esua_epdc_admin.sys_dept gr on co.id=gr.pid
left join
(select total.GRID_ID,
sum(total.userTotal) as userTotal,
sum(total.partyTotal) as partyTotal,
sum(total.groupTotal) as groupTotal,
sum(total.issueTotal) as issueTotal,
sum(total.topicTotal) as topicTotal,
sum(total.projectTotal) as projectTotal
from
(select ifnull(if(eu.DEPT_ID = 0, NULL, eu.DEPT_ID), (
SELECT GRID_ID FROM esua_epdc_user.epdc_user_grid_relation
WHERE DEL_FLAG = '0' AND USER_ID = eu.ID
ORDER BY
CREATED_TIME,id
LIMIT 1 )
) AS GRID_ID,
count(eu.id) as userTotal,
count(eu.PARTY_FLAG = '1' OR NULL ) AS partyTotal,
0 as groupTotal,
0 as issueTotal,
0 as topicTotal,
0 as projectTotal
from esua_epdc_user.epdc_user eu
where eu.DEL_FLAG=0
group by eu.DEPT_ID
UNION ALL
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
count(id) as groupTotal,
0 as issueTotal,
0 as topicTotal,
0 as projectTotal
from esua_epdc_group.epdc_group
where DEL_FLAG=0 and STATE=10
group by GRID_ID
union all
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
0 as groupTotal,
count(id) as issueTotal,
0 as topicTotal,
0 as projectTotal
from esua_epdc_events.epdc_issue
where DEL_FLAG=0
group by GRID_ID
UNION ALL
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
0 as groupTotal,
0 as issueTotal,
count(id) as topicTotal,
0 as projectTotal
from esua_epdc_group.epdc_topic
where DEL_FLAG=0
group by GRID_ID
UNION ALL
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
0 as groupTotal,
0 as issueTotal,
0 as topicTotal,
count(id) as projectTotal
from esua_epdc_events.epdc_item
where DEL_FLAG=0
group by GRID_ID)total
group by total.GRID_ID)t on gr.id=t.GRID_ID
where gr.del_flag=0
and co.del_flag=0
and co.type_key='community_party'
GROUP BY co.id
union all
SELECT st.id as orgId,
st.name as orgName,
st.pid as parentId,
'department' as orgType,
SUM(IFNULL(t.userTotal,0)) AS userTotal,
SUM(IFNULL(t.partyTotal,0)) AS partyTotal,
SUM(IFNULL(t.groupTotal,0)) AS groupTotal,
SUM(IFNULL(t.issueTotal,0)) AS issueTotal,
SUM(IFNULL(t.topicTotal,0)) AS topicTotal,
SUM(IFNULL(t.projectTotal,0)) AS projectTotal
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 total.GRID_ID,
sum(total.userTotal) as userTotal,
sum(total.partyTotal) as partyTotal,
sum(total.groupTotal) as groupTotal,
sum(total.issueTotal) as issueTotal,
sum(total.topicTotal) as topicTotal,
sum(total.projectTotal) as projectTotal
from
(select ifnull(if(eu.DEPT_ID = 0, NULL, eu.DEPT_ID), (
SELECT GRID_ID FROM esua_epdc_user.epdc_user_grid_relation
WHERE DEL_FLAG = '0' AND USER_ID = eu.ID
ORDER BY
CREATED_TIME,id
LIMIT 1 )
) AS GRID_ID,
count(eu.id) as userTotal,
count(eu.PARTY_FLAG = '1' OR NULL ) AS partyTotal,
0 as groupTotal,
0 as issueTotal,
0 as topicTotal,
0 as projectTotal
from esua_epdc_user.epdc_user eu
where eu.DEL_FLAG=0
group by eu.DEPT_ID
UNION ALL
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
count(id) as groupTotal,
0 as issueTotal,
0 as topicTotal,
0 as projectTotal
from esua_epdc_group.epdc_group
where DEL_FLAG=0 and STATE=10
group by GRID_ID
union all
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
0 as groupTotal,
count(id) as issueTotal,
0 as topicTotal,
0 as projectTotal
from esua_epdc_events.epdc_issue
where DEL_FLAG=0
group by GRID_ID
UNION ALL
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
0 as groupTotal,
0 as issueTotal,
count(id) as topicTotal,
0 as projectTotal
from esua_epdc_group.epdc_topic
where DEL_FLAG=0
group by GRID_ID
UNION ALL
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
0 as groupTotal,
0 as issueTotal,
0 as topicTotal,
count(id) as projectTotal
from esua_epdc_events.epdc_item
where DEL_FLAG=0
group by GRID_ID)total
group by total.GRID_ID)t on gr.id=t.GRID_ID
where gr.del_flag=0
and co.del_flag=0
and st.del_flag=0
and st.type_key='street_party'
GROUP BY st.id
union all
SELECT city.id as orgId,
city.name as orgName,
city.pid as parentId,
'department' as orgType,
SUM(IFNULL(t.userTotal,0)) AS userTotal,
SUM(IFNULL(t.partyTotal,0)) AS partyTotal,
SUM(IFNULL(t.groupTotal,0)) AS groupTotal,
SUM(IFNULL(t.issueTotal,0)) AS issueTotal,
SUM(IFNULL(t.topicTotal,0)) AS topicTotal,
SUM(IFNULL(t.projectTotal,0)) AS projectTotal
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 total.GRID_ID,
sum(total.userTotal) as userTotal,
sum(total.partyTotal) as partyTotal,
sum(total.groupTotal) as groupTotal,
sum(total.issueTotal) as issueTotal,
sum(total.topicTotal) as topicTotal,
sum(total.projectTotal) as projectTotal
from
(select ifnull(if(eu.DEPT_ID = 0, NULL, eu.DEPT_ID), (
SELECT GRID_ID FROM esua_epdc_user.epdc_user_grid_relation
WHERE DEL_FLAG = '0' AND USER_ID = eu.ID
ORDER BY
CREATED_TIME,id
LIMIT 1 )
) AS GRID_ID,
count(eu.id) as userTotal,
count(eu.PARTY_FLAG = '1' OR NULL ) AS partyTotal,
0 as groupTotal,
0 as issueTotal,
0 as topicTotal,
0 as projectTotal
from esua_epdc_user.epdc_user eu
where eu.DEL_FLAG=0
group by eu.DEPT_ID
UNION ALL
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
count(id) as groupTotal,
0 as issueTotal,
0 as topicTotal,
0 as projectTotal
from esua_epdc_group.epdc_group
where DEL_FLAG=0 and STATE=10
group by GRID_ID
union all
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
0 as groupTotal,
count(id) as issueTotal,
0 as topicTotal,
0 as projectTotal
from esua_epdc_events.epdc_issue
where DEL_FLAG=0
group by GRID_ID
UNION ALL
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
0 as groupTotal,
0 as issueTotal,
count(id) as topicTotal,
0 as projectTotal
from esua_epdc_group.epdc_topic
where DEL_FLAG=0
group by GRID_ID
UNION ALL
select GRID_ID,
0 as userTotal,
0 AS partyTotal,
0 as groupTotal,
0 as issueTotal,
0 as topicTotal,
count(id) as projectTotal
from esua_epdc_events.epdc_item
where DEL_FLAG=0
group by GRID_ID)total
group by total.GRID_ID)t on gr.id=t.GRID_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
</select>
</mapper>

Loading…
Cancel
Save