diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/config/IPageConfig.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/config/IPageConfig.java new file mode 100644 index 00000000..c8772bed --- /dev/null +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/config/IPageConfig.java @@ -0,0 +1,13 @@ +package com.daqing.financial.hrauth.config; + +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class IPageConfig { + @Bean + public PaginationInterceptor paginationInterceptor() { + return new PaginationInterceptor(); + } +} diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/LoginLogMapper.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/LoginLogMapper.java index 3cc42d4a..848df054 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/LoginLogMapper.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/LoginLogMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.daqing.framework.domain.hrms.LoginLog; +import com.daqing.framework.domain.hrms.LoginLogEntity; import com.daqing.framework.domain.hrms.request.UserLoginLogRequest; import com.daqing.framework.domain.hrms.request.UserLoginRequest; import org.apache.ibatis.annotations.Mapper; @@ -11,5 +12,5 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface LoginLogMapper extends BaseMapper { - IPage pageByCondition(Page page,@Param("loginLog") UserLoginLogRequest userLoginLogRequest); + IPage pageByCondition(Page page, @Param("loginLog") UserLoginLogRequest userLoginLogRequest); } diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/LoginLogServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/LoginLogServiceImpl.java index a78ca32c..5ad03a4e 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/LoginLogServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/LoginLogServiceImpl.java @@ -6,9 +6,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.daqing.financial.hrauth.dao.LoginLogMapper; import com.daqing.financial.hrauth.service.LoginLogService; import com.daqing.framework.domain.hrms.LoginLog; -import com.daqing.framework.domain.hrms.SystemLog; +import com.daqing.framework.domain.hrms.LoginLogEntity; import com.daqing.framework.domain.hrms.request.UserLoginLogRequest; -import com.daqing.framework.domain.hrms.request.UserLoginRequest; import com.daqing.framework.utils.PageUtils; import org.springframework.stereotype.Service; @@ -23,7 +22,7 @@ public class LoginLogServiceImpl extends ServiceImpl i if (size <= 0) { size = 10; } - IPage loginLogVo = this.getBaseMapper().pageByCondition(new Page(page, size),userLoginLogRequest); + IPage loginLogVo = this.getBaseMapper().pageByCondition(new Page(page, size),userLoginLogRequest); return new PageUtils(loginLogVo); } diff --git a/dq-financial-hrms-auth/src/main/resources/mapper/hrmsauth/LoginLogMapper.xml b/dq-financial-hrms-auth/src/main/resources/mapper/hrmsauth/LoginLogMapper.xml index 866bd044..3e21b4b1 100644 --- a/dq-financial-hrms-auth/src/main/resources/mapper/hrmsauth/LoginLogMapper.xml +++ b/dq-financial-hrms-auth/src/main/resources/mapper/hrmsauth/LoginLogMapper.xml @@ -12,8 +12,8 @@ \ No newline at end of file diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/LoginLogEntity.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/LoginLogEntity.java index 691b50ae..f4c9c879 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/LoginLogEntity.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/LoginLogEntity.java @@ -3,7 +3,9 @@ package com.daqing.framework.domain.hrms; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -21,9 +23,11 @@ public class LoginLogEntity { private int loginNum; //创建时间 + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") private Date createTime; //最新登录时间 + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") private Date newestTime; //员工姓名 diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginLogRequest.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginLogRequest.java index 45692174..1bf355c7 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginLogRequest.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginLogRequest.java @@ -13,14 +13,6 @@ import java.io.Serializable; */ @Data public class UserLoginLogRequest implements Serializable { - /** - * 姓名 - */ - private String name; - /** - * 工号 - */ - private String jobNumber; /** * 开始时间 */ @@ -29,4 +21,8 @@ public class UserLoginLogRequest implements Serializable { * 结束时间 */ private String endTime; + /** + * 查询条件为姓名或工号 + */ + private String jobNumberOrName; }