Browse Source

同步最新代码

master
review512jwy@163.com 2 months ago
parent
commit
433f5554fd
  1. 14
      data-center-business-common/src/main/java/com/techsor/datacenter/business/common/Constants.java
  2. 2
      data-center-business-common/src/main/java/com/techsor/datacenter/business/common/config/DataSourceAdminConfig.java
  3. 4
      data-center-business-common/src/main/java/com/techsor/datacenter/business/common/config/DataSourceInterceptor.java
  4. 2
      data-center-business-common/src/main/java/com/techsor/datacenter/business/common/config/FlywayConfig.java
  5. 22
      data-center-business-controller/src/main/java/com/techsor/datacenter/business/controller/MonitoringAssetController.java
  6. 20
      data-center-business-controller/src/main/java/com/techsor/datacenter/business/controller/RiliPersonnasController.java
  7. 10
      data-center-business-controller/src/main/resources/config/application.properties
  8. 28
      data-center-business-controller/src/main/resources/db/migration/V56__class_big_thumbnail.sql
  9. 6
      data-center-business-controller/src/main/resources/db/migration/V57__building_lat_lng.sql
  10. 11
      data-center-business-controller/src/main/resources/db/migration/V58__class_big_thumbnail_dis.sql
  11. 24
      data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/BasicAssetClassBigMapper.java
  12. 2
      data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/BasicBuildingMapperExt.java
  13. 101
      data-center-business-dao/src/main/resources/mappers/auto/BasicAssetClassBigMapper.xml
  14. 47
      data-center-business-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml
  15. 2
      data-center-business-dao/src/main/resources/mappers/ex/BasicAssetClassMapperExt.xml
  16. 31
      data-center-business-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml
  17. 16
      data-center-business-dao/src/main/resources/mappers/ex/BasicCompanyMapperExt.xml
  18. 6
      data-center-business-dao/src/main/resources/mappers/ex/BasicFloorMapperExt.xml
  19. 16
      data-center-business-dao/src/main/resources/mappers/ex/BasicMonitoringAssetMapperExt.xml
  20. 4
      data-center-business-dao/src/main/resources/mappers/ex/BasicProjectMapperExt.xml
  21. 8
      data-center-business-dao/src/main/resources/mappers/ex/BasicSpaceMapperExt.xml
  22. 28
      data-center-business-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml
  23. 6
      data-center-business-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml
  24. 4
      data-center-business-dao/src/main/resources/mappers/ex/MqttConfigMapperExt.xml
  25. 2
      data-center-business-dao/src/main/resources/mappers/ex/TargetForwardConfigMapperExt.xml
  26. 2
      data-center-business-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties
  27. 16
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/asset/QueryRelatedDeviceParams.java
  28. 6
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/building/OptBuildingParams.java
  29. 14
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/rilipersonnas/DownloadPersonnasHistoryParams.java
  30. 68
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicAssetClassBig.java
  31. 68
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuilding.java
  32. 140
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuildingExample.java
  33. 6
      data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/building/BuildingPageVO.java
  34. 2
      data-center-business-service/src/main/java/com/techsor/datacenter/business/listener/PreloadDeviceCompanyMappingListener.java
  35. 9
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/MonitoringAssetService.java
  36. 8
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/RiliPersonnasService.java
  37. 4
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/SyncTrendsStatsService.java
  38. 2
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/common/CommonOpt.java
  39. 4
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/BuildingServiceImpl.java
  40. 16
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/CommonServiceImpl.java
  41. 6
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DeviceServiceImpl.java
  42. 27
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/MonitoringAssetServiceImpl.java
  43. 61
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/RiliPersonnasServiceImpl.java
  44. 6
      document/db/20240510.sql
  45. 4
      document/db/20240528.sql
  46. 103
      document/db/alarm_tmpl.sql
  47. 2
      document/db/p2.sql
  48. 2
      document/db/p3-20231205.sql
  49. 8
      document/db/p3-20240306.sql
  50. 14
      document/db/p3-20240415.sql
  51. 10
      document/db/p3-20240611.sql
  52. 8
      document/db/p4-20240627-2d3d.sql
  53. 4
      document/db/p4-20240717.sql
  54. 2
      document/db/p4-20241022.sql

14
data-center-business-common/src/main/java/com/techsor/datacenter/business/common/Constants.java

@ -5,7 +5,7 @@ package com.techsor.datacenter.business.common;
*/
public class Constants {
public static final String APP_NAME = "data-center-business:";
public static final String APP_NAME = "data-center-aeon:";
public static final int LOGIN_ATTEMPTS = 5;
public static final long LOGIN_LOCK_PERIOD = 3600000;//ms
@ -19,24 +19,24 @@ public class Constants {
public static final String DES_SALT = "ci3b512jwy199511";
// User ID, login name, enterprise ID, token
public static final String ACCESS_TOKEN_FORMAT = "RequestHeader:AccessToken:{0}:{1}:{2}:{3}";
public static final String ACCESS_TOKEN_FORMAT = APP_NAME + "RequestHeader:AccessToken:{0}:{1}:{2}:{3}";
public static final String CAPTCHA_VERIFICATION = "CAPTCHA:VERIFICATION:";
public static final String CAPTCHA_VERIFICATION = APP_NAME + "CAPTCHA:VERIFICATION:";
// User ID, login name, enterprise ID, token
public static final String MFA_TOKEN_FORMAT = "RequestHeader:MfaToken:{0}:{1}:{2}:{3}";
public static final String MFA_TOKEN_FORMAT = APP_NAME + "RequestHeader:MfaToken:{0}:{1}:{2}:{3}";
// User ID, login name, enterprise ID, token
public static final String MFA_SERECT_FORMAT = "RequestHeader:MfaSecret:{0}:{1}:{2}:{3}";
public static final String MFA_SERECT_FORMAT = APP_NAME + "RequestHeader:MfaSecret:{0}:{1}:{2}:{3}";
// User ID, login name, enterprise ID, token
public static final String MFA_EMAIL_FORMAT = "RequestHeader:MfaEmail:{0}:{1}:{2}:{3}";
public static final String MFA_EMAIL_FORMAT = APP_NAME + "RequestHeader:MfaEmail:{0}:{1}:{2}:{3}";
public static final String AURORA_URL_FORMAT = "jdbc:mysql://{0}:3306/third?useSSL=false";
public static final String DATASOURCE_PREFIX = "dataSourceForCompany_";
public static final String THIRD_DB_PREFIX = "data_center_dongjian_";
public static final String THIRD_DB_PREFIX = "data_center_aeon_";
//Key for storing clientId sent.
public static final String SYS_ENV_GATEWAY_ALERT_MAIL_FLAG = "SYS_ENV_GATEWAY_ALERT_MAIL_FLAG_";

2
data-center-business-common/src/main/java/com/techsor/datacenter/business/common/config/DataSourceAdminConfig.java

@ -106,7 +106,7 @@ public class DataSourceAdminConfig {
"\t\t\tbcom.id,\n" +
"\t\t\tbcom.company_name companyName\n" +
"\t\tFROM\n" +
"\t\t\tdata_center_new.basic_company bcom\n" +
"\t\t\tdata_center_aeon_admin.basic_company bcom\n" +
"\t\tWHERE bcom.flag != 1 and (parent_id = 1 or parent_id = -1)";
jdbcTemplate.query(sql,rs->{

4
data-center-business-common/src/main/java/com/techsor/datacenter/business/common/config/DataSourceInterceptor.java

@ -44,7 +44,7 @@ public class DataSourceInterceptor implements HandlerInterceptor {
String sql="SELECT "
+ " bcom.id, bcom.parent_id parentId"
+ " FROM data_center_new.basic_company bcom "
+ " FROM data_center_aeon_admin.basic_company bcom "
+ " WHERE bcom.flag != 1 and bcom.id = " + companyId;
AtomicLong parentId = new AtomicLong(0);
@ -71,7 +71,7 @@ public class DataSourceInterceptor implements HandlerInterceptor {
"\t\t\tbcom.id,\n" +
"\t\t\tbcom.company_name companyName\n" +
"\t\tFROM\n" +
"\t\t\tdata_center_new.basic_company bcom\n" +
"\t\t\tdata_center_aeon_admin.basic_company bcom\n" +
"\t\tWHERE (bcom.parent_id=1 or bcom.parent_id=-1) and bcom.flag != 1";
jdbcTemplate.query(sql,rs->{

2
data-center-business-common/src/main/java/com/techsor/datacenter/business/common/config/FlywayConfig.java

@ -81,7 +81,7 @@ public class FlywayConfig {
"\t\t\tbcom.id,\n" +
"\t\t\tbcom.company_name companyName\n" +
"\t\tFROM\n" +
"\t\t\tdata_center_new.basic_company bcom\n" +
"\t\t\tdata_center_aeon_admin.basic_company bcom\n" +
"\t\tWHERE bcom.flag != 1 and (parent_id = 1 or parent_id = -1)";
List<String> resultList=new ArrayList<>();
jdbcTemplate.query(sql,rs->{

22
data-center-business-controller/src/main/java/com/techsor/datacenter/business/controller/MonitoringAssetController.java

@ -1,5 +1,7 @@
package com.techsor.datacenter.business.controller;
import com.techsor.datacenter.business.dto.asset.*;
import com.techsor.datacenter.business.vo.device.DeviceVO;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
@ -25,12 +27,6 @@ import com.techsor.datacenter.business.common.response.PageResponse;
import com.techsor.datacenter.business.common.response.ResponseCode;
import com.techsor.datacenter.business.common.response.SimpleDataResponse;
import com.techsor.datacenter.business.configurator.interceptor.AccessRequired;
import com.techsor.datacenter.business.dto.asset.AssetThirdParams;
import com.techsor.datacenter.business.dto.asset.FileNameList;
import com.techsor.datacenter.business.dto.asset.GetAssetFileTemporaryParams;
import com.techsor.datacenter.business.dto.asset.DeleteMonitoringAssetParams;
import com.techsor.datacenter.business.dto.asset.MonitoringAssetSearchParams;
import com.techsor.datacenter.business.dto.asset.OptMonitoringAssetParams;
import com.techsor.datacenter.business.dto.space.ModifyImageDescriptionParams;
import com.techsor.datacenter.business.service.MonitoringAssetService;
import com.techsor.datacenter.business.util.FileUtil;
@ -44,7 +40,7 @@ import com.techsor.datacenter.business.vo.asset.MonitoringAssetPageVO;
*
*/
@RestController
@AccessRequired
//@AccessRequired
@RequestMapping("/monitoringAsset")
@Tag(name = "MonitoringAssetController",description = "Monitoring asset related API")
@SuppressWarnings("unchecked")
@ -329,4 +325,16 @@ public class MonitoringAssetController {
return monitoringAssetService.importBarFiles(wsClientId, detailFile, UserId, CompanyId, LanguageType);
}
@Operation(summary = "Get asset field dropdown list")
@RequestMapping(value = "/getRelatedDeviceList", method = RequestMethod.GET)
public SimpleDataResponse getRelatedDeviceList(
QueryRelatedDeviceParams params,
@Parameter(name="LoginName", description ="Login name", required=true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName,
@Parameter(name="AccessToken", description ="Authentication token", required=true) @RequestHeader(required=true) String AccessToken,
@Parameter(name="UserId", description ="User ID", required=true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId,
@Parameter(name="CompanyId", description ="Company ID", required=false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId,
@Parameter(name="LanguageType", description ="Language type 0: Chinese 1: English 2: Japanese", required=true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType) {
return monitoringAssetService.getRelatedDeviceList(params, UserId, CompanyId, LanguageType);
}
}

20
data-center-business-controller/src/main/java/com/techsor/datacenter/business/controller/RiliPersonnasController.java

@ -5,10 +5,8 @@ import com.techsor.datacenter.business.common.response.PageInfo;
import com.techsor.datacenter.business.common.response.PageResponse;
import com.techsor.datacenter.business.common.response.ResponseCode;
import com.techsor.datacenter.business.common.response.SimpleDataResponse;
import com.techsor.datacenter.business.dto.rilipersonnas.DeleteRiliPersonnasParams;
import com.techsor.datacenter.business.dto.rilipersonnas.OptRiliPersonnasParams;
import com.techsor.datacenter.business.dto.rilipersonnas.RiliPersonnasHistorySearchParams;
import com.techsor.datacenter.business.dto.rilipersonnas.RiliPersonnasSearchParams;
import com.techsor.datacenter.business.dto.device.DeviceSearchParams;
import com.techsor.datacenter.business.dto.rilipersonnas.*;
import com.techsor.datacenter.business.dto.tenant.DeleteTenantParams;
import com.techsor.datacenter.business.dto.tenant.OptTenantParams;
import com.techsor.datacenter.business.dto.tenant.TenantGetAllParams;
@ -177,6 +175,20 @@ public class RiliPersonnasController {
}
}
@Operation(summary = "Download history", description = "Download history")
@PostMapping(path = "/downloadHistory")
public ResponseEntity downloadHistory(
@Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName,
@Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken,
@Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId,
@Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId,
@Parameter(name = "LanguageType", description = "Language type 0: Chinese 1: English 2: Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType,
@Parameter(name = "UTCOffset", description = "Offset between GMT and local time in minutes, e.g., -480 for GMT+8") @RequestHeader(required = true) Integer UTCOffset,
@RequestBody RiliPersonnasHistorySearchParams params) throws UnsupportedEncodingException {
return riliPersonnasService.downloadHistoryByPersonnasSpaceId(UserId, CompanyId, LanguageType, params);
}
}

10
data-center-business-controller/src/main/resources/config/application.properties

@ -6,22 +6,22 @@ spring.mvc.pathmatch.matching-strategy= ANT_PATH_MATCHER
mybatis.mapperLocations=classpath:mappers/**/*.xml
spring.datasource.admin.name=data_center_new
spring.datasource.admin.url=jdbc:mysql://${datasourceDNS}/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
spring.datasource.admin.name=data_center_aeon_admin
spring.datasource.admin.url=jdbc:mysql://${datasourceDNS}/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
spring.datasource.admin.username=${datasourceUsername}
spring.datasource.admin.password=${datasourcePassword}
#使用druid数据源
spring.datasource.admin.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.admin.driverClassName=com.mysql.jdbc.Driver
spring.datasource.admin.hikari.driverClassName=com.mysql.jdbc.Driver
spring.datasource.admin.hikari.schema=data_center_new
spring.datasource.admin.hikari.schema=data_center_aeon_admin
spring.datasource.admin.hikari.minimum-idle: 5
spring.datasource.admin.hikari.maximum-pool-size: ${rdsMaxPool:40}
spring.datasource.admin.hikari.connection-timeout:10000
dynamic.jdbc.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/%s?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
spring.datasource.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
spring.datasource.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
#配置log日志
@ -121,7 +121,7 @@ schedule.cron.expression=${stats.cron:0 3 * * * ? }
spring.flyway.enabled=true
spring.flyway.url=jdbc:mysql://${datasourceDNS}/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
spring.flyway.url=jdbc:mysql://${datasourceDNS}/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
spring.flyway.user=${datasourceUsername}
spring.flyway.password=${datasourcePassword}
spring.flyway.locations=classpath:db/migration

28
data-center-business-controller/src/main/resources/db/migration/V56__class_big_thumbnail.sql

@ -0,0 +1,28 @@
alter table basic_asset_class_big add (
`thumbnail_normal_base64` text COMMENT '普通图片转base64格式',
`thumbnail_alarm_base64` text COMMENT '告警图片转base64格式'
);
DROP TABLE IF EXISTS device_group;
DROP TABLE IF EXISTS device_group_relation;
CREATE TABLE `dashboard_device_group` (
`id` bigint NOT NULL AUTO_INCREMENT,
`company_id` bigint DEFAULT NULL,
`building_id` bigint DEFAULT NULL COMMENT '所属楼宇ID',
`name` varchar(500) NOT NULL,
`remark` varchar(500) DEFAULT NULL,
`flag` int DEFAULT '0' COMMENT '0-正常,1-删除',
`created_by` bigint DEFAULT NULL,
`created_at` bigint DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='dashboard设备分组表';
insert into `dashboard_device_group`(`id`,`company_id`,`name`,`remark`,`flag`,`created_by`,`created_at`) values
(1,NULL,'タイル1',NULL,0,NULL,NULL),
(2,NULL,'タイル2',NULL,0,NULL,NULL);
CREATE TABLE `dashboard_device_group_relation` (
`device_info_id` int NOT NULL COMMENT 'device_info表里的id',
`device_group_id` bigint NOT NULL COMMENT 'dashboard_device_group表里的id'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='dashboard设备分组归属关系';

6
data-center-business-controller/src/main/resources/db/migration/V57__building_lat_lng.sql

@ -0,0 +1,6 @@
alter table basic_building add (
`latitude` VARCHAR(20) DEFAULT NULL,
`longitude` VARCHAR(20) DEFAULT NULL
);
alter table basic_user add `create_platform` int default '0' COMMENT '创建平台,0-business, 1-dashboard';

11
data-center-business-controller/src/main/resources/db/migration/V58__class_big_thumbnail_dis.sql

@ -0,0 +1,11 @@
alter table basic_asset_class_big add (
`thumbnail_dis_base64` text COMMENT '灰色图片转base64格式'
);
CREATE TABLE dashboard_notice_ignored (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
redis_key VARCHAR(255) NOT NULL COMMENT 'alert_window_notice:ignore:%d:%s,%d:%s对应用户ID和token,防止多点登录',
member_value VARCHAR(255) NOT NULL COMMENT '存告警ID',
created_at bigint DEFAULT NULL,
UNIQUE KEY (redis_key, member_value)
) COMMENT '平台告警通知已读表';

24
data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/BasicAssetClassBigMapper.java

@ -46,6 +46,14 @@ public interface BasicAssetClassBigMapper {
*/
int insertSelective(BasicAssetClassBig record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_asset_class_big
*
* @mbg.generated
*/
List<BasicAssetClassBig> selectByExampleWithBLOBs(BasicAssetClassBigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_asset_class_big
@ -70,6 +78,14 @@ public interface BasicAssetClassBigMapper {
*/
int updateByExampleSelective(@Param("record") BasicAssetClassBig record, @Param("example") BasicAssetClassBigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_asset_class_big
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") BasicAssetClassBig record, @Param("example") BasicAssetClassBigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_asset_class_big
@ -86,6 +102,14 @@ public interface BasicAssetClassBigMapper {
*/
int updateByPrimaryKeySelective(BasicAssetClassBig record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_asset_class_big
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(BasicAssetClassBig record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_asset_class_big

2
data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/BasicBuildingMapperExt.java

@ -18,4 +18,6 @@ public interface BasicBuildingMapperExt extends BasicBuildingMapper{
List<BuildingPageVO> getListPage(BuildingSearchParams pageSearchParam);
List<BuildingPageVO> getAll(String companyId);
List<BuildingPageVO> getAllInList(List<Long> companyIdList);
}

101
data-center-business-dao/src/main/resources/mappers/auto/BasicAssetClassBigMapper.xml

@ -12,6 +12,14 @@
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="flag" jdbcType="INTEGER" property="flag" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.techsor.datacenter.business.model.BasicAssetClassBig">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="thumbnail_normal_base64" jdbcType="LONGVARCHAR" property="thumbnailNormalBase64" />
<result column="thumbnail_alarm_base64" jdbcType="LONGVARCHAR" property="thumbnailAlarmBase64" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
@ -85,6 +93,34 @@
-->
id, company_id, class_name, create_time, flag
</sql>
<sql id="Blob_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
thumbnail_normal_base64, thumbnail_alarm_base64
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.techsor.datacenter.business.model.BasicAssetClassBigExample" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from basic_asset_class_big
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.BasicAssetClassBigExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
@ -104,13 +140,15 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from basic_asset_class_big
where id = #{id,jdbcType=BIGINT}
</select>
@ -141,9 +179,11 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into basic_asset_class_big (company_id, class_name, create_time,
flag)
flag, thumbnail_normal_base64, thumbnail_alarm_base64
)
values (#{companyId,jdbcType=BIGINT}, #{className,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{flag,jdbcType=INTEGER})
#{flag,jdbcType=INTEGER}, #{thumbnailNormalBase64,jdbcType=LONGVARCHAR}, #{thumbnailAlarmBase64,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.BasicAssetClassBig">
<!--
@ -167,6 +207,12 @@
<if test="flag != null">
flag,
</if>
<if test="thumbnailNormalBase64 != null">
thumbnail_normal_base64,
</if>
<if test="thumbnailAlarmBase64 != null">
thumbnail_alarm_base64,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="companyId != null">
@ -181,6 +227,12 @@
<if test="flag != null">
#{flag,jdbcType=INTEGER},
</if>
<if test="thumbnailNormalBase64 != null">
#{thumbnailNormalBase64,jdbcType=LONGVARCHAR},
</if>
<if test="thumbnailAlarmBase64 != null">
#{thumbnailAlarmBase64,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.techsor.datacenter.business.model.BasicAssetClassBigExample" resultType="java.lang.Long">
@ -215,11 +267,34 @@
<if test="record.flag != null">
flag = #{record.flag,jdbcType=INTEGER},
</if>
<if test="record.thumbnailNormalBase64 != null">
thumbnail_normal_base64 = #{record.thumbnailNormalBase64,jdbcType=LONGVARCHAR},
</if>
<if test="record.thumbnailAlarmBase64 != null">
thumbnail_alarm_base64 = #{record.thumbnailAlarmBase64,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update basic_asset_class_big
set id = #{record.id,jdbcType=BIGINT},
company_id = #{record.companyId,jdbcType=BIGINT},
class_name = #{record.className,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
flag = #{record.flag,jdbcType=INTEGER},
thumbnail_normal_base64 = #{record.thumbnailNormalBase64,jdbcType=LONGVARCHAR},
thumbnail_alarm_base64 = #{record.thumbnailAlarmBase64,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
@ -254,9 +329,29 @@
<if test="flag != null">
flag = #{flag,jdbcType=INTEGER},
</if>
<if test="thumbnailNormalBase64 != null">
thumbnail_normal_base64 = #{thumbnailNormalBase64,jdbcType=LONGVARCHAR},
</if>
<if test="thumbnailAlarmBase64 != null">
thumbnail_alarm_base64 = #{thumbnailAlarmBase64,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.techsor.datacenter.business.model.BasicAssetClassBig">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update basic_asset_class_big
set company_id = #{companyId,jdbcType=BIGINT},
class_name = #{className,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
flag = #{flag,jdbcType=INTEGER},
thumbnail_normal_base64 = #{thumbnailNormalBase64,jdbcType=LONGVARCHAR},
thumbnail_alarm_base64 = #{thumbnailAlarmBase64,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.techsor.datacenter.business.model.BasicAssetClassBig">
<!--
WARNING - @mbg.generated

47
data-center-business-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml

@ -20,6 +20,8 @@
<result column="thumbnail_num" jdbcType="INTEGER" property="thumbnailNum" />
<result column="show_switch_2d3d" jdbcType="INTEGER" property="showSwitch2d3d" />
<result column="brief_introduction" jdbcType="VARCHAR" property="briefIntroduction" />
<result column="latitude" jdbcType="VARCHAR" property="latitude" />
<result column="longitude" jdbcType="VARCHAR" property="longitude" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.techsor.datacenter.business.model.BasicBuilding">
<!--
@ -101,7 +103,8 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
building_id, company_id, `name`, address, flag, create_time, creator_id, modify_time,
modifier_id, udf_building_id, building_bucket, thumbnail_num, show_switch_2d3d, brief_introduction
modifier_id, udf_building_id, building_bucket, thumbnail_num, show_switch_2d3d, brief_introduction,
latitude, longitude
</sql>
<sql id="Blob_Column_List">
<!--
@ -192,13 +195,15 @@
flag, create_time, creator_id,
modify_time, modifier_id, udf_building_id,
building_bucket, thumbnail_num, show_switch_2d3d,
brief_introduction, floor_info_list, picture_introduction
brief_introduction, latitude, longitude,
floor_info_list, picture_introduction
)
values (#{companyId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{flag,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT},
#{modifyTime,jdbcType=BIGINT}, #{modifierId,jdbcType=BIGINT}, #{udfBuildingId,jdbcType=VARCHAR},
#{buildingBucket,jdbcType=VARCHAR}, #{thumbnailNum,jdbcType=INTEGER}, #{showSwitch2d3d,jdbcType=INTEGER},
#{briefIntroduction,jdbcType=VARCHAR}, #{floorInfoList,jdbcType=LONGVARCHAR}, #{pictureIntroduction,jdbcType=LONGVARCHAR}
#{briefIntroduction,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR},
#{floorInfoList,jdbcType=LONGVARCHAR}, #{pictureIntroduction,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.BasicBuilding">
@ -250,6 +255,12 @@
<if test="briefIntroduction != null">
brief_introduction,
</if>
<if test="latitude != null">
latitude,
</if>
<if test="longitude != null">
longitude,
</if>
<if test="floorInfoList != null">
floor_info_list,
</if>
@ -297,6 +308,12 @@
<if test="briefIntroduction != null">
#{briefIntroduction,jdbcType=VARCHAR},
</if>
<if test="latitude != null">
#{latitude,jdbcType=VARCHAR},
</if>
<if test="longitude != null">
#{longitude,jdbcType=VARCHAR},
</if>
<if test="floorInfoList != null">
#{floorInfoList,jdbcType=LONGVARCHAR},
</if>
@ -364,6 +381,12 @@
<if test="record.briefIntroduction != null">
brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR},
</if>
<if test="record.latitude != null">
latitude = #{record.latitude,jdbcType=VARCHAR},
</if>
<if test="record.longitude != null">
longitude = #{record.longitude,jdbcType=VARCHAR},
</if>
<if test="record.floorInfoList != null">
floor_info_list = #{record.floorInfoList,jdbcType=LONGVARCHAR},
</if>
@ -395,6 +418,8 @@
thumbnail_num = #{record.thumbnailNum,jdbcType=INTEGER},
show_switch_2d3d = #{record.showSwitch2d3d,jdbcType=INTEGER},
brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR},
latitude = #{record.latitude,jdbcType=VARCHAR},
longitude = #{record.longitude,jdbcType=VARCHAR},
floor_info_list = #{record.floorInfoList,jdbcType=LONGVARCHAR},
picture_introduction = #{record.pictureIntroduction,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
@ -420,7 +445,9 @@
building_bucket = #{record.buildingBucket,jdbcType=VARCHAR},
thumbnail_num = #{record.thumbnailNum,jdbcType=INTEGER},
show_switch_2d3d = #{record.showSwitch2d3d,jdbcType=INTEGER},
brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR}
brief_introduction = #{record.briefIntroduction,jdbcType=VARCHAR},
latitude = #{record.latitude,jdbcType=VARCHAR},
longitude = #{record.longitude,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -471,6 +498,12 @@
<if test="briefIntroduction != null">
brief_introduction = #{briefIntroduction,jdbcType=VARCHAR},
</if>
<if test="latitude != null">
latitude = #{latitude,jdbcType=VARCHAR},
</if>
<if test="longitude != null">
longitude = #{longitude,jdbcType=VARCHAR},
</if>
<if test="floorInfoList != null">
floor_info_list = #{floorInfoList,jdbcType=LONGVARCHAR},
</if>
@ -499,6 +532,8 @@
thumbnail_num = #{thumbnailNum,jdbcType=INTEGER},
show_switch_2d3d = #{showSwitch2d3d,jdbcType=INTEGER},
brief_introduction = #{briefIntroduction,jdbcType=VARCHAR},
latitude = #{latitude,jdbcType=VARCHAR},
longitude = #{longitude,jdbcType=VARCHAR},
floor_info_list = #{floorInfoList,jdbcType=LONGVARCHAR},
picture_introduction = #{pictureIntroduction,jdbcType=LONGVARCHAR}
where building_id = #{buildingId,jdbcType=BIGINT}
@ -521,7 +556,9 @@
building_bucket = #{buildingBucket,jdbcType=VARCHAR},
thumbnail_num = #{thumbnailNum,jdbcType=INTEGER},
show_switch_2d3d = #{showSwitch2d3d,jdbcType=INTEGER},
brief_introduction = #{briefIntroduction,jdbcType=VARCHAR}
brief_introduction = #{briefIntroduction,jdbcType=VARCHAR},
latitude = #{latitude,jdbcType=VARCHAR},
longitude = #{longitude,jdbcType=VARCHAR}
where building_id = #{buildingId,jdbcType=BIGINT}
</update>
</mapper>

2
data-center-business-dao/src/main/resources/mappers/ex/BasicAssetClassMapperExt.xml

@ -74,7 +74,7 @@
<otherwise>
</otherwise>
</choose>
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = tab.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = tab.company_id
WHERE
tab.flag != 1 AND bcomp.flag != 1
AND tab.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>

31
data-center-business-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml

@ -41,10 +41,12 @@
bbuilding.thumbnail_num,
bbuilding.show_switch_2d3d,
bbuilding.brief_introduction,
bbuilding.picture_introduction
bbuilding.picture_introduction,
bbuilding.latitude,
bbuilding.longitude
FROM
basic_building bbuilding
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bbuilding.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bbuilding.company_id
WHERE
bbuilding.flag != 1 AND bcomp.flag != 1
AND bbuilding.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
@ -72,7 +74,7 @@
bbuilding.udf_building_id udfBuildingId
FROM
basic_building bbuilding
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bbuilding.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bbuilding.company_id
WHERE
bbuilding.flag != 1
<if test="companyId != null">
@ -80,6 +82,29 @@
</if>
AND bcomp.flag != 1
</select>
<select id="getAllInList" resultType="com.techsor.datacenter.business.vo.building.BuildingPageVO">
SELECT
bbuilding.building_id buildingId,
bbuilding.company_id companyId,
bcomp.company_name companyName,
bbuilding.name buildingName,
bbuilding.address,
bbuilding.udf_building_id udfBuildingId
FROM
basic_building bbuilding
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bbuilding.company_id
WHERE
bbuilding.flag != 1
<if test="companyIdList != null and companyIdList.size() > 0">
AND bbuilding.building_id IN
<foreach collection="companyIdList" item="companyId" open="(" separator="," close=")">
#{companyId}
</foreach>
</if>
AND bcomp.flag != 1
</select>
</mapper>

16
data-center-business-dao/src/main/resources/mappers/ex/BasicCompanyMapperExt.xml

@ -6,7 +6,7 @@
SELECT
bcom.id
FROM
data_center_new.basic_company bcom
data_center_aeon_admin.basic_company bcom
WHERE bcom.flag != 1 and bcom.parent_id IN (${companyIds})
</select>
@ -15,7 +15,7 @@
bcom.id,
bcom.company_name companyName
FROM
data_center_new.basic_company bcom
data_center_aeon_admin.basic_company bcom
WHERE bcom.flag != 1 AND bcom.id IN (${companyIds})
</select>
@ -25,7 +25,7 @@
bcom.company_name companyName,
bcom.parent_id parentId
FROM
data_center_new.basic_company bcom
data_center_aeon_admin.basic_company bcom
WHERE bcom.flag != 1
</select>
@ -33,7 +33,7 @@
SELECT
id, parent_id, company_name, mfa_switch, flag
FROM
data_center_new.basic_company bcom
data_center_aeon_admin.basic_company bcom
WHERE bcom.flag != 1
<if test="companyIdList != null and companyIdList.size() > 0">
AND bcom.id in
@ -50,7 +50,7 @@
aurora_username auroraUsername,
aurora_password auroraPassword
FROM
data_center_new.basic_company bcom
data_center_aeon_admin.basic_company bcom
WHERE flag != 1
<if test="companyId != null">
AND id = #{companyId}
@ -69,7 +69,7 @@
aurora_username auroraUsername,
aurora_password auroraPassword
FROM
data_center_new.basic_company bcom
data_center_aeon_admin.basic_company bcom
WHERE flag != 1
<if test="companyId != null">
AND id = #{companyId}
@ -84,7 +84,7 @@
id companyId,
apikey
FROM
data_center_new.basic_company bcom
data_center_aeon_admin.basic_company bcom
WHERE flag != 1
<if test="companyId != null">
AND id = #{companyId}
@ -96,7 +96,7 @@
id,
bearer_token bearerToken
FROM
data_center_new.basic_company
data_center_aeon_admin.basic_company
WHERE flag != 1
<if test="companyId != null">
AND id = #{companyId}

6
data-center-business-dao/src/main/resources/mappers/ex/BasicFloorMapperExt.xml

@ -61,7 +61,7 @@
bbuilding.udf_building_id
FROM
basic_floor bfloor
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bfloor.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bfloor.company_id
INNER JOIN basic_building bbuilding ON bbuilding.building_id = bfloor.building_id
WHERE
bfloor.flag != 1 AND bcomp.flag != 1 AND bbuilding.flag != 1
@ -91,7 +91,7 @@
bfloor.udf_floor_id udfFloorId
FROM
basic_floor bfloor
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bfloor.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bfloor.company_id
INNER JOIN basic_building bbuilding ON bbuilding.building_id = bfloor.building_id
WHERE
bfloor.flag != 1 AND bcomp.flag != 1 AND bbuilding.flag != 1
@ -120,7 +120,7 @@
from
basic_floor
left join data_center_new.basic_company on basic_floor.company_id = basic_company.id
left join data_center_aeon_admin.basic_company on basic_floor.company_id = basic_company.id
left join basic_building on basic_floor.building_id = basic_building.building_id
where
basic_building.flag!=1 and basic_floor.flag!=1

16
data-center-business-dao/src/main/resources/mappers/ex/BasicMonitoringAssetMapperExt.xml

@ -98,7 +98,7 @@
basset.images_introduction
FROM
basic_monitoring_asset basset
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN basic_space bspace ON bspace.space_id = basset.space_id
INNER JOIN basic_floor bfloor ON bfloor.floor_id = bspace.floor_id
<!-- <if test="buildingIdList != null"> -->
@ -192,7 +192,7 @@
basset.specifications6
FROM
basic_monitoring_asset basset
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN basic_space bspace ON bspace.space_id = basset.space_id
LEFT JOIN basic_asset_class_big acbig ON basset.class_big_id = acbig.id
LEFT JOIN basic_asset_class_medium acmedium ON basset.class_medium_id = acmedium.id
@ -261,7 +261,7 @@
bbuilding.udf_building_id
FROM
basic_monitoring_asset basset
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN basic_space bspace ON bspace.space_id = basset.space_id
INNER JOIN basic_floor bfloor ON bfloor.floor_id = bspace.floor_id
INNER JOIN basic_building bbuilding ON bfloor.building_id = bbuilding.building_id
@ -328,7 +328,7 @@
from
basic_monitoring_asset basset
left join data_center_new.basic_company on basset.company_id = basic_company.id
left join data_center_aeon_admin.basic_company on basset.company_id = basic_company.id
left join basic_space on basset.space_id = basic_space.space_id
left join basic_floor on basic_space.floor_id = basic_floor.floor_id
left join basic_building on basic_floor.building_id = basic_building.building_id
@ -420,7 +420,7 @@
basset.images_introduction
FROM
basic_monitoring_asset basset
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN basic_space bspace ON bspace.space_id = basset.space_id
<if test="buildingIdList != null or (buildingName != null and buildingName != '') or (udfBuildingId != null and udfBuildingId != '')">
INNER JOIN basic_floor bfloor ON bfloor.floor_id = bspace.floor_id
@ -488,7 +488,7 @@
basset.images_introduction
FROM
basic_monitoring_asset basset
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN basic_space bspace ON bspace.space_id = basset.space_id
INNER JOIN basic_floor bfloor ON bfloor.floor_id = bspace.floor_id
INNER JOIN basic_building bbuilding ON bfloor.building_id = bbuilding.building_id
@ -537,7 +537,7 @@
clsmall.class_name classSmallName
FROM
basic_monitoring_asset basset
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN basic_space bspace ON bspace.space_id = basset.space_id
INNER JOIN basic_floor bfloor ON bfloor.floor_id = bspace.floor_id
INNER JOIN basic_building bbuilding ON bfloor.building_id = bbuilding.building_id
@ -668,7 +668,7 @@
daconfig.building_id roidBuildingId
FROM
basic_monitoring_asset basset
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = basset.company_id
INNER JOIN basic_space bspace ON bspace.space_id = basset.space_id
INNER JOIN basic_floor bfloor ON bfloor.floor_id = bspace.floor_id
INNER JOIN device_info dinfo ON basset.equipment_id = dinfo.asset_id

4
data-center-business-dao/src/main/resources/mappers/ex/BasicProjectMapperExt.xml

@ -28,7 +28,7 @@
bpro.udf_project_id udfProjectId
FROM
basic_project bpro
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bpro.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bpro.company_id
WHERE
bpro.flag != 1 AND bcomp.flag != 1
AND bpro.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
@ -49,7 +49,7 @@
bpro.udf_project_id udfProjectId
FROM
basic_project bpro
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bpro.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bpro.company_id
WHERE
bpro.flag != 1 AND bcomp.flag != 1
<if test="companyId != null">

8
data-center-business-dao/src/main/resources/mappers/ex/BasicSpaceMapperExt.xml

@ -94,7 +94,7 @@
btenant.tenant_name tenantName
FROM
basic_space bspace
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bspace.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bspace.company_id
INNER JOIN basic_floor bfloor ON bfloor.floor_id = bspace.floor_id
INNER JOIN basic_building bbuilding ON bbuilding.building_id = bfloor.building_id
LEFT JOIN basic_tenant btenant ON btenant.tenant_id = bspace.tenant_id
@ -135,7 +135,7 @@
btenant.tenant_udf_id tenantUdfId
FROM
basic_space bspace
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bspace.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bspace.company_id
INNER JOIN basic_floor bfloor ON bfloor.floor_id = bspace.floor_id
INNER JOIN basic_building bbuilding ON bfloor.building_id = bbuilding.building_id
LEFT JOIN basic_tenant btenant ON btenant.tenant_id = bspace.tenant_id
@ -165,7 +165,7 @@
btenant.tenant_udf_id tenantUdfId
FROM
basic_space bspace
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bspace.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bspace.company_id
INNER JOIN basic_floor bfloor ON bfloor.floor_id = bspace.floor_id
LEFT JOIN basic_tenant btenant ON btenant.tenant_id = bspace.tenant_id
WHERE
@ -316,7 +316,7 @@
btenant.tenant_udf_id tenantUdfId
from
basic_space bspace
left join data_center_new.basic_company on bspace.company_id = basic_company.id
left join data_center_aeon_admin.basic_company on bspace.company_id = basic_company.id
left join basic_floor on bspace.floor_id = basic_floor.floor_id
left join basic_building on basic_floor.building_id = basic_building.building_id
left join basic_tenant btenant ON btenant.tenant_id = bspace.tenant_id

28
data-center-business-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml

@ -24,8 +24,8 @@
bcom.lock_switch,
buser.mfa_bind,
buser.super_role
from data_center_new.basic_user buser
inner join data_center_new.basic_company bcom on bcom.id = buser.company_id
from data_center_aeon_admin.basic_user buser
inner join data_center_aeon_admin.basic_company bcom on bcom.id = buser.company_id
WHERE buser.flag != 1 and buser.user_type = 2 and bcom.flag != 1 and (login_name = #{loginname})
</select>
@ -36,13 +36,13 @@
FROM
<choose>
<when test="superRole != null and superRole == 1">
data_center_new.basic_menu bmenu WHERE bmenu.flag != 1
data_center_aeon_admin.basic_menu bmenu WHERE bmenu.flag != 1
</when>
<otherwise>
data_center_new.basic_role_user_relation brur
INNER JOIN data_center_new.basic_role brole ON brole.id = brur.role_id
INNER JOIN data_center_new.basic_role_menu_relation brmr ON brur.role_id = brmr.role_id
INNER JOIN data_center_new.basic_menu bmenu ON bmenu.id = brmr.menu_id
data_center_aeon_admin.basic_role_user_relation brur
INNER JOIN data_center_aeon_admin.basic_role brole ON brole.id = brur.role_id
INNER JOIN data_center_aeon_admin.basic_role_menu_relation brmr ON brur.role_id = brmr.role_id
INNER JOIN data_center_aeon_admin.basic_menu bmenu ON bmenu.id = brmr.menu_id
WHERE
brole.flag != 1 AND bmenu.flag != 1 AND brur.user_id = #{userId}
<if test="targetPlatform == 2">
@ -61,14 +61,14 @@
u.email,
u.mobile_number
FROM
data_center_new.basic_user u
data_center_aeon_admin.basic_user u
WHERE u.id NOT IN (
SELECT DISTINCT
rru.user_id
FROM
data_center_new.basic_role_user_relation rru
INNER JOIN data_center_new.basic_role br ON br.id = rru.role_id
INNER JOIN data_center_new.basic_role_menu_relation rmr ON br.id = rmr.role_id
data_center_aeon_admin.basic_role_user_relation rru
INNER JOIN data_center_aeon_admin.basic_role br ON br.id = rru.role_id
INNER JOIN data_center_aeon_admin.basic_role_menu_relation rmr ON br.id = rmr.role_id
WHERE rmr.menu_id = 52 AND br.flag != 1
)
AND u.flag != 1 AND u.user_type = 2 AND u.company_id = #{companyId}
@ -79,9 +79,9 @@
SELECT
count(1)
FROM
data_center_new.basic_role_user_relation rru
INNER JOIN data_center_new.basic_role br ON br.id = rru.role_id
INNER JOIN data_center_new.basic_role_menu_relation rmr ON br.id = rmr.role_id
data_center_aeon_admin.basic_role_user_relation rru
INNER JOIN data_center_aeon_admin.basic_role br ON br.id = rru.role_id
INNER JOIN data_center_aeon_admin.basic_role_menu_relation rmr ON br.id = rmr.role_id
WHERE rmr.menu_id = 52 AND br.flag != 1 AND rru.user_id = #{userId}
</select>

6
data-center-business-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml

@ -110,7 +110,7 @@
#{bindBuildingId}
</foreach>
</if>
and device_info.flag = 0
and device_info.flag = 0 and basic_monitoring_asset.flag = 0 and basic_space.flag = 0
</where>
<if test="deviceVO.orderBy != null">
@ -190,7 +190,7 @@
<if test="companyId != null ">
and device_info.company_id = #{companyId}
</if>
and device_info.flag != 1
and device_info.flag = 0 and basic_monitoring_asset.flag = 0 and basic_space.flag = 0
</where>
</select>
@ -447,7 +447,7 @@
basic_company.third_api_host
from
device_info
inner join data_center_new.basic_company on basic_company.id = device_info.company_id
inner join data_center_aeon_admin.basic_company on basic_company.id = device_info.company_id
where device_info.flag != 1 and basic_company.flag != 1 and device_info.device_id = #{deviceId}
</select>

4
data-center-business-dao/src/main/resources/mappers/ex/MqttConfigMapperExt.xml

@ -33,7 +33,7 @@
bmqtt.purpose_type
FROM
mqtt_config bmqtt
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bmqtt.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bmqtt.company_id
WHERE
bmqtt.flag != 1 AND bcomp.flag != 1
AND bmqtt.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
@ -64,7 +64,7 @@
bmqtt.purpose_type
FROM
mqtt_config bmqtt
INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bmqtt.company_id
INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bmqtt.company_id
INNER JOIN mqtt_device_relation mdr ON mdr.mqtt_id = bmqtt.id
WHERE
bmqtt.flag != 1 AND bcomp.flag != 1

2
data-center-business-dao/src/main/resources/mappers/ex/TargetForwardConfigMapperExt.xml

@ -63,7 +63,7 @@
<delete id="deleteByAlertConfigId">
delete from
data_center_new.target_id_check
data_center_aeon_admin.target_id_check
where alert_config_id = #{alertConfigId}
</delete>
</mapper>

2
data-center-business-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties

@ -2,6 +2,6 @@
project =src/main/java
resources=src/main/resources
jdbc_driver =com.mysql.cj.jdbc.Driver
jdbc_url=jdbc:mysql://rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
jdbc_url=jdbc:mysql://rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
jdbc_user=zhc
jdbc_password=Youqu48bnb1

16
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/asset/QueryRelatedDeviceParams.java

@ -0,0 +1,16 @@
package com.techsor.datacenter.business.dto.asset;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @author Mr.Jiang
* @time 2022年7月21日 下午8:50:31
*/
@Data
public class QueryRelatedDeviceParams {
@Schema(description = "AssetId")
private Long assetId;
}

6
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/building/OptBuildingParams.java

@ -42,6 +42,12 @@ public class OptBuildingParams{
@Schema(description ="Brief Introduction", example = "123AAA6", required = false)
private String briefIntroduction;
@Schema(description ="latitude", example = "22.467", required = false)
private String latitude;
@Schema(description ="longitude", example = "115.783", required = false)
private String longitude;
@Data
public static class CustomFloorInfo {

14
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/rilipersonnas/DownloadPersonnasHistoryParams.java

@ -0,0 +1,14 @@
package com.techsor.datacenter.business.dto.rilipersonnas;
import com.techsor.datacenter.business.dto.BaseSearchParams;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Data
public class DownloadPersonnasHistoryParams {
@Schema(description = "personnasSpaceId", example = "2738967")
private String personnasSpaceId;
}

68
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicAssetClassBig.java

@ -48,6 +48,24 @@ public class BasicAssetClassBig implements Serializable {
*/
private Integer flag;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column basic_asset_class_big.thumbnail_normal_base64
*
* @mbg.generated
*/
private String thumbnailNormalBase64;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column basic_asset_class_big.thumbnail_alarm_base64
*
* @mbg.generated
*/
private String thumbnailAlarmBase64;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table basic_asset_class_big
@ -176,6 +194,54 @@ public class BasicAssetClassBig implements Serializable {
this.flag = flag;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_asset_class_big.thumbnail_normal_base64
*
* @return the value of basic_asset_class_big.thumbnail_normal_base64
*
* @mbg.generated
*/
public String getThumbnailNormalBase64() {
return thumbnailNormalBase64;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column basic_asset_class_big.thumbnail_normal_base64
*
* @param thumbnailNormalBase64 the value for basic_asset_class_big.thumbnail_normal_base64
*
* @mbg.generated
*/
public void setThumbnailNormalBase64(String thumbnailNormalBase64) {
this.thumbnailNormalBase64 = thumbnailNormalBase64 == null ? null : thumbnailNormalBase64.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_asset_class_big.thumbnail_alarm_base64
*
* @return the value of basic_asset_class_big.thumbnail_alarm_base64
*
* @mbg.generated
*/
public String getThumbnailAlarmBase64() {
return thumbnailAlarmBase64;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column basic_asset_class_big.thumbnail_alarm_base64
*
* @param thumbnailAlarmBase64 the value for basic_asset_class_big.thumbnail_alarm_base64
*
* @mbg.generated
*/
public void setThumbnailAlarmBase64(String thumbnailAlarmBase64) {
this.thumbnailAlarmBase64 = thumbnailAlarmBase64 == null ? null : thumbnailAlarmBase64.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_asset_class_big
@ -193,6 +259,8 @@ public class BasicAssetClassBig implements Serializable {
sb.append(", className=").append(className);
sb.append(", createTime=").append(createTime);
sb.append(", flag=").append(flag);
sb.append(", thumbnailNormalBase64=").append(thumbnailNormalBase64);
sb.append(", thumbnailAlarmBase64=").append(thumbnailAlarmBase64);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

68
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuilding.java

@ -129,6 +129,24 @@ public class BasicBuilding implements Serializable {
*/
private String briefIntroduction;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column basic_building.latitude
*
* @mbg.generated
*/
private String latitude;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column basic_building.longitude
*
* @mbg.generated
*/
private String longitude;
/**
*
* This field was generated by MyBatis Generator.
@ -491,6 +509,54 @@ public class BasicBuilding implements Serializable {
this.briefIntroduction = briefIntroduction == null ? null : briefIntroduction.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_building.latitude
*
* @return the value of basic_building.latitude
*
* @mbg.generated
*/
public String getLatitude() {
return latitude;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column basic_building.latitude
*
* @param latitude the value for basic_building.latitude
*
* @mbg.generated
*/
public void setLatitude(String latitude) {
this.latitude = latitude == null ? null : latitude.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_building.longitude
*
* @return the value of basic_building.longitude
*
* @mbg.generated
*/
public String getLongitude() {
return longitude;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column basic_building.longitude
*
* @param longitude the value for basic_building.longitude
*
* @mbg.generated
*/
public void setLongitude(String longitude) {
this.longitude = longitude == null ? null : longitude.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_building.floor_info_list
@ -565,6 +631,8 @@ public class BasicBuilding implements Serializable {
sb.append(", thumbnailNum=").append(thumbnailNum);
sb.append(", showSwitch2d3d=").append(showSwitch2d3d);
sb.append(", briefIntroduction=").append(briefIntroduction);
sb.append(", latitude=").append(latitude);
sb.append(", longitude=").append(longitude);
sb.append(", floorInfoList=").append(floorInfoList);
sb.append(", pictureIntroduction=").append(pictureIntroduction);
sb.append(", serialVersionUID=").append(serialVersionUID);

140
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuildingExample.java

@ -1083,6 +1083,146 @@ public class BasicBuildingExample {
addCriterion("brief_introduction not between", value1, value2, "briefIntroduction");
return (Criteria) this;
}
public Criteria andLatitudeIsNull() {
addCriterion("latitude is null");
return (Criteria) this;
}
public Criteria andLatitudeIsNotNull() {
addCriterion("latitude is not null");
return (Criteria) this;
}
public Criteria andLatitudeEqualTo(String value) {
addCriterion("latitude =", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeNotEqualTo(String value) {
addCriterion("latitude <>", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeGreaterThan(String value) {
addCriterion("latitude >", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeGreaterThanOrEqualTo(String value) {
addCriterion("latitude >=", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeLessThan(String value) {
addCriterion("latitude <", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeLessThanOrEqualTo(String value) {
addCriterion("latitude <=", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeLike(String value) {
addCriterion("latitude like", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeNotLike(String value) {
addCriterion("latitude not like", value, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeIn(List<String> values) {
addCriterion("latitude in", values, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeNotIn(List<String> values) {
addCriterion("latitude not in", values, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeBetween(String value1, String value2) {
addCriterion("latitude between", value1, value2, "latitude");
return (Criteria) this;
}
public Criteria andLatitudeNotBetween(String value1, String value2) {
addCriterion("latitude not between", value1, value2, "latitude");
return (Criteria) this;
}
public Criteria andLongitudeIsNull() {
addCriterion("longitude is null");
return (Criteria) this;
}
public Criteria andLongitudeIsNotNull() {
addCriterion("longitude is not null");
return (Criteria) this;
}
public Criteria andLongitudeEqualTo(String value) {
addCriterion("longitude =", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeNotEqualTo(String value) {
addCriterion("longitude <>", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeGreaterThan(String value) {
addCriterion("longitude >", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeGreaterThanOrEqualTo(String value) {
addCriterion("longitude >=", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeLessThan(String value) {
addCriterion("longitude <", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeLessThanOrEqualTo(String value) {
addCriterion("longitude <=", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeLike(String value) {
addCriterion("longitude like", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeNotLike(String value) {
addCriterion("longitude not like", value, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeIn(List<String> values) {
addCriterion("longitude in", values, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeNotIn(List<String> values) {
addCriterion("longitude not in", values, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeBetween(String value1, String value2) {
addCriterion("longitude between", value1, value2, "longitude");
return (Criteria) this;
}
public Criteria andLongitudeNotBetween(String value1, String value2) {
addCriterion("longitude not between", value1, value2, "longitude");
return (Criteria) this;
}
}
/**

6
data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/building/BuildingPageVO.java

@ -49,6 +49,12 @@ public class BuildingPageVO{
@Schema(description = "images info", example = "{}", hidden = false)
private String pictureIntroduction;
@Schema(description ="latitude", example = "22.467", required = false)
private String latitude;
@Schema(description ="longitude", example = "115.783", required = false)
private String longitude;
}

2
data-center-business-service/src/main/java/com/techsor/datacenter/business/listener/PreloadDeviceCompanyMappingListener.java

@ -37,7 +37,7 @@ public class PreloadDeviceCompanyMappingListener implements ApplicationListener<
"\t\t\tbcom.id,\n" +
"\t\t\tbcom.company_name companyName\n" +
"\t\tFROM\n" +
"\t\t\tdata_center_new.basic_company bcom\n" +
"\t\t\tdata_center_aeon_admin.basic_company bcom\n" +
"\t\tWHERE bcom.flag != 1 and (parent_id = 1 or parent_id = -1) ";
jdbcTemplate.query(sql,rs->{

9
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/MonitoringAssetService.java

@ -3,6 +3,8 @@ package com.techsor.datacenter.business.service;
import java.io.UnsupportedEncodingException;
import java.util.List;
import com.techsor.datacenter.business.dto.asset.*;
import com.techsor.datacenter.business.vo.device.DeviceVO;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.ResponseEntity;
@ -10,12 +12,6 @@ import org.springframework.web.multipart.MultipartFile;
import com.techsor.datacenter.business.common.response.PageInfo;
import com.techsor.datacenter.business.common.response.SimpleDataResponse;
import com.techsor.datacenter.business.dto.asset.AssetThirdParams;
import com.techsor.datacenter.business.dto.asset.FileNameList;
import com.techsor.datacenter.business.dto.asset.GetAssetFileTemporaryParams;
import com.techsor.datacenter.business.dto.asset.DeleteMonitoringAssetParams;
import com.techsor.datacenter.business.dto.asset.MonitoringAssetSearchParams;
import com.techsor.datacenter.business.dto.asset.OptMonitoringAssetParams;
import com.techsor.datacenter.business.dto.space.ModifyImageDescriptionParams;
import com.techsor.datacenter.business.vo.asset.AssetThirdVO;
import com.techsor.datacenter.business.vo.asset.MonitoringAssetPageVO;
@ -68,4 +64,5 @@ public interface MonitoringAssetService {
SimpleDataResponse modifyImageDescription(ModifyImageDescriptionParams modifyImageDescriptionParams, Long assetId,
Long userId, Long companyId, Integer languageType);
SimpleDataResponse getRelatedDeviceList(QueryRelatedDeviceParams assetThirdParams, Long userId, Long companyId, Integer languageType);
}

8
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/RiliPersonnasService.java

@ -43,13 +43,7 @@ public interface RiliPersonnasService {
SimpleDataResponse batchImport(MultipartFile multipartFile, Long userId, Long companyId, Integer languageType);
// List<TenantPageVO> getAll(TenantGetAllParams getAllParams,Long companyId, Long userId,
// Integer languageType, Integer uTCOffset);
ResponseEntity downloadHistoryByPersonnasSpaceId(Long userId, Long companyId, Integer languageType, RiliPersonnasHistorySearchParams params) throws UnsupportedEncodingException;
// ResponseEntity downloadTenant(TenantSearchParams pageSearchParam, Long companyId, Long userId,
// Integer languageType, Integer uTCOffset) throws UnsupportedEncodingException;
// List<String> batchAddTenantInfos(List<TenantInfoExcel> dataList, Map<String, Object> s3InfoMap, Long userId, Long companyId, Integer languageType);
}

4
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/SyncTrendsStatsService.java

@ -101,7 +101,7 @@ public class SyncTrendsStatsService {
"\t\t\tbcom.id,\n" +
"\t\t\tbcom.company_name companyName\n" +
"\t\tFROM\n" +
"\t\t\tdata_center_new.basic_company bcom\n" +
"\t\t\tdata_center_aeon_admin.basic_company bcom\n" +
"\t\tWHERE bcom.parent_id=1 and bcom.flag != 1";
jdbcTemplate.query(sql,rs->{
@ -274,7 +274,7 @@ public class SyncTrendsStatsService {
"\t\t\tbcom.id,\n" +
"\t\t\tbcom.company_name companyName\n" +
"\t\tFROM\n" +
"\t\t\tdata_center_new.basic_company bcom\n" +
"\t\t\tdata_center_aeon_admin.basic_company bcom\n" +
"\t\tWHERE bcom.flag != 1";
jdbcTemplate.query(sql,rs->{

2
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/common/CommonOpt.java

@ -98,7 +98,7 @@ public class CommonOpt {
@PostConstruct
// @PostConstruct
public void initS3Client() {
BasicAWSCredentials awsCreds = new BasicAWSCredentials(awsAccessKeyId, awsAccessSecret);

4
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/BuildingServiceImpl.java

@ -892,7 +892,9 @@ public class BuildingServiceImpl implements BuildingService {
@Override
public List<BuildingPageVO> getAll(Long companyId,
Long userId, Integer languageType, Integer uTCOffset) {
List<BuildingPageVO> resultList = basicBuildingMapperExt.getAll(companyId.toString());
List<Long> bindingCompanyIdList = commonOpt.getBindBuildingIdList(userId);
List<BuildingPageVO> resultList = basicBuildingMapperExt.getAllInList(bindingCompanyIdList);
return resultList;
}

16
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/CommonServiceImpl.java

@ -425,7 +425,7 @@ public class CommonServiceImpl implements CommonService {
Class.forName("com.mysql.cj.jdbc.Driver");
String regex = "(jdbc:mysql://)([^/]+)(/data_center_new.*)";
String regex = "(jdbc:mysql://)([^/]+)(/data_center_aeon_admin.*)";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(dbUrl);
String newJdbcUrl = "";
@ -434,7 +434,7 @@ public class CommonServiceImpl implements CommonService {
}
try (Connection conn = DriverManager.getConnection(
newJdbcUrl.replace("data_center_new", "third") + "&allowPublicKeyRetrieval=true",
newJdbcUrl.replace("data_center_aeon_admin", "third") + "&allowPublicKeyRetrieval=true",
DESUtil.decrypt(apikeyInfo.getAuroraUsername(), Constants.DES_SALT),
DESUtil.decrypt(apikeyInfo.getAuroraPassword(), Constants.DES_SALT))) {
@ -954,7 +954,7 @@ public class CommonServiceImpl implements CommonService {
if (StringUtils.isNotBlank(apikeyInfo.getAuroraUrl()) && CollectionUtils.isNotEmpty(deviceInfoVOs)) {
Class.forName("com.mysql.cj.jdbc.Driver");
String regex = "(jdbc:mysql://)([^/]+)(/data_center_new.*)";
String regex = "(jdbc:mysql://)([^/]+)(/data_center_aeon_admin.*)";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(dbUrl);
String newJdbcUrl = "";
@ -963,7 +963,7 @@ public class CommonServiceImpl implements CommonService {
}
try (Connection conn = DriverManager.getConnection(
newJdbcUrl.replace("data_center_new", "third") + "&allowPublicKeyRetrieval=true",
newJdbcUrl.replace("data_center_aeon_admin", "third") + "&allowPublicKeyRetrieval=true",
DESUtil.decrypt(apikeyInfo.getAuroraUsername(), Constants.DES_SALT),
DESUtil.decrypt(apikeyInfo.getAuroraPassword(), Constants.DES_SALT))) {
@ -1489,7 +1489,7 @@ public class CommonServiceImpl implements CommonService {
if (StringUtils.isNotBlank(apikeyInfo.getAuroraUrl()) && CollectionUtils.isNotEmpty(dpfDeviceInfoVOs)) {
Class.forName("com.mysql.cj.jdbc.Driver");
String regex = "(jdbc:mysql://)([^/]+)(/data_center_new.*)";
String regex = "(jdbc:mysql://)([^/]+)(/data_center_aeon_admin.*)";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(dbUrl);
String newJdbcUrl = "";
@ -1498,7 +1498,7 @@ public class CommonServiceImpl implements CommonService {
}
try (Connection conn = DriverManager.getConnection(
newJdbcUrl.replace("data_center_new", "third") + "&allowPublicKeyRetrieval=true",
newJdbcUrl.replace("data_center_aeon_admin", "third") + "&allowPublicKeyRetrieval=true",
DESUtil.decrypt(apikeyInfo.getAuroraUsername(), Constants.DES_SALT),
DESUtil.decrypt(apikeyInfo.getAuroraPassword(), Constants.DES_SALT))) {
@ -2053,7 +2053,7 @@ public class CommonServiceImpl implements CommonService {
if (StringUtils.isNotBlank(apikeyInfo.getAuroraUrl()) && CollectionUtils.isNotEmpty(deviceInfoVOs)) {
Class.forName("com.mysql.cj.jdbc.Driver");
String regex = "(jdbc:mysql://)([^/]+)(/data_center_new.*)";
String regex = "(jdbc:mysql://)([^/]+)(/data_center_aeon_admin.*)";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(dbUrl);
String newJdbcUrl = "";
@ -2062,7 +2062,7 @@ public class CommonServiceImpl implements CommonService {
}
try (Connection conn = DriverManager.getConnection(
newJdbcUrl.replace("data_center_new", "third") + "&allowPublicKeyRetrieval=true",
newJdbcUrl.replace("data_center_aeon_admin", "third") + "&allowPublicKeyRetrieval=true",
DESUtil.decrypt(apikeyInfo.getAuroraUsername(), Constants.DES_SALT),
DESUtil.decrypt(apikeyInfo.getAuroraPassword(), Constants.DES_SALT))) {

6
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DeviceServiceImpl.java

@ -1871,7 +1871,7 @@ public class DeviceServiceImpl implements IDeviceService {
if (CollectionUtils.isEmpty(floorResultList)) {
return false;
} else {
deviceInfo.setFloorId(floorResultList.get(0).getFloorId());
deviceInfo.setFloorId(floorResultList.get(floorResultList.size()-1).getFloorId());
return true;
}
}
@ -1897,7 +1897,7 @@ public class DeviceServiceImpl implements IDeviceService {
if (CollectionUtils.isEmpty(spaceList)) {
return false;
} else {
deviceInfo.setSpaceId(spaceList.get(0).getSpaceId());
deviceInfo.setSpaceId(spaceList.get(spaceList.size()-1).getSpaceId());
return true;
}
}
@ -1922,7 +1922,7 @@ public class DeviceServiceImpl implements IDeviceService {
if (CollectionUtils.isEmpty(assetList)) {
return false;
} else {
deviceInfo.setAssetId(assetList.get(0).getEquipmentId());
deviceInfo.setAssetId(assetList.get(assetList.size()-1).getEquipmentId());
return true;
}
}

27
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/MonitoringAssetServiceImpl.java

@ -19,6 +19,7 @@ import java.util.function.Function;
import java.util.stream.Collectors;
import com.techsor.datacenter.business.dao.ex.*;
import com.techsor.datacenter.business.dto.asset.*;
import com.techsor.datacenter.business.dto.assetclass.AssetClassSearchParams;
import com.techsor.datacenter.business.dto.building.BuildingSearchParams;
import com.techsor.datacenter.business.dto.floor.FloorSearchParams;
@ -86,12 +87,6 @@ import com.techsor.datacenter.business.common.language.msg.MsgLanguageChange;
import com.techsor.datacenter.business.common.response.PageInfo;
import com.techsor.datacenter.business.common.response.ResponseCode;
import com.techsor.datacenter.business.common.response.SimpleDataResponse;
import com.techsor.datacenter.business.dto.asset.AssetThirdParams;
import com.techsor.datacenter.business.dto.asset.FileNameList;
import com.techsor.datacenter.business.dto.asset.GetAssetFileTemporaryParams;
import com.techsor.datacenter.business.dto.asset.DeleteMonitoringAssetParams;
import com.techsor.datacenter.business.dto.asset.MonitoringAssetSearchParams;
import com.techsor.datacenter.business.dto.asset.OptMonitoringAssetParams;
import com.techsor.datacenter.business.dto.space.ModifyImageDescriptionParams;
import com.techsor.datacenter.business.entity.common.S3FileInfoEntity;
import com.techsor.datacenter.business.importexcel.asset.DeleteAssetExcelCn;
@ -1806,4 +1801,24 @@ public class MonitoringAssetServiceImpl implements MonitoringAssetService {
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, "server error");
}
}
@Override
public SimpleDataResponse getRelatedDeviceList(QueryRelatedDeviceParams params, Long userId, Long companyId, Integer languageType) {
try {
BasicMonitoringAsset oldBF = basicMonitoringAssetMapperExt.selectByPrimaryKey(params.getAssetId());
if (ObjectUtils.isEmpty(oldBF) || 1 == oldBF.getFlag()){
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found");
}
DeviceInfoExample deviceInfoExample = new DeviceInfoExample();
deviceInfoExample.createCriteria().andAssetIdEqualTo(params.getAssetId()).andFlagEqualTo(0);
List<DeviceInfo> deviceInfoList = deviceInfoMapperExt.selectByExample(deviceInfoExample);
return SimpleDataResponse.success(deviceInfoList);
} catch (Exception e) {
logger.error("Editing monitoring asset encountered an error", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, "server error");
}
}
}

61
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/RiliPersonnasServiceImpl.java

@ -13,10 +13,8 @@ import com.techsor.datacenter.business.common.response.PageInfo;
import com.techsor.datacenter.business.common.response.ResponseCode;
import com.techsor.datacenter.business.common.response.SimpleDataResponse;
import com.techsor.datacenter.business.dao.ex.*;
import com.techsor.datacenter.business.dto.rilipersonnas.DeleteRiliPersonnasParams;
import com.techsor.datacenter.business.dto.rilipersonnas.OptRiliPersonnasParams;
import com.techsor.datacenter.business.dto.rilipersonnas.RiliPersonnasHistorySearchParams;
import com.techsor.datacenter.business.dto.rilipersonnas.RiliPersonnasSearchParams;
import com.techsor.datacenter.business.dto.device.DeviceSearchParams;
import com.techsor.datacenter.business.dto.rilipersonnas.*;
import com.techsor.datacenter.business.dto.tenant.DeleteTenantParams;
import com.techsor.datacenter.business.dto.tenant.OptTenantParams;
import com.techsor.datacenter.business.dto.tenant.TenantGetAllParams;
@ -33,6 +31,7 @@ import com.techsor.datacenter.business.service.common.CommonOpt;
import com.techsor.datacenter.business.util.CommonUtil;
import com.techsor.datacenter.business.util.CsvUtils;
import com.techsor.datacenter.business.util.RandomNumberUtil;
import com.techsor.datacenter.business.vo.device.DeviceInfoCsvVO;
import com.techsor.datacenter.business.vo.tenant.TenantDownloadVO;
import com.techsor.datacenter.business.vo.tenant.TenantPageVO;
import jakarta.annotation.Resource;
@ -362,4 +361,58 @@ public class RiliPersonnasServiceImpl implements RiliPersonnasService {
return errorMessage;
}
}
@Override
public ResponseEntity downloadHistoryByPersonnasSpaceId(Long userId, Long companyId, Integer languageType, RiliPersonnasHistorySearchParams params) throws UnsupportedEncodingException {
List<RiliPersonnasHistory> resultList = riliPersonnasLatestMapper.getHistoryListPage(params);
String fileName="";
String[] csvHeader = {};
List<String[]> csvContentList = new ArrayList<>();
switch (languageType){
case 0:
csvHeader = new String[]{"Personnas空间ID", "名称","数据时间", "值"};
fileName = "人数统计";
break;
case 1:
csvHeader = new String[]{"Personnas Space ID", "Name","Date Time", "Value"};
fileName = "Personnas";
break;
default:
csvHeader = new String[]{"パーソナスペースID", "名前","時刻", "値"};
fileName = "人数統計";
break;
}
//Transform all the list data.
for (RiliPersonnasHistory item : resultList) {
String[] csvRow = {
item.getPersonnasSpaceId(),
item.getName(),
item.getCheckTs(),
item.getValue().toString()
};
csvContentList.add(csvRow);
}
byte[] fileStream = CsvUtils.generateXlsx(csvHeader,csvContentList);
HttpHeaders headers = new HttpHeaders();
// headers.setContentType(MediaType.parseMediaType("text/csv; charset=UTF-8"));
// headers.setContentDispositionFormData("filename", fileName+".csv");
headers.setContentType(MediaType.parseMediaType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"));
headers.setContentDispositionFormData("filename", new String((fileName + ".xlsx").getBytes("UTF-8")));
//Record log
userOperationLogsService.recordLog(companyId,userId,"批量下载人数统计历史",
"Batch Download Personnas Information",
"人数統計を一括ダウンロード",
"Success",
Constants.USER_OPERATION_LOG_TYPE_ASSET_LOG,
"Downloaded Devices Count:"+csvContentList.size());
DataSourceContextHolder.clearCurrentDataSourceKey();
return new ResponseEntity<>(fileStream, headers, HttpStatus.OK);
}
}

6
document/db/20240510.sql

@ -1,4 +1,4 @@
USE `data_center_new`;
USE `data_center_aeon_admin`;
DROP procedure IF EXISTS `add_column`;
@ -10,7 +10,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_monitoring_asset'
AND column_name = 's3_file_name'
) THEN
@ -21,7 +21,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_monitoring_asset'
AND column_name = 'mapper_file_name'
) THEN

4
document/db/20240528.sql

@ -1,4 +1,4 @@
USE `data_center_new`;
USE `data_center_aeon_admin`;
DROP procedure IF EXISTS `add_column`;
@ -10,7 +10,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_monitoring_asset'
AND column_name = 'external_file'
) THEN

103
document/db/alarm_tmpl.sql

@ -1,51 +1,52 @@
/*
SQLyog - MySQL GUI v8.14
MySQL - 8.0.28 : Database - data_center_new
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`data_center_new` /*!40100 DEFAULT CHARACTER SET utf8 */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `data_center_new`;
/*Table structure for table `device_alert_template` */
DROP TABLE IF EXISTS `device_alert_template`;
CREATE TABLE `device_alert_template` (
`id` bigint NOT NULL AUTO_INCREMENT,
`company_id` bigint DEFAULT NULL,
`tmpl_name` varchar(100) DEFAULT NULL,
`level` varchar(20) DEFAULT NULL COMMENT '告警级别',
`message` varchar(999) DEFAULT NULL COMMENT '告警信息',
`flag` int DEFAULT '0' COMMENT '0 开启,1关闭',
`template_defs` varchar(999) DEFAULT NULL COMMENT '模板定义',
`forward_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '转发类型api, mail, sms',
`alert_cancel_template_defs` varchar(999) DEFAULT '' COMMENT '告警解除模板定义',
`alert_cancel_message` varchar(999) DEFAULT '' COMMENT '告警解除模板初步填充后内容',
`alert_title` varchar(999) DEFAULT NULL,
`alert_cancel_title` varchar(999) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='设备告警模板信息';
/*Table structure for table `device_alert_template_bind` */
DROP TABLE IF EXISTS `device_alert_template_bind`;
CREATE TABLE `device_alert_template_bind` (
`device_id` varchar(45) NOT NULL,
`device_alert_template_id` bigint NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*
SQLyog - MySQL GUI v8.14
MySQL - 8.0.28 : Database - data_center_aeon_admin
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`data_center_aeon_admin` /*!40100 DEFAULT CHARACTER SET utf8 */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `data_center_aeon_admin`;
/*Table structure for table `device_alert_template` */
DROP TABLE IF EXISTS `device_alert_template`;
CREATE TABLE `device_alert_template` (
`id` bigint NOT NULL AUTO_INCREMENT,
`company_id` bigint DEFAULT NULL,
`tmpl_name` varchar(100) DEFAULT NULL,
`level` varchar(20) DEFAULT NULL COMMENT '告警级别',
`message` varchar(999) DEFAULT NULL COMMENT '告警信息',
`flag` int DEFAULT '0' COMMENT '0 开启,1关闭',
`template_defs` varchar(999) DEFAULT NULL COMMENT '模板定义',
`forward_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '转发类型api, mail, sms',
`alert_cancel_template_defs` varchar(999) DEFAULT '' COMMENT '告警解除模板定义',
`alert_cancel_message` varchar(999) DEFAULT '' COMMENT '告警解除模板初步填充后内容',
`alert_title` varchar(999) DEFAULT NULL,
`alert_cancel_title` varchar(999) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='设备告警模板信息';
/*Table structure for table `device_alert_template_bind` */
DROP TABLE IF EXISTS `device_alert_template_bind`;
CREATE TABLE `device_alert_template_bind` (
`device_id` varchar(45) NOT NULL,
`device_alert_template_id` bigint NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

2
document/db/p2.sql

@ -1,4 +1,4 @@
USE `data_center_new`;
USE `data_center_aeon_admin`;
/*Table structure for table `login_history` */

2
document/db/p3-20231205.sql

@ -1,4 +1,4 @@
USE `data_center_new`;
USE `data_center_aeon_admin`;
ALTER TABLE `basic_monitoring_asset` ADD (
`class_big` varchar(255) DEFAULT NULL,

8
document/db/p3-20240306.sql

@ -1,4 +1,4 @@
USE `data_center_new`;
USE `data_center_aeon_admin`;
/*Table structure for table `device_alert_template` */
@ -33,9 +33,9 @@ CREATE TABLE `device_alert_template_bind` (
/** 旧的设备的告警配置,插入到模板去 **/
USE `data_center_new`;
USE `data_center_aeon_admin`;
DROP procedure IF EXISTS `data_center_new`.`add_tmpl`;
DROP procedure IF EXISTS `data_center_aeon_admin`.`add_tmpl`;
DELIMITER $$
@ -152,4 +152,4 @@ DELIMITER ;
CALL add_tmpl();
DROP procedure IF EXISTS `data_center_new`.`add_tmpl`;
DROP procedure IF EXISTS `data_center_aeon_admin`.`add_tmpl`;

14
document/db/p3-20240415.sql

@ -1,4 +1,4 @@
USE `data_center_new`;
USE `data_center_aeon_admin`;
DROP procedure IF EXISTS `add_column`;
@ -11,7 +11,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_company'
AND column_name = 'mfa_switch'
) THEN
@ -23,7 +23,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_user'
AND column_name = 'mfa_secret'
) THEN
@ -35,7 +35,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_user'
AND column_name = 'mfa_bind'
) THEN
@ -47,7 +47,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_user'
AND column_name = 'super_role'
) THEN
@ -59,7 +59,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_user'
AND column_name = 'user_type'
) THEN
@ -80,7 +80,7 @@ DROP procedure IF EXISTS `add_column`;
USE `data_center_new`;
USE `data_center_aeon_admin`;
/*Table structure for table `mail_sent_result` */

10
document/db/p3-20240611.sql

@ -1,4 +1,4 @@
USE `data_center_new`;
USE `data_center_aeon_admin`;
DROP procedure IF EXISTS `add_column`;
@ -10,7 +10,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_monitoring_asset'
AND column_name = 'user_manual'
) THEN
@ -21,7 +21,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_monitoring_asset'
AND column_name = 'device_image'
) THEN
@ -32,7 +32,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'type'
AND column_name = 'device_category_id'
) THEN
@ -43,7 +43,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'type'
AND column_name = 'unit'
) THEN

8
document/db/p4-20240627-2d3d.sql

@ -1,4 +1,4 @@
USE `data_center_new`;
USE `data_center_aeon_admin`;
DROP procedure IF EXISTS `add_column`;
@ -10,7 +10,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_monitoring_asset'
AND column_name = 'class_big_id'
) THEN
@ -21,7 +21,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_monitoring_asset'
AND column_name = 'class_medium_id'
) THEN
@ -32,7 +32,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_monitoring_asset'
AND column_name = 'class_small_id'
) THEN

4
document/db/p4-20240717.sql

@ -1,4 +1,4 @@
USE `data_center_new`;
USE `data_center_aeon_admin`;
DROP procedure IF EXISTS `add_column`;
@ -10,7 +10,7 @@ BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'device_alert_template'
AND column_name = 'effective_period'
) THEN

2
document/db/p4-20241022.sql

@ -1,4 +1,4 @@
USE `data_center_new`;
USE `data_center_aeon_admin`;
DROP TABLE IF EXISTS `mqtt_config`;

Loading…
Cancel
Save