package com.ruoyi.mall.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.RegionMapper;
import com.ruoyi.mall.domain.Region;
import com.ruoyi.mall.service.IRegionService;

import javax.annotation.Resource;

/**
 * 省市区Service业务层处理
 *
 * @author ruoyi
 * @date 2023-11-07
 */
@Service
public class RegionServiceImpl implements IRegionService
{
    @Resource
    private RegionMapper regionMapper;

    /**
     * 查询省市区
     *
     * @param id 省市区主键
     * @return 省市区
     */
    @Override
    public Region selectRegionById(Long id)
    {
        return regionMapper.selectRegionById(id);
    }

    /**
     * 查询省市区列表
     *
     * @param region 省市区
     * @return 省市区
     */
    @Override
    public List<Region> selectRegionList(Region region)
    {
        return regionMapper.selectRegionList(region);
    }

    /**
     * 新增省市区
     *
     * @param region 省市区
     * @return 结果
     */
    @Override
    public int insertRegion(Region region)
    {
        return regionMapper.insertRegion(region);
    }

    /**
     * 修改省市区
     *
     * @param region 省市区
     * @return 结果
     */
    @Override
    public int updateRegion(Region region)
    {
        return regionMapper.updateRegion(region);
    }

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

    /**
     * 删除省市区信息
     *
     * @param id 省市区主键
     * @return 结果
     */
    @Override
    public int deleteRegionById(Long id)
    {
        return regionMapper.deleteRegionById(id);
    }
}
