package com.tmerclub.cloud.platform.service.impl;

import com.tmerclub.cloud.common.database.dto.PageDTO;
import com.tmerclub.cloud.common.database.util.PageUtil;
import com.tmerclub.cloud.common.database.vo.PageVO;
import com.tmerclub.cloud.platform.dto.PublicBankDTO;
import com.tmerclub.cloud.platform.mapper.PublicBankMapper;
import com.tmerclub.cloud.platform.service.PublicBankService;
import com.tmerclub.cloud.platform.vo.PublicBankVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author gaozijie
 * @date 2023-03-21
 */
@Service
public class PublicBankServiceImpl implements PublicBankService {

    @Autowired
    private PublicBankMapper publicBankMapper;

    @Override
    public List<PublicBankVO> listPublicBank(PublicBankDTO publicBankDTO) {
        return publicBankMapper.listPublicBank(publicBankDTO);
    }

    @Override
    public PageVO<PublicBankVO> pagePublicBank(PageDTO pageDTO, PublicBankDTO publicBankDTO) {
        return PageUtil.doPage(pageDTO, () -> publicBankMapper.listPublicBank(publicBankDTO));
    }

    @Override
    public void save(PublicBankDTO publicBankDTO) {
        publicBankMapper.save(publicBankDTO);
    }

    @Override
    public void update(PublicBankDTO publicBankDTO) {
        publicBankMapper.update(publicBankDTO);
    }

    @Override
    public void deleteByIds(List<Long> bankIds) {
        publicBankMapper.deleteByIds(bankIds);
    }
}
