DATE_FORMAT(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), '%Y-%m'), '%Y%m') AS monthId,
</otherwise>
</choose>
a.staffId,
a.staffName,
a.gridId,
@ -41,8 +57,16 @@
seur.STAFF_NAME as staffName,
ee.GRID_ID as gridId,
sd.pid,
<choose>
<whentest="endTime != null and endTime != ''">
count(DATE_FORMAT(ee.CREATED_TIME, '%Y-%m-%d') <= #{endTime} or null) as projectCount, -- 项目立项数,截止到当前dateId的总数
count(DATE_FORMAT(ee.CREATED_TIME, '%Y-%m-%d') = #{endTime} or null) as projectIncr, -- 项目立项数,dateId这一天的增量
</when>
<otherwise>
count(DATE_FORMAT(ee.CREATED_TIME, '%Y-%m-%d') <= #{yearMonthDay} or null) as projectCount, -- 项目立项数,截止到当前dateId的总数
count(DATE_FORMAT(ee.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} or null) as projectIncr, -- 项目立项数,dateId这一天的增量
</otherwise>
</choose>
0 as issueToProjectCount,
0 as closedIssueCount,
0 as projectResponseCount,
@ -73,12 +97,20 @@
sd.pid,
0 as projectCount,
0 as projectIncr,
<choose>
<whentest="endTime != null and endTime != ''">
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{endTime} or null) as issueToProjectCount, -- 议题转项目数,截止到当前dateId的总数
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{endTime} or null) as issueToProjectIncr, -- 议题转项目数,dateId这一天的增量
</when>
<otherwise>
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{yearMonthDay} or null) as issueToProjectCount, -- 议题转项目数,截止到当前dateId的总数
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} or null) as issueToProjectIncr, -- 议题转项目数,dateId这一天的增量
</otherwise>
</choose>
0 as closedIssueCount,
0 as projectResponseCount,
0 as projectTransferCount,
0 as projectClosedCount,
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} or null) as issueToProjectIncr, -- 议题转项目数,dateId这一天的增量
0 as closedIssueIncr,
0 as projectResponseIncr,
0 as projectTransferIncr,
@ -104,12 +136,20 @@
0 as projectCount,
0 as projectIncr,
0 as issueToProjectCount,
<choose>
<whentest="endTime != null and endTime != ''">
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{endTime} or null) as closedIssueCount, -- 议题关闭数,截止到当前dateId的总数
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{endTime} or null) as closedIssueIncr, -- 议题关闭数,dateId这一天的增量
</when>
<otherwise>
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{yearMonthDay} or null) as closedIssueCount, -- 议题关闭数,截止到当前dateId的总数
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} or null) as closedIssueIncr, -- 议题关闭数,dateId这一天的增量
</otherwise>
</choose>
0 as projectResponseCount,
0 as projectTransferCount,
0 as projectClosedCount,
0 as issueToProjectIncr,
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} or null) as closedIssueIncr, -- 议题关闭数,dateId这一天的增量
0 as projectResponseIncr,
0 as projectTransferIncr,
0 as projectClosedIncr
@ -136,14 +176,26 @@
0 as projectIncr,
0 as issueToProjectCount,
0 as closedIssueCount,
<choose>
<whentest="endTime != null and endTime != ''">
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{endTime} and ei.STATE = 0 and eid.ID is null or null) as projectResponseCount, -- 项目响应数,截止到当前dateId的总数
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{endTime} and ei.STATE = 0 and eid.ID is not null or null) as projectTransferCount, -- 项目吹哨数,截止到当前dateId的总数
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{endTime} and ei.STATE = 10 or null) as projectClosedCount, -- 项目结案数,截止到当前dateId的总数
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{endTime} and ei.STATE = 0 and eid.ID is null or null) as projectResponseIncr, -- 项目响应数,dateId这一天的增量
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{endTime} and ei.STATE = 0 and eid.ID is not null or null) as projectTransferIncr, -- 项目吹哨数,dateId这一天的增量
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{endTime} and ei.STATE = 10 or null) as projectClosedIncr -- 项目结案数,dateId这一天的增量
</when>
<otherwise>
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{yearMonthDay} and ei.STATE = 0 and eid.ID is null or null) as projectResponseCount, -- 项目响应数,截止到当前dateId的总数
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{yearMonthDay} and ei.STATE = 0 and eid.ID is not null or null) as projectTransferCount, -- 项目吹哨数,截止到当前dateId的总数
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{yearMonthDay} and ei.STATE = 10 or null) as projectClosedCount, -- 项目结案数,截止到当前dateId的总数
0 as issueToProjectIncr,
0 as closedIssueIncr,
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} and ei.STATE = 0 and eid.ID is null or null) as projectResponseIncr, -- 项目响应数,dateId这一天的增量
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} and ei.STATE = 0 and eid.ID is not null or null) as projectTransferIncr, -- 项目吹哨数,dateId这一天的增量
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} and ei.STATE = 10 or null) as projectClosedIncr -- 项目结案数,dateId这一天的增量
</otherwise>
</choose>
0 as issueToProjectIncr,
0 as closedIssueIncr,
from esua_epdc_admin.sys_epmet_user_relation seur
left join esua_epdc_admin.sys_user eu on eu.MOBILE = seur.MOBILE
right join esua_epdc_events.epdc_item_handle_process ei on ei.CREATED_BY = eu.id and ei.DEL_FLAG = '0'