package com.hw.ems.base.service.impl;

import com.hw.common.core.utils.DateUtils;
import com.hw.ems.base.domain.CbsMonitorReport;
import com.hw.ems.base.mapper.CbsMonitorReportMapper;
import com.hw.ems.base.service.ICbsMonitorReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * CBS抄报Service业务层处理
 *
 * @author YinQ
 * @date 2023-10-20
 */
@Service
public class CbsMonitorReportServiceImpl implements ICbsMonitorReportService
{
    @Autowired
    private CbsMonitorReportMapper cbsMonitorReportMapper;

    /**
     * 查询CBS抄报
     *
     * @param objId CBS抄报主键
     * @return CBS抄报
     */
    @Override
//    @DS("#header.poolName")
    public CbsMonitorReport selectCbsMonitorReportByObjId(Long objId)
    {
        return cbsMonitorReportMapper.selectCbsMonitorReportByObjId(objId);
    }

    /**
     * 查询CBS抄报列表
     *
     * @param cbsMonitorReport CBS抄报
     * @return CBS抄报
     */
    @Override
//    @DS("#header.poolName")
    public List<CbsMonitorReport> selectCbsMonitorReportList(CbsMonitorReport cbsMonitorReport)
    {
        return cbsMonitorReportMapper.selectCbsMonitorReportList(cbsMonitorReport);
    }

    /**
     * 新增CBS抄报
     *
     * @param cbsMonitorReport CBS抄报
     * @return 结果
     */
    @Override
//    @DS("#header.poolName")
    public int insertCbsMonitorReport(CbsMonitorReport cbsMonitorReport)
    {
        cbsMonitorReport.setCreateTime(DateUtils.getNowDate());
        return cbsMonitorReportMapper.insertCbsMonitorReport(cbsMonitorReport);
    }

    /**
     * 修改CBS抄报
     *
     * @param cbsMonitorReport CBS抄报
     * @return 结果
     */
    @Override
//    @DS("#header.poolName")
    public int updateCbsMonitorReport(CbsMonitorReport cbsMonitorReport)
    {
        cbsMonitorReport.setUpdateTime(DateUtils.getNowDate());
        return cbsMonitorReportMapper.updateCbsMonitorReport(cbsMonitorReport);
    }

    /**
     * 批量删除CBS抄报
     *
     * @param objIds 需要删除的CBS抄报主键
     * @return 结果
     */
    @Override
//    @DS("#header.poolName")
    public int deleteCbsMonitorReportByObjIds(Long[] objIds)
    {
        return cbsMonitorReportMapper.deleteCbsMonitorReportByObjIds(objIds);
    }

    /**
     * 删除CBS抄报信息
     *
     * @param objId CBS抄报主键
     * @return 结果
     */
    @Override
//    @DS("#header.poolName")
    public int deleteCbsMonitorReportByObjId(Long objId)
    {
        return cbsMonitorReportMapper.deleteCbsMonitorReportByObjId(objId);
    }

//


//    /**
//     * 查询实时数据
//     * @param emsApiVo CBS抄报
//     * @return
//     */
//    @Override
//    @DS("#header.poolName")
//    public List<CbsMonitorReport> selectRealTimeMonitorList(EmsApiVo emsApiVo)
//    {
//        return cbsMonitorReportMapper.selectRealTimeMonitorList(emsApiVo);
//    }

    /**
     * 查询上次CBS抄表数据
     *
     * @param cbsMonitorReport CBS抄报主键
     * @return CBS抄报
     */
    @Override
//    @DS("#header.poolName")
    public CbsMonitorReport selectLastTimeCbsMonitorReport(CbsMonitorReport cbsMonitorReport)
    {
        return cbsMonitorReportMapper.selectLastTimeCbsMonitorReport(cbsMonitorReport);
    }

}
