Browse Source

街镇、区县

master
yinzuomei 2 years ago
parent
commit
e3b2c9f302
  1. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java
  2. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java
  3. 46
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java

@ -42,12 +42,12 @@ public interface StaffLoginLogDao extends BaseDao<StaffLoginLogEntity> {
/** /**
* 各区县登录总次数 * 各区县登录总次数
* @param orgIdPath * @param orgId
* @param startDate * @param startDate
* @param endDate * @param endDate
* @return * @return
*/ */
List<CommunityLoginResultDTO> pageDistrictCount(@Param("orgIdPath")String orgIdPath, List<CommunityLoginResultDTO> pageDistrictCount(@Param("orgId")String orgId,
@Param("startDate")Date startDate, @Param("startDate")Date startDate,
@Param("endDate")Date endDate); @Param("endDate")Date endDate);

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java

@ -245,15 +245,14 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl<StaffLoginLogDao,
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId());
orgId=staffInfoCacheResult.getAgencyId(); orgId=staffInfoCacheResult.getAgencyId();
} }
String orgIdPath = SpringContextUtils.getBean(CustomerAgencyService.class).getOrgIdPath(orgId);
if (isPage) { if (isPage) {
PageHelper.startPage(pageNo, pageSize); PageHelper.startPage(pageNo, pageSize);
List<CommunityLoginResultDTO> list = baseDao.pageDistrictCount(orgIdPath, startDate, endDate); List<CommunityLoginResultDTO> list = baseDao.pageDistrictCount(orgId, startDate, endDate);
PageInfo<CommunityLoginResultDTO> pageInfo = new PageInfo<>(list); PageInfo<CommunityLoginResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal(),pageSize); return new PageData<>(list, pageInfo.getTotal(),pageSize);
} }
// 不分页 // 不分页
List<CommunityLoginResultDTO> list = baseDao.pageDistrictCount(orgIdPath,startDate, endDate); List<CommunityLoginResultDTO> list = baseDao.pageDistrictCount(orgId,startDate, endDate);
int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size();
return new PageData<>(list, total, total); return new PageData<>(list, total, total);
} }

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

@ -48,7 +48,7 @@
</if> </if>
GROUP BY GROUP BY
ca.id ca.id
order by count(1) desc order by count(l.id) desc
</select> </select>
<!-- 柱状图:下级组织账号登录次数汇总 --> <!-- 柱状图:下级组织账号登录次数汇总 -->
@ -75,17 +75,16 @@
<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
l.AGENCY_ID AS agencyId, ca.id AS agencyId,
ca.ORGANIZATION_NAME AS agencyName, ca.ORGANIZATION_NAME AS agencyName,
l.AGENCY_LEVEL AS agencyLevel, ca.LEVEL AS agencyLevel,
count( 1 ) AS count count(l.id) AS count
FROM FROM customer_agency ca
staff_login_log l left join staff_login_log l ON ( ca.ID =l.AGENCY_ID and l.DEL_FLAG = '0')
INNER JOIN customer_agency ca ON ( l.AGENCY_ID = ca.ID )
WHERE WHERE
l.DEL_FLAG = '0' and ca.DEL_FLAG = '0'
AND l.ORG_ID_PATH LIKE concat( #{orgIdPath}, '%' ) and (ca.id=#{orgId} or ca.pids like concat('%',#{orgId},'%') )
AND l.AGENCY_LEVEL = 'district' AND ca.LEVEL = 'district'
<if test ='null != startDate'> <if test ='null != startDate'>
and l.LOGIN_TIME &gt;= #{startDate} and l.LOGIN_TIME &gt;= #{startDate}
</if> </if>
@ -93,26 +92,23 @@
and l.LOGIN_TIME &lt;= #{endDate} and l.LOGIN_TIME &lt;= #{endDate}
</if> </if>
GROUP BY GROUP BY
l.AGENCY_ID ca.id
order by count(1) 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
l.AGENCY_ID AS agencyId, ca.id AS agencyId,
ca.ORGANIZATION_NAME AS agencyName, ca.ORGANIZATION_NAME AS agencyName,
l.AGENCY_LEVEL AS agencyLevel, ca.LEVEL AS agencyLevel,
s.ORGANIZATION_NAME AS districtName, count(l.id) AS count
count( 1 ) AS count FROM customer_agency ca
FROM left join staff_login_log l ON ( ca.ID =l.AGENCY_ID and l.DEL_FLAG = '0')
staff_login_log l
INNER JOIN customer_agency ca ON ( l.AGENCY_ID = ca.ID )
LEFT JOIN customer_agency s ON ( ca.PID = s.ID )
WHERE WHERE
l.DEL_FLAG = '0' and ca.DEL_FLAG = '0'
AND l.ORG_ID_PATH LIKE concat( #{orgIdPath}, '%' ) and (ca.id = #{orgId} or ca.pids like concat('%',#{orgId},'%') )
AND l.AGENCY_LEVEL = 'street' AND ca.LEVEL = 'street'
<if test ='null != startDate'> <if test ='null != startDate'>
and l.LOGIN_TIME &gt;= #{startDate} and l.LOGIN_TIME &gt;= #{startDate}
</if> </if>
@ -120,7 +116,7 @@
and l.LOGIN_TIME &lt;= #{endDate} and l.LOGIN_TIME &lt;= #{endDate}
</if> </if>
GROUP BY GROUP BY
l.AGENCY_ID ca.id
order by count(1) desc order by count(l.id) desc
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save