package com.meas.system.service.impl;

import java.util.List;
        import com.meas.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.meas.system.mapper.MeasStatusMapper;
import com.meas.system.domain.MeasStatus;
import com.meas.system.service.IMeasStatusService;

/**
 * 状态Service业务层处理
 *
 * @author Allen
 * @date 2024-07-24
 */
@Service
public class MeasStatusServiceImpl implements IMeasStatusService {
    @Autowired
    private MeasStatusMapper measStatusMapper;

    /**
     * 查询状态
     *
     * @param id 状态主键
     * @return 状态
     */
    @Override
    public MeasStatus selectMeasStatusById(Long id) {
        return measStatusMapper.selectMeasStatusById(id);
    }

    /**
     * 查询状态列表
     *
     * @param measStatus 状态
     * @return 状态
     */
    @Override
    public List<MeasStatus> selectMeasStatusList(MeasStatus measStatus) {
        return measStatusMapper.selectMeasStatusList(measStatus);
    }

    /**
     * 新增状态
     *
     * @param measStatus 状态
     * @return 结果
     */
    @Override
    public int insertMeasStatus(MeasStatus measStatus) {
                measStatus.setCreateTime(DateUtils.getNowDate());
            return measStatusMapper.insertMeasStatus(measStatus);
    }

    /**
     * 修改状态
     *
     * @param measStatus 状态
     * @return 结果
     */
    @Override
    public int updateMeasStatus(MeasStatus measStatus) {
                measStatus.setUpdateTime(DateUtils.getNowDate());
        return measStatusMapper.updateMeasStatus(measStatus);
    }

    /**
     * 批量删除状态
     *
     * @param ids 需要删除的状态主键
     * @return 结果
     */
    @Override
    public int deleteMeasStatusByIds(Long[] ids) {
        return measStatusMapper.deleteMeasStatusByIds(ids);
    }

    /**
     * 删除状态信息
     *
     * @param id 状态主键
     * @return 结果
     */
    @Override
    public int deleteMeasStatusById(Long id) {
        return measStatusMapper.deleteMeasStatusById(id);
    }

    @Override
    public List<String> getOption() {
        return measStatusMapper.getOption();
    }
}
