package com.ruoyi.predict.service.impl;

import com.ruoyi.predict.domain.Mv;
import com.ruoyi.predict.mapper.MvMapper;
import com.ruoyi.predict.service.IMvService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * MvService业务层处理
 *
 * @author hlf
 * @date 2021-08-04
 */
@Service
public class MvServiceImpl implements IMvService {
    @Autowired(required = false)
    private MvMapper mvMapper;

    /**
     * 查询Mv
     *
     * @param mvNo MvID
     * @return Mv
     */
    @Override
    public Mv selectMvById(Long mvNo) {
        return mvMapper.selectMvById(mvNo);
    }

    /**
     * 查询Mv列表
     *
     * @param mv Mv
     * @return Mv
     */
    @Override
    public List<Mv> selectMvList(Mv mv) {
        return mvMapper.selectMvList(mv);
    }

    /**
     * 新增Mv
     *
     * @param mv Mv
     * @return 结果
     */
    @Override
    public int insertMv(Mv mv) {
        return mvMapper.insertMv(mv);
    }

    /**
     * 修改Mv
     *
     * @param mv Mv
     * @return 结果
     */
    @Override
    public int updateMv(Mv mv) {
        return mvMapper.updateMv(mv);
    }

    /**
     * 删除Mv信息
     *
     * @param mvNo MvID
     * @return 结果
     */
    @Override
    public int deleteMvById(Long mvNo) {
        return mvMapper.deleteMvById(mvNo);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertMvList(List<Mv> mvList) {
        return mvMapper.insertMvList(mvList);
    }

    @Override
    public Mv selectMvByWturNoRef(Long wtgNo, Long measurementtypeNo) {
        return mvMapper.selectMvByWturNoRef(wtgNo, measurementtypeNo);
    }

    @Override
    public List<Mv> selectMvListIsNot0(Mv mv) {
        return mvMapper.selectMvListIsNot0(mv);
    }
}
