package com.yuchen.saas.park.service.mapper.elevator;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuchen.saas.park.api.entity.elevator.SaasParkElevatorManageLocationEntity;
import com.yuchen.saas.park.api.entity.elevator.SaasParkElevatorPointEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: baichaojie
 * @CreateTime: 2024/06/24 13:51
 * @Description: TODO
 * @Version: 1.0
 */
public interface SaasParkElevatorPointMapper extends BaseMapper<SaasParkElevatorPointEntity> {


    @Select(" select a.*" +
            " from saas_park_elevator_manage_location a" +
            " where a.park_id=${parkId} and a.building_id=${buildingId} and (unit_id is null or unit_id='')")
    List<SaasParkElevatorManageLocationEntity> selectList(@Param("parkId")Long parkId,@Param("buildingId")Long buildingId);

    @Select(" select a.*" +
            " from saas_park_elevator_manage_location a" +
            " where a.park_id=${parkId} and a.building_id=${buildingId} and (unit_id is null or unit_id='')")
    List<SaasParkElevatorManageLocationEntity> selectListByBuildingId(@Param("parkId")Long parkId,@Param("buildingId")Long buildingId);

    @Select(" select a.*" +
            " from saas_park_elevator_manage_location a" +
            " where a.park_id=${parkId} and a.unit_id=${unitId} ")
    List<SaasParkElevatorManageLocationEntity> selectListByUnitId(@Param("parkId")Long parkId,@Param("buildingId")Long unitId);


}
