package com.ruoyi.predict.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.predict.domain.Wtur;
import com.ruoyi.predict.mapper.WturMapper;
import com.ruoyi.predict.service.IWturService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * WturService业务层处理
 *
 * @author hlf
 * @date 2021-08-02
 */
@Service
public class WturServiceImpl implements IWturService {
    @Autowired(required = false)
    private WturMapper wturMapper;

    /**
     * 查询Wtur
     *
     * @param wturNo WturID
     * @return Wtur
     */
    @Override
    public Wtur selectWturById(Long wturNo) {
        return wturMapper.selectWturById(wturNo);
    }

    /**
     * 查询Wtur列表
     *
     * @param wtur Wtur
     * @return Wtur
     */
    @Override
    public List<Wtur> selectWturList(Wtur wtur) {
        return wturMapper.selectWturList(wtur);
    }

    /**
     * 新增Wtur
     *
     * @param wtur Wtur
     * @return 结果
     */
    @Override
    public int insertWtur(Wtur wtur) {
        return wturMapper.insertWtur(wtur);
    }

    /**
     * 修改Wtur
     *
     * @param wtur Wtur
     * @return 结果
     */
    @Override
    public int updateWtur(Wtur wtur) {
        return wturMapper.updateWtur(wtur);
    }

    /**
     * 删除Wtur信息
     *
     * @param wturNo WturID
     * @return 结果
     */
    @Override
    public int deleteWturById(Long wturNo) {
        return wturMapper.deleteWturById(wturNo);
    }

    /**
     * 删除Wtur对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWturByIds(String ids) {
        return wturMapper.deleteWturByIds(Convert.toStrArray(ids));
    }

    @Override
    public List<Wtur> selectWturListByWindplantNo(Long windplantNo) {
        return wturMapper.selectWturListByWindplantNo(windplantNo);
    }

    @Override
    public Long selectNewData() {
        return wturMapper.selectNewData();
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertWturList(List<Wtur> wturList) {
        return wturMapper.insertWturList(wturList);
    }
}
