package com.persagy.adm.server.custom.entity;

import com.persagy.adm.server.custom.entity.db.*;
import lombok.Data;

import java.util.List;

/**
 * 按建筑下载的数据结构
 */
@Data
public class BuildingData extends DownLoadData {

	private String buildingId;

	private List objects;

	/** 按建筑筛选关系比较困难，待定 */
	private List relations;

	private List<AdmPipe> pipes;

	private List<AdmJobSpace> jobSpace;

	private List<AdmFile> file;

	private List<AdmQrCode> qrCode;

	private List<AdmServeArea> serveArea;

	// 核查问题数据
	private List<AdmProblem> problems;

	/**
	 * ADM图纸
	 */
	private List<AdmCad> admCads;



	/** 待废弃 */
	private String timestamp;

	@Override
	public void buildDownloadTs() {
		long ts = getMaxTs(objects, relations);
		if(ts > 0)
			bdtpDownloadTs = ts;
		ts = getMaxTs(pipes, jobSpace, file, qrCode, serveArea);
		if(ts > 0)
			admDownloadTs = ts;
	}

}
