Browse Source

修复活跃社区与不活跃社区统计中忘记加时间限制的bug

master
duanliangtao 2 years ago
parent
commit
14725b0abb
  1. 49
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml

49
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml

@ -202,25 +202,36 @@
</select> </select>
<select id="selectOneActivityTotal" resultType="com.epmet.dto.result.yt.ActivityTatalInfo"> <select id="selectOneActivityTotal" resultType="com.epmet.dto.result.yt.ActivityTatalInfo">
SELECT SELECT
COUNT(t.activityCount = '0' OR NULL) inactivityCount, COUNT(t.activityCount = '0' OR NULL) inactivityCount,
COUNT(t.activityCount > '0' OR NULL) activityCount COUNT(t.activityCount > '0' OR NULL) activityCount
FROM FROM
( (
SELECT SELECT
COUNT(DISTINCT(l.ID)) activityCount COUNT(DISTINCT(l.ID)) activityCount
FROM FROM
customer_agency a customer_agency a
LEFT JOIN staff_login_log l ON a.ID = l.AGENCY_ID LEFT JOIN staff_login_log l ON a.ID = l.AGENCY_ID
WHERE WHERE
a.`LEVEL` = 'community' a.`LEVEL` = 'community'
AND a.DEL_FLAG = '0' AND a.DEL_FLAG = '0'
<if test="orgId!= null and orgId.trim() != ''"> <if test='null != startDate'>
AND a.PIDS LIKE CONCAT('%',#{orgId},'%') and l.LOGIN_TIME &gt;= #{startDate}
</if> </if>
GROUP BY <if test='null != endDate'>
a.ID and l.LOGIN_TIME &lt;= #{endDate}
) t; </if>
<choose >
<when test='isActivity!= null and isActivity == "1" and isActivity.trim() != ""'>
AND l.AGENCY_ID is NOT NULL
</when>
<otherwise>
AND l.AGENCY_ID is NULL
</otherwise>
</choose>
GROUP BY
a.ID
) t;
</select> </select>

Loading…
Cancel
Save