package com.community.huiju.dao;


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

import java.util.List;

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

    int insert(TpBuilding record);

    int insertSelective(TpBuilding record);

    TpBuilding selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TpBuilding record);

    int updateByPrimaryKey(TpBuilding record);

    /**
     * 根据小区id，期id
     * @param communityId
     * @param phaseId
     * @return
     */
    @ResultMap("BaseResultMap")
    @Select("select * from tp_building where community_id=#{communityId} and phase_id=#{phaseId}")
    List<TpBuilding> selectByAddress(@Param("communityId") Integer communityId, @Param("phaseId") Integer phaseId);

}