package com.yijia.customer.service.impl;

import java.util.List;
import com.yijia.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yijia.customer.mapper.CustomerCardRecordRechargeMapper;
import com.yijia.customer.domain.CustomerCardRecordRecharge;
import com.yijia.customer.service.ICustomerCardRecordRechargeService;

/**
 * 客户电子会员卡充值记录Service业务层处理
 * 
 * @author yijia
 * @date 2021-04-13
 */
@Service
public class CustomerCardRecordRechargeServiceImpl implements ICustomerCardRecordRechargeService 
{
    @Autowired
    private CustomerCardRecordRechargeMapper customerCardRecordRechargeMapper;

    /**
     * 查询客户电子会员卡充值记录
     * 
     * @param id 客户电子会员卡充值记录ID
     * @return 客户电子会员卡充值记录
     */
    @Override
    public CustomerCardRecordRecharge selectCustomerCardRecordRechargeById(Long id)
    {
        return customerCardRecordRechargeMapper.selectCustomerCardRecordRechargeById(id);
    }

    /**
     * 查询客户电子会员卡充值记录列表
     * 
     * @param customerCardRecordRecharge 客户电子会员卡充值记录
     * @return 客户电子会员卡充值记录
     */
    @Override
    public List<CustomerCardRecordRecharge> selectCustomerCardRecordRechargeList(CustomerCardRecordRecharge customerCardRecordRecharge)
    {
        return customerCardRecordRechargeMapper.selectCustomerCardRecordRechargeList(customerCardRecordRecharge);
    }

    /**
     * 新增客户电子会员卡充值记录
     * 
     * @param customerCardRecordRecharge 客户电子会员卡充值记录
     * @return 结果
     */
    @Override
    public int insertCustomerCardRecordRecharge(CustomerCardRecordRecharge customerCardRecordRecharge)
    {
        customerCardRecordRecharge.setCreateTime(DateUtils.getNowDate());
        return customerCardRecordRechargeMapper.insertCustomerCardRecordRecharge(customerCardRecordRecharge);
    }

    /**
     * 修改客户电子会员卡充值记录
     * 
     * @param customerCardRecordRecharge 客户电子会员卡充值记录
     * @return 结果
     */
    @Override
    public int updateCustomerCardRecordRecharge(CustomerCardRecordRecharge customerCardRecordRecharge)
    {
        return customerCardRecordRechargeMapper.updateCustomerCardRecordRecharge(customerCardRecordRecharge);
    }

    /**
     * 批量删除客户电子会员卡充值记录
     * 
     * @param ids 需要删除的客户电子会员卡充值记录ID
     * @return 结果
     */
    @Override
    public int deleteCustomerCardRecordRechargeByIds(Long[] ids)
    {
        return customerCardRecordRechargeMapper.deleteCustomerCardRecordRechargeByIds(ids);
    }

    /**
     * 删除客户电子会员卡充值记录信息
     * 
     * @param id 客户电子会员卡充值记录ID
     * @return 结果
     */
    @Override
    public int deleteCustomerCardRecordRechargeById(Long id)
    {
        return customerCardRecordRechargeMapper.deleteCustomerCardRecordRechargeById(id);
    }

    /**
     * 获取客户电子会员卡充值汇总金额
     */
    @Override
    public CustomerCardRecordRecharge czAmtQuery(CustomerCardRecordRecharge customerCardRecordRecharge) {
        return customerCardRecordRechargeMapper.czAmtQuery(customerCardRecordRecharge);
    }

    /**
     * 获取客户电子会员卡消费汇总折线图消费数据
     */
    @Override
    public List<CustomerCardRecordRecharge> listQydataCZ(CustomerCardRecordRecharge customerCardRecordRecharge) {
        return customerCardRecordRechargeMapper.listQydataCZ(customerCardRecordRecharge);
    }

    /**
     * 获取客户电子会员卡消费充值明细
     */
    @Override
    public List<CustomerCardRecordRecharge> selectCardDetail(CustomerCardRecordRecharge customerCardRecordRecharge) {
        return customerCardRecordRechargeMapper.selectCardDetail(customerCardRecordRecharge);
    }

    @Override
    public List<CustomerCardRecordRecharge> selectCardDetailPage(CustomerCardRecordRecharge customerCardRecordRecharge) {
        return customerCardRecordRechargeMapper.selectCardDetailPage(customerCardRecordRecharge);
    }

    @Override
    public CustomerCardRecordRecharge listCZData(CustomerCardRecordRecharge customerCardRecordRecharge) {
        return customerCardRecordRechargeMapper.listCZData(customerCardRecordRecharge);
    }

}
