|
|
|
|
@ -1,17 +1,21 @@
|
|
|
|
|
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.BaseException;
|
|
|
|
|
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;
|
|
|
|
|
@ -19,6 +23,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,23 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|
|
|
|
|
|
|
|
|
employeeMapper.insert(employee);//后续步骤定义
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页查询
|
|
|
|
|
*
|
|
|
|
|
* @param pageQueryDTO
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public PageResult pageQuery(EmployeePageQueryDTO pageQueryDTO) {
|
|
|
|
|
// select * from employee limit 0,10
|
|
|
|
|
//开始分页查询
|
|
|
|
|
PageHelper.startPage(pageQueryDTO.getPage(), pageQueryDTO.getPageSize());
|
|
|
|
|
Page<Employee> page = employeeMapper.pageQuery(pageQueryDTO);//后续定义
|
|
|
|
|
long total = page.getTotal();
|
|
|
|
|
List<Employee> records = page.getResult();
|
|
|
|
|
|
|
|
|
|
return new PageResult(total, records);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|