package com.ruoyi.predict.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.predict.domain.WtgTypeTemperatureDef;
import com.ruoyi.predict.mapper.WtgTypeTemperatureDefMapper;
import com.ruoyi.predict.service.IWtgTypeTemperatureDefService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * WtgTypeTemperatureDefService业务层处理
 *
 * @author hlf
 * @date 2022-01-10
 */
@Service
public class WtgTypeTemperatureDefServiceImpl implements IWtgTypeTemperatureDefService {
    @Autowired(required = false)
    private WtgTypeTemperatureDefMapper wtgTypeTemperatureDefMapper;

    /**
     * 查询WtgTypeTemperatureDef
     *
     * @param wtgType WtgTypeTemperatureDefID
     * @return WtgTypeTemperatureDef
     */
    @Override
    public WtgTypeTemperatureDef selectWtgTypeTemperatureDefById(Long wtgType) {
        return wtgTypeTemperatureDefMapper.selectWtgTypeTemperatureDefById(wtgType);
    }

    /**
     * 查询WtgTypeTemperatureDef列表
     *
     * @param wtgTypeTemperatureDef WtgTypeTemperatureDef
     * @return WtgTypeTemperatureDef
     */
    @Override
    public List<WtgTypeTemperatureDef> selectWtgTypeTemperatureDefList(WtgTypeTemperatureDef wtgTypeTemperatureDef) {
        return wtgTypeTemperatureDefMapper.selectWtgTypeTemperatureDefList(wtgTypeTemperatureDef);
    }

    /**
     * 新增WtgTypeTemperatureDef
     *
     * @param wtgTypeTemperatureDef WtgTypeTemperatureDef
     * @return 结果
     */
    @Override
    public int insertWtgTypeTemperatureDef(WtgTypeTemperatureDef wtgTypeTemperatureDef) {
        return wtgTypeTemperatureDefMapper.insertWtgTypeTemperatureDef(wtgTypeTemperatureDef);
    }

    /**
     * 修改WtgTypeTemperatureDef
     *
     * @param wtgTypeTemperatureDef WtgTypeTemperatureDef
     * @return 结果
     */
    @Override
    public int updateWtgTypeTemperatureDef(WtgTypeTemperatureDef wtgTypeTemperatureDef) {
        return wtgTypeTemperatureDefMapper.updateWtgTypeTemperatureDef(wtgTypeTemperatureDef);
    }

    /**
     * 删除WtgTypeTemperatureDef信息
     *
     * @param wtgType WtgTypeTemperatureDefID
     * @return 结果
     */
    @Override
    public int deleteWtgTypeTemperatureDefById(Long wtgType) {
        return wtgTypeTemperatureDefMapper.deleteWtgTypeTemperatureDefById(wtgType);
    }

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

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertWtgTypeTemperatureDefList(List<WtgTypeTemperatureDef> wtgTypeTemperatureDefList) {
        return wtgTypeTemperatureDefMapper.insertWtgTypeTemperatureDefList(wtgTypeTemperatureDefList);
    }
}
