|
|
|
@ -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> |
|
|
|
|
|
|
|
|
|
|
|
|