package com.fastbee.waterele.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.waterele.mapper.MaCardinfoMapper;
import com.fastbee.waterele.domain.MaCardinfo;
import com.fastbee.waterele.service.IMaCardinfoService;

/**
 * 卡记录Service业务层处理
 * 
 * @author kerwincui
 * @date 2024-08-12
 */
@Service
public class MaCardinfoServiceImpl implements IMaCardinfoService 
{
    @Autowired
    private MaCardinfoMapper maCardinfoMapper;

    /**
     * 查询卡记录
     * 
     * @param id 卡记录主键
     * @return 卡记录
     */
    @Override
    public MaCardinfo selectMaCardinfoById(Long id)
    {
        return maCardinfoMapper.selectMaCardinfoById(id);
    }

    /**
     * 查询卡记录列表
     * 
     * @param maCardinfo 卡记录
     * @return 卡记录
     */
    @Override
    public List<MaCardinfo> selectMaCardinfoList(MaCardinfo maCardinfo)
    {
        return maCardinfoMapper.selectMaCardinfoList(maCardinfo);
    }

    /**
     * 新增卡记录
     * 
     * @param maCardinfo 卡记录
     * @return 结果
     */
    @Override
    public int insertMaCardinfo(MaCardinfo maCardinfo)
    {
        maCardinfo.setCreateTime(DateUtils.getNowDate());
        return maCardinfoMapper.insertMaCardinfo(maCardinfo);
    }

    /**
     * 修改卡记录
     * 
     * @param maCardinfo 卡记录
     * @return 结果
     */
    @Override
    public int updateMaCardinfo(MaCardinfo maCardinfo)
    {
        maCardinfo.setUpdateTime(DateUtils.getNowDate());
        return maCardinfoMapper.updateMaCardinfo(maCardinfo);
    }

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

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