package com.jwipc.finance.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.finance.entity.AccountStatement;
import com.jwipc.finance.mapper.AccountStatementMapper;
import com.jwipc.finance.model.po.AccountStatementPO;
import com.jwipc.finance.model.po.ImgCodePO;
import com.jwipc.finance.model.query.AccountStatementQuery;
import com.jwipc.finance.model.query.ImgCodeQuery;
import com.jwipc.finance.service.IAccountStatementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 对账模块-对账单主表 服务实现类
 * </p>
 *
 * @author shenyang.ou
 * @since 2024-03-04
 */
@Service
public class AccountStatementServiceImpl extends ServiceImpl<AccountStatementMapper, AccountStatement> implements IAccountStatementService {

    @Override
    public List<AccountStatementPO> findPageByQuery(Page<AccountStatement> dbPage, AccountStatementQuery query) {
        if (dbPage==null){
            return baseMapper.findPageByQuery(query);
        }
        return baseMapper.findPageByQuery(dbPage,query);
    }

    /**
     * 检查对账单状态
     *
     * @param idList 对账单ID集合
     * @return 结果
     */
    @Override
    public List<AccountStatement> checkAccountStatementStatus(List<Long> idList) {
        return baseMapper.checkAccountStatementStatus(idList);
    }

    @Override
    public AccountStatementPO selectPoById(Long id) {
        return baseMapper.selectPoById(id);
    }

    @Override
    public List<AccountStatementPO> accountOrApplyList(Page<AccountStatement> dbPage, AccountStatementQuery query) {
        if (dbPage==null){
            return baseMapper.accountOrApplyList(query);
        }
        return baseMapper.accountOrApplyList(dbPage,query);
    }

    @Override
    public List<AccountStatementPO> accountOrApplyListByNo(AccountStatementQuery query) {
        return baseMapper.accountOrApplyListByNo(query);
    }

    @Override
    public List<AccountStatementPO> findAccountStatementByYM(AccountStatementQuery query) {
        return baseMapper.findAccountStatementByYM(query);
    }

    @Override
    public List<AccountStatementPO> findAccountStatementBySupplierCodeS(AccountStatementQuery query) {
        return baseMapper.findAccountStatementBySupplierCodeS(query);
    }

    @Override
    public List<AccountStatementPO> findAccountStatementBySupplierCodeS2(AccountStatementQuery query) {
        return baseMapper.findAccountStatementBySupplierCodeS2(query);
    }

    @Override
    public List<AccountStatementPO> findAccountStatementBySupplierCodeD(AccountStatementQuery query) {
        return baseMapper.findAccountStatementBySupplierCodeD(query);
    }

    @Override
    public List<ImgCodePO> findImgCodePage(Page<AccountStatement> dbPage, ImgCodeQuery query) {
        if (dbPage==null){
            return baseMapper.findImgCodePage(query);
        }
        return baseMapper.findImgCodePage(dbPage,query);
    }

}
