package com.sky.ioc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sky.ioc.entity.domain.space.AccessSpace;
import com.sky.ioc.entity.domain.space.BuildingSpace;
import com.sky.ioc.entity.params.IocParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AccessSpaceMapper extends BaseMapper<AccessSpace> {
    @Select("<script>" +
            "SELECT name,company, end_date as endDate,tier" +
            " FROM access_space where 1=1 " +
            "<if test='iocParam!=null  and iocParam.floorId != null  '>" +
            " and tier=#{iocParam.floorId} " +
            "</if>"+
            "</script>")
    List<AccessSpace> getByTier(@Param("iocParam") IocParam iocParam);

}
