package com.fastbee.iot.service.impl;

import java.util.List;
import com.fastbee.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.iot.mapper.NgCardSwipeRecordsMapper;
import com.fastbee.iot.domain.NgCardSwipeRecords;
import com.fastbee.iot.service.INgCardSwipeRecordsService;

/**
 * 刷卡记录Service业务层处理
 *
 * @author kerwincui
 * @date 2024-12-30
 */
@Service
public class NgCardSwipeRecordsServiceImpl implements INgCardSwipeRecordsService
{
    @Autowired
    private NgCardSwipeRecordsMapper ngCardSwipeRecordsMapper;

    /**
     * 查询刷卡记录
     *
     * @param id 刷卡记录主键
     * @return 刷卡记录
     */
    @Override
    public NgCardSwipeRecords selectNgCardSwipeRecordsById(Long id)
    {
        return ngCardSwipeRecordsMapper.selectNgCardSwipeRecordsById(id);
    }

    @Override
    public List<NgCardSwipeRecords> selectNgCardSwipeRecordsUserList(NgCardSwipeRecords ngCardSwipeRecords) {
        return ngCardSwipeRecordsMapper.selectNgCardSwipeRecordsUserList(ngCardSwipeRecords);
    }

    /**
     * 查询刷卡记录列表
     *
     * @param ngCardSwipeRecords 刷卡记录
     * @return 刷卡记录
     */
    @Override
    public List<NgCardSwipeRecords> selectNgCardSwipeRecordsList(NgCardSwipeRecords ngCardSwipeRecords)
    {
        return ngCardSwipeRecordsMapper.selectNgCardSwipeRecordsList(ngCardSwipeRecords);
    }

    /**
     * 新增刷卡记录
     *
     * @param ngCardSwipeRecords 刷卡记录
     * @return 结果
     */
    @Override
    public int insertNgCardSwipeRecords(NgCardSwipeRecords ngCardSwipeRecords)
    {
        ngCardSwipeRecords.setCreateTime(DateUtils.getNowDate());
        return ngCardSwipeRecordsMapper.insertNgCardSwipeRecords(ngCardSwipeRecords);
    }

    /**
     * 修改刷卡记录
     *
     * @param ngCardSwipeRecords 刷卡记录
     * @return 结果
     */
    @Override
    public int updateNgCardSwipeRecords(NgCardSwipeRecords ngCardSwipeRecords)
    {
        ngCardSwipeRecords.setUpdateTime(DateUtils.getNowDate());
        return ngCardSwipeRecordsMapper.updateNgCardSwipeRecords(ngCardSwipeRecords);
    }

    /**
     * 批量删除刷卡记录
     *
     * @param ids 需要删除的刷卡记录主键
     * @return 结果
     */
    @Override
    public int deleteNgCardSwipeRecordsByIds(Long[] ids)
    {
        return ngCardSwipeRecordsMapper.deleteNgCardSwipeRecordsByIds(ids);
    }

    /**
     * 删除刷卡记录信息
     *
     * @param id 刷卡记录主键
     * @return 结果
     */
    @Override
    public int deleteNgCardSwipeRecordsById(Long id)
    {
        return ngCardSwipeRecordsMapper.deleteNgCardSwipeRecordsById(id);
    }
}
