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

import cn.com.ty.lift.business.project.dao.entity.PropertyCompany;
import cn.com.ty.lift.business.project.dao.mapper.PropertyCompanyMapper;
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-11-11
 */
@Service
public class PropertyCompanyService extends ServiceImpl<PropertyCompanyMapper, PropertyCompany> {
    /**
     * 根据维保公司id查询所有的甲方公司
     * @param mtCompanyId long
     * @return
     */
    public List<PropertyCompany> listByMtCompanyId(Long mtCompanyId){
        LambdaQueryWrapper<PropertyCompany> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.eq(PropertyCompany::getMtCompanyId, mtCompanyId);
        //状态非0，
        lambdaQueryWrapper.ne(PropertyCompany::getStatus,0);
        return list(lambdaQueryWrapper);
    }
}