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 id="selectOneActivityTotal" resultType="com.epmet.dto.result.yt.ActivityTatalInfo">
SELECT
COUNT(t.activityCount = '0' OR NULL) inactivityCount,
COUNT(t.activityCount > '0' OR NULL) activityCount
FROM
(
SELECT
COUNT(DISTINCT(l.ID)) activityCount
FROM
customer_agency a
LEFT JOIN staff_login_log l ON a.ID = l.AGENCY_ID
WHERE
a.`LEVEL` = 'community'
AND a.DEL_FLAG = '0'
<if test="orgId!= null and orgId.trim() != ''">
AND a.PIDS LIKE CONCAT('%',#{orgId},'%')
</if>
GROUP BY
a.ID
) t;
SELECT
COUNT(t.activityCount = '0' OR NULL) inactivityCount,
COUNT(t.activityCount > '0' OR NULL) activityCount
FROM
(
SELECT
COUNT(DISTINCT(l.ID)) activityCount
FROM
customer_agency a
LEFT JOIN staff_login_log l ON a.ID = l.AGENCY_ID
WHERE
a.`LEVEL` = 'community'
AND a.DEL_FLAG = '0'
<if test='null != startDate'>
and l.LOGIN_TIME &gt;= #{startDate}
</if>
<if test='null != endDate'>
and l.LOGIN_TIME &lt;= #{endDate}
</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>

Loading…
Cancel
Save