package com.younike.system.service.impl;

import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.younike.system.mapper.MerchantBankMapper;
import com.younike.system.domain.MerchantBank;
import com.younike.system.service.IMerchantBankService;

/**
 * 店铺银行信息Service业务层处理
 * 
 * @author elev
 * @date 2022-01-05
 */
@Service
public class MerchantBankServiceImpl implements IMerchantBankService 
{
    @Autowired
    private MerchantBankMapper merchantBankMapper;

    /**
     * 查询店铺银行信息
     * 
     * @param merchantId 店铺银行信息主键
     * @return 店铺银行信息
     */
    @Override
    public MerchantBank selectMerchantBankByMerchantId(Long merchantId)
    {
        return merchantBankMapper.selectMerchantBankByMerchantId(merchantId);
    }

    /**
     * 查询店铺银行信息列表
     * 
     * @param merchantBank 店铺银行信息
     * @return 店铺银行信息
     */
    @Override
    public List<MerchantBank> selectMerchantBankList(MerchantBank merchantBank)
    {
        return merchantBankMapper.selectMerchantBankList(merchantBank);
    }

    /**
     * 新增店铺银行信息
     * 
     * @param merchantBank 店铺银行信息
     * @return 结果
     */
    @Override
    public int insertMerchantBank(MerchantBank merchantBank)
    {
        merchantBank.setCreateTime(LocalDateTime.now());
        return merchantBankMapper.insertMerchantBank(merchantBank);
    }

    /**
     * 修改店铺银行信息
     * 
     * @param merchantBank 店铺银行信息
     * @return 结果
     */
    @Override
    public int updateMerchantBank(MerchantBank merchantBank)
    {
        merchantBank.setUpdateTime(LocalDateTime.now());
        return merchantBankMapper.updateMerchantBank(merchantBank);
    }

    /**
     * 批量删除店铺银行信息
     * 
     * @param merchantIds 需要删除的店铺银行信息主键
     * @return 结果
     */
    @Override
    public int deleteMerchantBankByMerchantIds(Long[] merchantIds)
    {
        return merchantBankMapper.deleteMerchantBankByMerchantIds(merchantIds);
    }

    /**
     * 删除店铺银行信息信息
     * 
     * @param merchantId 店铺银行信息主键
     * @return 结果
     */
    @Override
    public int deleteMerchantBankByMerchantId(Long merchantId)
    {
        return merchantBankMapper.deleteMerchantBankByMerchantId(merchantId);
    }
}
