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.IntegralRecordMapper;
import com.younike.system.domain.IntegralRecord;
import com.younike.system.service.IIntegralRecordService;

/**
 * 积分记录Service业务层处理
 * 
 * @author elev
 * @date 2022-01-14
 */
@Service
public class IntegralRecordServiceImpl implements IIntegralRecordService {
    @Autowired
    private IntegralRecordMapper integralRecordMapper;

    /**
     * 查询积分记录
     * 
     * @param id 积分记录主键
     * @return 积分记录
     */
    @Override
    public IntegralRecord selectIntegralRecordById(Long id) {
        return integralRecordMapper.selectIntegralRecordById(id);
    }

    /**
     * 查询积分记录列表
     * 
     * @param integralRecord 积分记录
     * @return 积分记录
     */
    @Override
    public List<IntegralRecord> selectIntegralRecordList(IntegralRecord integralRecord) {
        return integralRecordMapper.selectIntegralRecordList(integralRecord);
    }

    /**
     * 新增积分记录
     * 
     * @param integralRecord 积分记录
     * @return 结果
     */
    @Override
    public int insertIntegralRecord(IntegralRecord integralRecord) {
        integralRecord.setCreateTime(LocalDateTime.now());
        return integralRecordMapper.insertIntegralRecord(integralRecord);
    }

    /**
     * 修改积分记录
     * 
     * @param integralRecord 积分记录
     * @return 结果
     */
    @Override
    public int updateIntegralRecord(IntegralRecord integralRecord) {
        return integralRecordMapper.updateIntegralRecord(integralRecord);
    }

    /**
     * 批量删除积分记录
     * 
     * @param ids 需要删除的积分记录主键
     * @return 结果
     */
    @Override
    public int deleteIntegralRecordByIds(Long[] ids) {
        return integralRecordMapper.deleteIntegralRecordByIds(ids);
    }

    /**
     * 删除积分记录信息
     * 
     * @param id 积分记录主键
     * @return 结果
     */
    @Override
    public int deleteIntegralRecordById(Long id)
    {
        return integralRecordMapper.deleteIntegralRecordById(id);
    }
}
