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.CustomerElectronicCardMapper;
import com.yijia.customer.domain.CustomerElectronicCard;
import com.yijia.customer.service.ICustomerElectronicCardService;

/**
 * 客户电子会员卡（储蓄卡）Service业务层处理
 * 
 * @author yijia
 * @date 2021-04-12
 */
@Service
public class CustomerElectronicCardServiceImpl implements ICustomerElectronicCardService 
{
    @Autowired
    private CustomerElectronicCardMapper customerElectronicCardMapper;

    /**
     * 查询客户电子会员卡（储蓄卡）
     * 
     * @param id 客户电子会员卡（储蓄卡）ID
     * @return 客户电子会员卡（储蓄卡）
     */
    @Override
    public CustomerElectronicCard selectCustomerElectronicCardById(Long id)
    {
        return customerElectronicCardMapper.selectCustomerElectronicCardById(id);
    }

    /**
     * 查询客户电子会员卡（储蓄卡）列表
     * 
     * @param customerElectronicCard 客户电子会员卡（储蓄卡）
     * @return 客户电子会员卡（储蓄卡）
     */
    @Override
    public List<CustomerElectronicCard> selectCustomerElectronicCardList(CustomerElectronicCard customerElectronicCard)
    {
        return customerElectronicCardMapper.selectCustomerElectronicCardList(customerElectronicCard);
    }

    /**
     * 新增客户电子会员卡（储蓄卡）
     * 
     * @param customerElectronicCard 客户电子会员卡（储蓄卡）
     * @return 结果
     */
    @Override
    public int insertCustomerElectronicCard(CustomerElectronicCard customerElectronicCard)
    {
        customerElectronicCard.setCreateTime(DateUtils.getNowDate());
        return customerElectronicCardMapper.insertCustomerElectronicCard(customerElectronicCard);
    }

    /**
     * 修改客户电子会员卡（储蓄卡）
     * 
     * @param customerElectronicCard 客户电子会员卡（储蓄卡）
     * @return 结果
     */
    @Override
    public int updateCustomerElectronicCard(CustomerElectronicCard customerElectronicCard)
    {
        return customerElectronicCardMapper.updateCustomerElectronicCard(customerElectronicCard);
    }

    /**
     * 批量删除客户电子会员卡（储蓄卡）
     * 
     * @param ids 需要删除的客户电子会员卡（储蓄卡）ID
     * @return 结果
     */
    @Override
    public int deleteCustomerElectronicCardByIds(Long[] ids)
    {
        return customerElectronicCardMapper.deleteCustomerElectronicCardByIds(ids);
    }

    /**
     * 删除客户电子会员卡（储蓄卡）信息
     * 
     * @param id 客户电子会员卡（储蓄卡）ID
     * @return 结果
     */
    @Override
    public int deleteCustomerElectronicCardById(Long id)
    {
        return customerElectronicCardMapper.deleteCustomerElectronicCardById(id);
    }

    /**
     * 查询电子会员数据
     */
    @Override
    public CustomerElectronicCard listSum(CustomerElectronicCard customerElectronicCard) {
        return customerElectronicCardMapper.listSum(customerElectronicCard);
    }

    /**
     * 查询电子会员报表数据
     */
    @Override
    public List<CustomerElectronicCard> selectCard(CustomerElectronicCard customerElectronicCard) {
        return customerElectronicCardMapper.selectCard(customerElectronicCard);
    }

    @Override
    public List<CustomerElectronicCard> selectCardPage(CustomerElectronicCard customerElectronicCard) {
        return customerElectronicCardMapper.selectCardPage(customerElectronicCard);
    }

    @Override
    public CustomerElectronicCard listHYData(CustomerElectronicCard customerElectronicCard) {
        return customerElectronicCardMapper.listHYData( customerElectronicCard) ;
    }

    @Override
    public CustomerElectronicCard listJRHYData(CustomerElectronicCard customerElectronicCard) {
        return customerElectronicCardMapper.listJRHYData( customerElectronicCard) ;
    }

}
