package com.ruoyi.project.base.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.base.mapper.TBaseRegionMapper;
import com.ruoyi.project.base.domain.TBaseRegion;
import com.ruoyi.project.base.service.ITBaseRegionService;

/**
 * 区域Service业务层处理
 *
 * @author ruoyi
 * @date 2022-11-14
 */
@Service
public class TBaseRegionServiceImpl implements ITBaseRegionService
{
    @Autowired
    private TBaseRegionMapper tBaseRegionMapper;

    /**
     * 查询区域
     *
     * @param id 区域主键
     * @return 区域
     */
    @Override
    public TBaseRegion selectTBaseRegionById(Long id)
    {
        return tBaseRegionMapper.selectTBaseRegionById(id);
    }

    @Override
    public TBaseRegion selectTBaseRegionByName(String name,Long plantId) {
        return tBaseRegionMapper.selectTBaseRegionByName(name,plantId);
    }

    /**
     * 查询区域列表
     *
     * @param tBaseRegion 区域
     * @return 区域
     */
    @Override
    public List<TBaseRegion> selectTBaseRegionList(TBaseRegion tBaseRegion)
    {
        return tBaseRegionMapper.selectTBaseRegionList(tBaseRegion);
    }
    @Override
    public List<TBaseRegion> selectAllRegionByPlantId(Long plantId)
    {
        return tBaseRegionMapper.selectAllRegionByPlantId(plantId);
    }

    /**
     * 新增区域
     *
     * @param tBaseRegion 区域
     * @return 结果
     */
    @Override
    public int insertTBaseRegion(TBaseRegion tBaseRegion)
    {
        return tBaseRegionMapper.insertTBaseRegion(tBaseRegion);
    }

    /**
     * 修改区域
     *
     * @param tBaseRegion 区域
     * @return 结果
     */
    @Override
    public int updateTBaseRegion(TBaseRegion tBaseRegion)
    {
        return tBaseRegionMapper.updateTBaseRegion(tBaseRegion);
    }
    @Override
    public int updateTBaseRegionByRegionIds(TBaseRegion tBaseRegion)
    {
        return tBaseRegionMapper.updateTBaseRegionByRegionIds(tBaseRegion);
    }

    /**
     * 批量删除区域
     *
     * @param ids 需要删除的区域主键
     * @return 结果
     */
    @Override
    public int deleteTBaseRegionByIds(Long[] ids)
    {
        return tBaseRegionMapper.deleteTBaseRegionByIds(ids);
    }

    /**
     * 删除区域信息
     *
     * @param id 区域主键
     * @return 结果
     */
    @Override
    public int deleteTBaseRegionById(Long id)
    {
        return tBaseRegionMapper.deleteTBaseRegionById(id);
    }
}
