diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java index 5fc00d0691..81b4135d52 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/CommunityLoginFormDTO.java @@ -37,5 +37,11 @@ public class CommunityLoginFormDTO extends PageFormDTO { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date endDate; + + /** + * exclude_zero:不展示登录次数为0的社区 + * all:全部展示 + */ + private String dataRange; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java index e3f1252b8f..0bd7263a29 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffLoginLogDao.java @@ -27,11 +27,13 @@ public interface StaffLoginLogDao extends BaseDao { * @param orgId * @param startDate * @param endDate + * @param dataRange exclude_zero:不展示登录次数为0的社区 all:全部展示 * @return */ List pageCommunityCount(@Param("orgId") String orgId, @Param("startDate") Date startDate, - @Param("endDate") Date endDate); + @Param("endDate") Date endDate, + @Param("dataRange")String dataRange); List selectCommunityCount(@Param("orgId") String orgId, @Param("startDate") Date startDate, diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java index 37e27b83b1..d295661263 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java @@ -223,12 +223,12 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate()); + List list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate(),formDTO.getDataRange()); PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal(), formDTO.getPageSize()); } // 不分页 - List list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate()); + List list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate(),formDTO.getDataRange()); int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); return new PageData<>(list, total, total); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml index 9eddf595fa..98d0c99cf1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml @@ -48,7 +48,14 @@ and l.LOGIN_TIME <= #{endDate} - GROUP BY ca.id + + + GROUP BY ca.id having count( l.id )>0 + + + GROUP BY ca.id + + order by count(l.id) desc,ca.CREATED_TIME desc