package com.persagy.dmp.basic.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.persagy.dmp.basic.validations.QueryClassCodeVadition;
import com.persagy.dmp.basic.validations.QueryFloorIdVadition;
import com.persagy.dmp.basic.validations.QuerySpaceIdVadition;
import com.persagy.dmp.basic.validations.QuerySystemIdVadition;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.util.List;
import java.util.Set;

/***
 * @Description: 统一的请求体封装对象
 * @author: lijie
 * @Date:2020/7/9 10:35
 * Update By lijie 2020/7/9 10:35
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RequestData {

    /** 安装位置 */
    public static final String INSTALL_LOCATION_HUM = "installLocation";
    /** 生产厂家 */
    public static final String MANUFACTURER = "manufacturer";
    /** 设备状态 */
    public static final String EQUIP_STATUS_HUM = "equipStatus";
    /** 维保单位名称 */
    public static final String WARRANTER = "warranter";
    /** CADID图纸编码 */
    public static final String CAD_ID = "cadId";
    /** 项目id数组 */
    public static final String PROJECT_IDS_HUM = "projectIds";

    /**账号id*/
    @JsonAlias({"user_id"})
    @JsonProperty("userId")
    @JSONField(name = "userId",alternateNames = {"user_id"})
    private String userId;
    /**管理分区id*/
    @JsonAlias({"group_manage_zone_ids"})
    @JsonProperty("groupManageZoneIds")
    @JSONField(name = "groupManageZoneIds",alternateNames = {"group_manage_zone_ids"})
    private Set<String> groupManageZoneIds;
    /** 分页页码,从 1 开始 */
    @JsonAlias({"page"})
    @JsonProperty("page")
    @JSONField(name = "page",alternateNames = {"page"})
    private Long page;
    /** 每页行数 */
    @JsonAlias({"page_size","size","pageSize"})
    @JsonProperty("size")
    @JSONField(name = "size",alternateNames = {"page_size","size","pageSize"})
    private Long size;
    /** 筛选关键字,本地名称筛选 */
    @JsonAlias({"keyword"})
    @JsonProperty("keyword")
    @JSONField(name = "keyword",alternateNames = {"keyword"})
    private String keyword;
    /** 是否只统计总数 */
    @JsonAlias({"only_count","onlyCount"})
    @JsonProperty("onlyCount")
    @JSONField(name = "onlyCount",alternateNames = {"only_count","onlyCount"})
    private boolean onlyCount = false;
    /** 创建时间筛选范围 */
    @JsonAlias({"ctime","createTimeScope"})
    @JsonProperty("createTimeScope")
    @JSONField(name = "createTimeScope",alternateNames = {"ctime","createTimeScope"})
    private TimeScope createTimeScope;
    /** 返回信息点过滤,仅过滤infos内的信息点,基础信息点不过滤 */
    @JsonAlias({"return_infos","returnInfos"})
    @JsonProperty("returnInfos")
    @JSONField(name = "returnInfos",alternateNames = {"return_infos","returnInfos"})
    private Set<String> returnInfos;
    /** 查询有效数据,true,false */
    @JsonAlias({"valid_set","validSet"})
    @JsonProperty("validSet")
    @JSONField(name = "validSet",alternateNames = {"valid_set","validSet"})
    private Set<Integer> validSet;
    /** 集团编码 */
    @JsonAlias({"group_code","groupCode"})
    @JsonProperty("groupCode")
    @JSONField(name = "groupCode",alternateNames = {"group_code","groupCode"})
    private String groupCode;
    /** 项目id */
    @JsonAlias({"project_id","projectId"})
    @JsonProperty("projectId")
    @JSONField(name = "projectId",alternateNames = {"project_id","projectId"})
    private String projectId;
    /** 项目id数组 */
    @JsonAlias({"project_ids","projectIds"})
    @JsonProperty("projectIds")
    @JSONField(name = "projectIds",alternateNames = {"project_ids","projectIds"})
    private Set<String> projectIds;
    /** 建筑id */
    @JsonAlias({"building_id","buildingId"})
    @JsonProperty("buildingId")
    @JSONField(name = "buildingId",alternateNames = {"building_id","buildingId"})
    private String buildingId;
    /** 楼层id */
    @JsonAlias({"floor_id","floorId"})
    @JsonProperty("floorId")
    @JSONField(name = "floorId",alternateNames = {"floor_id","floorId"})
    @NotBlank(message = "缺少必填项:楼层id", groups = {QueryFloorIdVadition.class})
    private String floorId;
    /** 楼层id */
    @JsonAlias({"space_id","spaceId"})
    @JsonProperty("spaceId")
    @JSONField(name = "spaceId",alternateNames = {"space_id","spaceId"})
    @NotBlank(message = "缺少必填项:空间id", groups = {QuerySpaceIdVadition.class})
    private String spaceId;
    /** 系统id */
    @JsonAlias({"system_id","systemId"})
    @JsonProperty("systemId")
    @JSONField(name = "systemId",alternateNames = {"system_id","systemId"})
    @NotBlank(message = "缺少必填项:空间id", groups = {QuerySystemIdVadition.class})
    private String systemId;
    /** 空间功能类型 */
    @JsonAlias({"room_func_type","roomFuncType"})
    @JsonProperty("roomFuncType")
    @JSONField(name = "roomFuncType",alternateNames = {"room_func_type","roomFuncType"})
    private String roomFuncType;
    /** 对象类型 */
    @JsonAlias({"class_code","classCode"})
    @JsonProperty("classCode")
    @JSONField(name = "classCode",alternateNames = {"class_code","classCode"})
    @NotBlank(message = "缺少必填项:对象类型",groups = {QueryClassCodeVadition.class})
    private String classCode;
    /** 对象关系id */
    @JsonAlias({"rel_id","relId"})
    @JsonProperty("relId")
    @JSONField(name = "relId",alternateNames = {"rel_id","relId"})
    private String relId;
    /** 关系Code */
    @JsonAlias({"rel_code","relCode"})
    @JsonProperty("relCode")
    @JSONField(name = "relCode",alternateNames = {"rel_code","relCode"})
    private String relCode;
    /** 对象分类 */
    @JsonAlias({"obj_type","objType"})
    @JsonProperty("objType")
    @JSONField(name = "objType",alternateNames = {"obj_type","objType"})
    private String objType;
    /** 设备id */
    @JsonAlias({"equipment_id","equipmentId"})
    @JsonProperty("equipmentId")
    @JSONField(name = "equipmentId",alternateNames = {"equipment_id","equipmentId"})
    private String equipmentId;
    /** 对象类型数组 */
    @JsonAlias({"class_codes","classCodes"})
    @JsonProperty("classCodes")
    @JSONField(name = "classCodes",alternateNames = {"class_codes","classCodes"})
    private Set<String> classCodes;
    /** 对象分类数组 */
    @JsonAlias({"obj_types","objTypes"})
    @JsonProperty("objTypes")
    @JSONField(name = "objTypes",alternateNames = {"obj_types","objTypes"})
    private Set<String> objTypes;
    /** 跳跃条数 */
    @JsonAlias({"skip"})
    @JsonProperty("skip")
    @JSONField(name = "skip",alternateNames = {"skip"})
    private Long skip;
    /** 关系code数组 */
    @JsonAlias({"relCodes","rel_codes"})
    @JsonProperty("relCodes")
    @JSONField(name = "relCodes",alternateNames = {"relCodes","rel_codes"})
    private Set<String> relCodes;
    /** 查询部件标记,true-查询,false-不查询 */
    @JsonAlias({"queryEcFlag","query_ec_flag"})
    @JsonProperty("queryEcFlag")
    @JSONField(name = "queryEcFlag",alternateNames = {"queryEcFlag","query_ec_flag"})
    private Boolean queryEcFlag=false;
    /** 部件关系码 */
    @JsonAlias({"ecRelCodes","ec_rel_codes"})
    @JsonProperty("ecRelCodes")
    @JSONField(name = "ecRelCodes",alternateNames = {"ecRelCodes","ec_rel_codes"})
    private Set<String> ecRelCodes;
    /** 过滤的对象id */
    @JsonAlias({"filterObjId","filter_obj_id"})
    @JsonProperty("filterObjId")
    @JSONField(name = "filterObjId",alternateNames = {"filterObjId","filter_obj_id"})
    private String filterObjId;
    /** 安装位置 */
    @JsonAlias({"installLocation","install_location"})
    @JsonProperty("installLocation")
    @JSONField(name = "installLocation",alternateNames = {"installLocation","install_location"})
    private String installLocation;
    /** 生产厂家 */
    @JsonAlias({"manufacturer"})
    @JsonProperty("manufacturer")
    @JSONField(name = "manufacturer",alternateNames = {"manufacturer","manufacturer"})
    private String manufacturer;
    /** 维保单位名称 */
    @JsonAlias({"warranter"})
    @JsonProperty("warranter")
    @JSONField(name = "warranter",alternateNames = {"warranter"})
    private String warranter;
    /** 设备状态 */
    @JsonAlias({"equipStatus","equip_status"})
    @JsonProperty("equipStatus")
    @JSONField(name = "equipStatus",alternateNames = {"equip_status","equipStatus"})
    private String equipStatus;
    /** 排序条件 */
    @JsonAlias({"orders"})
    @JsonProperty("orders")
    @JSONField(name = "orders",alternateNames = {"orders"})
    private List<OrderItem> orders;
    /** 码表数据code */
    @JsonAlias({"codes"})
    @JsonProperty("codes")
    @JSONField(name = "codes",alternateNames = {"codes"})
    private Set<String> codes;
    /** 码表数据code */
    @JsonAlias({"parentCode","parent_code"})
    @JsonProperty("parentCode")
    @JSONField(name = "parentCode",alternateNames = {"parentCode","parent_code"})
    private String parentCode;
    /** 码表类型 */
    @JsonAlias({"typeCode","type_code"})
    @JsonProperty("typeCode")
    @JSONField(name = "typeCode",alternateNames = {"typeCode","type_code"})
    private String typeCode;
    /** 图类型编码 */
    @JsonAlias({"graphCode","graph_code"})
    @JsonProperty("graphCode")
    @JSONField(name = "graphCode",alternateNames = {"graphCode","graph_code"})
    private String graphCode;
    /** 关系值 */
    @JsonAlias({"relValue","rel_value"})
    @JsonProperty("relValue")
    @JSONField(name = "relValue",alternateNames = {"relValue","rel_value"})
    private String relValue;
    /** 主对象分类 */
    @JsonAlias({"masterObjType","master_obj_type"})
    @JsonProperty("masterObjType")
    @JSONField(name = "masterObjType",alternateNames = {"masterObjType","master_obj_type"})
    private String masterObjType;
    /** 从对象分类 */
    @JsonAlias({"slaveObjType","slave_obj_type"})
    @JsonProperty("slaveObjType")
    @JSONField(name = "slaveObjType",alternateNames = {"slaveObjType","slave_obj_type"})
    private String slaveObjType;
    /** 信息点名称，CADID图纸编码(cadId),设备名称(name),设备ID(id),本地编码(localId),本地名称(localName) */
    @JsonProperty("type")
    @JSONField(name = "type")
    private String type;
    /** 主对象内容 */
    @JsonAlias({"mainContent","main_content"})
    @JsonProperty("mainContent")
    @JSONField(name = "mainContent",alternateNames = {"mainContent","main_content"})
    private String mainContent;
    /** 从对象内容 */
    @JsonAlias({"slaveContent","slave_content"})
    @JsonProperty("slaveContent")
    @JSONField(name = "slaveContent",alternateNames = {"slaveContent","slave_content"})
    private Set<String> slaveContent;
    /** 计算标记 1 为手动 2为自动 */
    @JsonProperty("sign")
    @JSONField(name = "sign")
    private String sign;
    /** 创建关系时是否带上relValue,默认不赋值 */
    @JsonAlias({"hasRelValue","has_rel_value"})
    @JsonProperty("hasRelValue")
    @JSONField(name = "hasRelValue",alternateNames = {"hasRelValue","has_rel_value"})
    private Boolean hasRelValue;
    /** 查询从对象时是否过滤主对象id,默认过滤 */
    @JsonAlias({"hasFilterMasterId","has_filter_master_id"})
    @JsonProperty("hasFilterMasterId")
    @JSONField(name = "hasFilterMasterId",alternateNames = {"hasFilterMasterId","has_filter_master_id"})
    private Boolean hasFilterMasterId;
    /** 查询从对象时是否过滤classCode,true-过滤,false-不过滤,默认不过滤 */
    @JsonAlias({"hasFilterClassCode","has_filter_class_code"})
    @JsonProperty("hasFilterClassCode")
    @JSONField(name = "hasFilterClassCode",alternateNames = {"hasFilterClassCode","has_filter_class_code"})
    private Boolean hasFilterClassCode;
    /** 是否检查传感器类型,true-检查,false-不检查,默认不检查 */
    @JsonAlias({"hasCheckSensor","has_check_sensor"})
    @JsonProperty("hasCheckSensor")
    @JSONField(name = "hasCheckSensor",alternateNames = {"hasCheckSensor","has_check_sensor"})
    private Boolean hasCheckSensor;
    /** 是否检查classCode,true-检查,false-不检查,默认不检查 */
    @JsonAlias({"hasCheckClassCode","has_check_class_code"})
    @JsonProperty("hasCheckClassCode")
    @JSONField(name = "hasCheckClassCode",alternateNames = {"hasCheckClassCode","has_check_class_code"})
    private Boolean hasCheckClassCode;
    /** 是否检查classCode使用的classCodes列表 */
    @JsonAlias({"checkClassCodes","check_class_codes"})
    @JsonProperty("checkClassCodes")
    @JSONField(name = "checkClassCodes",alternateNames = {"checkClassCodes","check_class_codes"})
    private Set<String> checkClassCodes;
    /** 是否检查传感器使用的传感器类型列表 */
    @JsonAlias({"checkSensorCodes","check_sensor_codes"})
    @JsonProperty("checkSensorCodes")
    @JSONField(name = "checkSensorCodes",alternateNames = {"checkSensorCodes","check_sensor_codes"})
    private Set<String> checkSensorCodes;
    /** 过滤的计算标记,1-手动计算,2-自动计算 */
    @JsonAlias({"filterSigns","filter_signs"})
    @JsonProperty("filterSigns")
    @JSONField(name = "filterSigns",alternateNames = {"filterSigns","filter_signs"})
    private Set<String> filterSigns;
    /** 是否计算前置关系,true-计算,false-不计算.默认不计算 */
    @JsonAlias({"calBeforeRelFlag","cal_before_rel_flag"})
    @JsonProperty("calBeforeRelFlag")
    @JSONField(name = "calBeforeRelFlag",alternateNames = {"calBeforeRelFlag","cal_before_rel_flag"})
    private Boolean calBeforeRelFlag=false;
    /** 信息点分组统计 */
    @JsonProperty("groups")
    @JSONField(name = "groups")
    private List<String> groups;

    /** distinct 查询 系统定制 **/
    @JsonProperty("projection")
    @JSONField(name = "projection")
    private List<String> projection;
}
