diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenProjectDataController.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenProjectDataController.java index cf40b1e..59949dd 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenProjectDataController.java +++ b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenProjectDataController.java @@ -1,6 +1,7 @@ package com.elink.esua.epdc.modules.screen.controller; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.screen.form.ScreenJobFormDTO; import com.elink.esua.epdc.dto.screen.form.ScreenProjectFormDTO; import com.elink.esua.epdc.modules.screen.service.ScreenProjectDataService; import org.springframework.beans.factory.annotation.Autowired; @@ -78,8 +79,8 @@ public class ScreenProjectDataController { * @return com.elink.esua.epdc.commons.tools.utils.Result */ @PostMapping("quantity-grid-monthly") - private Result quantityGridMonthly(){ - return screenProjectDataService.quantityGridMonthly(); + private Result quantityGridMonthly(@RequestBody ScreenJobFormDTO formDto){ + return screenProjectDataService.quantityGridMonthly(formDto.getYearMonth()); } /** @@ -90,7 +91,7 @@ public class ScreenProjectDataController { * @return com.elink.esua.epdc.commons.tools.utils.Result */ @PostMapping("quantity-org-monthly") - private Result quantityOrgMonthly(){ - return screenProjectDataService.quantityOrgMonthly(); + private Result quantityOrgMonthly(@RequestBody ScreenJobFormDTO formDto){ + return screenProjectDataService.quantityOrgMonthly(formDto.getYearMonth()); } } diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenPublicDataController.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenPublicDataController.java index 0677690..c4b5045 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenPublicDataController.java +++ b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenPublicDataController.java @@ -1,9 +1,11 @@ package com.elink.esua.epdc.modules.screen.controller; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.screen.form.ScreenJobFormDTO; import com.elink.esua.epdc.modules.screen.service.ScreenPublicDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -57,22 +59,23 @@ public class ScreenPublicDataController { } /** + * @return com.elink.esua.epdc.commons.tools.utils.Result * @describe: 001、基层党建-党员基本情况 * @author wk * @date 2020/8/19 17:25 * @params [] - * @return com.elink.esua.epdc.commons.tools.utils.Result */ @PostMapping("cpcbasedata") public Result cpcbasedata() { return screenPublicDataService.cpcbasedata(); } + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result * @describe: 002、党建引领-先锋模范数据 * @author wangtong * @date 2020/8/20 18:02 * @params [] - * @return com.elink.esua.epdc.commons.tools.utils.Result */ @PostMapping("pioneerdata") public Result pioneerdata() { @@ -80,29 +83,33 @@ public class ScreenPublicDataController { } /** + * @return com.elink.esua.epdc.commons.tools.utils.Result * @describe: 003、党建引领-党员联系群众数据 * @author wangtong * @date 2020/8/20 14:25 * @params [] - * @return com.elink.esua.epdc.commons.tools.utils.Result */ @PostMapping("partylinkmassesdata") public Result partylinkmassesdata() { return screenPublicDataService.partylinkmassesdata(); } + /** * 004、党建引领-先进排行榜单-先进支部排行 + * * @Params: * @Return: OrgrankdataResultDTO * @Author: wanggongfeng * @Date: 2020/08/19 */ @PostMapping("orgrankdata") - public Result orgrankdata() { - return screenPublicDataService.getOrgrankdata(); + public Result orgrankdata(@RequestBody ScreenJobFormDTO formDto) { + return screenPublicDataService.getOrgrankdata(formDto.getYearMonth()); } + /** * 005、党建引领|基层治理-居民(党员)积分排行榜 + * * @Params: * @Return: PartyuserrankdataResultDTO * @Author: wk @@ -110,11 +117,13 @@ public class ScreenPublicDataController { */ @PostMapping("partyuserrankdata") public Result partyuserrankdata() { - return screenPublicDataService.getPartyuserrankdata(); + return screenPublicDataService.getPartyuserrankdata(); } + /** - * 006、基层治理-难点赌点项目上报 + * 006、基层治理-难点赌点项目上报 + * * @Params: * @Return: DifficultydataResultDTO * @Author: wk @@ -124,46 +133,52 @@ public class ScreenPublicDataController { public Result difficultydata() { return screenPublicDataService.getDifficultydata(); } + /** * 007、基层治理-公众参与 + * * @Params: * @Return: UserjoinResultDTO * @Author: wanggongfeng * @Date: 2020/08/20 */ @PostMapping("userjoin") - public Result userjoin() { - return screenPublicDataService.getUserjoin(); + public Result userjoin(@RequestBody ScreenJobFormDTO formDto) { + return screenPublicDataService.getUserjoin(formDto.getYearMonth()); } + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result * @describe: 008、公众参与各类总数 * @author wangtong * @date 2020/8/24 18:27 * @params [] - * @return com.elink.esua.epdc.commons.tools.utils.Result */ @PostMapping("publicpartitotaldata") public Result publicpartitotaldata() { return screenPublicDataService.publicpartitotaldata(); } + /** * 009、基层治理-治理能力数据 + * * @Params: * @Return: GovernrankdataResultDTO * @Author: wanggongfeng * @Date: 2020/08/19 */ @PostMapping("governrankdata") - public Result governrankdata() { - return screenPublicDataService.getGovernrankdata(); + public Result governrankdata(@RequestBody ScreenJobFormDTO formDto) { + return screenPublicDataService.getGovernrankdata(formDto.getYearMonth()); } + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result * @describe: 010、中央区各类总数 * @author wk * @date 2020/8/21 10:32 * @params [] - * @return com.elink.esua.epdc.commons.tools.utils.Result */ @PostMapping("usertotaldata") public Result usertotaldata() { diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenProjectDataDao.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenProjectDataDao.java index 86b8953..e4c94a1 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenProjectDataDao.java +++ b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenProjectDataDao.java @@ -57,7 +57,7 @@ public interface ScreenProjectDataDao extends BaseDao */ - List selectQuantityGridMonthly(@Param("lastMonth") String lastMonth); + List selectQuantityGridMonthly(@Param("yearMonth") String yearMonth); /** * @describe: 【事件/项目分析】组织内月度数量统计 @@ -66,5 +66,5 @@ public interface ScreenProjectDataDao extends BaseDao */ - List selectQuantityOrgMonthly(@Param("lastMonth") String lastMonth); + List selectQuantityOrgMonthly(@Param("yearMonth") String yearMonth); } diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenPublicDataDao.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenPublicDataDao.java index d6970da..c1507eb 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenPublicDataDao.java +++ b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenPublicDataDao.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.modules.screen.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.screen.result.*; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -72,7 +73,7 @@ public interface ScreenPublicDataDao extends BaseDao * @Author: wanggongfeng * @Date: 2020/08/19 */ - List getOrgrankdata(); + List getOrgrankdata(@Param("yearMonth")String yearMonth); /** * 005、党建引领|基层治理-居民(党员)积分排行榜 * @Params: @@ -97,7 +98,7 @@ public interface ScreenPublicDataDao extends BaseDao * @Author: wanggongfeng * @Date: 2020/08/20 */ - List getUserjoin(); + List getUserjoin(@Param("yearMonth")String yearMonth); /** * @describe: 008、公众参与各类总数 @@ -114,7 +115,7 @@ public interface ScreenPublicDataDao extends BaseDao * @Author: wanggongfeng * @Date: 2020/08/19 */ - List getGovernrankdata(); + List getGovernrankdata(@Param("yearMonth")String yearMonth); /** diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenProjectDataService.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenProjectDataService.java index 004eac2..8f211d4 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenProjectDataService.java +++ b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenProjectDataService.java @@ -56,7 +56,7 @@ public interface ScreenProjectDataService { * @params [] * @return com.elink.esua.epdc.commons.tools.utils.Result */ - Result quantityGridMonthly(); + Result quantityGridMonthly(String yearMonth); /** * @describe: 【事件/项目分析】组织内月度数量统计 @@ -65,5 +65,5 @@ public interface ScreenProjectDataService { * @params [] * @return com.elink.esua.epdc.commons.tools.utils.Result */ - Result quantityOrgMonthly(); + Result quantityOrgMonthly(String yearMonth); } diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenPublicDataService.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenPublicDataService.java index 27f543c..02c33f7 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenPublicDataService.java +++ b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenPublicDataService.java @@ -72,7 +72,7 @@ public interface ScreenPublicDataService { * @Author: wanggongfeng * @Date: 2020/08/19 */ - Result getOrgrankdata(); + Result getOrgrankdata(String yearMonth); /** * 005、党建引领|基层治理-居民(党员)积分排行榜 @@ -102,7 +102,7 @@ public interface ScreenPublicDataService { * @Author: wanggongfeng * @Date: 2020/08/20 */ - Result getUserjoin(); + Result getUserjoin(String yearMonth); /** * @return com.elink.esua.epdc.commons.tools.utils.Result @@ -121,7 +121,7 @@ public interface ScreenPublicDataService { * @Author: wanggongfeng * @Date: 2020/08/19 */ - Result getGovernrankdata(); + Result getGovernrankdata(String yearMonth); /** * @return com.elink.esua.epdc.commons.tools.utils.Result diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenProjectDataServiceImpl.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenProjectDataServiceImpl.java index c552d1d..ff8c5aa 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenProjectDataServiceImpl.java +++ b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenProjectDataServiceImpl.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.modules.screen.service.impl; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.EpmetConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.utils.DateUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.screen.form.ScreenProjectFormDTO; import com.elink.esua.epdc.dto.screen.result.*; @@ -10,9 +11,11 @@ import com.elink.esua.epdc.modules.screen.dao.ScreenProjectDataDao; import com.elink.esua.epdc.modules.screen.service.ScreenProjectDataService; import com.elink.esua.epdc.utils.EpmetUtils; import com.elink.esua.epdc.utils.ScreenDataUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Date; import java.util.List; /** @@ -101,24 +104,26 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl data = baseDao.selectQuantityGridMonthly(lastMonth); + List data = baseDao.selectQuantityGridMonthly(yearMonth); // 数据格式化 - String dataJson = ScreenDataUtils.getScreenDataMonthJson(data, null,true); + String dataJson = ScreenDataUtils.getScreenDataMonthJson(data, yearMonth,true); // 数据上报 epmetUtils.httpPost(EpmetConstant.EPMET_PROJECT_GRID_MONTHLY, dataJson); return new Result(); } @Override - public Result quantityOrgMonthly() { - String lastMonth = ScreenDataUtils.getLastMonthDate(); + public Result quantityOrgMonthly(String yearMonth) { + // 如果统计月份为空,则统计上个月的数据 + yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth; // 数据统计 - List data = baseDao.selectQuantityOrgMonthly(lastMonth); + List data = baseDao.selectQuantityOrgMonthly(yearMonth); // 数据格式化 - String dataJson = ScreenDataUtils.getScreenDataMonthJson(data, null,true); + String dataJson = ScreenDataUtils.getScreenDataMonthJson(data, yearMonth,true); // 数据上报 epmetUtils.httpPost(EpmetConstant.EPMET_PROJECT_ORG_MONTHLY, dataJson); return new Result(); diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenPublicDataServiceImpl.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenPublicDataServiceImpl.java index 5e419ec..249195a 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenPublicDataServiceImpl.java +++ b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenPublicDataServiceImpl.java @@ -3,16 +3,19 @@ package com.elink.esua.epdc.modules.screen.service.impl; import com.alibaba.fastjson.JSONObject; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.EpmetConstant; +import com.elink.esua.epdc.commons.tools.utils.DateUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.screen.result.*; import com.elink.esua.epdc.modules.screen.dao.ScreenPublicDataDao; import com.elink.esua.epdc.modules.screen.service.ScreenPublicDataService; import com.elink.esua.epdc.utils.EpmetUtils; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Date; import java.util.List; @@ -122,13 +125,15 @@ public class ScreenPublicDataServiceImpl extends BaseServiceImpl list = baseDao.getOrgrankdata(); + public Result getOrgrankdata(String yearMonth) { + // 如果统计月份为空,则统计上个月的数据 + yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth; + List list = baseDao.getOrgrankdata(yearMonth); // 将list转换为json格式 if(list != null && list.size()>0){ OrgrankdataDTO result = new OrgrankdataDTO(); result.setDataList(list); - result.setMonthId(list.get(0).getMonthId()); + result.setMonthId(yearMonth); String json = JSONObject.toJSONString(result); String body = epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_COLL_ORG_RANK, json); log.info(body); @@ -192,13 +197,15 @@ public class ScreenPublicDataServiceImpl extends BaseServiceImpl list = baseDao.getUserjoin(); + public Result getUserjoin(String yearMonth) { + // 如果统计月份为空,则统计上个月的数据 + yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth; + List list = baseDao.getUserjoin(yearMonth); // 将list转换为json格式 if(list != null && list.size()>0) { UserjoinDTO result = new UserjoinDTO(); result.setDataList(list); - result.setMonthId(list.get(0).getMonthId()); + result.setMonthId(yearMonth); String json = JSONObject.toJSONString(result); String body = epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_COLL_USER_JOIN, json); log.info(body); @@ -233,13 +240,15 @@ public class ScreenPublicDataServiceImpl extends BaseServiceImpl list = baseDao.getGovernrankdata(); + public Result getGovernrankdata(String yearMonth) { + // 如果统计月份为空,则统计上个月的数据 + yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth; + List list = baseDao.getGovernrankdata(yearMonth); // 将list转换为json格式 if(list != null && list.size()>0){ GovernrankdataDTO result = new GovernrankdataDTO(); result.setDataList(list); - result.setMonthId(list.get(0).getMonthId()); + result.setMonthId(yearMonth); String json = JSONObject.toJSONString(result); String body = epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_COLL_GOVERN_RANK, json); log.info(body); diff --git a/epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index 05d442a..95f3d10 100644 --- a/epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -243,7 +243,7 @@ from (select lin.* from (select * from .epdc_item order by id) lin where lin.DEL_FLAG=0 - AND date_format( lin.CREATED_TIME, '%Y-%m' ) = #{lastMonth} + AND date_format( lin.CREATED_TIME, '%Y-%m' ) = #{yearMonth} group by lin.EVENT_ID)li group by li.GRID_ID)it on it.GRID_ID=sd.id left join (select al.GRID_ID, @@ -253,7 +253,7 @@ from (select lin.* from (select * from .epdc_item order by id) lin where lin.DEL_FLAG=0 - AND date_format( lin.CREATED_TIME, '%Y-%m' ) <= #{lastMonth} + AND date_format( lin.CREATED_TIME, '%Y-%m' ) <= #{yearMonth} group by lin.EVENT_ID)al group by al.GRID_ID)li2 on li2.GRID_ID=sd.id WHERE sd.`del_flag`= 0 @@ -285,7 +285,7 @@ from (select lin.* from (select * from .epdc_item order by id) lin where lin.DEL_FLAG=0 - AND date_format( lin.CREATED_TIME, '%Y-%m' ) =#{lastMonth} + AND date_format( lin.CREATED_TIME, '%Y-%m' ) =#{yearMonth} group by lin.EVENT_ID)li group by li.GRID_ID)it on it.GRID_ID=sd.id left join (select al.GRID_ID, @@ -295,7 +295,7 @@ from (select lin.* from (select * from .epdc_item order by id) lin where lin.DEL_FLAG=0 - AND date_format( lin.CREATED_TIME, '%Y-%m' ) <=#{lastMonth} + AND date_format( lin.CREATED_TIME, '%Y-%m' ) <=#{yearMonth} group by lin.EVENT_ID)al group by al.GRID_ID)li2 on li2.GRID_ID=sd.id WHERE sd.`del_flag`= 0 @@ -324,7 +324,7 @@ from (select lin.* from (select * from .epdc_item order by id) lin where lin.DEL_FLAG=0 - AND date_format( lin.CREATED_TIME, '%Y-%m' ) =#{lastMonth} + AND date_format( lin.CREATED_TIME, '%Y-%m' ) =#{yearMonth} group by lin.EVENT_ID)li group by li.GRID_ID)it on it.GRID_ID=sd.id left join (select al.GRID_ID, @@ -334,7 +334,7 @@ from (select lin.* from (select * from .epdc_item order by id) lin where lin.DEL_FLAG=0 - AND date_format( lin.CREATED_TIME, '%Y-%m' ) <=#{lastMonth} + AND date_format( lin.CREATED_TIME, '%Y-%m' ) <=#{yearMonth} group by lin.EVENT_ID)al group by al.GRID_ID)li2 on li2.GRID_ID=sd.id WHERE sd.`del_flag`= 0 @@ -364,7 +364,7 @@ from (select lin.* from (select * from .epdc_item order by id) lin where lin.DEL_FLAG=0 - AND date_format( lin.CREATED_TIME, '%Y-%m' ) =#{lastMonth} + AND date_format( lin.CREATED_TIME, '%Y-%m' ) =#{yearMonth} group by lin.EVENT_ID)li group by li.GRID_ID)it on it.GRID_ID=sd.id left join (select al.GRID_ID, @@ -374,7 +374,7 @@ from (select lin.* from (select * from .epdc_item order by id) lin where lin.DEL_FLAG=0 - AND date_format( lin.CREATED_TIME, '%Y-%m' ) <=#{lastMonth} + AND date_format( lin.CREATED_TIME, '%Y-%m' ) <=#{yearMonth} group by lin.EVENT_ID)al group by al.GRID_ID)li2 on li2.GRID_ID=sd.id WHERE sd.`del_flag`= 0 diff --git a/epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenPublicDataDao.xml b/epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenPublicDataDao.xml index ee93128..6927ad8 100644 --- a/epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenPublicDataDao.xml +++ b/epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenPublicDataDao.xml @@ -925,21 +925,21 @@ select gr.id as orgId, IFNULL(t.projectTotal,0) as satisfactionRatioFm from ( select - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId, - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId, 'agency' as orgType, sd.ID orgId, sd.PID parentId, sd.PIDS allParentIds , sd.NAME orgName, - (SELECT count( * ) partyTotal FROM .epdc_user uu WHERE uu.DEL_FLAG = '0' AND uu.PARTY_FLAG = '1') partyTotal, + (SELECT count( * ) partyTotal FROM esua_epdc_user.epdc_user uu WHERE uu.DEL_FLAG = '0' AND uu.PARTY_FLAG = '1') partyTotal, ( select count(*) groupTotal - from .epdc_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' ) + from esua_epdc_group.epdc_group ws + where ws.DEL_FLAG = '0' and date_format(ws.CREATED_TIME, '%Y-%m' ) = #{yearMonth} ) groupTotal, - (select count(*) topicTotal from .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_group.epdc_topic top where top.DEL_FLAG = '0' and date_format(top.CREATED_TIME, '%Y-%m' ) = #{yearMonth} ) topicTotal, ( SELECT count( t.a ) issueTotal @@ -949,10 +949,10 @@ select gr.id as orgId, count(id) as a, EVENT_ID FROM - .epdc_issue mei + esua_epdc_events.epdc_issue mei WHERE mei.DEL_FLAG = '0' - AND date_format( mei.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) + AND date_format( mei.CREATED_TIME, '%Y-%m' ) = #{yearMonth} GROUP BY EVENT_ID )t @@ -966,25 +966,25 @@ select gr.id as orgId, count(id) as a, EVENT_ID FROM - .epdc_item item + esua_epdc_events.epdc_item item WHERE item.DEL_FLAG = '0' - AND date_format( item.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) + AND date_format( item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} GROUP BY EVENT_ID )t ) projectTotal, - (select count(*) itemCloseTotal from .epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.ITEM_STATE = 10 ) itemCloseTotal, - (select count(*) itemSatisfiedTotal from .epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 1 ) itemSatisfiedTotal, - (select count(*) itemVeryTotal from .epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 2 ) itemVeryTotal - from .sys_dept sd + (select count(*) itemCloseTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.ITEM_STATE = 10 ) itemCloseTotal, + (select count(*) itemSatisfiedTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 1 ) itemSatisfiedTotal, + (select count(*) itemVeryTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 2 ) itemVeryTotal + from esua_epdc_admin.sys_dept sd where sd.DEL_FLAG = '0' AND sd.id IS NOT NULL and sd.TYPE_KEY = 'district_party' union all select - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId, - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId, 'agency' as orgType, sd.ID orgId, sd.PID parentId, @@ -998,12 +998,12 @@ select gr.id as orgId, IFNULL(itemCloseCount.itemNum,0) itemCloseTotal, IFNULL(itemSatisfiedCount.itemNum,0) itemSatisfiedTotal, IFNULL(itemVeryCount.itemNum,0) itemVeryTotal - from .sys_dept sd + from esua_epdc_admin.sys_dept sd left join ( select sum(userNum.partyNum) partyNum , d2.PID DEPT_ID from (SELECT count( * ) partyNum, uu.DEPT_ID - FROM .epdc_user uu WHERE uu.DEL_FLAG = '0' AND uu.PARTY_FLAG = '1' - GROUP BY uu.DEPT_ID) userNum left join .sys_dept d1 on d1.ID = userNum.DEPT_ID - left join .sys_dept d2 on d1.PID = d2.ID group by d2.PID + FROM esua_epdc_user.epdc_user uu WHERE uu.DEL_FLAG = '0' AND uu.PARTY_FLAG = '1' + GROUP BY uu.DEPT_ID) userNum left join esua_epdc_admin.sys_dept d1 on d1.ID = userNum.DEPT_ID + left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID group by d2.PID ) user on user.DEPT_ID = sd.ID left join ( select @@ -1014,22 +1014,22 @@ select gr.id as orgId, sum( info.STATE = 10 ) as num, info.GRID_ID FROM - .epdc_group info + esua_epdc_group.epdc_group info GROUP BY info.GRID_ID ) daily - left join .sys_dept dept on dept.id = daily.GRID_ID - left join .sys_dept dept2 on dept2.id = dept.PID - left join .sys_dept parent on parent.id = dept2.PID and parent.type_key= 'street_party' + 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 + left join esua_epdc_admin.sys_dept parent on parent.id = dept2.PID and parent.type_key= 'street_party' where dept2.type_key = 'street_party' or parent.type_key= 'street_party' GROUP BY IFNULL(parent.id,dept2.id) ) 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 .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 ) topn - left join .sys_dept d1 on d1.ID = topn.GRID_ID - left join .sys_dept d2 on d1.PID = d2.ID + ( select top.GRID_ID ,count(*) topNum from esua_epdc_group.epdc_topic top where top.DEL_FLAG = '0' + and date_format(top.CREATED_TIME, '%Y-%m' ) = #{yearMonth} 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 group by d2.PID ) topCount on topCount.DEPT_ID = sd.ID left join ( @@ -1045,10 +1045,10 @@ select gr.id as orgId, EVENT_ID, GRID_ID FROM - .epdc_issue mei + esua_epdc_events.epdc_issue mei WHERE mei.DEL_FLAG = '0' - AND date_format( mei.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) + AND date_format( mei.CREATED_TIME, '%Y-%m' ) = #{yearMonth} GROUP BY EVENT_ID, GRID_ID @@ -1056,8 +1056,8 @@ select gr.id as orgId, GROUP BY t.GRID_ID ) issuegrid - left join .sys_dept d1 on d1.ID = issuegrid.GRID_ID - left join .sys_dept d2 on d1.PID = d2.ID + left join esua_epdc_admin.sys_dept d1 on d1.ID = issuegrid.GRID_ID + left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID group by d2.PID ) issueCount on issueCount.DEPT_ID = sd.ID left join ( @@ -1073,10 +1073,10 @@ select gr.id as orgId, EVENT_ID, GRID_ID FROM - .epdc_item item + esua_epdc_events.epdc_item item WHERE item.DEL_FLAG = '0' - AND date_format( item.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) + AND date_format( item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} GROUP BY EVENT_ID, GRID_ID @@ -1084,32 +1084,32 @@ select gr.id as orgId, GROUP BY t.GRID_ID ) itemgrid - left join .sys_dept d1 on d1.ID = itemgrid.GRID_ID - left join .sys_dept d2 on d1.PID = d2.ID + left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID + left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID group by d2.PID ) itemCount on itemCount.DEPT_ID = sd.ID left join ( select sum(itemgrid.itemNum) itemNum ,d2.PID DEPT_ID from - ( select item.GRID_ID ,count(*) itemNum from .epdc_item item where item.DEL_FLAG = '0' - and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.ITEM_STATE = 10 group by item.GRID_ID ) itemgrid - left join .sys_dept d1 on d1.ID = itemgrid.GRID_ID - left join .sys_dept d2 on d1.PID = d2.ID + ( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' + and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.ITEM_STATE = 10 group by item.GRID_ID ) itemgrid + left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID + left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID group by d2.PID ) itemCloseCount on itemCloseCount.DEPT_ID = sd.ID left join ( select sum(itemgrid.itemNum) itemNum ,d2.PID DEPT_ID from - ( select item.GRID_ID ,count(*) itemNum from .epdc_item item where item.DEL_FLAG = '0' - and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 1 group by item.GRID_ID ) itemgrid - left join .sys_dept d1 on d1.ID = itemgrid.GRID_ID - left join .sys_dept d2 on d1.PID = d2.ID + ( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' + and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 1 group by item.GRID_ID ) itemgrid + left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID + left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID group by d2.PID ) itemSatisfiedCount on itemSatisfiedCount.DEPT_ID = sd.ID left join ( select sum(itemgrid.itemNum) itemNum ,d2.PID DEPT_ID from - ( select item.GRID_ID ,count(*) itemNum from .epdc_item item where item.DEL_FLAG = '0' - and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 2 group by item.GRID_ID ) itemgrid - left join .sys_dept d1 on d1.ID = itemgrid.GRID_ID - left join .sys_dept d2 on d1.PID = d2.ID + ( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' + and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 2 group by item.GRID_ID ) itemgrid + left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID + left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID group by d2.PID ) itemVeryCount on itemVeryCount.DEPT_ID = sd.ID where sd.DEL_FLAG = '0' @@ -1117,8 +1117,8 @@ select gr.id as orgId, and sd.TYPE_KEY = 'street_party' union all select - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId, - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId, 'agency' as orgType, sd.ID orgId, sd.PID parentId, @@ -1132,11 +1132,11 @@ select gr.id as orgId, IFNULL(itemCloseCount.itemNum,0) itemCloseTotal, IFNULL(itemSatisfiedCount.itemNum,0) itemSatisfiedTotal, IFNULL(itemVeryCount.itemNum,0) itemVeryTotal - from .sys_dept sd + from esua_epdc_admin.sys_dept sd left join ( select sum(userNum.partyNum) partyNum ,d1.PID DEPT_ID from (SELECT count( * ) partyNum, uu.DEPT_ID - FROM .epdc_user uu WHERE uu.DEL_FLAG = '0' AND uu.PARTY_FLAG = '1' GROUP BY uu.DEPT_ID) userNum - left join .sys_dept d1 on d1.ID = userNum.DEPT_ID group by d1.PID + FROM esua_epdc_user.epdc_user uu WHERE uu.DEL_FLAG = '0' AND uu.PARTY_FLAG = '1' GROUP BY uu.DEPT_ID) userNum + left join esua_epdc_admin.sys_dept d1 on d1.ID = userNum.DEPT_ID group by d1.PID ) user on user.DEPT_ID = sd.ID left join ( select @@ -1147,20 +1147,20 @@ select gr.id as orgId, sum( info.STATE = 10 ) as num, info.GRID_ID FROM - .epdc_group info + esua_epdc_group.epdc_group info GROUP BY info.GRID_ID ) daily - left join .sys_dept dept on dept.id = daily.GRID_ID - left join .sys_dept parent on parent.id = dept.PID and parent.type_key= 'community_party' + 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' where dept.type_key = 'community_party' or parent.type_key= 'community_party' GROUP BY IFNULL(parent.id,dept.id) ) 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 .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 ) topn - left join .sys_dept d1 on d1.ID = topn.GRID_ID group by d1.PID + ( select top.GRID_ID ,count(*) topNum from esua_epdc_group.epdc_topic top where top.DEL_FLAG = '0' + and date_format(top.CREATED_TIME, '%Y-%m' ) = #{yearMonth} 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 left join ( select sum(issuegrid.issueNum) issueNum ,d1.PID DEPT_ID from @@ -1175,10 +1175,10 @@ select gr.id as orgId, EVENT_ID, GRID_ID FROM - .epdc_issue mei + esua_epdc_events.epdc_issue mei WHERE mei.DEL_FLAG = '0' - AND date_format( mei.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) + AND date_format( mei.CREATED_TIME, '%Y-%m' ) = #{yearMonth} GROUP BY EVENT_ID, GRID_ID @@ -1186,7 +1186,7 @@ select gr.id as orgId, GROUP BY t.GRID_ID ) issuegrid - left join .sys_dept d1 on d1.ID = issuegrid.GRID_ID + left join esua_epdc_admin.sys_dept d1 on d1.ID = issuegrid.GRID_ID group by d1.PID ) issueCount on issueCount.DEPT_ID = sd.ID left join ( @@ -1203,10 +1203,10 @@ select gr.id as orgId, EVENT_ID, GRID_ID FROM - .epdc_item item + esua_epdc_events.epdc_item item WHERE item.DEL_FLAG = '0' - AND date_format( item.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) + AND date_format( item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} GROUP BY EVENT_ID, GRID_ID @@ -1214,37 +1214,37 @@ select gr.id as orgId, GROUP BY t.GRID_ID ) itemgrid - left join .sys_dept d1 on d1.ID = itemgrid.GRID_ID + left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID group by d1.PID ) itemCount on itemCount.DEPT_ID = sd.ID left join ( select sum(itemgrid.itemNum) itemNum ,d1.PID DEPT_ID from - ( select item.GRID_ID ,count(*) itemNum from .epdc_item item where item.DEL_FLAG = '0' - and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.ITEM_STATE = 10 group by item.GRID_ID ) itemgrid - left join .sys_dept d1 on d1.ID = itemgrid.GRID_ID group by d1.PID + ( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' + and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.ITEM_STATE = 10 group by item.GRID_ID ) itemgrid + left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID group by d1.PID ) itemCloseCount on itemCloseCount.DEPT_ID = sd.ID left join ( select sum(itemgrid.itemNum) itemNum ,d1.PID DEPT_ID from - ( select item.GRID_ID ,count(*) itemNum from .epdc_item item where item.DEL_FLAG = '0' - and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 1 group by item.GRID_ID ) itemgrid - left join .sys_dept d1 on d1.ID = itemgrid.GRID_ID group by d1.PID + ( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' + and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 1 group by item.GRID_ID ) itemgrid + left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID group by d1.PID ) itemSatisfiedCount on itemSatisfiedCount.DEPT_ID = sd.ID left join ( select sum(itemgrid.itemNum) itemNum ,d1.PID DEPT_ID from - ( select item.GRID_ID ,count(*) itemNum from .epdc_item item where item.DEL_FLAG = '0' - and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 2 group by item.GRID_ID ) itemgrid - left join .sys_dept d1 on d1.ID = itemgrid.GRID_ID group by d1.PID + ( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' + and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 2 group by item.GRID_ID ) itemgrid + left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID group by d1.PID ) itemVeryCount on itemVeryCount.DEPT_ID = sd.ID where sd.DEL_FLAG = '0' AND sd.id IS NOT NULL AND sd.`id` NOT IN( SELECT t.`dept_id` - FROM .`sys_dept_config` t + FROM `esua_epdc_admin`.`sys_dept_config` t WHERE t.`del_flag`= 0) and sd.TYPE_KEY = 'community_party' union all select - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId, - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId, 'grid' as orgType, sd.ID orgId, sd.PID parentId, @@ -1258,17 +1258,17 @@ select gr.id as orgId, IFNULL(itemCloseCount.itemNum,0) itemCloseTotal, IFNULL(itemSatisfiedCount.itemNum,0) itemSatisfiedTotal, IFNULL(itemVeryCount.itemNum,0) itemVeryTotal - from .sys_dept sd - left join (select count(*) partyNum,uu.DEPT_ID from .epdc_user uu where uu.DEL_FLAG = '0' and uu.PARTY_FLAG = '1' group by uu.DEPT_ID) user on user.DEPT_ID = sd.ID + from esua_epdc_admin.sys_dept sd + left join (select count(*) partyNum,uu.DEPT_ID from esua_epdc_user.epdc_user uu where uu.DEL_FLAG = '0' and uu.PARTY_FLAG = '1' group by uu.DEPT_ID) user on user.DEPT_ID = sd.ID left join ( select count(*) as TIMES_TOTAL, ws.GRID_ID as DEPT_ID - from .epdc_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' ) + from esua_epdc_group.epdc_group ws + where ws.DEL_FLAG = '0' and date_format(ws.CREATED_TIME, '%Y-%m' ) = #{yearMonth} GROUP BY ws.GRID_ID ) tto on tto.DEPT_ID = sd.ID - left join (select top.GRID_ID DEPT_ID ,count(*) topNum from .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_group.epdc_topic top where top.DEL_FLAG = '0' and date_format(top.CREATED_TIME, '%Y-%m' ) = #{yearMonth} group by top.GRID_ID) topCount on topCount.DEPT_ID = sd.ID left join ( SELECT count( t.a ) issueNum, @@ -1280,10 +1280,10 @@ select gr.id as orgId, EVENT_ID, GRID_ID FROM - .epdc_issue mei + esua_epdc_events.epdc_issue mei WHERE mei.DEL_FLAG = '0' - AND date_format( mei.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) + AND date_format( mei.CREATED_TIME, '%Y-%m' ) = #{yearMonth} GROUP BY EVENT_ID, GRID_ID @@ -1302,10 +1302,10 @@ select gr.id as orgId, EVENT_ID, GRID_ID FROM - .epdc_item item + esua_epdc_events.epdc_item item WHERE item.DEL_FLAG = '0' - AND date_format( item.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) + AND date_format( item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} GROUP BY EVENT_ID, GRID_ID @@ -1313,13 +1313,13 @@ select gr.id as orgId, GROUP BY t.GRID_ID ) itemCount on itemCount.DEPT_ID = sd.ID - left join (select item.GRID_ID DEPT_ID ,count(*) itemNum from .epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.ITEM_STATE = 10 group by item.GRID_ID) itemCloseCount on itemCloseCount.DEPT_ID = sd.ID - left join (select item.GRID_ID DEPT_ID ,count(*) itemNum from .epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 1 group by item.GRID_ID) itemSatisfiedCount on itemSatisfiedCount.DEPT_ID = sd.ID - left join (select item.GRID_ID DEPT_ID ,count(*) itemNum from .epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 2 group by item.GRID_ID) itemVeryCount on itemVeryCount.DEPT_ID = sd.ID + left join (select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.ITEM_STATE = 10 group by item.GRID_ID) itemCloseCount on itemCloseCount.DEPT_ID = sd.ID + left join (select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 1 group by item.GRID_ID) itemSatisfiedCount on itemSatisfiedCount.DEPT_ID = sd.ID + left join (select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 2 group by item.GRID_ID) itemVeryCount on itemVeryCount.DEPT_ID = sd.ID where sd.DEL_FLAG = '0' AND sd.id IS NOT NULL AND sd.`id` NOT IN( SELECT t.`dept_id` - FROM .`sys_dept_config` t + FROM `esua_epdc_admin`.`sys_dept_config` t WHERE t.`del_flag`= 0) and sd.TYPE_KEY = 'grid_party' ) t @@ -1359,7 +1359,7 @@ select gr.id as orgId, select - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId, - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId, 'agency' as orgType, sd.ID orgId, sd.PID parentId, @@ -2320,7 +2321,7 @@ union all - from .sys_dept sd + from esua_epdc_admin.sys_dept sd left join (select d3.PID DEPT_ID, @@ -2339,28 +2340,28 @@ union all from ( SELECT *, - ( SELECT CREATED_TIME FROM .epdc_issue_handle WHERE DEL_FLAG = '0' AND STATE = '1' AND ISSUE_ID = issue.id ORDER BY CREATED_TIME DESC, id DESC LIMIT 1) AS HANDLE_CREATED_TIME - FROM .epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) + ( SELECT CREATED_TIME FROM esua_epdc_events.epdc_issue_handle WHERE DEL_FLAG = '0' AND STATE = '1' AND ISSUE_ID = issue.id ORDER BY CREATED_TIME DESC, id DESC LIMIT 1) AS HANDLE_CREATED_TIME + FROM esua_epdc_events.epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = #{yearMonth} ) mee - LEFT JOIN .epdc_item mei ON mee.id = mei.ISSUE_ID and mei.DEL_FLAG = '0' - left join (select count(*) as deptCount,ITEM_ID from .epdc_item_dept where DEL_FLAG = '0' group by ITEM_ID) ide on ide.ITEM_ID = mei.ID - left join .sys_dept d1 on d1.ID = mee.GRID_ID - left join .sys_dept d2 on d1.PID = d2.ID - left join .sys_dept d3 on d2.PID = d3.ID + LEFT JOIN esua_epdc_events.epdc_item mei ON mee.id = mei.ISSUE_ID and mei.DEL_FLAG = '0' + left join (select count(*) as deptCount,ITEM_ID from esua_epdc_events.epdc_item_dept where DEL_FLAG = '0' group by ITEM_ID) ide on ide.ITEM_ID = mei.ID + left join esua_epdc_admin.sys_dept d1 on d1.ID = mee.GRID_ID + left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID + left join esua_epdc_admin.sys_dept d3 on d2.PID = d3.ID group by d3.PID ) rr on rr.DEPT_ID = sd.ID where sd.DEL_FLAG = '0' and sd.id IS NOT NULL AND sd.`id` NOT IN( SELECT t.`dept_id` - FROM .`sys_dept_config` t + FROM `esua_epdc_admin`.`sys_dept_config` t WHERE t.`del_flag`= 0) and sd.TYPE_KEY = 'district_party' union all select - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId, - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId, 'agency' as orgType, sd.ID orgId, sd.PID parentId, @@ -2378,7 +2379,7 @@ union all IFNULL(rr.governRatioFm,0) governRatioFm, IFNULL(rr.satisfactionRatioFz,0) satisfactionRatioFz, IFNULL(rr.satisfactionRatioFm,0) satisfactionRatioFm - from .sys_dept sd + from esua_epdc_admin.sys_dept sd left join (select d2.PID DEPT_ID, @@ -2396,28 +2397,28 @@ union all count(mei.EVALUATION_SCORE is not null or null) as satisfactionRatioFm from ( SELECT *, - ( SELECT CREATED_TIME FROM .epdc_issue_handle WHERE DEL_FLAG = '0' AND STATE = '1' AND ISSUE_ID = issue.id ORDER BY CREATED_TIME DESC, id DESC LIMIT 1) AS HANDLE_CREATED_TIME - FROM .epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) + ( SELECT CREATED_TIME FROM esua_epdc_events.epdc_issue_handle WHERE DEL_FLAG = '0' AND STATE = '1' AND ISSUE_ID = issue.id ORDER BY CREATED_TIME DESC, id DESC LIMIT 1) AS HANDLE_CREATED_TIME + FROM esua_epdc_events.epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = #{yearMonth} ) mee - LEFT JOIN .epdc_item mei ON mee.id = mei.ISSUE_ID and mei.DEL_FLAG = '0' - left join (select count(*) as deptCount,ITEM_ID from .epdc_item_dept where DEL_FLAG = '0' group by ITEM_ID) ide on ide.ITEM_ID = mei.ID - left join .sys_dept d1 on d1.ID = mee.GRID_ID - left join .sys_dept d2 on d1.PID = d2.ID + LEFT JOIN esua_epdc_events.epdc_item mei ON mee.id = mei.ISSUE_ID and mei.DEL_FLAG = '0' + left join (select count(*) as deptCount,ITEM_ID from esua_epdc_events.epdc_item_dept where DEL_FLAG = '0' group by ITEM_ID) ide on ide.ITEM_ID = mei.ID + left join esua_epdc_admin.sys_dept d1 on d1.ID = mee.GRID_ID + left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID group by d2.PID ) rr on rr.DEPT_ID = sd.ID where sd.DEL_FLAG = '0' and sd.id IS NOT NULL AND sd.`id` NOT IN( SELECT t.`dept_id` - FROM .`sys_dept_config` t + FROM `esua_epdc_admin`.`sys_dept_config` t WHERE t.`del_flag`= 0) and sd.TYPE_KEY = 'street_party' union all select - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId, - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId, 'agency' as orgType, sd.ID orgId, sd.PID parentId, @@ -2435,7 +2436,7 @@ union all IFNULL(rr.governRatioFm,0) governRatioFm, IFNULL(rr.satisfactionRatioFz,0) satisfactionRatioFz, IFNULL(rr.satisfactionRatioFm,0) satisfactionRatioFm - from .sys_dept sd + from esua_epdc_admin.sys_dept sd left join (select d1.PID DEPT_ID, @@ -2454,12 +2455,12 @@ union all from ( SELECT *, - ( SELECT CREATED_TIME FROM .epdc_issue_handle WHERE DEL_FLAG = '0' AND STATE = '1' AND ISSUE_ID = issue.id ORDER BY CREATED_TIME DESC, id DESC LIMIT 1) AS HANDLE_CREATED_TIME - FROM .epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) + ( SELECT CREATED_TIME FROM esua_epdc_events.epdc_issue_handle WHERE DEL_FLAG = '0' AND STATE = '1' AND ISSUE_ID = issue.id ORDER BY CREATED_TIME DESC, id DESC LIMIT 1) AS HANDLE_CREATED_TIME + FROM esua_epdc_events.epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = #{yearMonth} ) mee - LEFT JOIN .epdc_item mei ON mee.id = mei.ISSUE_ID and mei.DEL_FLAG = '0' - left join (select count(*) as deptCount,ITEM_ID from .epdc_item_dept where DEL_FLAG = '0' group by ITEM_ID) ide on ide.ITEM_ID = mei.ID - left join .sys_dept d1 on d1.ID = mee.GRID_ID + LEFT JOIN esua_epdc_events.epdc_item mei ON mee.id = mei.ISSUE_ID and mei.DEL_FLAG = '0' + left join (select count(*) as deptCount,ITEM_ID from esua_epdc_events.epdc_item_dept where DEL_FLAG = '0' group by ITEM_ID) ide on ide.ITEM_ID = mei.ID + left join esua_epdc_admin.sys_dept d1 on d1.ID = mee.GRID_ID group by d1.PID ) rr on rr.DEPT_ID = sd.ID @@ -2467,15 +2468,15 @@ union all sd.DEL_FLAG = '0' and sd.id IS NOT NULL AND sd.`id` NOT IN( SELECT t.`dept_id` - FROM .`sys_dept_config` t + FROM `esua_epdc_admin`.`sys_dept_config` t WHERE t.`del_flag`= 0) and sd.TYPE_KEY = 'community_party' union all select - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId, - date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId, + DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId, 'grid' as orgType, sd.ID orgId, sd.PID parentId, @@ -2493,7 +2494,7 @@ union all IFNULL(rr.governRatioFm,0) governRatioFm, IFNULL(rr.satisfactionRatioFz,0) satisfactionRatioFz, IFNULL(rr.satisfactionRatioFm,0) satisfactionRatioFm - from .sys_dept sd + from esua_epdc_admin.sys_dept sd left join (select mee.GRID_ID DEPT_ID, @@ -2511,17 +2512,17 @@ union all count(mei.EVALUATION_SCORE is not null or null) as satisfactionRatioFm from ( SELECT *, - ( SELECT CREATED_TIME FROM .epdc_issue_handle WHERE DEL_FLAG = '0' AND STATE = '1' AND ISSUE_ID = issue.id ORDER BY CREATED_TIME DESC, id DESC LIMIT 1) AS HANDLE_CREATED_TIME - FROM .epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) + ( SELECT CREATED_TIME FROM esua_epdc_events.epdc_issue_handle WHERE DEL_FLAG = '0' AND STATE = '1' AND ISSUE_ID = issue.id ORDER BY CREATED_TIME DESC, id DESC LIMIT 1) AS HANDLE_CREATED_TIME + FROM esua_epdc_events.epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = #{yearMonth} ) mee - LEFT JOIN .epdc_item mei ON mee.id = mei.ISSUE_ID and mei.DEL_FLAG = '0' - left join (select count(*) as deptCount,ITEM_ID from .epdc_item_dept where DEL_FLAG = '0' group by ITEM_ID) ide on ide.ITEM_ID = mei.ID + LEFT JOIN esua_epdc_events.epdc_item mei ON mee.id = mei.ISSUE_ID and mei.DEL_FLAG = '0' + left join (select count(*) as deptCount,ITEM_ID from esua_epdc_events.epdc_item_dept where DEL_FLAG = '0' group by ITEM_ID) ide on ide.ITEM_ID = mei.ID GROUP BY mee.GRID_ID) rr on rr.DEPT_ID = sd.ID where sd.DEL_FLAG = '0' and sd.id IS NOT NULL AND sd.`id` NOT IN( SELECT t.`dept_id` - FROM .`sys_dept_config` t + FROM `esua_epdc_admin`.`sys_dept_config` t WHERE t.`del_flag`= 0) and sd.TYPE_KEY = 'grid_party'