package com.aucma.base.service.impl;

import java.util.List;

import com.aucma.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.base.mapper.BaseMonitorWorkUnitMapper;
import com.aucma.base.domain.BaseMonitorWorkUnit;
import com.aucma.base.service.IBaseMonitorWorkUnitService;

/**
 * 统计计量信息Service业务层处理
 *
 * @author Yinq
 * @date 2023-10-12
 */
@Service
public class BaseMonitorWorkUnitServiceImpl implements IBaseMonitorWorkUnitService
{
    @Autowired
    private BaseMonitorWorkUnitMapper baseMonitorWorkUnitMapper;

    /**
     * 查询统计计量信息
     *
     * @param objId 统计计量信息主键
     * @return 统计计量信息
     */
    @Override
    public BaseMonitorWorkUnit selectBaseMonitorWorkUnitByObjId(Long objId)
    {
        return baseMonitorWorkUnitMapper.selectBaseMonitorWorkUnitByObjId(objId);
    }

    /**
     * 查询统计计量信息列表
     *
     * @param baseMonitorWorkUnit 统计计量信息
     * @return 统计计量信息
     */
    @Override
    public List<BaseMonitorWorkUnit> selectBaseMonitorWorkUnitList(BaseMonitorWorkUnit baseMonitorWorkUnit)
    {
        return baseMonitorWorkUnitMapper.selectBaseMonitorWorkUnitList(baseMonitorWorkUnit);
    }

    /**
     * 新增统计计量信息
     *
     * @param baseMonitorWorkUnit 统计计量信息
     * @return 结果
     */
    @Override
    public int insertBaseMonitorWorkUnit(BaseMonitorWorkUnit baseMonitorWorkUnit)
    {
        baseMonitorWorkUnit.setCreatedTime(DateUtils.getNowDate());
        return baseMonitorWorkUnitMapper.insertBaseMonitorWorkUnit(baseMonitorWorkUnit);
    }

    /**
     * 修改统计计量信息
     *
     * @param baseMonitorWorkUnit 统计计量信息
     * @return 结果
     */
    @Override
    public int updateBaseMonitorWorkUnit(BaseMonitorWorkUnit baseMonitorWorkUnit)
    {
        baseMonitorWorkUnit.setUpdatedTime(DateUtils.getNowDate());
        return baseMonitorWorkUnitMapper.updateBaseMonitorWorkUnit(baseMonitorWorkUnit);
    }

    /**
     * 批量删除统计计量信息
     *
     * @param objIds 需要删除的统计计量信息主键
     * @return 结果
     */
    @Override
    public int deleteBaseMonitorWorkUnitByObjIds(Long[] objIds)
    {
        return baseMonitorWorkUnitMapper.deleteBaseMonitorWorkUnitByObjIds(objIds);
    }

    /**
     * 删除统计计量信息信息
     *
     * @param objId 统计计量信息主键
     * @return 结果
     */
    @Override
    public int deleteBaseMonitorWorkUnitByObjId(Long objId)
    {
        return baseMonitorWorkUnitMapper.deleteBaseMonitorWorkUnitByObjId(objId);
    }
}
