|  |  |  | 
|---|
|  |  |  | change geoCoordSys geo_coord_sys varchar(50) not null; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | alter table device | 
|---|
|  |  |  | change treeType tree_type varchar(50) not null; | 
|---|
|  |  |  | drop column treeType; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | alter table device | 
|---|
|  |  |  | change mediaServerId media_server_id varchar(50) default 'auto' null; | 
|---|
|  |  |  | 
|---|
|  |  |  | change updateTime update_time varchar(50) null; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | alter table parent_platform | 
|---|
|  |  |  | change treeType tree_type varchar(50) not null; | 
|---|
|  |  |  | drop column treeType; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | alter table parent_platform | 
|---|
|  |  |  | change asMessageChannel as_message_channel bool default false; | 
|---|
|  |  |  | 
|---|
|  |  |  | charset character varying(50), | 
|---|
|  |  |  | ssrc_check bool default false, | 
|---|
|  |  |  | geo_coord_sys character varying(50), | 
|---|
|  |  |  | tree_type character varying(50), | 
|---|
|  |  |  | media_server_id character varying(50), | 
|---|
|  |  |  | custom_name character varying(255), | 
|---|
|  |  |  | sdp_ip character varying(50), | 
|---|
|  |  |  | 
|---|
|  |  |  | catalog_group integer, | 
|---|
|  |  |  | create_time character varying(50), | 
|---|
|  |  |  | update_time character varying(50), | 
|---|
|  |  |  | tree_type character varying(50), | 
|---|
|  |  |  | as_message_channel bool default false, | 
|---|
|  |  |  | constraint uk_platform_unique_server_gb_id unique (server_gb_id) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | 
|---|
|  |  |  | @Schema(description = "å°çåæ ç³»ï¼ ç®åæ¯æ WGS84,GCJ02") | 
|---|
|  |  |  | private String geoCoordSys; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ ç±»å å½æ è§å®äºä¸¤ç§æ çå±ç°æ¹å¼ è¡æ¿åºåï¼CivilCode åä¸å¡åç»:BusinessGroup | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Schema(description = "æ ç±»å å½æ è§å®äºä¸¤ç§æ çå±ç°æ¹å¼ è¡æ¿åºåï¼CivilCode åä¸å¡åç»:BusinessGroup") | 
|---|
|  |  |  | private String treeType; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(description = "å¯ç ") | 
|---|
|  |  |  | private String password; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setGeoCoordSys(String geoCoordSys) { | 
|---|
|  |  |  | this.geoCoordSys = geoCoordSys; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getTreeType() { | 
|---|
|  |  |  | return treeType; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setTreeType(String treeType) { | 
|---|
|  |  |  | this.treeType = treeType; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getPassword() { | 
|---|
|  |  |  | 
|---|
|  |  |  | @Schema(description = "å建æ¶é´") | 
|---|
|  |  |  | private String createTime; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ ç±»å å½æ è§å®äºä¸¤ç§æ çå±ç°æ¹å¼ è¡æ¿åºå CivilCode åä¸å¡åç»:BusinessGroup | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Schema(description = "æ ç±»å å½æ è§å®äºä¸¤ç§æ çå±ç°æ¹å¼ è¡æ¿åºå CivilCode åä¸å¡åç»:BusinessGrou") | 
|---|
|  |  |  | private String treeType; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(description = "æ¯å¦ä½ä¸ºæ¶æ¯éé") | 
|---|
|  |  |  | private boolean asMessageChannel; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setCreateTime(String createTime) { | 
|---|
|  |  |  | this.createTime = createTime; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getTreeType() { | 
|---|
|  |  |  | return treeType; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setTreeType(String treeType) { | 
|---|
|  |  |  | this.treeType = treeType; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public boolean isAsMessageChannel() { | 
|---|
|  |  |  | 
|---|
|  |  |  | device.setStreamMode("UDP"); | 
|---|
|  |  |  | device.setCharset("GB2312"); | 
|---|
|  |  |  | device.setGeoCoordSys("WGS84"); | 
|---|
|  |  |  | device.setTreeType("CivilCode"); | 
|---|
|  |  |  | device.setDeviceId(deviceId); | 
|---|
|  |  |  | device.setOnLine(false); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | deviceInStore.setSdpIp(device.getSdpIp()); | 
|---|
|  |  |  | deviceInStore.setCharset(device.getCharset()); | 
|---|
|  |  |  | deviceInStore.setTreeType(device.getTreeType()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //  ç®å½è®¢é
ç¸å
³çä¿¡æ¯ | 
|---|
|  |  |  | if (device.getSubscribeCycleForCatalog() > 0) { | 
|---|
|  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public boolean update(ParentPlatform parentPlatform) { | 
|---|
|  |  |  | logger.info("[彿 çº§è]æ´æ°å¹³å° {}", parentPlatform.getDeviceGBId()); | 
|---|
|  |  |  | // TODO åç»çæ¬å»é¤ | 
|---|
|  |  |  | parentPlatform.setTreeType(""); | 
|---|
|  |  |  | parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase()); | 
|---|
|  |  |  | ParentPlatform parentPlatformOld = platformMapper.getParentPlatById(parentPlatform.getId()); | 
|---|
|  |  |  | ParentPlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(parentPlatformOld.getServerGBId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | "ssrc_check," + | 
|---|
|  |  |  | "as_message_channel," + | 
|---|
|  |  |  | "geo_coord_sys," + | 
|---|
|  |  |  | "tree_type," + | 
|---|
|  |  |  | "on_line," + | 
|---|
|  |  |  | "media_server_id," + | 
|---|
|  |  |  | "(SELECT count(0) FROM wvp_device_channel WHERE device_id=wvp_device.device_id) as channel_count "+ | 
|---|
|  |  |  | 
|---|
|  |  |  | "ssrc_check,"+ | 
|---|
|  |  |  | "as_message_channel,"+ | 
|---|
|  |  |  | "geo_coord_sys,"+ | 
|---|
|  |  |  | "tree_type,"+ | 
|---|
|  |  |  | "on_line"+ | 
|---|
|  |  |  | ") VALUES (" + | 
|---|
|  |  |  | "#{deviceId}," + | 
|---|
|  |  |  | 
|---|
|  |  |  | "#{ssrcCheck}," + | 
|---|
|  |  |  | "#{asMessageChannel}," + | 
|---|
|  |  |  | "#{geoCoordSys}," + | 
|---|
|  |  |  | "#{treeType}," + | 
|---|
|  |  |  | "#{onLine}" + | 
|---|
|  |  |  | ")") | 
|---|
|  |  |  | int add(Device device); | 
|---|
|  |  |  | 
|---|
|  |  |  | "ssrc_check,"+ | 
|---|
|  |  |  | "as_message_channel,"+ | 
|---|
|  |  |  | "geo_coord_sys,"+ | 
|---|
|  |  |  | "tree_type,"+ | 
|---|
|  |  |  | "on_line,"+ | 
|---|
|  |  |  | "media_server_id,"+ | 
|---|
|  |  |  | "(SELECT count(0) FROM wvp_device_channel WHERE device_id=de.device_id) as channel_count " + | 
|---|
|  |  |  | 
|---|
|  |  |  | "ssrc_check,"+ | 
|---|
|  |  |  | "as_message_channel,"+ | 
|---|
|  |  |  | "geo_coord_sys,"+ | 
|---|
|  |  |  | "tree_type,"+ | 
|---|
|  |  |  | "on_line"+ | 
|---|
|  |  |  | " FROM wvp_device WHERE on_line = true") | 
|---|
|  |  |  | List<Device> getOnlineDevices(); | 
|---|
|  |  |  | 
|---|
|  |  |  | "ssrc_check,"+ | 
|---|
|  |  |  | "as_message_channel,"+ | 
|---|
|  |  |  | "geo_coord_sys,"+ | 
|---|
|  |  |  | "tree_type,"+ | 
|---|
|  |  |  | "on_line"+ | 
|---|
|  |  |  | " FROM wvp_device WHERE ip = #{host} AND port=#{port}") | 
|---|
|  |  |  | Device getDeviceByHostAndPort(String host, int port); | 
|---|
|  |  |  | 
|---|
|  |  |  | "<if test=\"ssrcCheck != null\">, ssrc_check=#{ssrcCheck}</if>" + | 
|---|
|  |  |  | "<if test=\"asMessageChannel != null\">, as_message_channel=#{asMessageChannel}</if>" + | 
|---|
|  |  |  | "<if test=\"geoCoordSys != null\">, geo_coord_sys=#{geoCoordSys}</if>" + | 
|---|
|  |  |  | "<if test=\"treeType != null\">, tree_type=#{treeType}</if>" + | 
|---|
|  |  |  | "<if test=\"mediaServerId != null\">, media_server_id=#{mediaServerId}</if>" + | 
|---|
|  |  |  | "WHERE device_id=#{deviceId}"+ | 
|---|
|  |  |  | " </script>"}) | 
|---|
|  |  |  | 
|---|
|  |  |  | "ssrc_check,"+ | 
|---|
|  |  |  | "as_message_channel,"+ | 
|---|
|  |  |  | "geo_coord_sys,"+ | 
|---|
|  |  |  | "tree_type,"+ | 
|---|
|  |  |  | "on_line,"+ | 
|---|
|  |  |  | "media_server_id"+ | 
|---|
|  |  |  | ") VALUES (" + | 
|---|
|  |  |  | 
|---|
|  |  |  | "#{ssrcCheck}," + | 
|---|
|  |  |  | "#{asMessageChannel}," + | 
|---|
|  |  |  | "#{geoCoordSys}," + | 
|---|
|  |  |  | "#{treeType}," + | 
|---|
|  |  |  | "#{onLine}," + | 
|---|
|  |  |  | "#{mediaServerId}" + | 
|---|
|  |  |  | ")") | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Insert("INSERT INTO wvp_platform (enable, name, server_gb_id, server_gb_domain, server_ip, server_port,device_gb_id,device_ip,"+ | 
|---|
|  |  |  | "device_port,username,password,expires,keep_timeout,transport,character_set,ptz,rtcp,as_message_channel,"+ | 
|---|
|  |  |  | "status,start_offline_push,catalog_id,administrative_division,catalog_group,create_time,update_time,tree_type) " + | 
|---|
|  |  |  | "status,start_offline_push,catalog_id,administrative_division,catalog_group,create_time,update_time) " + | 
|---|
|  |  |  | "            VALUES (#{enable}, #{name}, #{serverGBId}, #{serverGBDomain}, #{serverIP}, #{serverPort}, #{deviceGBId}, #{deviceIp}, " + | 
|---|
|  |  |  | "            #{devicePort}, #{username}, #{password}, #{expires}, #{keepTimeout}, #{transport}, #{characterSet}, #{ptz}, #{rtcp}, #{asMessageChannel}, " + | 
|---|
|  |  |  | "            #{status},  #{startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime}, #{treeType})") | 
|---|
|  |  |  | "            #{status},  #{startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime})") | 
|---|
|  |  |  | int addParentPlatform(ParentPlatform parentPlatform); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Update("UPDATE wvp_platform " + | 
|---|
|  |  |  | 
|---|
|  |  |  | "administrative_division=#{administrativeDivision}, " + | 
|---|
|  |  |  | "create_time=#{createTime}, " + | 
|---|
|  |  |  | "update_time=#{updateTime}, " + | 
|---|
|  |  |  | "tree_type=#{treeType}, " + | 
|---|
|  |  |  | "catalog_id=#{catalogId} " + | 
|---|
|  |  |  | "WHERE id=#{id}") | 
|---|
|  |  |  | int updateParentPlatform(ParentPlatform parentPlatform); | 
|---|