|
|
@ -22,32 +22,33 @@ |
|
|
|
<result property="updatedTime" column="UPDATED_TIME"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<!-- 各社区登录总次数 --> |
|
|
|
<!-- 账号登录情况:各社区登录总次数 --> |
|
|
|
<select id="pageCommunityCount" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityLoginResultDTO"> |
|
|
|
SELECT |
|
|
|
ca.id AS agencyId, |
|
|
|
d.ORGANIZATION_NAME AS districtName, |
|
|
|
s.ORGANIZATION_NAME AS streetName, |
|
|
|
ca.ORGANIZATION_NAME AS agencyName, |
|
|
|
ca.`LEVEL` AS agencyLevel, |
|
|
|
count( l.id ) AS count |
|
|
|
FROM |
|
|
|
customer_agency ca |
|
|
|
left JOIN staff_login_log l 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 d ON ( s.PID = d.ID ) |
|
|
|
ca.id AS agencyId, |
|
|
|
d.ORGANIZATION_NAME AS districtName, |
|
|
|
s.ORGANIZATION_NAME AS streetName, |
|
|
|
ca.ORGANIZATION_NAME AS agencyName, |
|
|
|
ca.`LEVEL` AS agencyLevel, |
|
|
|
count( l.id ) AS count |
|
|
|
FROM customer_agency ca |
|
|
|
left JOIN staff_login_log l |
|
|
|
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 d |
|
|
|
ON ( s.PID = d.ID ) |
|
|
|
WHERE |
|
|
|
ca.DEL_FLAG = '0' |
|
|
|
AND (ca.id = #{orgId} or ca.pids like concat('%',#{orgId},'%') ) |
|
|
|
AND ca.LEVEL = 'community' |
|
|
|
<if test='null != startDate'> |
|
|
|
and l.LOGIN_TIME >= #{startDate} |
|
|
|
</if> |
|
|
|
<if test='null != endDate'> |
|
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
ca.id |
|
|
|
ca.DEL_FLAG = '0' |
|
|
|
AND (ca.id = #{orgId} or ca.pids like concat('%',#{orgId},'%') ) |
|
|
|
AND ca.LEVEL = 'community' |
|
|
|
<if test='null != startDate'> |
|
|
|
and l.LOGIN_TIME >= #{startDate} |
|
|
|
</if> |
|
|
|
<if test='null != endDate'> |
|
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
|
</if> |
|
|
|
GROUP BY ca.id |
|
|
|
order by count(l.id) desc |
|
|
|
</select> |
|
|
|
<!--社区活跃列表--> |
|
|
@ -91,72 +92,72 @@ |
|
|
|
COUNT(DISTINCT(l.id)) DESC; |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 柱状图:下级组织账号登录次数汇总 --> |
|
|
|
<!-- 账号登录情况:柱状图:下级组织账号登录次数汇总 --> |
|
|
|
<select id="querySubCount" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityLoginResultDTO"> |
|
|
|
select |
|
|
|
ca.ID AS agencyId, |
|
|
|
ca.ORGANIZATION_NAME AS agencyName, |
|
|
|
ca.level as agencyLevel, |
|
|
|
count(l.ID) AS count |
|
|
|
ca.ID AS agencyId, |
|
|
|
ca.ORGANIZATION_NAME AS agencyName, |
|
|
|
ca.level as agencyLevel, |
|
|
|
count(l.ID) AS count |
|
|
|
from customer_agency ca |
|
|
|
left join staff_login_log l |
|
|
|
on(ca.ID=l.AGENCY_ID) |
|
|
|
on(ca.ID=l.AGENCY_ID) |
|
|
|
where ca.DEL_FLAG='0' |
|
|
|
and ca.PID = #{orgId} |
|
|
|
<if test='null != startDate'> |
|
|
|
and l.LOGIN_TIME >= #{startDate} |
|
|
|
</if> |
|
|
|
<if test='null != endDate'> |
|
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
|
</if> |
|
|
|
and ca.PID = #{orgId} |
|
|
|
<if test='null != startDate'> |
|
|
|
and l.LOGIN_TIME >= #{startDate} |
|
|
|
</if> |
|
|
|
<if test='null != endDate'> |
|
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
|
</if> |
|
|
|
group by ca.id |
|
|
|
order by count(l.ID) desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 账号登录情况:查看区县--> |
|
|
|
<select id="pageDistrictCount" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityLoginResultDTO"> |
|
|
|
SELECT |
|
|
|
ca.id AS agencyId, |
|
|
|
ca.ORGANIZATION_NAME AS agencyName, |
|
|
|
ca.LEVEL AS agencyLevel, |
|
|
|
count(l.id) AS count |
|
|
|
ca.id AS agencyId, |
|
|
|
ca.ORGANIZATION_NAME AS agencyName, |
|
|
|
ca.LEVEL AS agencyLevel, |
|
|
|
count(l.id) AS count |
|
|
|
FROM customer_agency ca |
|
|
|
left join staff_login_log l ON ( ca.ID =l.AGENCY_ID and l.DEL_FLAG = '0') |
|
|
|
WHERE |
|
|
|
ca.DEL_FLAG = '0' |
|
|
|
and (ca.id=#{orgId} or ca.pids like concat('%',#{orgId},'%') ) |
|
|
|
AND ca.LEVEL = 'district' |
|
|
|
<if test='null != startDate'> |
|
|
|
and l.LOGIN_TIME >= #{startDate} |
|
|
|
</if> |
|
|
|
<if test='null != endDate'> |
|
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
ca.id |
|
|
|
left join staff_login_log l |
|
|
|
ON ( ca.ID =l.AGENCY_ID and l.DEL_FLAG = '0') |
|
|
|
WHERE ca.DEL_FLAG = '0' |
|
|
|
and (ca.id=#{orgId} or ca.pids like concat('%',#{orgId},'%') ) |
|
|
|
AND ca.LEVEL = 'district' |
|
|
|
<if test='null != startDate'> |
|
|
|
and l.LOGIN_TIME >= #{startDate} |
|
|
|
</if> |
|
|
|
<if test='null != endDate'> |
|
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
|
</if> |
|
|
|
GROUP BY ca.id |
|
|
|
order by count(l.id) desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 查看街镇--> |
|
|
|
<!-- 账号登录情况:查看街镇--> |
|
|
|
<select id="pageStreetCount" parameterType="map" resultType="com.epmet.dto.result.yt.CommunityLoginResultDTO"> |
|
|
|
SELECT |
|
|
|
ca.id AS agencyId, |
|
|
|
ca.ORGANIZATION_NAME AS agencyName, |
|
|
|
ca.LEVEL AS agencyLevel, |
|
|
|
count(l.id) AS count |
|
|
|
ca.id AS agencyId, |
|
|
|
ca.ORGANIZATION_NAME AS agencyName, |
|
|
|
ca.LEVEL AS agencyLevel, |
|
|
|
count(l.id) AS count |
|
|
|
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') |
|
|
|
WHERE |
|
|
|
ca.DEL_FLAG = '0' |
|
|
|
and (ca.id = #{orgId} or ca.pids like concat('%',#{orgId},'%') ) |
|
|
|
AND ca.LEVEL = 'street' |
|
|
|
<if test='null != startDate'> |
|
|
|
and l.LOGIN_TIME >= #{startDate} |
|
|
|
</if> |
|
|
|
<if test='null != endDate'> |
|
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
ca.id |
|
|
|
ca.DEL_FLAG = '0' |
|
|
|
and (ca.id = #{orgId} or ca.pids like concat('%',#{orgId},'%') ) |
|
|
|
AND ca.LEVEL = 'street' |
|
|
|
<if test='null != startDate'> |
|
|
|
and l.LOGIN_TIME >= #{startDate} |
|
|
|
</if> |
|
|
|
<if test='null != endDate'> |
|
|
|
and l.LOGIN_TIME <= #{endDate} |
|
|
|
</if> |
|
|
|
GROUP BY ca.id |
|
|
|
order by count(l.id) desc |
|
|
|
</select> |
|
|
|
|
|
|
|