Browse Source

议题项目数量类目分析 接口修改

dev
zhangyongzhangyong 6 years ago
parent
commit
77ca6daaa1
  1. 2
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/issue/form/IssueStatisticsInfoFormDTO.java
  2. 85
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/issue/IssueAnalysisDao.xml
  3. 2
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAnalysisIssueController.java

2
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/issue/form/IssueStatisticsInfoFormDTO.java

@ -47,5 +47,5 @@ public class IssueStatisticsInfoFormDTO implements Serializable {
/** /**
* 部门ID列表 * 部门ID列表
*/ */
List<Long> gridIds; List<Long> deptIdList;
} }

85
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/issue/IssueAnalysisDao.xml

@ -189,67 +189,70 @@
<select id="selectListStatisticsByFirstCategory" resultType="com.elink.esua.epdc.dto.issue.result.IssueStatisticsInfoResultDTO"> <select id="selectListStatisticsByFirstCategory" resultType="com.elink.esua.epdc.dto.issue.result.IssueStatisticsInfoResultDTO">
SELECT SELECT
SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 1 ) AS cotegoryName, SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 1 ) AS cotegoryName,
COUNT( ei.ID ) AS count COUNT( ei.ID ) AS count
FROM FROM
esua_epdc_events.epdc_issue ei esua_epdc_events.epdc_issue ei
WHERE WHERE
ei.DEL_FLAG = '0' ei.DEL_FLAG = '0'
<if test="gridIds!=null and gridIds.size()>0"> AND ei.GRID_ID IN
and ei.GRID_ID in <foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
<foreach collection="gridIds" index="index" item="deptId" open="(" separator="," close=")"> #{deptId}
#{deptId} </foreach>
</foreach> <if test="timestamp != null and timestamp != ''">
</if> <![CDATA[ AND DATE_FORMAT(ei.CREATED_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{timestamp}
</if>
GROUP BY GROUP BY
SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 1 ) SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 1 )
ORDER BY ORDER BY
cotegoryName DESC count DESC
LIMIT 5; LIMIT #{pageIndex}, #{pageSize};
</select> </select>
<select id="selectListStatisticsByTwoCategory" resultType="com.elink.esua.epdc.dto.issue.result.IssueStatisticsInfoResultDTO"> <select id="selectListStatisticsByTwoCategory" resultType="com.elink.esua.epdc.dto.issue.result.IssueStatisticsInfoResultDTO">
SELECT SELECT
SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 2 ) AS cotegoryName, SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 2 ) AS cotegoryName,
COUNT( ei.ID ) AS counut COUNT( ei.ID ) AS count
FROM FROM
esua_epdc_events.epdc_issue ei esua_epdc_events.epdc_issue ei
WHERE WHERE
ei.DEL_FLAG = '0' ei.DEL_FLAG = '0'
AND ( LENGTH( ei.CATEGORY_FULL_NAME ) - LENGTH( REPLACE ( ei.CATEGORY_FULL_NAME, '-', '' ) ) ) > 0 AND ( LENGTH( ei.CATEGORY_FULL_NAME ) - LENGTH( REPLACE ( ei.CATEGORY_FULL_NAME, '-', '' ) ) ) > 0
<if test="gridIds!=null and gridIds.size()>0"> AND ei.GRID_ID IN
and ei.GRID_ID in <foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
<foreach collection="gridIds" index="index" item="deptId" open="(" separator="," close=")"> #{deptId}
#{deptId} </foreach>
</foreach> <if test="timestamp != null and timestamp != ''">
</if> <![CDATA[ AND DATE_FORMAT(ei.CREATED_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{timestamp}
</if>
GROUP BY GROUP BY
SUBSTRING_INDEX( SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 2 ), '-', - 1 ) SUBSTRING_INDEX( SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 2 ), '-', - 1 )
ORDER BY ORDER BY
cotegoryName DESC count DESC
LIMIT 5; LIMIT #{pageIndex}, #{pageSize};
</select> </select>
<select id="selectListStatisticsByThreeCategory" resultType="com.elink.esua.epdc.dto.issue.result.IssueStatisticsInfoResultDTO"> <select id="selectListStatisticsByThreeCategory" resultType="com.elink.esua.epdc.dto.issue.result.IssueStatisticsInfoResultDTO">
SELECT SELECT
SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 3 ) AS cotegoryName, SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 3 ) AS cotegoryName,
COUNT( ei.ID ) AS count COUNT( ei.ID ) AS count
FROM FROM
esua_epdc_events.epdc_issue ei esua_epdc_events.epdc_issue ei
WHERE WHERE
ei.DEL_FLAG = '0' ei.DEL_FLAG = '0'
AND ( LENGTH( ei.CATEGORY_FULL_NAME ) - LENGTH( REPLACE ( ei.CATEGORY_FULL_NAME, '-', '' ) ) ) > 1 AND ( LENGTH( ei.CATEGORY_FULL_NAME ) - LENGTH( REPLACE ( ei.CATEGORY_FULL_NAME, '-', '' ) ) ) > 1
<if test="gridIds!=null and gridIds.size()>0"> AND ei.GRID_ID IN
and ei.GRID_ID in <foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
<foreach collection="gridIds" index="index" item="deptId" open="(" separator="," close=")"> #{deptId}
#{deptId} </foreach>
</foreach> <if test="timestamp != null and timestamp != ''">
</if> <![CDATA[ AND DATE_FORMAT(ei.CREATED_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{timestamp}
</if>
GROUP BY GROUP BY
SUBSTRING_INDEX( SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 3 ), '-', - 1 ) SUBSTRING_INDEX( SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 3 ), '-', - 1 )
ORDER BY ORDER BY
cotegoryName DESC count DESC
LIMIT 5; LIMIT #{pageIndex}, #{pageSize};
</select> </select>

2
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAnalysisIssueController.java

@ -55,7 +55,7 @@ public class ApiAnalysisIssueController {
public Result<List<IssueStatisticsInfoResultDTO>> getStatisticsByCategory(@RequestBody IssueStatisticsInfoFormDTO formDto) { public Result<List<IssueStatisticsInfoResultDTO>> getStatisticsByCategory(@RequestBody IssueStatisticsInfoFormDTO formDto) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDto); ValidatorUtils.validateEntity(formDto);
formDto.setGridIds(SecurityUser.getUser().getDeptIdList()); formDto.setDeptIdList(SecurityUser.getUser().getDeptIdList());
return analysisIssueService.listStatisticsByCategory(formDto); return analysisIssueService.listStatisticsByCategory(formDto);
} }

Loading…
Cancel
Save