package com.community.huiju.dao;

import com.community.huiju.model.TpUnit;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TpUnitMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TpUnit record);

    int insertSelective(TpUnit record);

    TpUnit selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TpUnit record);

    int updateByPrimaryKey(TpUnit record);

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