@ -63,16 +63,31 @@
</select> -->
<select id= "selectProjectEvaluate" resultType= "com.epmet.dto.extract.result.ProjectEvaluateResultDTO" >
SELECT
IFNULL(ld.ACTION_CODE,'good') AS actionCode,
md.GRID_ID AS gridId,
md.ID AS projectId
FROM fact_origin_project_main_daily md
LEFT JOIN fact_origin_project_log_daily ld ON (ld.PROJECT_ID = md.ID AND ld.DEL_FLAG = 0 AND ld.CUSTOMER_ID = #{customerId} AND ld.ACTION_CODE IN( 'bad','good', 'perfect'))
WHERE md.DEL_FLAG = 0
AND md.ORIGIN = 'issue'
AND md.PROJECT_STATUS = 'closed'
AND md.CUSTOMER_ID = #{customerId}
AND md.MONTH_ID = #{monthId}
IFNULL(en.actionCode,'good') AS actionCode,
cl.projectId,
cl.gridId
FROM
(SELECT
ld.PROJECT_ID AS projectId,
ld.ORG_ID AS gridId
FROM fact_origin_project_log_daily ld
WHERE ld.DEL_FLAG = 0
AND ld.CUSTOMER_ID = #{customerId}
AND ld.ACTION_CODE IN('close')
AND ld.ORG_TYPE = 'grid'
AND ld.MONTH_ID = #{monthId}
) cl
LEFT JOIN
(SELECT
IFNULL(ld.ACTION_CODE,'good') AS actionCode,
ld.ORG_ID AS gridId,
ld.PROJECT_ID AS projectId
FROM fact_origin_project_log_daily ld
WHERE ld.DEL_FLAG = 0
AND ld.ACTION_CODE IN( 'bad','good', 'perfect')
AND ld.MONTH_ID = #{monthId}
AND ld.CUSTOMER_ID = #{customerId}
) en ON (en.projectId = cl.projectId)
</select>
<!-- 网格项目自治率查询 -->