package com.yijia.integral.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.integral.mapper.CustomerPointsRecordMapper;
import com.yijia.integral.domain.CustomerPointsRecord;
import com.yijia.integral.service.ICustomerPointsRecordService;

/**
 * 客户积分记录Service业务层处理
 * 
 * @author yijia
 * @date 2021-03-17
 */
@Service
public class CustomerPointsRecordServiceImpl implements ICustomerPointsRecordService 
{
    @Autowired
    private CustomerPointsRecordMapper customerPointsRecordMapper;

    /**
     * 查询客户积分记录
     * 
     * @param id 客户积分记录ID
     * @return 客户积分记录
     */
    @Override
    public CustomerPointsRecord selectCustomerPointsRecordById(Long id)
    {
        return customerPointsRecordMapper.selectCustomerPointsRecordById(id);
    }

    /**
     * 查询客户积分记录列表
     * 
     * @param customerPointsRecord 客户积分记录
     * @return 客户积分记录
     */
    @Override
    public List<CustomerPointsRecord> selectCustomerPointsRecordList(CustomerPointsRecord customerPointsRecord)
    {
        return customerPointsRecordMapper.selectCustomerPointsRecordList(customerPointsRecord);
    }

    /**
     * 新增客户积分记录
     * 
     * @param customerPointsRecord 客户积分记录
     * @return 结果
     */
    @Override
    public int insertCustomerPointsRecord(CustomerPointsRecord customerPointsRecord)
    {
        customerPointsRecord.setCreateTime(DateUtils.getNowDate());
        return customerPointsRecordMapper.insertCustomerPointsRecord(customerPointsRecord);
    }

    /**
     * 修改客户积分记录
     * 
     * @param customerPointsRecord 客户积分记录
     * @return 结果
     */
    @Override
    public int updateCustomerPointsRecord(CustomerPointsRecord customerPointsRecord)
    {
        return customerPointsRecordMapper.updateCustomerPointsRecord(customerPointsRecord);
    }

    /**
     * 批量删除客户积分记录
     * 
     * @param ids 需要删除的客户积分记录ID
     * @return 结果
     */
    @Override
    public int deleteCustomerPointsRecordByIds(Long[] ids)
    {
        return customerPointsRecordMapper.deleteCustomerPointsRecordByIds(ids);
    }

    /**
     * 删除客户积分记录信息
     * 
     * @param id 客户积分记录ID
     * @return 结果
     */
    @Override
    public int deleteCustomerPointsRecordById(Long id)
    {
        return customerPointsRecordMapper.deleteCustomerPointsRecordById(id);
    }
}
