package com.cool.store.dao;

import com.cool.store.entity.BankdocDO;
import com.cool.store.entity.BanktypeDO;
import com.cool.store.mapper.BankdocMapper;
import com.cool.store.mapper.BanktypeMapper;
import com.cool.store.request.BranchBankPageRequest;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wxp
 * @FileName: BankDAO
 * @Description:
 * @date 2024-03-19 10:49
 */
@Slf4j
@Repository
public class BankDAO {

    @Resource
    private BanktypeMapper banktypeMapper;
    @Resource
    private BankdocMapper bankdocMapper;

    public List<BanktypeDO> listBank() {
        List<BanktypeDO> bankList = banktypeMapper.listBank();
        return bankList;
    }

    public Page<BankdocDO> listBranchBank(BranchBankPageRequest request){
        PageHelper.startPage(request.getPageNum(), request.getPageSize());
        return bankdocMapper.listBranchBank(request);
    }
}
