package com.shkj.wms.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shkj.common.core.domain.Result;
import com.shkj.common.utils.DateUtils;
import com.shkj.wms.domain.BusinDataTaskErrmsg;
import com.shkj.wms.mapper.BusinDataTaskErrmsgMapper;
import com.shkj.wms.service.IBusinDataTaskErrmsgService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 设备异常记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-05
 */
@Slf4j
@Service
public class BusinDataTaskErrmsgServiceImpl extends ServiceImpl<BusinDataTaskErrmsgMapper, BusinDataTaskErrmsg>  implements IBusinDataTaskErrmsgService
{
    @Autowired
    private BusinDataTaskErrmsgMapper businDataTaskErrmsgMapper;

    /**
     * 查询设备异常记录
     * 
     * @param id 设备异常记录主键
     * @return 设备异常记录
     */
    @Override
    public BusinDataTaskErrmsg selectBusinDataTaskErrmsgById(Long id)
    {
        return businDataTaskErrmsgMapper.selectBusinDataTaskErrmsgById(id);
    }

    /**
     * 查询设备异常记录列表
     * 
     * @param businDataTaskErrmsg 设备异常记录
     * @return 设备异常记录
     */
    @Override
    public List<BusinDataTaskErrmsg> selectBusinDataTaskErrmsgList(BusinDataTaskErrmsg businDataTaskErrmsg)
    {
        return businDataTaskErrmsgMapper.selectBusinDataTaskErrmsgList(businDataTaskErrmsg);
    }

    /**
     * 新增设备异常记录
     * 
     * @param businDataTaskErrmsg 设备异常记录
     * @return 结果
     */
    @Override
    public Result<Boolean> insertBusinDataTaskErrmsg(BusinDataTaskErrmsg businDataTaskErrmsg)
    {
        businDataTaskErrmsg.setCreateTime(DateUtils.getNowDate());
        return businDataTaskErrmsgMapper.insertBusinDataTaskErrmsg(businDataTaskErrmsg)>0?Result.ok():Result.err();
    }

    /**
     * 修改设备异常记录
     * 
     * @param businDataTaskErrmsg 设备异常记录
     * @return 结果
     */
    @Override
    public  Result<Boolean> updateBusinDataTaskErrmsg(BusinDataTaskErrmsg businDataTaskErrmsg)
    {
        businDataTaskErrmsg.setUpdateTime(DateUtils.getNowDate());
        return businDataTaskErrmsgMapper.updateBusinDataTaskErrmsg(businDataTaskErrmsg)>0?Result.ok():Result.err();
    }

    /**
     * 批量删除设备异常记录
     * 
     * @param ids 需要删除的设备异常记录主键
     * @return 结果
     */
    @Override
    public int deleteBusinDataTaskErrmsgByIds(Long[] ids)
    {
        return businDataTaskErrmsgMapper.deleteBusinDataTaskErrmsgByIds(ids);
    }

    /**
     * 删除设备异常记录信息
     * 
     * @param id 设备异常记录主键
     * @return 结果
     */
    @Override
    public  Result<Boolean> deleteBusinDataTaskErrmsgById(Long id)
    {
        return businDataTaskErrmsgMapper.deleteBusinDataTaskErrmsgById(id)>0?Result.ok():Result.err();
    }
}
