package com.ruoyi.predict.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.predict.domain.WfProjectCwWtg;
import com.ruoyi.predict.mapper.WfProjectCwWtgMapper;
import com.ruoyi.predict.service.IWfProjectCwWtgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * WfProjectCwWtgService业务层处理
 *
 * @author hlf
 * @date 2021-08-04
 */
@Service
public class WfProjectCwWtgServiceImpl implements IWfProjectCwWtgService {
    @Autowired(required = false)
    private WfProjectCwWtgMapper wfProjectCwWtgMapper;

    /**
     * 查询WfProjectCwWtg
     *
     * @param wtgNo WfProjectCwWtgID
     * @return WfProjectCwWtg
     */
    @Override
    public WfProjectCwWtg selectWfProjectCwWtgById(Long wtgNo) {
        return wfProjectCwWtgMapper.selectWfProjectCwWtgById(wtgNo);
    }

    /**
     * 查询WfProjectCwWtg列表
     *
     * @param wfProjectCwWtg WfProjectCwWtg
     * @return WfProjectCwWtg
     */
    @Override
    public List<WfProjectCwWtg> selectWfProjectCwWtgList(WfProjectCwWtg wfProjectCwWtg) {
        return wfProjectCwWtgMapper.selectWfProjectCwWtgList(wfProjectCwWtg);
    }

    /**
     * 新增WfProjectCwWtg
     *
     * @param wfProjectCwWtg WfProjectCwWtg
     * @return 结果
     */
    @Override
    public int insertWfProjectCwWtg(WfProjectCwWtg wfProjectCwWtg) {
        return wfProjectCwWtgMapper.insertWfProjectCwWtg(wfProjectCwWtg);
    }

    /**
     * 修改WfProjectCwWtg
     *
     * @param wfProjectCwWtg WfProjectCwWtg
     * @return 结果
     */
    @Override
    public int updateWfProjectCwWtg(WfProjectCwWtg wfProjectCwWtg) {
        return wfProjectCwWtgMapper.updateWfProjectCwWtg(wfProjectCwWtg);
    }

    /**
     * 删除WfProjectCwWtg信息
     *
     * @param wtgNo WfProjectCwWtgID
     * @return 结果
     */
    @Override
    public int deleteWfProjectCwWtgById(Long wtgNo) {
        return wfProjectCwWtgMapper.deleteWfProjectCwWtgById(wtgNo);
    }

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

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertWfProjectCwWtgList(List<WfProjectCwWtg> wfProjectCwWtgList) {
        return wfProjectCwWtgMapper.insertWfProjectCwWtgList(wfProjectCwWtgList);
    }

    @Override
    public List<WfProjectCwWtg> selectWfProjectCwWtgByWindplantNo(Long windplantNo) {
        return wfProjectCwWtgMapper.selectWfProjectCwWtgByWindplantNo(windplantNo);
    }

    @Override
    public List<WfProjectCwWtg> selectWfProjectCwWtgByPojectNo(Long windplantNo, Long projectNo) {
        return wfProjectCwWtgMapper.selectWfProjectCwWtgByPojectNo(windplantNo, projectNo);
    }

    @Override
    public List<WfProjectCwWtg> selectWfProjectCwWtgByCollectorwireNo(Long windplantNo, Long projectNo, Long collectorwireNo) {
        return wfProjectCwWtgMapper.selectWfProjectCwWtgByCollectorwireNo(windplantNo, projectNo, collectorwireNo);
    }

    @Override
    public int deleteWfProjectCwWtgByWindplantNo(Long windplantNo) {
        return wfProjectCwWtgMapper.deleteWfProjectCwWtgByWindplantNo(windplantNo);
    }

    @Override
    public int deleteWfProjectCwWtgByProjectNo(Long windplantNo, Long projectNo) {
        return wfProjectCwWtgMapper.deleteWfProjectCwWtgByProjectNo(windplantNo, projectNo);
    }

    @Override
    public int deleteWfProjectCwWtgByCollectorwireNo(Long windplantNo, Long projectNo, Long collectorwireNo) {
        return wfProjectCwWtgMapper.deleteWfProjectCwWtgByCollectorwireNo(windplantNo, projectNo, collectorwireNo);
    }
}
