package com.yd.csf.service.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yd.csf.service.model.SalaryRemittance;
import com.yd.csf.service.dao.SalaryRemittanceMapper;
import com.yd.csf.service.service.ISalaryRemittanceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 薪资汇款明细表 服务实现类
 * </p>
 *
 * @author zxm
 * @since 2026-05-08
 */
@Service
public class SalaryRemittanceServiceImpl extends ServiceImpl<SalaryRemittanceMapper, SalaryRemittance> implements ISalaryRemittanceService {

    @Override
    public Boolean delBySalaryBizId(String salaryBizId) {
        return this.remove(new LambdaQueryWrapper<SalaryRemittance>()
                .eq(SalaryRemittance::getSalaryBizId,salaryBizId));
    }

    @Override
    public List<SalaryRemittance> queryList(String salaryBizId) {
        return this.baseMapper.selectList(new LambdaQueryWrapper<SalaryRemittance>()
        .eq(SalaryRemittance::getSalaryBizId,salaryBizId));
    }

    @Override
    public SalaryRemittance queryOne(String salaryRemittanceBizId) {
        return this.baseMapper.selectOne(new LambdaQueryWrapper<SalaryRemittance>()
                .eq(SalaryRemittance::getSalaryRemittanceBizId,salaryRemittanceBizId)
                .last(" limit 1 "));
    }
}
