package com.community.huiju.dao;

import com.community.huiju.model.TpLevel;
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 TpLevelMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TpLevel record);

    int insertSelective(TpLevel record);

    TpLevel selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TpLevel record);

    int updateByPrimaryKey(TpLevel record);

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