Browse Source

streetdetail-py

红黄绿事件
dev_shibei_match
zxc 4 years ago
parent
commit
ec88b107f4
  1. 30
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/ColorProjectTotalFormDTO.java
  2. 27
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/StreetDetailPYFormDTO.java
  3. 48
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/ColorProjectTotalResultDTO.java
  4. 50
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/StreetDetailPYResultDTO.java
  5. 38
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PyController.java
  6. 23
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  7. 17
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java
  8. 17
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java
  9. 21
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/PyService.java
  10. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java
  11. 51
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PyServiceImpl.java
  12. 30
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  13. 37
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
  14. 28
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml

30
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/ColorProjectTotalFormDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.form.screen;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/6/1 3:11 下午
* @DESC
*/
@Data
public class ColorProjectTotalFormDTO implements Serializable {
private static final long serialVersionUID = -6991770717583778665L;
public interface ColorProjectTotalForm{}
/**
* 组织id
*/
@NotBlank(message = "组织ID不能为空",groups = ColorProjectTotalForm.class)
private String agencyId;
/**
* 行政区域码平阴必填
*/
private String areaCode;
}

27
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/StreetDetailPYFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form.screen;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/6/2 9:42 上午
* @DESC
*/
@Data
public class StreetDetailPYFormDTO implements Serializable {
private static final long serialVersionUID = -4821168326488796711L;
public interface StreetDetailPYForm{}
@NotBlank(message = "组织ID不能为空",groups = StreetDetailPYForm.class)
private String agencyId;
/**
* 行政区域编码 平阴必填
*/
private String areaCode;
}

48
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/ColorProjectTotalResultDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.result.screen;
import com.epmet.commons.tools.constant.NumConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/6/1 3:15 下午
* @DESC
*/
@Data
public class ColorProjectTotalResultDTO implements Serializable {
private static final long serialVersionUID = -8211214262766797296L;
/**
* 事件总数
*/
private Integer projectTotal;
/**
* 红灯事件总数
*/
private Integer redTotal;
/**
* 黄灯事件总数
*/
private Integer yellowTotal;
/**
* 绿灯事件总数
*/
private Integer greenTotal;
@JsonIgnore
private Integer projectLevel;
public ColorProjectTotalResultDTO() {
this.projectTotal = NumConstant.ZERO;
this.redTotal = NumConstant.ZERO;
this.yellowTotal = NumConstant.ZERO;
this.greenTotal = NumConstant.ZERO;
}
}

50
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/StreetDetailPYResultDTO.java

@ -0,0 +1,50 @@
package com.epmet.dto.result.screen;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/6/2 9:43 上午
* @DESC
*/
@Data
public class StreetDetailPYResultDTO implements Serializable {
private static final long serialVersionUID = 663001974527694466L;
/**
* 组织id
*/
private String agencyId;
/**
* 组织名称
*/
private String agencyName;
/**
* 注册党员数
*/
private Integer partyMemberTotal;
/**
* 网格总数
*/
private Integer gridTotal;
/**
* 网格员数
*/
private Integer gridMemberTotal;
public StreetDetailPYResultDTO() {
this.partyMemberTotal = NumConstant.ZERO;
this.gridTotal = NumConstant.ZERO;
this.gridMemberTotal = NumConstant.ZERO;
this.agencyId = "";
this.agencyName = "";
}
}

38
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PyController.java

@ -0,0 +1,38 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.PyService;
import com.epmet.dto.form.screen.StreetDetailPYFormDTO;
import com.epmet.dto.result.screen.StreetDetailPYResultDTO;
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;
/**
* @Author zxc
* @DateTime 2021/6/2 9:40 上午
* @DESC
*/
@RestController
@RequestMapping("pyscreen")
public class PyController {
@Autowired
private PyService pyService;
/**
* @Description 街道注册党员数网格数网格员数
* @Param formDTO
* @author zxc
* @date 2021/6/2 10:07 上午
*/
@PostMapping("streetdetail-py")
public Result<StreetDetailPYResultDTO> streetDetail(@RequestBody StreetDetailPYFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, StreetDetailPYFormDTO.StreetDetailPYForm.class);
return new Result<StreetDetailPYResultDTO>().ok(pyService.streetDetail(formDTO));
}
}

23
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java

@ -5,14 +5,8 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectOrgDailyService; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectOrgDailyService;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; import com.epmet.dto.form.screen.*;
import com.epmet.dto.form.screen.EfficiencyAnalysisFormDTO; import com.epmet.dto.result.screen.*;
import com.epmet.dto.form.screen.QueryQuantityMonthlyFormDTO;
import com.epmet.dto.form.screen.ScreenCommonFormDTO;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO;
import com.epmet.dto.result.screen.ProjectQuantityResultDTO;
import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
@ -132,4 +126,17 @@ public class ScreenProjectController {
ValidatorUtils.validateEntity(formDTO, CategoryAnalysisFormDTO.CategoryAnalysis.class); ValidatorUtils.validateEntity(formDTO, CategoryAnalysisFormDTO.CategoryAnalysis.class);
return new Result<List<CategoryAnalysisResultDTO>>().ok(screenProjectService.categoryAnalysis(customerId, formDTO)); return new Result<List<CategoryAnalysisResultDTO>>().ok(screenProjectService.categoryAnalysis(customerId, formDTO));
} }
/**
* @Description 红黄绿事件总数
* @Param formDTO
* @author zxc
* @date 2021/6/1 3:20 下午
*/
@PostMapping("colorprojectotal")
public Result<ColorProjectTotalResultDTO> colorProjectTotal(@RequestBody ColorProjectTotalFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ColorProjectTotalFormDTO.ColorProjectTotalForm.class);
return new Result<ColorProjectTotalResultDTO>().ok(screenProjectService.colorProjectTotal(formDTO));
}
} }

17
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java

@ -1,5 +1,6 @@
package com.epmet.datareport.dao.evaluationindex.screen; package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.result.screen.ColorProjectTotalResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -28,4 +29,20 @@ public interface ScreenProjectDataDao {
List<ScreenProjectDetailResultDTO.processDTO.AttachmentDTO> selectProjectProcessAttachments(@Param("processId") String processId, List<ScreenProjectDetailResultDTO.processDTO.AttachmentDTO> selectProjectProcessAttachments(@Param("processId") String processId,
@Param("projectId") String projectId, @Param("projectId") String projectId,
@Param("customerId") String customerId); @Param("customerId") String customerId);
/**
* @Description 根据agencyId查询事件
* @Param agencyId
* @author zxc
* @date 2021/6/1 3:48 下午
*/
List<ColorProjectTotalResultDTO> selectColorProjectByAgencyId(@Param("agencyId") String agencyId);
/**
* @Description 根据areaCode查询事件
* @Param agencyId
* @author zxc
* @date 2021/6/1 3:48 下午
*/
List<ColorProjectTotalResultDTO> selectColorProjectByAreaCode(@Param("areaCode") String areaCode);
} }

17
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.evaluationindex.screen; package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.result.screen.StreetDetailPYResultDTO;
import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO; import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TopProfileResultDTO; import com.epmet.evaluationindex.screen.dto.result.TopProfileResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -60,4 +61,20 @@ public interface ScreenUserTotalDataDao {
int selectAvgIssue(@Param("agencyId")String agencyId); int selectAvgIssue(@Param("agencyId")String agencyId);
PartymemberPercentResultDTO selectAgencyPartymemberPercentByIds(@Param("orgIds") List<String> orgIds); PartymemberPercentResultDTO selectAgencyPartymemberPercentByIds(@Param("orgIds") List<String> orgIds);
/**
* @Description 根据组织ID查询街道详情
* @Param agencyId
* @author zxc
* @date 2021/6/2 10:38 上午
*/
StreetDetailPYResultDTO selectStreetDetailByAgencyId(@Param("agencyId")String agencyId);
/**
* @Description 根据组织编码查询街道详情
* @Param agencyId
* @author zxc
* @date 2021/6/2 10:38 上午
*/
StreetDetailPYResultDTO selectStreetDetailByAreaCode(@Param("areaCode")String areaCode);
} }

21
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/PyService.java

@ -0,0 +1,21 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.dto.form.screen.StreetDetailPYFormDTO;
import com.epmet.dto.result.screen.StreetDetailPYResultDTO;
/**
* @Author zxc
* @DateTime 2021/6/2 10:05 上午
* @DESC
*/
public interface PyService {
/**
* @Description 街道注册党员数网格数网格员数
* @Param formDTO
* @author zxc
* @date 2021/6/2 10:07 上午
*/
StreetDetailPYResultDTO streetDetail(StreetDetailPYFormDTO formDTO);
}

10
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java

@ -2,7 +2,9 @@ package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.form.screen.ColorProjectTotalFormDTO;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.dto.result.screen.ColorProjectTotalResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
@ -40,4 +42,12 @@ public interface ScreenProjectService {
List<ScreenProjectDistributionResultDTO> projectDistribution(ScreenProjectDistributionFormDTO formDTO); List<ScreenProjectDistributionResultDTO> projectDistribution(ScreenProjectDistributionFormDTO formDTO);
Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO); Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO);
/**
* @Description 红黄绿事件总数
* @Param formDTO
* @author zxc
* @date 2021/6/1 3:20 下午
*/
ColorProjectTotalResultDTO colorProjectTotal(ColorProjectTotalFormDTO formDTO);
} }

51
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PyServiceImpl.java

@ -0,0 +1,51 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenUserTotalDataDao;
import com.epmet.datareport.service.evaluationindex.screen.PyService;
import com.epmet.dto.form.screen.StreetDetailPYFormDTO;
import com.epmet.dto.result.screen.StreetDetailPYResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Author zxc
* @DateTime 2021/6/2 10:05 上午
* @DESC
*/
@Slf4j
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class PyServiceImpl implements PyService {
@Autowired
private ScreenUserTotalDataDao screenUserTotalDataDao;
/**
* @Description 街道注册党员数网格数网格员数
* @Param formDTO
* @author zxc
* @date 2021/6/2 10:07 上午
*/
@Override
public StreetDetailPYResultDTO streetDetail(StreetDetailPYFormDTO formDTO) {
StreetDetailPYResultDTO result = new StreetDetailPYResultDTO();
if (StringUtils.isEmpty(formDTO.getAreaCode())){
result = screenUserTotalDataDao.selectStreetDetailByAgencyId(formDTO.getAgencyId());
}else {
StreetDetailPYResultDTO eightStreet = screenUserTotalDataDao.selectStreetDetailByAreaCode(formDTO.getAreaCode());
result = screenUserTotalDataDao.selectStreetDetailByAgencyId(formDTO.getAgencyId());
if (null == result){
throw new RenException("组织ID【"+formDTO.getAgencyId()+"】不存在于screen_customer_agency");
}
result.setGridMemberTotal(result.getGridMemberTotal() + eightStreet.getGridMemberTotal());
result.setPartyMemberTotal(result.getPartyMemberTotal() + eightStreet.getPartyMemberTotal());
result.setGridTotal(result.getGridTotal() + eightStreet.getGridTotal());
}
return result;
}
}

30
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java

@ -11,7 +11,9 @@ import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgD
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.form.screen.ColorProjectTotalFormDTO;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.dto.result.screen.ColorProjectTotalResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
@ -28,6 +30,8 @@ import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 项目 * 项目
@ -149,4 +153,30 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
} }
return resultList; return resultList;
} }
/**
* @Description 红黄绿事件总数
* @Param formDTO
* @author zxc
* @date 2021/6/1 3:20 下午
*/
@Override
public ColorProjectTotalResultDTO colorProjectTotal(ColorProjectTotalFormDTO formDTO) {
ColorProjectTotalResultDTO result = new ColorProjectTotalResultDTO();
List<ColorProjectTotalResultDTO> list = new ArrayList<>();
if (StringUtils.isEmpty(formDTO.getAreaCode())){
list = screenProjectDataDao.selectColorProjectByAgencyId(formDTO.getAgencyId());
}else {
list = screenProjectDataDao.selectColorProjectByAreaCode(formDTO.getAreaCode());
}
// 事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期
if (!CollectionUtils.isEmpty(list)){
Map<Integer, List<ColorProjectTotalResultDTO>> groupByLevel = list.stream().collect(Collectors.groupingBy(ColorProjectTotalResultDTO::getProjectLevel));
result.setRedTotal(CollectionUtils.isEmpty(groupByLevel.get(NumConstant.ONE)) ? NumConstant.ZERO : groupByLevel.get(NumConstant.ONE).size());
result.setYellowTotal(CollectionUtils.isEmpty(groupByLevel.get(NumConstant.TWO)) ? NumConstant.ZERO : groupByLevel.get(NumConstant.TWO).size());
result.setGreenTotal(CollectionUtils.isEmpty(groupByLevel.get(NumConstant.THREE)) ? NumConstant.ZERO : groupByLevel.get(NumConstant.THREE).size());
result.setProjectTotal(list.size());
}
return result;
}
} }

37
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

@ -112,4 +112,41 @@
and CUSTOMER_ID= #{customerId} and CUSTOMER_ID= #{customerId}
order by sort asc order by sort asc
</select> </select>
<!-- 根据agencyId查询事件 -->
<select id="selectColorProjectByAgencyId" resultType="com.epmet.dto.result.screen.ColorProjectTotalResultDTO">
SELECT
PROJECT_LEVEL
FROM screen_project_data
WHERE DEL_FLAG = '0'
AND PARENT_ID = #{agencyId}
AND PROJECT_LEVEL != 0
</select>
<!-- 根据areaCode查询事件 -->
<select id="selectColorProjectByAreaCode" resultType="com.epmet.dto.result.screen.ColorProjectTotalResultDTO">
(SELECT pd.PROJECT_LEVEL
FROM screen_project_data pd
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = pd.ORG_ID
WHERE pd.DEL_FLAG = '0'
AND pd.ORG_TYPE = 'agency'
AND pd.PROJECT_LEVEL != 0
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%'))
UNION ALL
(SELECT pd.PROJECT_LEVEL
FROM screen_project_data pd
LEFT JOIN screen_customer_grid scg ON scg.GRID_ID = pd.ORG_ID
WHERE pd.DEL_FLAG = '0'
AND pd.ORG_TYPE = 'grid'
AND pd.PROJECT_LEVEL != 0
AND scg.AREA_CODE LIKE CONCAT(#{areaCode},'%'))
UNION ALL
(SELECT pd.PROJECT_LEVEL
FROM screen_project_data pd
LEFT JOIN screen_customer_dept scd ON scd.DEPT_ID = pd.ORG_ID
WHERE pd.DEL_FLAG = '0'
AND pd.ORG_TYPE = 'department'
AND pd.PROJECT_LEVEL != 0
AND scd.AREA_CODE LIKE CONCAT(#{areaCode},'%'))
</select>
</mapper> </mapper>

28
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml

@ -82,4 +82,32 @@
ISSUE_TOTAL desc, ISSUE_TOTAL desc,
PROJECT_TOTAL desc PROJECT_TOTAL desc
</select> </select>
<!-- 根据组织ID查询街道详情 -->
<select id="selectStreetDetailByAgencyId" resultType="com.epmet.dto.result.screen.StreetDetailPYResultDTO">
SELECT
td.ORG_ID AS agencyId,
td.ORG_NAME AS agencyName,
IFNULL(td.PARTY_TOTAL,0) AS partyMemberTotal,
IFNULL(td.USER_TOTAL,0) AS gridMemberTotal,
(SELECT COUNT(ID) FROM screen_customer_grid WHERE DEL_FLAG = '0' AND PARENT_AGENCY_ID = #{agencyId}) AS gridTotal
FROM screen_customer_agency sca
LEFT JOIN screen_user_total_data td ON td.ORG_ID = sca.AGENCY_ID
WHERE td.DEL_FLAG = '0'
AND td.ORG_TYPE = 'agency'
AND sca.AGENCY_ID = #{agencyId}
</select>
<!-- 根据组织编码查询街道详情 【适用平阴】 -->
<select id="selectStreetDetailByAreaCode" resultType="com.epmet.dto.result.screen.StreetDetailPYResultDTO">
SELECT
IFNULL(SUM(td.PARTY_TOTAL),0) AS partyMemberTotal,
IFNULL(SUM(td.USER_TOTAL),0) AS gridMemberTotal,
(SELECT COUNT(ID) FROM screen_customer_grid WHERE DEL_FLAG = '0' AND AREA_CODE LIKE CONCAT(#{areaCode},'%')) AS gridTotal
FROM screen_user_total_data td
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = td.ORG_ID
WHERE td.DEL_FLAG = '0'
AND sca.PARENT_AREA_CODE = #{areaCode}
AND td.ORG_TYPE = 'agency'
</select>
</mapper> </mapper>
Loading…
Cancel
Save