|
|
|
@ -1339,20 +1339,21 @@ |
|
|
|
</select> |
|
|
|
<select id="selectActiveUserCountByParams" resultType="int"> |
|
|
|
SELECT IFNULL(count(*),0) |
|
|
|
FROM (SELECT ecu.ID |
|
|
|
FROM (SELECT count(ecu.ID),ecu.USER_ID |
|
|
|
FROM esua_epdc_analysis.`epdc_active_user_info` ecu |
|
|
|
LEFT JOIN esua_epdc_analysis.meta_sys_dept dept on ecu.DEPT_ID=dept.ID |
|
|
|
LEFT JOIN esua_epdc_analysis.meta_sys_dept com on dept.PID=com.ID |
|
|
|
LEFT JOIN esua_epdc_analysis.meta_sys_dept street ON com.PID=street.ID |
|
|
|
where street.id=#{streetId} |
|
|
|
where street.id = #{streetId} |
|
|
|
and ecu.DEL_FLAG=0 |
|
|
|
<if test=" endTime != null and endTime != ''"> |
|
|
|
and ecu.REACH_ACTIVE_TIME <= #{endTime} |
|
|
|
AND DATE_FORMAT(ecu.REACH_ACTIVE_TIME,'%Y-%m-%d') <= #{endTime} |
|
|
|
|
|
|
|
</if> |
|
|
|
<if test="operationStartTime != null and operationStartTime != '' and operationEndTime != null and operationEndTime != ''"> |
|
|
|
and (#{operationStartTime} BETWEEN ecu.REACH_ACTIVE_TIME and ecu.VALID_TIME |
|
|
|
and (#{operationStartTime} BETWEEN DATE_FORMAT(ecu.REACH_ACTIVE_TIME,'%Y-%m-%d') and DATE_FORMAT(ecu.VALID_TIME,'%Y-%m-%d') |
|
|
|
or |
|
|
|
#{operationEndTime} BETWEEN ecu.REACH_ACTIVE_TIME and ecu.VALID_TIME) |
|
|
|
#{operationEndTime} BETWEEN DATE_FORMAT(ecu.REACH_ACTIVE_TIME,'%Y-%m-%d') and DATE_FORMAT(ecu.VALID_TIME,'%Y-%m-%d')) |
|
|
|
</if> |
|
|
|
group by ecu.USER_ID -- 去重 |
|
|
|
)total |
|
|
|
|