package com.younike.system.service.impl;

import java.util.List;
import java.time.LocalDateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.younike.system.mapper.BondPaymentMapper;
import com.younike.system.domain.BondPayment;
import com.younike.system.service.IBondPaymentService;

/**
 * 保证金充值Service业务层处理
 * 
 * @author elev
 * @date 2022-01-24
 */
@Service
public class BondPaymentServiceImpl implements IBondPaymentService {
    @Autowired
    private BondPaymentMapper bondPaymentMapper;

    /**
     * 查询保证金充值
     * 
     * @param paymentId 保证金充值主键
     * @return 保证金充值
     */
    @Override
    public BondPayment selectBondPaymentByPaymentId(String paymentId) {
        return bondPaymentMapper.selectBondPaymentByPaymentId(paymentId);
    }

    /**
     * 查询保证金充值列表
     * 
     * @param bondPayment 保证金充值
     * @return 保证金充值
     */
    @Override
    public List<BondPayment> selectBondPaymentList(BondPayment bondPayment) {
        return bondPaymentMapper.selectBondPaymentList(bondPayment);
    }

    /**
     * 新增保证金充值
     * 
     * @param bondPayment 保证金充值
     * @return 结果
     */
    @Override
    public int insertBondPayment(BondPayment bondPayment) {
        bondPayment.setCreateTime(LocalDateTime.now());
        return bondPaymentMapper.insertBondPayment(bondPayment);
    }

    /**
     * 修改保证金充值
     * 
     * @param bondPayment 保证金充值
     * @return 结果
     */
    @Override
    public int updateBondPayment(BondPayment bondPayment) {
        bondPayment.setUpdateTime(LocalDateTime.now());
        return bondPaymentMapper.updateBondPayment(bondPayment);
    }

    /**
     * 批量删除保证金充值
     * 
     * @param paymentIds 需要删除的保证金充值主键
     * @return 结果
     */
    @Override
    public int deleteBondPaymentByPaymentIds(String[] paymentIds) {
        return bondPaymentMapper.deleteBondPaymentByPaymentIds(paymentIds);
    }

    /**
     * 删除保证金充值信息
     * 
     * @param paymentId 保证金充值主键
     * @return 结果
     */
    @Override
    public int deleteBondPaymentByPaymentId(String paymentId)
    {
        return bondPaymentMapper.deleteBondPaymentByPaymentId(paymentId);
    }
}
