package com.srs.dormitory.mapper;

import com.srs.dormitory.domain.DmsDormitoryBuilding;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.srs.dormitory.domain.DmsDormitoryBuildingInfo;
import com.srs.dormitory.domain.Dto.BuildingDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 宿舍楼表 Mapper 接口
 * </p>
 *
 * @author 猪油骨
 * @since 2023-07-14
 */
public interface DmsDormitoryBuildingMapper extends BaseMapper<DmsDormitoryBuilding> {

    /**
     * 查看宿舍楼入住人数
     * @param id 宿舍楼id
     * @return
     */
    Integer selectTotalOccupancy(@Param("id") Long id);

    /**
     * 查看宿舍楼详细信息
     * @param id
     * @return
     */
    Map<String, Object> selectBuildingById(@Param("id") Long id);

    /**
     * 查询宿舍楼列表
     * @param buildingDto
     * @return
     */
    List<Map<String, Object>> getDmsDormitoryList(BuildingDto buildingDto);

    /**
     * 查询宿舍楼名称和园区名称
     * @return
     */
    List<DmsDormitoryBuilding> selectBuildingNameAndParkName();

    /**
     * 批量修改性别
     */
    int  updateDormitoryGenderBatch(DmsDormitoryBuildingInfo d);


}
