|
@@ -1,16 +1,20 @@
|
|
|
package com.sky.service.impl;
|
|
|
|
|
|
+import com.github.pagehelper.Page;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
import com.sky.constant.MessageConstant;
|
|
|
import com.sky.constant.PasswordConstant;
|
|
|
import com.sky.constant.StatusConstant;
|
|
|
import com.sky.context.BaseContext;
|
|
|
import com.sky.dto.EmployeeDTO;
|
|
|
import com.sky.dto.EmployeeLoginDTO;
|
|
|
+import com.sky.dto.EmployeePageQueryDTO;
|
|
|
import com.sky.entity.Employee;
|
|
|
import com.sky.exception.AccountLockedException;
|
|
|
import com.sky.exception.AccountNotFoundException;
|
|
|
import com.sky.exception.PasswordErrorException;
|
|
|
import com.sky.mapper.EmployeeMapper;
|
|
|
+import com.sky.result.PageResult;
|
|
|
import com.sky.service.EmployeeService;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -18,6 +22,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.DigestUtils;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Service
|
|
|
public class EmployeeServiceImpl implements EmployeeService {
|
|
@@ -90,4 +95,16 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|
|
employeeMapper.insert(employee);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public PageResult pageQuery(EmployeePageQueryDTO employeePageQueryDTO) {
|
|
|
+ // 开始分页查询
|
|
|
+ PageHelper.startPage(employeePageQueryDTO.getPage(),employeePageQueryDTO.getPageSize());
|
|
|
+
|
|
|
+ Page<Employee> page = employeeMapper.pageQuery(employeePageQueryDTO);
|
|
|
+ long total = page.getTotal();
|
|
|
+ List<Employee> records = page.getResult();
|
|
|
+
|
|
|
+ return new PageResult(total,records);
|
|
|
+ }
|
|
|
+
|
|
|
}
|