package com.huiju.estateagents.property.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huiju.estateagents.common.CommConstant;
import com.huiju.estateagents.property.entity.TpCommunity;
import com.huiju.estateagents.property.mapper.TpCommunityMapper;
import com.huiju.estateagents.property.service.ITpCommunityService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yansen
 * @since 2021-01-19
 */
@Service
public class TpCommunityServiceImpl extends ServiceImpl<TpCommunityMapper, TpCommunity> implements ITpCommunityService {

    @Override
    public List<TpCommunity> getAllByOrg(Integer orgId) {
        QueryWrapper<TpCommunity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("org_id", orgId);
        queryWrapper.eq("status", CommConstant.STATUS_NORMAL);

        return list(queryWrapper);
    }
}
