package cn.com.ty.lift.business.project.service;

import cn.com.ty.lift.business.project.dao.entity.Region;
import cn.com.ty.lift.business.project.dao.mapper.RegionMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 区域表 服务实现类
 * </p>
 *
 * @author wang-hai-cheng
 * @since 2019-12-09
 */
@Service
public class RegionService extends ServiceImpl<RegionMapper, Region> {
    /**
     * 根据维保公司id查询所有的区域
     * @param mtCompanyId
     * @return
     */
    public List<Region> listByMtCompanyId(Long mtCompanyId){
        LambdaQueryWrapper<Region> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.eq(Region::getMtCompanyId,mtCompanyId);
        return list(lambdaQueryWrapper);
    }
}