package com.community.huiju.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.community.huiju.common.base.ResponseBean;
import com.community.huiju.model.TpBuilding;
import com.community.huiju.dao.TpBuildingMapper;
import com.community.huiju.service.ITpBuildingService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 小区楼栋资料表 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2019-05-15
 */
@Service
public class TpBuildingServiceImpl extends ServiceImpl<TpBuildingMapper, TpBuilding> implements ITpBuildingService {


    @Override
    public ResponseBean getBuilding(Integer communityId, Integer phaseId) {
        ResponseBean responseBean = new ResponseBean();

        QueryWrapper<TpBuilding> buildingQueryWrapper = new QueryWrapper<>();
        buildingQueryWrapper.eq("community_id", communityId);
        buildingQueryWrapper.eq("phase_id", phaseId);
        List<TpBuilding> list = this.list(buildingQueryWrapper);
        responseBean.addSuccess(list);
        return responseBean;
    }
}
