package com.huyi.service.credit.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huyi.service.credit.mapper.OwnCreditMapper;
import com.huyi.service.credit.service.OwnCreditService;
import com.huyi.service.invoice.mapper.OwnInvoiceMapper;
import com.huyi.service.invoice.service.OwnInvoiceService;
import com.keao.tianhu.starter.mybatis.plus.entity.QueryRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class OwnCreditServiceImpl implements OwnCreditService {
    @Autowired
    private OwnCreditMapper creditMapper;


    @Override
    public IPage<Map> selectCreditList(Map map, QueryRequest request) {
        Page page = new Page<>(request.getPageNum(), request.getPageSize());
        return creditMapper.selectCreditList(page,map);
    }

    @Override
    public List<Map> selectCreditLineList(Map map) {
        return creditMapper.selectCreditLineList(map);
    }

    @Override
    public List<Map> selectSupplierCreditLineList(Map map) {
        return creditMapper.selectSupplierCreditLineList(map);
    }

    @Override
    public IPage<Map> getReceiverList(Map map, QueryRequest request) {
        Page page = new Page<>(request.getPageNum(), request.getPageSize());
        return  creditMapper.getReceiverList(page,map);
    }

    @Override
    public IPage<Map> getAccountsPay(Map map, QueryRequest request) {
        Page page = new Page<>(request.getPageNum(), request.getPageSize());
        return creditMapper.getAccountsPay(page,map);
    }

    @Override
    public IPage<Map> getAccountsCollection(Map map, QueryRequest request) {
        Page page = new Page<>(request.getPageNum(), request.getPageSize());
        return creditMapper.getAccountsCollection(page,map);
    }

    @Override
    public String getUsedBalance(Map map) {
        return creditMapper.getUsedBalance(map);
    }

    @Override
    public String getSupplierUsedBalance(Map map) {
        return creditMapper.getSupplierUsedBalance(map);
    }

}
