|
|
@ -198,15 +198,22 @@ |
|
|
|
COUNT(DISTINCT log.PROJECT_ID) AS count |
|
|
|
FROM |
|
|
|
fact_origin_project_log_daily log |
|
|
|
LEFT JOIN fact_origin_project_main_daily project ON log.PROJECT_ID = project.ID AND project.DEL_FLAG = '0' AND project.CUSTOMER_ID = #{customerId} |
|
|
|
WHERE log.DEL_FLAG = '0' |
|
|
|
AND project.PROJECT_STATUS LIKE 'close%' |
|
|
|
AND log.CUSTOMER_ID = #{customerId} |
|
|
|
AND log.IS_ACTIVE = '0' |
|
|
|
|
|
|
|
<if test='null != dimId and "" != dimId.trim()'> |
|
|
|
AND log.MONTH_ID = #{dimId} |
|
|
|
AND EXISTS ( |
|
|
|
select id from fact_origin_project_log_daily where del_flag = '0' |
|
|
|
and customer_id = #{customerId} and month_id = #{dimId} |
|
|
|
and action_code like 'close%' |
|
|
|
<if test="agencies != null and agencies.size() > 0"> |
|
|
|
<foreach collection="agencies" item="agencyId" open="AND (" close=" )" separator=" OR "> |
|
|
|
AGENCY_ID = #{agencyId} |
|
|
|
</foreach></if> |
|
|
|
) |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="agencies != null and agencies.size() > 0"> |
|
|
|
<foreach collection="agencies" item="agencyId" open="AND (" close=" )" separator=" OR "> |
|
|
|
log.AGENCY_ID = #{agencyId} |
|
|
|