package com.zksy.info.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zksy.info.domain.EEmployeeSalary;
import com.zksy.info.service.EEmployeeSalaryService;
import com.zksy.info.mapper.EEmployeeSalaryMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【e_employee_salary(员工薪资管理表)】的数据库操作Service实现
* @createDate 2025-06-30 09:43:15
*/
@Service
public class EEmployeeSalaryServiceImpl extends ServiceImpl<EEmployeeSalaryMapper, EEmployeeSalary>
    implements EEmployeeSalaryService{

    @Override
    public Page<EEmployeeSalary> findByPage(long pageNum, long pageSize, String employeeNo, String fullName, String salaryStatus) {
        Page<EEmployeeSalary> page = new Page<>(pageNum,pageSize);
        LambdaQueryWrapper<EEmployeeSalary> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(employeeNo != null,EEmployeeSalary::getEmployeeNo,employeeNo);
        queryWrapper.like(fullName != null,EEmployeeSalary::getFullName,fullName);
        queryWrapper.like(salaryStatus != null,EEmployeeSalary::getSalaryStatus,salaryStatus);
        queryWrapper.orderByDesc(EEmployeeSalary::getUpdateTime);
        Page<EEmployeeSalary> pageResult = this.page(page, queryWrapper);
        return pageResult;
    }

    @Override
    public List<EEmployeeSalary> getEEmployeeSalaryList(String employeeNo, String fullName, String salaryStatus) {
        LambdaQueryWrapper<EEmployeeSalary> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(employeeNo != null,EEmployeeSalary::getEmployeeNo,employeeNo);
        queryWrapper.like(fullName != null,EEmployeeSalary::getFullName,fullName);
        queryWrapper.like(salaryStatus != null,EEmployeeSalary::getSalaryStatus,salaryStatus);
        queryWrapper.orderByDesc(EEmployeeSalary::getUpdateTime);
        List<EEmployeeSalary> list = this.list(queryWrapper);
        return list;
    }
}




