|
@ -22,7 +22,7 @@ |
|
|
<result property="updatedTime" column="UPDATED_TIME"/> |
|
|
<result property="updatedTime" column="UPDATED_TIME"/> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
|
|
|
|
|
|
<!-- 各社区登录总次数 --> |
|
|
<!-- 账号登录情况:各社区登录总次数 --> |
|
|
<select id="pageCommunityCount" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityLoginResultDTO"> |
|
|
<select id="pageCommunityCount" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityLoginResultDTO"> |
|
|
SELECT |
|
|
SELECT |
|
|
ca.id AS agencyId, |
|
|
ca.id AS agencyId, |
|
@ -31,11 +31,13 @@ |
|
|
ca.ORGANIZATION_NAME AS agencyName, |
|
|
ca.ORGANIZATION_NAME AS agencyName, |
|
|
ca.`LEVEL` AS agencyLevel, |
|
|
ca.`LEVEL` AS agencyLevel, |
|
|
count( l.id ) AS count |
|
|
count( l.id ) AS count |
|
|
FROM |
|
|
FROM customer_agency ca |
|
|
customer_agency ca |
|
|
left JOIN staff_login_log l |
|
|
left JOIN staff_login_log l ON ( ca.ID =l.AGENCY_ID and l.DEL_FLAG = '0') |
|
|
ON ( ca.ID =l.AGENCY_ID and l.DEL_FLAG = '0') |
|
|
LEFT JOIN customer_agency s ON ( ca.PID = s.ID ) |
|
|
LEFT JOIN customer_agency s |
|
|
LEFT JOIN customer_agency d ON ( s.PID = d.ID ) |
|
|
ON ( ca.PID = s.ID ) |
|
|
|
|
|
LEFT JOIN customer_agency d |
|
|
|
|
|
ON ( s.PID = d.ID ) |
|
|
WHERE |
|
|
WHERE |
|
|
ca.DEL_FLAG = '0' |
|
|
ca.DEL_FLAG = '0' |
|
|
AND (ca.id = #{orgId} or ca.pids like concat('%',#{orgId},'%') ) |
|
|
AND (ca.id = #{orgId} or ca.pids like concat('%',#{orgId},'%') ) |
|
@ -46,12 +48,51 @@ |
|
|
<if test='null != endDate'> |
|
|
<if test='null != endDate'> |
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
</if> |
|
|
</if> |
|
|
GROUP BY |
|
|
GROUP BY ca.id |
|
|
ca.id |
|
|
|
|
|
order by count(l.id) desc |
|
|
order by count(l.id) desc |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
<!--社区活跃列表--> |
|
|
|
|
|
<select id="selectListActivityInfo" resultType="com.epmet.dto.result.yt.AccountActivityInfo"> |
|
|
|
|
|
SELECT |
|
|
|
|
|
COUNT(DISTINCT(l.id)) AS loginCount, |
|
|
|
|
|
COUNT(DISTINCT(l.STAFF_ID)) accountActivityCount, |
|
|
|
|
|
COUNT(DISTINCT(ag.USER_ID)) accountCount, |
|
|
|
|
|
a.ID agencyId, |
|
|
|
|
|
a.ALL_PARENT_NAME agencyName |
|
|
|
|
|
FROM |
|
|
|
|
|
customer_agency a |
|
|
|
|
|
LEFT JOIN staff_login_log l ON a.ID = l.AGENCY_ID |
|
|
|
|
|
AND a.`LEVEL` = l.AGENCY_LEVEL |
|
|
|
|
|
AND l.DEL_FLAG = '0' |
|
|
|
|
|
LEFT JOIN customer_staff_agency ag ON a.ID = ag.AGENCY_ID |
|
|
|
|
|
AND ag.DEL_FLAG = '0' |
|
|
|
|
|
WHERE |
|
|
|
|
|
a.DEL_FLAG = '0' |
|
|
|
|
|
AND a.`LEVEL` = 'community' |
|
|
|
|
|
<if test="orgId!= null and orgId.trim() != ''"> |
|
|
|
|
|
AND a.PIDS LIKE CONCAT('%',#{orgId},'%') |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test='null != startDate'> |
|
|
|
|
|
and l.LOGIN_TIME >= #{startDate} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test='null != endDate'> |
|
|
|
|
|
and l.LOGIN_TIME <= #{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 |
|
|
|
|
|
ORDER BY |
|
|
|
|
|
COUNT(DISTINCT(l.id)) DESC; |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 柱状图:下级组织账号登录次数汇总 --> |
|
|
<!-- 账号登录情况:柱状图:下级组织账号登录次数汇总 --> |
|
|
<select id="querySubCount" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityLoginResultDTO"> |
|
|
<select id="querySubCount" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityLoginResultDTO"> |
|
|
select |
|
|
select |
|
|
ca.ID AS agencyId, |
|
|
ca.ID AS agencyId, |
|
@ -73,6 +114,7 @@ |
|
|
order by count(l.ID) desc |
|
|
order by count(l.ID) desc |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 账号登录情况:查看区县--> |
|
|
<select id="pageDistrictCount" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityLoginResultDTO"> |
|
|
<select id="pageDistrictCount" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityLoginResultDTO"> |
|
|
SELECT |
|
|
SELECT |
|
|
ca.id AS agencyId, |
|
|
ca.id AS agencyId, |
|
@ -80,9 +122,9 @@ |
|
|
ca.LEVEL AS agencyLevel, |
|
|
ca.LEVEL AS agencyLevel, |
|
|
count(l.id) AS count |
|
|
count(l.id) AS count |
|
|
FROM customer_agency ca |
|
|
FROM customer_agency ca |
|
|
left join staff_login_log l ON ( ca.ID =l.AGENCY_ID and l.DEL_FLAG = '0') |
|
|
left join staff_login_log l |
|
|
WHERE |
|
|
ON ( ca.ID =l.AGENCY_ID and l.DEL_FLAG = '0') |
|
|
ca.DEL_FLAG = '0' |
|
|
WHERE ca.DEL_FLAG = '0' |
|
|
and (ca.id=#{orgId} or ca.pids like concat('%',#{orgId},'%') ) |
|
|
and (ca.id=#{orgId} or ca.pids like concat('%',#{orgId},'%') ) |
|
|
AND ca.LEVEL = 'district' |
|
|
AND ca.LEVEL = 'district' |
|
|
<if test='null != startDate'> |
|
|
<if test='null != startDate'> |
|
@ -91,20 +133,23 @@ |
|
|
<if test='null != endDate'> |
|
|
<if test='null != endDate'> |
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
</if> |
|
|
</if> |
|
|
GROUP BY |
|
|
GROUP BY ca.id |
|
|
ca.id |
|
|
|
|
|
order by count(l.id) desc |
|
|
order by count(l.id) desc |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 查看街镇--> |
|
|
<!-- 账号登录情况:查看街镇--> |
|
|
<select id="pageStreetCount" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityLoginResultDTO"> |
|
|
<select id="pageStreetCount" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityLoginResultDTO"> |
|
|
SELECT |
|
|
SELECT |
|
|
ca.id AS agencyId, |
|
|
ca.id AS agencyId, |
|
|
ca.ORGANIZATION_NAME AS agencyName, |
|
|
ca.ORGANIZATION_NAME AS agencyName, |
|
|
ca.LEVEL AS agencyLevel, |
|
|
ca.LEVEL AS agencyLevel, |
|
|
|
|
|
pa.ORGANIZATION_NAME as districtName, |
|
|
count(l.id) AS count |
|
|
count(l.id) AS count |
|
|
FROM customer_agency ca |
|
|
FROM customer_agency ca |
|
|
left join staff_login_log l ON ( ca.ID =l.AGENCY_ID and l.DEL_FLAG = '0') |
|
|
left join staff_login_log l |
|
|
|
|
|
ON ( ca.ID =l.AGENCY_ID and l.DEL_FLAG = '0') |
|
|
|
|
|
left join customer_agency pa |
|
|
|
|
|
on(ca.pid=pa.id) |
|
|
WHERE |
|
|
WHERE |
|
|
ca.DEL_FLAG = '0' |
|
|
ca.DEL_FLAG = '0' |
|
|
and (ca.id = #{orgId} or ca.pids like concat('%',#{orgId},'%') ) |
|
|
and (ca.id = #{orgId} or ca.pids like concat('%',#{orgId},'%') ) |
|
@ -115,8 +160,32 @@ |
|
|
<if test='null != endDate'> |
|
|
<if test='null != endDate'> |
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
</if> |
|
|
</if> |
|
|
GROUP BY |
|
|
GROUP BY ca.id |
|
|
ca.id |
|
|
|
|
|
order by count(l.id) desc |
|
|
order by count(l.id) desc |
|
|
</select> |
|
|
</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.PIDS LIKE CONCAT( |
|
|
|
|
|
'%', |
|
|
|
|
|
#{orgId}, |
|
|
|
|
|
'%' |
|
|
|
|
|
) |
|
|
|
|
|
AND a.`LEVEL` = 'community' |
|
|
|
|
|
AND a.DEL_FLAG = '0' |
|
|
|
|
|
GROUP BY |
|
|
|
|
|
a.ID |
|
|
|
|
|
) t; |
|
|
|
|
|
|
|
|
|
|
|
</select> |
|
|
</mapper> |
|
|
</mapper> |