package com.huiju.estateagents.property.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huiju.estateagents.property.model.TpUnit;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 小区单元资料表 Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2019-04-01
 */
@Mapper
public interface TpUnitMapper extends BaseMapper<TpUnit> {

    /**
     * 根据 小区id，期id，楼栋id 查询
     * @param orgId
     * @param phaseId
     * @param buildingId
     * @return
     */
    @ResultType(TpUnit.class)
    @Select("select * from tp_unit where org_id =#{orgId} and phase_id=#{phaseId} and building_id=#{buildingId}")
    List<TpUnit> selectByAddress(Integer orgId, Integer phaseId, Integer buildingId);

}
