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.TpRoomNo;
import com.community.huiju.dao.TpRoomNoMapper;
import com.community.huiju.service.ITpRoomNoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 户号信息表 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2019-05-15
 */
@Service
public class TpRoomNoServiceImpl extends ServiceImpl<TpRoomNoMapper, TpRoomNo> implements ITpRoomNoService {

    @Override
    public ResponseBean getRoomNo(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId) {
        ResponseBean responseBean = new ResponseBean();

        QueryWrapper<TpRoomNo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("community_id", communityId);
        queryWrapper.eq("phase_id", phaseId);
        queryWrapper.eq("building_id", buildingId);
        queryWrapper.eq("unit_id", unitId);
        queryWrapper.eq("level_id", levelId);
        List<TpRoomNo> list = this.list(queryWrapper);
        responseBean.addSuccess(list);
        return responseBean;
    }
}
