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列表
*/
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
SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 1 ) AS cotegoryName,
COUNT( ei.ID ) AS count
SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 1 ) AS cotegoryName,
COUNT( ei.ID ) AS count
FROM
esua_epdc_events.epdc_issue ei
esua_epdc_events.epdc_issue ei
WHERE
ei.DEL_FLAG = '0'
<if test="gridIds!=null and gridIds.size()>0">
and ei.GRID_ID in
<foreach collection="gridIds" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
ei.DEL_FLAG = '0'
AND ei.GRID_ID IN
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
<if test="timestamp != null and timestamp != ''">
<![CDATA[ AND DATE_FORMAT(ei.CREATED_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{timestamp}
</if>
GROUP BY
SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 1 )
SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 1 )
ORDER BY
cotegoryName DESC
LIMIT 5;
count DESC
LIMIT #{pageIndex}, #{pageSize};
</select>
<select id="selectListStatisticsByTwoCategory" resultType="com.elink.esua.epdc.dto.issue.result.IssueStatisticsInfoResultDTO">
SELECT
SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 2 ) AS cotegoryName,
COUNT( ei.ID ) AS counut
SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 2 ) AS cotegoryName,
COUNT( ei.ID ) AS count
FROM
esua_epdc_events.epdc_issue ei
esua_epdc_events.epdc_issue ei
WHERE
ei.DEL_FLAG = '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
<foreach collection="gridIds" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
ei.DEL_FLAG = '0'
AND ( LENGTH( ei.CATEGORY_FULL_NAME ) - LENGTH( REPLACE ( ei.CATEGORY_FULL_NAME, '-', '' ) ) ) > 0
AND ei.GRID_ID IN
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
<if test="timestamp != null and timestamp != ''">
<![CDATA[ AND DATE_FORMAT(ei.CREATED_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{timestamp}
</if>
GROUP BY
SUBSTRING_INDEX( SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 2 ), '-', - 1 )
SUBSTRING_INDEX( SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 2 ), '-', - 1 )
ORDER BY
cotegoryName DESC
LIMIT 5;
count DESC
LIMIT #{pageIndex}, #{pageSize};
</select>
<select id="selectListStatisticsByThreeCategory" resultType="com.elink.esua.epdc.dto.issue.result.IssueStatisticsInfoResultDTO">
SELECT
SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 3 ) AS cotegoryName,
COUNT( ei.ID ) AS count
SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 3 ) AS cotegoryName,
COUNT( ei.ID ) AS count
FROM
esua_epdc_events.epdc_issue ei
esua_epdc_events.epdc_issue ei
WHERE
ei.DEL_FLAG = '0'
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
<foreach collection="gridIds" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
ei.DEL_FLAG = '0'
AND ( LENGTH( ei.CATEGORY_FULL_NAME ) - LENGTH( REPLACE ( ei.CATEGORY_FULL_NAME, '-', '' ) ) ) > 1
AND ei.GRID_ID IN
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
<if test="timestamp != null and timestamp != ''">
<![CDATA[ AND DATE_FORMAT(ei.CREATED_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{timestamp}
</if>
GROUP BY
SUBSTRING_INDEX( SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 3 ), '-', - 1 )
SUBSTRING_INDEX( SUBSTRING_INDEX( ei.CATEGORY_FULL_NAME, '-', 3 ), '-', - 1 )
ORDER BY
cotegoryName DESC
LIMIT 5;
count DESC
LIMIT #{pageIndex}, #{pageSize};
</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) {
//效验数据
ValidatorUtils.validateEntity(formDto);
formDto.setGridIds(SecurityUser.getUser().getDeptIdList());
formDto.setDeptIdList(SecurityUser.getUser().getDeptIdList());
return analysisIssueService.listStatisticsByCategory(formDto);
}

Loading…
Cancel
Save