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

import java.util.List;

import com.hw.common.core.utils.DateUtils;
import com.hw.ems.base.domain.BaseWaterThreshold;
import com.hw.ems.base.mapper.BaseWaterThresholdMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.ems.base.service.IBaseWaterThresholdService;

/**
 * 水阈值信息Service业务层处理
 *
 * @author sf
 * @date 2023-04-20
 */
@Service
public class BaseWaterThresholdServiceImpl implements IBaseWaterThresholdService {
    @Autowired
    private BaseWaterThresholdMapper baseWaterThresholdMapper;

    /**
     * 查询水阈值信息
     *
     * @param objid 水阈值信息主键
     * @return 水阈值信息
     */
    @Override
    //@DS("#header.poolName")
    public BaseWaterThreshold selectBaseWaterThresholdByObjid(Long objid) {
        return baseWaterThresholdMapper.selectBaseWaterThresholdByObjid(objid);
    }

    /**
     * 查询水阈值信息列表
     *
     * @param baseWaterThreshold 水阈值信息
     * @return 水阈值信息
     */
    @Override
    //@DS("#header.poolName")
    public List<BaseWaterThreshold> selectBaseWaterThresholdList(BaseWaterThreshold baseWaterThreshold) {
        return baseWaterThresholdMapper.selectBaseWaterThresholdList(baseWaterThreshold);
    }

    /**
     * 新增水阈值信息
     *
     * @param baseWaterThreshold 水阈值信息
     * @return 结果
     */
    @Override
    //@DS("#header.poolName")
    public int insertBaseWaterThreshold(BaseWaterThreshold baseWaterThreshold) {
        baseWaterThreshold.setCreateTime(DateUtils.getNowDate());
        return baseWaterThresholdMapper.insertBaseWaterThreshold(baseWaterThreshold);
    }

    /**
     * 修改水阈值信息
     *
     * @param baseWaterThreshold 水阈值信息
     * @return 结果
     */
    @Override
    //@DS("#header.poolName")
    public int updateBaseWaterThreshold(BaseWaterThreshold baseWaterThreshold) {
        baseWaterThreshold.setUpdateTime(DateUtils.getNowDate());
        return baseWaterThresholdMapper.updateBaseWaterThreshold(baseWaterThreshold);
    }

    /**
     * 批量删除水阈值信息
     *
     * @param objids 需要删除的水阈值信息主键
     * @return 结果
     */
    @Override
    //@DS("#header.poolName")
    public int deleteBaseWaterThresholdByObjids(Long[] objids) {
        return baseWaterThresholdMapper.deleteBaseWaterThresholdByObjids(objids);
    }

    /**
     * 删除水阈值信息信息
     *
     * @param objid 水阈值信息主键
     * @return 结果
     */
    @Override
    //@DS("#header.poolName")
    public int deleteBaseWaterThresholdByObjid(Long objid) {
        return baseWaterThresholdMapper.deleteBaseWaterThresholdByObjid(objid);
    }
}
