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.EArchivesAdministration;
import com.zksy.info.service.EArchivesAdministrationService;
import com.zksy.info.mapper.EArchivesAdministrationMapper;
import org.springframework.stereotype.Service;
import java.util.List;

/**
* @author Administrator
* @description 针对表【e_archives_administration(员工档案管理)】的数据库操作Service实现
* @createDate 2025-06-27 13:58:28
*/
@Service
public class EArchivesAdministrationServiceImpl extends ServiceImpl<EArchivesAdministrationMapper, EArchivesAdministration>
    implements EArchivesAdministrationService{

    @Override
    public Page<EArchivesAdministration> findByPage(long pageNum, long pageSize, String workNumber,String fullName,String type) {
        Page<EArchivesAdministration> page = new Page<>(pageNum,pageSize);
        LambdaQueryWrapper<EArchivesAdministration> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(workNumber != null,EArchivesAdministration::getWorkNumber,workNumber);
        queryWrapper.like(fullName != null,EArchivesAdministration::getFullName,fullName);
        queryWrapper.like(type != null,EArchivesAdministration::getType,type);
        queryWrapper.orderByDesc(EArchivesAdministration::getUpdateTime);
        Page<EArchivesAdministration> page1 = this.page(page, queryWrapper);
        return page1;
    }

    @Override
    public List<EArchivesAdministration> getEArchivesAdministrationList(String workNumber,String fullName,String type) {
        LambdaQueryWrapper<EArchivesAdministration> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(workNumber != null,EArchivesAdministration::getWorkNumber,workNumber);
        queryWrapper.like(fullName != null,EArchivesAdministration::getFullName,fullName);
        queryWrapper.like(type != null,EArchivesAdministration::getType,type);
        queryWrapper.orderByDesc(EArchivesAdministration::getUpdateTime);
        List<EArchivesAdministration> list = this.list(queryWrapper);
        return list;
    }
}




