package com.sptg.estate.biz.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.dto.BuildingDto;
import com.sptg.estate.api.entity.Building;
import com.sptg.estate.api.entity.Residential;

import java.util.List;

/**
 * title: BuildingServiceInterface
 * package: com.sptg.estate.biz.security
 * description: 楼栋 服务层接口
 *
 *
 *
 */
public interface BuildingServiceInterface extends IService<Building> {

    /**
     * 功能描述:楼栋列表查询
     * @param buildingDto 楼栋业务对象（含分页及查询条件）
     * @return ResultBean<Page<Building>>
     *
     *
     */
    ResultBean<Page<Building>> showBuildingList(BuildingDto buildingDto);

    /**
     * 功能描述:新增楼栋
     * @param buildingDto 楼栋业务对象
     * @return ResultBean<Boolean>
     *
     *
     */
    ResultBean<Building> addBuilding(BuildingDto buildingDto);

    /**
     * 功能描述:根据Id查找楼栋
     * @param id 必填
     * @return Building
     *
     *
     */
    Building findBuildingById(Long id);

    /**
     * 功能描述:编辑楼栋
     * @param buildingDto 楼栋业务对象
     * @return ResultBean<Boolean>
     *
     *
     */
    ResultBean<Boolean> updateBuilding(BuildingDto buildingDto);

    /**
     * 功能描述:删除楼栋
     * @param buildingDto 单元传输对象
     * @return ResultBean<Boolean>
     *
     *
     */
    ResultBean<Boolean> deleteBuilding(BuildingDto buildingDto);

    /**
     * 功能描述:楼栋放入垃圾箱
     * @param buildingDto 单元传输对象
     * @return ResultBean<Boolean>
     *
     *
     */
    ResultBean<Boolean> trashOrRecover(BuildingDto buildingDto);

    /**
     * 功能描述:根据Id集合批量删除楼栋
     * @param buildingDto 楼栋业务对象
     * @throws Exception
     *
     *
     */
    ResultBean<Boolean> deleteBuildingList(BuildingDto buildingDto) throws Exception;

    /**
     * 功能描述:根据位置查找楼栋
     * @param buildingDto 楼栋业务对象
     * @return  ResultBean<Building>
     *
     *
     */
    ResultBean<Building> findListByPosition(BuildingDto buildingDto);

    /**
     * 功能描述:导入楼栋
     * @param buildingDto 楼栋业务对象
     * @return ResultBean<Boolean>
     *
     *
     */
    ResultBean<Boolean> importBuildingList(BuildingDto buildingDto);

    /**
     * 功能描述:查询单元下的楼栋
     * @param unitId
     * @return
     *
     *
     */
    ResultBean<Building> getByUnitId(Long unitId);

    /**
     * 功能描述:根据位置查询楼栋数量
     * @param buildingDto
     * {
     *    orgPosition : 位置信息
     *    isAllType : 查询类型
     * }
     * @return int
     *
     *
     */
    int getBuildingAccount(BuildingDto buildingDto);

    /**
     * 功能描述:根基buildingId查询楼栋
     * @param buildingIds
     * @return List<Building>
     *
     *
     */
    List<Building> getListByBuildingId(List<Long> buildingIds);

    /**
     * 功能描述:根基buildingId查询楼栋-分页
     * @param buildingDto
     * @return List<Building>
     *
     *
     */
    Page<Building> pagingByIds(BuildingDto buildingDto);

    /**
     * 功能描述:根据条件查询楼栋数量
     * @param buildingDto 楼栋业务对象
     * @return int
     *
     *
     */
    int findBuildingByCondition(BuildingDto buildingDto);

    /**
     * 功能描述:根据楼栋名称和门牌号查询楼栋
     * @param buildingDto 楼栋业务对象
     * @return Building
     *
     *
     */
    Building findBuildingByNameAndNumber(BuildingDto buildingDto);

    /**
     * 功能描述:导入生成楼栋
     * @param building
     * @return Building
     *
     *
     */
    Building addBuildingByImport(Building building);


    List<Building> getListByLikeName(BuildingDto dto);

    /**
     * 功能描述:根据楼栋编号查询楼栋
     * @param buildingNumber
     * @return Building
     *
     *
     */
    Building findByBuildingNumber(String buildingNumber);

    Building findByOldId(String oldId);

    List<Building> getListByCondition(BuildingDto buildingDto);

    int addBuildingBySync(Building building);

    int updateBuildingBySync(Building building);
}
