diff --git a/data-center-business-common/src/main/resources/config/language/msg/msg_cn.yml b/data-center-business-common/src/main/resources/config/language/msg/msg_cn.yml index 46d2b7a..55bee5a 100644 --- a/data-center-business-common/src/main/resources/config/language/msg/msg_cn.yml +++ b/data-center-business-common/src/main/resources/config/language/msg/msg_cn.yml @@ -186,3 +186,8 @@ msgcn: spaceIdDumplicated: 空间Id已存在 spaceIdNotExist: 空间Id不存在 personnasSpaceIdCannotBeNull: 人员空间Id不能为空 + dataProviderGatewayInfoNotExist: 网关情报不存在 + alarmLevelNotExist: 告警级别错误 + dataProviderNotExist: 数据提供方不存在 + monitoringPointCategoryNotExist: 监控点分类不存在 + deviceGroupNotExist: 设备组不存在 diff --git a/data-center-business-common/src/main/resources/config/language/msg/msg_en.yml b/data-center-business-common/src/main/resources/config/language/msg/msg_en.yml index 8fe6d26..8dbabc5 100644 --- a/data-center-business-common/src/main/resources/config/language/msg/msg_en.yml +++ b/data-center-business-common/src/main/resources/config/language/msg/msg_en.yml @@ -185,4 +185,9 @@ msgen: spaceIdOrSpaceNameIsNull: Space ID or space name is required. spaceIdDumplicated: The space ID is duplicated spaceIdNotExist: Space ID does not exist - personnasSpaceIdCannotBeNull: Personas space ID cannot be null \ No newline at end of file + personnasSpaceIdCannotBeNull: Personas space ID cannot be null + dataProviderGatewayInfoNotExist: Gateway information does not exist + alarmLevelNotExist: Alarm level error + dataProviderNotExist: Data provider does not exist + monitoringPointCategoryNotExist: Monitoring point category does not exist + deviceGroupNotExist: Device group does not exist \ No newline at end of file diff --git a/data-center-business-common/src/main/resources/config/language/msg/msg_jp.yml b/data-center-business-common/src/main/resources/config/language/msg/msg_jp.yml index 02d183f..df2ada9 100644 --- a/data-center-business-common/src/main/resources/config/language/msg/msg_jp.yml +++ b/data-center-business-common/src/main/resources/config/language/msg/msg_jp.yml @@ -185,4 +185,9 @@ msgjp: spaceIdOrSpaceNameIsNull: 空間IDまたは空間名が空です spaceIdDumplicated: 空間IDが重複しています spaceIdNotExist: 空間IDは存在しません - personnasSpaceIdCannotBeNull: 個人空間IDは空です \ No newline at end of file + personnasSpaceIdCannotBeNull: 個人空間IDは空です + dataProviderGatewayInfoNotExist: ゲートウェイ情報が存在しません + alarmLevelNotExist: アラームレベルが正しくありません + dataProviderNotExist: データ提供者が存在しません + monitoringPointCategoryNotExist: 監視ポイント分類が存在しません + deviceGroupNotExist: デバイスグループが存在しません \ No newline at end of file diff --git a/data-center-business-controller/src/main/resources/template/deviceInfo_zh.xlsx b/data-center-business-controller/src/main/resources/template/deviceInfo_zh.xlsx index a5cf97b..813faba 100644 Binary files a/data-center-business-controller/src/main/resources/template/deviceInfo_zh.xlsx and b/data-center-business-controller/src/main/resources/template/deviceInfo_zh.xlsx differ diff --git a/data-center-business-controller/src/main/resources/template/en/deviceInfo_en.xlsx b/data-center-business-controller/src/main/resources/template/en/deviceInfo_en.xlsx index ba7b6ee..cf79a62 100644 Binary files a/data-center-business-controller/src/main/resources/template/en/deviceInfo_en.xlsx and b/data-center-business-controller/src/main/resources/template/en/deviceInfo_en.xlsx differ diff --git a/data-center-business-controller/src/main/resources/template/jp/deviceInfo_jp.xlsx b/data-center-business-controller/src/main/resources/template/jp/deviceInfo_jp.xlsx index 8261f6c..146f808 100644 Binary files a/data-center-business-controller/src/main/resources/template/jp/deviceInfo_jp.xlsx and b/data-center-business-controller/src/main/resources/template/jp/deviceInfo_jp.xlsx differ diff --git a/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/DeviceGroupMapper.java b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/DeviceGroupMapper.java new file mode 100644 index 0000000..39f2d1b --- /dev/null +++ b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/DeviceGroupMapper.java @@ -0,0 +1,96 @@ +package com.techsor.datacenter.business.dao.auto; + +import com.techsor.datacenter.business.model.DeviceGroup; +import com.techsor.datacenter.business.model.DeviceGroupExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DeviceGroupMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + long countByExample(DeviceGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + int deleteByExample(DeviceGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + int insert(DeviceGroup record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + int insertSelective(DeviceGroup record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + List selectByExample(DeviceGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + DeviceGroup selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DeviceGroup record, @Param("example") DeviceGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + int updateByExample(@Param("record") DeviceGroup record, @Param("example") DeviceGroupExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(DeviceGroup record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + int updateByPrimaryKey(DeviceGroup record); +} \ No newline at end of file diff --git a/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/DeviceGroupRelationMapper.java b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/DeviceGroupRelationMapper.java new file mode 100644 index 0000000..1746e0b --- /dev/null +++ b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/DeviceGroupRelationMapper.java @@ -0,0 +1,64 @@ +package com.techsor.datacenter.business.dao.auto; + +import com.techsor.datacenter.business.model.DeviceGroupRelation; +import com.techsor.datacenter.business.model.DeviceGroupRelationExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DeviceGroupRelationMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + long countByExample(DeviceGroupRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + int deleteByExample(DeviceGroupRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + int insert(DeviceGroupRelation record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + int insertSelective(DeviceGroupRelation record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + List selectByExample(DeviceGroupRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DeviceGroupRelation record, @Param("example") DeviceGroupRelationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + int updateByExample(@Param("record") DeviceGroupRelation record, @Param("example") DeviceGroupRelationExample example); +} \ No newline at end of file diff --git a/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/DeviceGroupMapperExt.java b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/DeviceGroupMapperExt.java new file mode 100644 index 0000000..0a680ee --- /dev/null +++ b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/DeviceGroupMapperExt.java @@ -0,0 +1,11 @@ +package com.techsor.datacenter.business.dao.ex; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; + +import com.techsor.datacenter.business.dao.auto.DeviceGroupMapper; + +@Mapper +public interface DeviceGroupMapperExt extends DeviceGroupMapper { +} diff --git a/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/DeviceGroupRelationMapperExt.java b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/DeviceGroupRelationMapperExt.java new file mode 100644 index 0000000..01aa699 --- /dev/null +++ b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/DeviceGroupRelationMapperExt.java @@ -0,0 +1,10 @@ +package com.techsor.datacenter.business.dao.ex; + +import org.apache.ibatis.annotations.Mapper; + +import com.techsor.datacenter.business.dao.auto.DeviceGroupRelationMapper; + +@Mapper +public interface DeviceGroupRelationMapperExt extends DeviceGroupRelationMapper { + +} diff --git a/data-center-business-dao/src/main/resources/mappers/auto/BasicAssetClassBigMapper.xml b/data-center-business-dao/src/main/resources/mappers/auto/BasicAssetClassBigMapper.xml index 272974a..21f3c74 100644 --- a/data-center-business-dao/src/main/resources/mappers/auto/BasicAssetClassBigMapper.xml +++ b/data-center-business-dao/src/main/resources/mappers/auto/BasicAssetClassBigMapper.xml @@ -19,6 +19,7 @@ --> + - thumbnail_normal_base64, thumbnail_alarm_base64 + thumbnail_normal_base64, thumbnail_alarm_base64, thumbnail_dis_base64 + + select + + distinct + + 'true' as QUERYID, + + from dashboard_device_group + + + + + order by ${orderByClause} + + + + + + delete from dashboard_device_group + where id = #{id,jdbcType=BIGINT} + + + + delete from dashboard_device_group + + + + + + + + SELECT LAST_INSERT_ID() + + insert into dashboard_device_group (company_id, building_id, `name`, + remark, flag, created_by, + created_at) + values (#{companyId,jdbcType=BIGINT}, #{buildingId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, + #{remark,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT}, + #{createdAt,jdbcType=BIGINT}) + + + + + SELECT LAST_INSERT_ID() + + insert into dashboard_device_group + + + company_id, + + + building_id, + + + `name`, + + + remark, + + + flag, + + + created_by, + + + created_at, + + + + + #{companyId,jdbcType=BIGINT}, + + + #{buildingId,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{createdBy,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + + + + + update dashboard_device_group + + + id = #{record.id,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + building_id = #{record.buildingId,jdbcType=BIGINT}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + created_by = #{record.createdBy,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=BIGINT}, + + + + + + + + + update dashboard_device_group + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + building_id = #{record.buildingId,jdbcType=BIGINT}, + `name` = #{record.name,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=BIGINT} + + + + + + + update dashboard_device_group + + + company_id = #{companyId,jdbcType=BIGINT}, + + + building_id = #{buildingId,jdbcType=BIGINT}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + created_by = #{createdBy,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update dashboard_device_group + set company_id = #{companyId,jdbcType=BIGINT}, + building_id = #{buildingId,jdbcType=BIGINT}, + `name` = #{name,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + created_by = #{createdBy,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/data-center-business-dao/src/main/resources/mappers/auto/DeviceGroupRelationMapper.xml b/data-center-business-dao/src/main/resources/mappers/auto/DeviceGroupRelationMapper.xml new file mode 100644 index 0000000..27e62e6 --- /dev/null +++ b/data-center-business-dao/src/main/resources/mappers/auto/DeviceGroupRelationMapper.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + device_info_id, device_group_id + + + + + delete from dashboard_device_group_relation + + + + + + + insert into dashboard_device_group_relation (device_info_id, device_group_id) + values (#{deviceInfoId,jdbcType=INTEGER}, #{deviceGroupId,jdbcType=BIGINT}) + + + + insert into dashboard_device_group_relation + + + device_info_id, + + + device_group_id, + + + + + #{deviceInfoId,jdbcType=INTEGER}, + + + #{deviceGroupId,jdbcType=BIGINT}, + + + + + + + update dashboard_device_group_relation + + + device_info_id = #{record.deviceInfoId,jdbcType=INTEGER}, + + + device_group_id = #{record.deviceGroupId,jdbcType=BIGINT}, + + + + + + + + + update dashboard_device_group_relation + set device_info_id = #{record.deviceInfoId,jdbcType=INTEGER}, + device_group_id = #{record.deviceGroupId,jdbcType=BIGINT} + + + + + \ No newline at end of file diff --git a/data-center-business-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml b/data-center-business-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml index c3d9a1b..3afe20e 100644 --- a/data-center-business-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml +++ b/data-center-business-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml @@ -3,7 +3,11 @@ - INSERT INTO device_info (device_id, device_sn, type_id, wsclient_id, space_id, device_name, remark, building_id, asset_id, flag, company_id, created_by, created_timestamp, updated_by, updated_timestamp, project_id, floor_id) + INSERT INTO device_info (device_id, device_sn, type_id, wsclient_id, space_id, + device_name, remark, building_id, asset_id, flag, company_id, + created_by, created_timestamp, updated_by, updated_timestamp, + project_id, floor_id, monitoring_point_name, data_provider_id, + gateway_info_id, alarm_level) VALUES ( @@ -23,7 +27,11 @@ #{item.updatedBy,jdbcType=BIGINT}, #{item.updatedTimestamp,jdbcType=BIGINT}, #{item.projectId,jdbcType=BIGINT}, - #{item.floorId,jdbcType=BIGINT} + #{item.floorId,jdbcType=BIGINT}, + #{item.monitoringPointName,jdbcType=VARCHAR}, + #{item.dataProviderId,jdbcType=BIGINT}, + #{item.gatewayInfoId,jdbcType=BIGINT}, + #{item.alarmLevel,jdbcType=INTEGER} ) diff --git a/data-center-business-dao/src/main/resources/mybatis-generator/generatorConfig.xml b/data-center-business-dao/src/main/resources/mybatis-generator/generatorConfig.xml index edaa7bc..00970e0 100644 --- a/data-center-business-dao/src/main/resources/mybatis-generator/generatorConfig.xml +++ b/data-center-business-dao/src/main/resources/mybatis-generator/generatorConfig.xml @@ -261,5 +261,14 @@ + + + + +
+ + + +
\ No newline at end of file diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/AlarmLevelMapping.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/AlarmLevelMapping.java new file mode 100644 index 0000000..07058ec --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/AlarmLevelMapping.java @@ -0,0 +1,40 @@ +package com.techsor.datacenter.business.importexcel.deviceinfo; + +import java.util.HashMap; +import java.util.Map; + +public class AlarmLevelMapping { + + // 初始化映射关系 + public static final Map> statusMap = new HashMap<>(); + // 中文映射 + public static final Map zhMap = new HashMap<>(); + // 英文映射 + public static final Map enMap = new HashMap<>(); + // 日文映射 + public static final Map jaMap = new HashMap<>(); + + static { + zhMap.put("正常", 1); + zhMap.put("紧急", 2); + zhMap.put("严重故障", 3); + zhMap.put("中等故障", 4); + zhMap.put("轻微故障", 5); + + enMap.put("Normal", 1); + enMap.put("Emergency", 2); + enMap.put("Critical Failure", 3); + enMap.put("Medium Failure", 4); + enMap.put("Minor Failure", 5); + + jaMap.put("正常", 1); + jaMap.put("緊急", 2); + jaMap.put("重大故障", 3); + jaMap.put("中程度の故障", 4); + jaMap.put("軽微な故障", 5); + + statusMap.put(0, zhMap); + statusMap.put(1, enMap); + statusMap.put(2, jaMap); + } +} diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceGroupRelationExcel.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceGroupRelationExcel.java new file mode 100644 index 0000000..5d42d99 --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceGroupRelationExcel.java @@ -0,0 +1,14 @@ +package com.techsor.datacenter.business.importexcel.deviceinfo; + +import lombok.Data; + +@Data +public class DeviceGroupRelationExcel { + + private Integer deviceInfoId; + + private Long deviceGroupId; + + private String deviceId; + +} diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcel.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcel.java index 8ad74e5..cea60b7 100644 --- a/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcel.java +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcel.java @@ -55,4 +55,22 @@ public class DeviceInfoExcel { @ExcelProperty(value ="IoT Core") private String iotCoreName; + @ExcelProperty(value ="监控点名称") + private String monitoringPointName; + + @ExcelProperty(value ="网关情报名称") + private String gatewayInfo; + + @ExcelProperty(value ="告警级别") + private String alarmLevel; + + @ExcelProperty(value ="数据提供方") + private String dataProvider; + + @ExcelProperty(value ="监控点分类") + private String monitoringPointCategory; + + @ExcelProperty(value ="设备组") + private String deviceGroup; + } diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcelCn.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcelCn.java index 068ec43..e2e3061 100644 --- a/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcelCn.java +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcelCn.java @@ -79,6 +79,23 @@ public class DeviceInfoExcelCn { @ExcelProperty(value ="MQTT项目名") private String iotCoreName; - + + @ExcelProperty(value ="监控点名称") + private String monitoringPointName; + + @ExcelProperty(value ="网关情报名称") + private String gatewayInfo; + + @ExcelProperty(value ="告警级别") + private String alarmLevel; + + @ExcelProperty(value ="数据提供方") + private String dataProvider; + + @ExcelProperty(value ="监控点分类") + private String monitoringPointCategory; + + @ExcelProperty(value ="设备组") + private String deviceGroup; } diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcelEn.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcelEn.java index 8cb95ce..8f4a9a4 100644 --- a/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcelEn.java +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcelEn.java @@ -49,5 +49,23 @@ public class DeviceInfoExcelEn { @ExcelProperty(value ="MQTT Name") private String iotCoreName; + + @ExcelProperty(value ="Monitoring Point Name") + private String monitoringPointName; + + @ExcelProperty(value ="Gateway Data Provider Name") + private String gatewayInfo; + + @ExcelProperty(value ="Alarm Level") + private String alarmLevel; + + @ExcelProperty(value ="Data Provider") + private String dataProvider; + + @ExcelProperty(value ="Monitoring Point Category") + private String monitoringPointCategory; + + @ExcelProperty(value ="Device Group") + private String deviceGroup; } diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcelJp.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcelJp.java index 9087642..f45b437 100644 --- a/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcelJp.java +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/importexcel/deviceinfo/DeviceInfoExcelJp.java @@ -51,5 +51,23 @@ public class DeviceInfoExcelJp { @ExcelProperty(value ="MQTT項目名") private String iotCoreName; + + @ExcelProperty(value ="監視ポイント名") + private String monitoringPointName; + + @ExcelProperty(value ="ゲートウェイ情報名") + private String gatewayInfo; + + @ExcelProperty(value ="アラームレベル") + private String alarmLevel; + + @ExcelProperty(value ="データ提供元") + private String dataProvider; + + @ExcelProperty(value ="監視ポイント分類") + private String monitoringPointCategory; + + @ExcelProperty(value ="デバイスグループ") + private String deviceGroup; } diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicAssetClassBig.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicAssetClassBig.java index 924885d..a6ce697 100644 --- a/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicAssetClassBig.java +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicAssetClassBig.java @@ -66,6 +66,15 @@ public class BasicAssetClassBig implements Serializable { */ private String thumbnailAlarmBase64; + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_asset_class_big.thumbnail_dis_base64 + * + * @mbg.generated + */ + private String thumbnailDisBase64; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database table basic_asset_class_big @@ -242,6 +251,30 @@ public class BasicAssetClassBig implements Serializable { this.thumbnailAlarmBase64 = thumbnailAlarmBase64 == null ? null : thumbnailAlarmBase64.trim(); } + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_asset_class_big.thumbnail_dis_base64 + * + * @return the value of basic_asset_class_big.thumbnail_dis_base64 + * + * @mbg.generated + */ + public String getThumbnailDisBase64() { + return thumbnailDisBase64; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_asset_class_big.thumbnail_dis_base64 + * + * @param thumbnailDisBase64 the value for basic_asset_class_big.thumbnail_dis_base64 + * + * @mbg.generated + */ + public void setThumbnailDisBase64(String thumbnailDisBase64) { + this.thumbnailDisBase64 = thumbnailDisBase64 == null ? null : thumbnailDisBase64.trim(); + } + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table basic_asset_class_big @@ -261,6 +294,7 @@ public class BasicAssetClassBig implements Serializable { sb.append(", flag=").append(flag); sb.append(", thumbnailNormalBase64=").append(thumbnailNormalBase64); sb.append(", thumbnailAlarmBase64=").append(thumbnailAlarmBase64); + sb.append(", thumbnailDisBase64=").append(thumbnailDisBase64); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuilding.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuilding.java index 13187e4..d5b6f21 100644 --- a/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuilding.java +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuilding.java @@ -147,6 +147,15 @@ public class BasicBuilding implements Serializable { */ private String longitude; + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.retain_alert + * + * @mbg.generated + */ + private Integer retainAlert; + /** * * This field was generated by MyBatis Generator. @@ -557,6 +566,30 @@ public class BasicBuilding implements Serializable { 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.retain_alert + * + * @return the value of basic_building.retain_alert + * + * @mbg.generated + */ + public Integer getRetainAlert() { + return retainAlert; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.retain_alert + * + * @param retainAlert the value for basic_building.retain_alert + * + * @mbg.generated + */ + public void setRetainAlert(Integer retainAlert) { + this.retainAlert = retainAlert; + } + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column basic_building.floor_info_list @@ -633,6 +666,7 @@ public class BasicBuilding implements Serializable { sb.append(", briefIntroduction=").append(briefIntroduction); sb.append(", latitude=").append(latitude); sb.append(", longitude=").append(longitude); + sb.append(", retainAlert=").append(retainAlert); sb.append(", floorInfoList=").append(floorInfoList); sb.append(", pictureIntroduction=").append(pictureIntroduction); sb.append(", serialVersionUID=").append(serialVersionUID); diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuildingExample.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuildingExample.java index 88af535..2a98ab5 100644 --- a/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuildingExample.java +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuildingExample.java @@ -1223,6 +1223,66 @@ public class BasicBuildingExample { addCriterion("longitude not between", value1, value2, "longitude"); return (Criteria) this; } + + public Criteria andRetainAlertIsNull() { + addCriterion("retain_alert is null"); + return (Criteria) this; + } + + public Criteria andRetainAlertIsNotNull() { + addCriterion("retain_alert is not null"); + return (Criteria) this; + } + + public Criteria andRetainAlertEqualTo(Integer value) { + addCriterion("retain_alert =", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertNotEqualTo(Integer value) { + addCriterion("retain_alert <>", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertGreaterThan(Integer value) { + addCriterion("retain_alert >", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertGreaterThanOrEqualTo(Integer value) { + addCriterion("retain_alert >=", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertLessThan(Integer value) { + addCriterion("retain_alert <", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertLessThanOrEqualTo(Integer value) { + addCriterion("retain_alert <=", value, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertIn(List values) { + addCriterion("retain_alert in", values, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertNotIn(List values) { + addCriterion("retain_alert not in", values, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertBetween(Integer value1, Integer value2) { + addCriterion("retain_alert between", value1, value2, "retainAlert"); + return (Criteria) this; + } + + public Criteria andRetainAlertNotBetween(Integer value1, Integer value2) { + addCriterion("retain_alert not between", value1, value2, "retainAlert"); + return (Criteria) this; + } } /** diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroup.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroup.java new file mode 100644 index 0000000..9664f94 --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroup.java @@ -0,0 +1,302 @@ +package com.techsor.datacenter.business.model; + +import java.io.Serializable; + +public class DeviceGroup implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_device_group.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_device_group.company_id + * + * @mbg.generated + */ + private Long companyId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_device_group.building_id + * + * @mbg.generated + */ + private Long buildingId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_device_group.name + * + * @mbg.generated + */ + private String name; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_device_group.remark + * + * @mbg.generated + */ + private String remark; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_device_group.flag + * + * @mbg.generated + */ + private Integer flag; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_device_group.created_by + * + * @mbg.generated + */ + private Long createdBy; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_device_group.created_at + * + * @mbg.generated + */ + private Long createdAt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_device_group.id + * + * @return the value of dashboard_device_group.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_device_group.id + * + * @param id the value for dashboard_device_group.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_device_group.company_id + * + * @return the value of dashboard_device_group.company_id + * + * @mbg.generated + */ + public Long getCompanyId() { + return companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_device_group.company_id + * + * @param companyId the value for dashboard_device_group.company_id + * + * @mbg.generated + */ + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_device_group.building_id + * + * @return the value of dashboard_device_group.building_id + * + * @mbg.generated + */ + public Long getBuildingId() { + return buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_device_group.building_id + * + * @param buildingId the value for dashboard_device_group.building_id + * + * @mbg.generated + */ + public void setBuildingId(Long buildingId) { + this.buildingId = buildingId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_device_group.name + * + * @return the value of dashboard_device_group.name + * + * @mbg.generated + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_device_group.name + * + * @param name the value for dashboard_device_group.name + * + * @mbg.generated + */ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_device_group.remark + * + * @return the value of dashboard_device_group.remark + * + * @mbg.generated + */ + public String getRemark() { + return remark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_device_group.remark + * + * @param remark the value for dashboard_device_group.remark + * + * @mbg.generated + */ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_device_group.flag + * + * @return the value of dashboard_device_group.flag + * + * @mbg.generated + */ + public Integer getFlag() { + return flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_device_group.flag + * + * @param flag the value for dashboard_device_group.flag + * + * @mbg.generated + */ + public void setFlag(Integer flag) { + this.flag = flag; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_device_group.created_by + * + * @return the value of dashboard_device_group.created_by + * + * @mbg.generated + */ + public Long getCreatedBy() { + return createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_device_group.created_by + * + * @param createdBy the value for dashboard_device_group.created_by + * + * @mbg.generated + */ + public void setCreatedBy(Long createdBy) { + this.createdBy = createdBy; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_device_group.created_at + * + * @return the value of dashboard_device_group.created_at + * + * @mbg.generated + */ + public Long getCreatedAt() { + return createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_device_group.created_at + * + * @param createdAt the value for dashboard_device_group.created_at + * + * @mbg.generated + */ + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", companyId=").append(companyId); + sb.append(", buildingId=").append(buildingId); + sb.append(", name=").append(name); + sb.append(", remark=").append(remark); + sb.append(", flag=").append(flag); + sb.append(", createdBy=").append(createdBy); + sb.append(", createdAt=").append(createdAt); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroupExample.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroupExample.java new file mode 100644 index 0000000..9b7b55d --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroupExample.java @@ -0,0 +1,802 @@ +package com.techsor.datacenter.business.model; + +import java.util.ArrayList; +import java.util.List; + +public class DeviceGroupExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + public DeviceGroupExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNull() { + addCriterion("building_id is null"); + return (Criteria) this; + } + + public Criteria andBuildingIdIsNotNull() { + addCriterion("building_id is not null"); + return (Criteria) this; + } + + public Criteria andBuildingIdEqualTo(Long value) { + addCriterion("building_id =", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotEqualTo(Long value) { + addCriterion("building_id <>", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThan(Long value) { + addCriterion("building_id >", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdGreaterThanOrEqualTo(Long value) { + addCriterion("building_id >=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThan(Long value) { + addCriterion("building_id <", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdLessThanOrEqualTo(Long value) { + addCriterion("building_id <=", value, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdIn(List values) { + addCriterion("building_id in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotIn(List values) { + addCriterion("building_id not in", values, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdBetween(Long value1, Long value2) { + addCriterion("building_id between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andBuildingIdNotBetween(Long value1, Long value2) { + addCriterion("building_id not between", value1, value2, "buildingId"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andFlagIsNull() { + addCriterion("flag is null"); + return (Criteria) this; + } + + public Criteria andFlagIsNotNull() { + addCriterion("flag is not null"); + return (Criteria) this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThan(Integer value) { + addCriterion("flag >", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("flag >=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThan(Integer value) { + addCriterion("flag <", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagLessThanOrEqualTo(Integer value) { + addCriterion("flag <=", value, "flag"); + return (Criteria) this; + } + + public Criteria andFlagIn(List values) { + addCriterion("flag in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotIn(List values) { + addCriterion("flag not in", values, "flag"); + return (Criteria) this; + } + + public Criteria andFlagBetween(Integer value1, Integer value2) { + addCriterion("flag between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andFlagNotBetween(Integer value1, Integer value2) { + addCriterion("flag not between", value1, value2, "flag"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNull() { + addCriterion("created_by is null"); + return (Criteria) this; + } + + public Criteria andCreatedByIsNotNull() { + addCriterion("created_by is not null"); + return (Criteria) this; + } + + public Criteria andCreatedByEqualTo(Long value) { + addCriterion("created_by =", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotEqualTo(Long value) { + addCriterion("created_by <>", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThan(Long value) { + addCriterion("created_by >", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByGreaterThanOrEqualTo(Long value) { + addCriterion("created_by >=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThan(Long value) { + addCriterion("created_by <", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByLessThanOrEqualTo(Long value) { + addCriterion("created_by <=", value, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByIn(List values) { + addCriterion("created_by in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotIn(List values) { + addCriterion("created_by not in", values, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByBetween(Long value1, Long value2) { + addCriterion("created_by between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedByNotBetween(Long value1, Long value2) { + addCriterion("created_by not between", value1, value2, "createdBy"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Long value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Long value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Long value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Long value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Long value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Long value1, Long value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Long value1, Long value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_device_group + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_device_group + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroupRelation.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroupRelation.java new file mode 100644 index 0000000..0dc75d2 --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroupRelation.java @@ -0,0 +1,98 @@ +package com.techsor.datacenter.business.model; + +import java.io.Serializable; + +public class DeviceGroupRelation implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_device_group_relation.device_info_id + * + * @mbg.generated + */ + private Integer deviceInfoId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_device_group_relation.device_group_id + * + * @mbg.generated + */ + private Long deviceGroupId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_device_group_relation.device_info_id + * + * @return the value of dashboard_device_group_relation.device_info_id + * + * @mbg.generated + */ + public Integer getDeviceInfoId() { + return deviceInfoId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_device_group_relation.device_info_id + * + * @param deviceInfoId the value for dashboard_device_group_relation.device_info_id + * + * @mbg.generated + */ + public void setDeviceInfoId(Integer deviceInfoId) { + this.deviceInfoId = deviceInfoId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_device_group_relation.device_group_id + * + * @return the value of dashboard_device_group_relation.device_group_id + * + * @mbg.generated + */ + public Long getDeviceGroupId() { + return deviceGroupId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_device_group_relation.device_group_id + * + * @param deviceGroupId the value for dashboard_device_group_relation.device_group_id + * + * @mbg.generated + */ + public void setDeviceGroupId(Long deviceGroupId) { + this.deviceGroupId = deviceGroupId; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", deviceInfoId=").append(deviceInfoId); + sb.append(", deviceGroupId=").append(deviceGroupId); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroupRelationExample.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroupRelationExample.java new file mode 100644 index 0000000..8baf1d6 --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroupRelationExample.java @@ -0,0 +1,422 @@ +package com.techsor.datacenter.business.model; + +import java.util.ArrayList; +import java.util.List; + +public class DeviceGroupRelationExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + public DeviceGroupRelationExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andDeviceInfoIdIsNull() { + addCriterion("device_info_id is null"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdIsNotNull() { + addCriterion("device_info_id is not null"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdEqualTo(Integer value) { + addCriterion("device_info_id =", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdNotEqualTo(Integer value) { + addCriterion("device_info_id <>", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdGreaterThan(Integer value) { + addCriterion("device_info_id >", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdGreaterThanOrEqualTo(Integer value) { + addCriterion("device_info_id >=", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdLessThan(Integer value) { + addCriterion("device_info_id <", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdLessThanOrEqualTo(Integer value) { + addCriterion("device_info_id <=", value, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdIn(List values) { + addCriterion("device_info_id in", values, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdNotIn(List values) { + addCriterion("device_info_id not in", values, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdBetween(Integer value1, Integer value2) { + addCriterion("device_info_id between", value1, value2, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceInfoIdNotBetween(Integer value1, Integer value2) { + addCriterion("device_info_id not between", value1, value2, "deviceInfoId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdIsNull() { + addCriterion("device_group_id is null"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdIsNotNull() { + addCriterion("device_group_id is not null"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdEqualTo(Long value) { + addCriterion("device_group_id =", value, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdNotEqualTo(Long value) { + addCriterion("device_group_id <>", value, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdGreaterThan(Long value) { + addCriterion("device_group_id >", value, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdGreaterThanOrEqualTo(Long value) { + addCriterion("device_group_id >=", value, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdLessThan(Long value) { + addCriterion("device_group_id <", value, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdLessThanOrEqualTo(Long value) { + addCriterion("device_group_id <=", value, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdIn(List values) { + addCriterion("device_group_id in", values, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdNotIn(List values) { + addCriterion("device_group_id not in", values, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdBetween(Long value1, Long value2) { + addCriterion("device_group_id between", value1, value2, "deviceGroupId"); + return (Criteria) this; + } + + public Criteria andDeviceGroupIdNotBetween(Long value1, Long value2) { + addCriterion("device_group_id not between", value1, value2, "deviceGroupId"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_device_group_relation + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DeviceServiceImpl.java b/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DeviceServiceImpl.java index 75a4842..d60a823 100644 --- a/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DeviceServiceImpl.java +++ b/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DeviceServiceImpl.java @@ -37,6 +37,8 @@ import com.techsor.datacenter.business.dto.device.forward.DeviceForwardBatchPara import com.techsor.datacenter.business.dto.device.forward.DeviceForwardQueryParams; import com.techsor.datacenter.business.dto.device.forward.DeviceForwardRemoveParmas; import com.techsor.datacenter.business.importexcel.deviceAlertInfo.DeviceAlertInfoExcel; +import com.techsor.datacenter.business.importexcel.deviceinfo.AlarmLevelMapping; +import com.techsor.datacenter.business.importexcel.deviceinfo.DeviceGroupRelationExcel; import com.techsor.datacenter.business.importexcel.deviceinfo.DeviceInfoExcel; import com.techsor.datacenter.business.model.*; import com.techsor.datacenter.business.service.IDeviceService; @@ -175,6 +177,18 @@ public class DeviceServiceImpl implements IDeviceService { @Resource private MqttConfigMapperExt mqttConfigMapperExt; + @Resource + private DataProviderGatewayInfoMapperExt gatewayInfoMapperExt; + + @Resource + private DataProviderMapperExt dataProviderMapperExt; + + @Resource + private DeviceGroupMapperExt deviceGroupMapperExt; + + @Resource + private DeviceGroupRelationMapperExt deviceGroupRelationMapperExt; + @Resource private DeviceForwardConfigMapperExt deviceForwardConfigMapperExt; @@ -684,37 +698,39 @@ public class DeviceServiceImpl implements IDeviceService { * @return A list of error messages detailing issues encountered during batch device addition. */ @Override - public List batchAddDeviceInfos(String wsClientId, List dataList, Map s3InfoMap, - Long userId, Long companyId, Integer languageType) { - - List redisList = new ArrayList<>(); - try { - List errorMsgList=new ArrayList<>(); - int dataSize = dataList.size(); - //First, check if it is being imported - boolean absent = true; - for (DeviceInfoExcel deviceInfoExcel : dataList) { - absent = redisUtil.setIfAbsent(deviceInfoExcel.getDeviceId(), userId, 120, TimeUnit.SECONDS); - if (!absent) { - break; - } else { - redisList.add(deviceInfoExcel.getDeviceId()); - } - } - - if (!absent) { - if (CollectionUtils.isNotEmpty(redisList)) { - redisUtil.delKeys(redisList); - } - - errorMsgList.add(msgLanguageChange.getParameterMapByCode(languageType, "deviceIsImporting")); - return errorMsgList; - } - - + public List batchAddDeviceInfos(String wsClientId, List dataList, Map s3InfoMap, + Long userId, Long companyId, Integer languageType) { + + List redisList = new ArrayList<>(); + try { + List errorMsgList=new ArrayList<>(); + int dataSize = dataList.size(); + //First, check if it is being imported + boolean absent = true; + for (DeviceInfoExcel deviceInfoExcel : dataList) { + String importKey = "importing-" + deviceInfoExcel.getDeviceId(); + absent = redisUtil.setIfAbsent(importKey, userId, 120, TimeUnit.SECONDS); + if (!absent) { + break; + } else { + redisList.add(importKey); + } + } + + if (!absent) { + if (CollectionUtils.isNotEmpty(redisList)) { + redisUtil.delKeys(redisList); + } + + errorMsgList.add(msgLanguageChange.getParameterMapByCode(languageType, "deviceIsImporting")); + return errorMsgList; + } + + DataSourceContextHolder.clearCurrentDataSourceKey(); - + List batchInfoList=new ArrayList<>(); + List deviceGroupRelationExcelList = new ArrayList<>(); // BasicCompanyExample basicCompanyExample=new BasicCompanyExample(); // basicCompanyExample.createCriteria().andIdEqualTo(companyId); @@ -726,7 +742,7 @@ public class DeviceServiceImpl implements IDeviceService { int i=1; Long topCompanyId = dataSourceInterceptor.getTopCompanyId(companyId+""); DataSourceContextHolder.setCurrentDataSourceKey("dataSourceForCompany_" + topCompanyId); - + //get iotcore MqttConfigExample mqttConfigExample = new MqttConfigExample(); MqttConfigExample.Criteria mqttCriteria = mqttConfigExample.createCriteria(); @@ -734,12 +750,31 @@ public class DeviceServiceImpl implements IDeviceService { List iotcoreConfigs = mqttConfigMapperExt.selectByExample(mqttConfigExample); Map iotcoreMapping = iotcoreConfigs.stream() .collect(Collectors.toMap(MqttConfig::getMqttName, item -> item)); - - + + DataProviderGatewayInfoExample dataProviderGatewayInfoExample = new DataProviderGatewayInfoExample(); + DataProviderGatewayInfoExample.Criteria dataProviderGatewayInfoCriteria = dataProviderGatewayInfoExample.createCriteria(); + dataProviderGatewayInfoCriteria.andCompanyIdEqualTo(companyId).andFlagNotEqualTo(1); + List dataProviderGatewayInfoList = gatewayInfoMapperExt.selectByExample(dataProviderGatewayInfoExample); + Map dataProviderGatewayInfoMapping = dataProviderGatewayInfoList.stream() + .collect(Collectors.toMap(DataProviderGatewayInfo::getName, item -> item)); + + DataProviderExample dataProviderExample = new DataProviderExample(); + DataProviderExample.Criteria dataProviderCriteria = dataProviderExample.createCriteria(); + dataProviderCriteria.andCompanyIdEqualTo(companyId).andFlagNotEqualTo(1); + List dataProviderList = dataProviderMapperExt.selectByExample(dataProviderExample); + Map dataProviderMapping = dataProviderList.stream() + .collect(Collectors.toMap(DataProvider::getName, item -> item)); + + DeviceGroupExample deviceGroupExample = new DeviceGroupExample(); + List deviceGroupList = deviceGroupMapperExt.selectByExample(deviceGroupExample); + Map deviceGroupMapping = deviceGroupList.stream() + .collect(Collectors.toMap(DeviceGroup::getName, item -> item)); + + List targetFowardCodeIdListCache = new ArrayList<>(); for (int dataIndex=0; dataIndex errorList = new ArrayList<>(); @@ -783,12 +818,39 @@ public class DeviceServiceImpl implements IDeviceService { if (!deviceExists) { errorList.add(msgLanguageChange.getParameterMapByCode(languageType, "deviceTypeNotExist")); } - + // iotcore Check if (StringUtils.isNotBlank(deviceInfoExcel.getIotCoreName()) && !iotcoreMapping.containsKey(deviceInfoExcel.getIotCoreName())) { errorList.add(msgLanguageChange.getParameterMapByCode(languageType, "IoTCoreNotExist")); } + if (StringUtils.isNotBlank(deviceInfoExcel.getGatewayInfo()) && !dataProviderGatewayInfoMapping.containsKey(deviceInfoExcel.getGatewayInfo())) { + errorList.add(msgLanguageChange.getParameterMapByCode(languageType, "dataProviderGatewayInfoNotExist")); + } + + if (StringUtils.isNotBlank(deviceInfoExcel.getAlarmLevel()) && !AlarmLevelMapping.statusMap.get(languageType).containsKey(deviceInfoExcel.getAlarmLevel())) { + errorList.add(msgLanguageChange.getParameterMapByCode(languageType, "alarmLevelNotExist")); + } + + if (StringUtils.isNotBlank(deviceInfoExcel.getDataProvider()) && !dataProviderMapping.containsKey(deviceInfoExcel.getDataProvider())) { + errorList.add(msgLanguageChange.getParameterMapByCode(languageType, "dataProviderNotExist")); + } + + if (StringUtils.isNotBlank(deviceInfoExcel.getDeviceGroup())) { + if (!deviceGroupMapping.containsKey(deviceInfoExcel.getDeviceGroup())) { + errorList.add(msgLanguageChange.getParameterMapByCode(languageType, "deviceGroupNotExist")); + } else { + DeviceGroupRelationExcel deviceGroupRelationExcel = new DeviceGroupRelationExcel(); + deviceGroupRelationExcel.setDeviceId(deviceInfoExcel.getDeviceId()); + deviceGroupRelationExcel.setDeviceGroupId(deviceGroupMapping.get(deviceInfoExcel.getDeviceGroup()).getId()); + deviceGroupRelationExcelList.add(deviceGroupRelationExcel); + } + } + +// if (StringUtils.isNotBlank(deviceInfoExcel.getMonitoringPointCategory()) && !monitoringPointCategoryMapping.containsKey(deviceInfoExcel.getMonitoringPointCategory())) { +// errorList.add(msgLanguageChange.getParameterMapByCode(languageType, "monitoringPointCategoryNotExist")); +// } + //TargetForward Code Check Integer wsClientIdId = checkWsClientId(deviceInfoExcel.getWsClientId(),companyId); if (wsClientIdId==-1){ @@ -820,7 +882,7 @@ public class DeviceServiceImpl implements IDeviceService { String deviceId=deviceInfoExcel.getDeviceId(); DeviceInfoExample deviceInfoExample=new DeviceInfoExample(); - deviceInfoExample.createCriteria().andCompanyIdEqualTo(companyId).andDeviceIdEqualTo(deviceId); + deviceInfoExample.createCriteria().andCompanyIdEqualTo(companyId).andDeviceIdEqualTo(deviceId).andFlagNotEqualTo(1); long cntNum=this.deviceInfoMapperExt.countByExample(deviceInfoExample); DeviceConfigInfoExample deviceConfigInfoExample = new DeviceConfigInfoExample(); deviceConfigInfoExample.createCriteria().andNameEqualTo(deviceInfoExcel.getDeviceType()); @@ -838,9 +900,24 @@ public class DeviceServiceImpl implements IDeviceService { deviceInfo.setUpdatedTimestamp(System.currentTimeMillis()); deviceInfo.setWsclientId(wsClientIdId); deviceInfo.setFlag(0); + if (StringUtils.isNotBlank(deviceInfoExcel.getMonitoringPointName())) { + deviceInfo.setMonitoringPointName(deviceInfoExcel.getMonitoringPointName()); + } + if (StringUtils.isNotBlank(deviceInfoExcel.getGatewayInfo())) { + deviceInfo.setGatewayInfoId(dataProviderGatewayInfoMapping.get(deviceInfoExcel.getGatewayInfo()).getId()); + } + if (StringUtils.isNotBlank(deviceInfoExcel.getAlarmLevel())) { + deviceInfo.setAlarmLevel(AlarmLevelMapping.statusMap.get(languageType).get(deviceInfoExcel.getAlarmLevel())); + } + if (StringUtils.isNotBlank(deviceInfoExcel.getDataProvider())) { + deviceInfo.setDataProviderId(dataProviderMapping.get(deviceInfoExcel.getDataProvider()).getId()); + } +// if (StringUtils.isNotBlank(deviceInfoExcel.getMonitoringPointCategory())) { +// deviceInfo.setMonitoringPointCategoryId(monitoringPointCategoryMapping.get(deviceInfoExcel.getMonitoringPointCategory()).getId()); +// } this.notificationService.saveDeviceCompanyMapping(deviceInfo.getDeviceId(), String.valueOf(companyId)); this.deviceInfoMapperExt.updateByExampleSelective(deviceInfo,deviceInfoExample); - batchDeviceFowardConfig(deviceInfo,userId,targetForwardCodeId); + batchDeviceFowardConfig(deviceInfo,userId,targetForwardCodeId, deviceGroupRelationExcelList); }else{ // Set values and add to the batch list deviceInfo.setTypeId(deviceConfigInfoList.get(0).getId().intValue()); @@ -855,47 +932,82 @@ public class DeviceServiceImpl implements IDeviceService { deviceInfo.setFlag(0); deviceInfo.setUpdatedTimestamp(System.currentTimeMillis()); deviceInfo.setWsclientId(wsClientIdId); + if (StringUtils.isNotBlank(deviceInfoExcel.getMonitoringPointName())) { + deviceInfo.setMonitoringPointName(deviceInfoExcel.getMonitoringPointName()); + } + if (StringUtils.isNotBlank(deviceInfoExcel.getGatewayInfo())) { + deviceInfo.setGatewayInfoId(dataProviderGatewayInfoMapping.get(deviceInfoExcel.getGatewayInfo()).getId()); + } + if (StringUtils.isNotBlank(deviceInfoExcel.getAlarmLevel())) { + deviceInfo.setAlarmLevel(AlarmLevelMapping.statusMap.get(languageType).get(deviceInfoExcel.getAlarmLevel())); + } + if (StringUtils.isNotBlank(deviceInfoExcel.getDataProvider())) { + deviceInfo.setDataProviderId(dataProviderMapping.get(deviceInfoExcel.getDataProvider()).getId()); + } +// if (StringUtils.isNotBlank(deviceInfoExcel.getMonitoringPointCategory())) { +// deviceInfo.setMonitoringPointCategoryId(monitoringPointCategoryMapping.get(deviceInfoExcel.getMonitoringPointCategory()).getId()); +// } batchInfoList.add(deviceInfo); targetFowardCodeIdListCache.add(targetForwardCodeId); // Note: if targetForwardCodeId=0, don't process this.notificationService.saveDeviceCompanyMapping(deviceInfo.getDeviceId(), String.valueOf(companyId)); } - + webSocketServer.sendToOne(wsClientId, Arith.mul(Arith.div(dataIndex, dataSize, 2), 30)+""); } if (errorMsgList.size()>0){ return errorMsgList; }else{ - - //Old data saved to s3 - if (CollectionUtils.isNotEmpty(dataList)) { - oldDeviceInfoDataSaveToS3(companyId,dataList, languageType, s3InfoMap); - webSocketServer.sendToOne(wsClientId, "40"); - } - + + //Old data saved to s3 + if (CollectionUtils.isNotEmpty(dataList)) { + oldDeviceInfoDataSaveToS3(companyId,dataList, languageType, s3InfoMap); + webSocketServer.sendToOne(wsClientId, "40"); + } + if (!batchInfoList.isEmpty()) { this.deviceInfoMapperExt.batchInsert(batchInfoList); - - webSocketServer.sendToOne(wsClientId, "60"); - + + webSocketServer.sendToOne(wsClientId, "50"); + int batchInfoSize = batchInfoList.size(); for (int j=0;j deviceInfoIds = deviceGroupRelationExcelList.stream() + .map(DeviceGroupRelationExcel::getDeviceInfoId) + .collect(Collectors.toList()); + // 使用 Example 删除指定设备ID的所有绑定记录 + DeviceGroupRelationExample example = new DeviceGroupRelationExample(); + example.createCriteria().andDeviceInfoIdIn(deviceInfoIds); + deviceGroupRelationMapperExt.deleteByExample(example); + // 插入新绑定关系 + int deviceGroupRelationSize = deviceGroupRelationExcelList.size(); + for (int j=0;j resultList = deviceInfoMapperExt.downloadAllDevicesInfo(companyId,deviceSearchParams); if (CollectionUtils.isNotEmpty(resultList)) { @@ -995,7 +1107,7 @@ public class DeviceServiceImpl implements IDeviceService { String s3FileName = timeStr + "_old_" + RandomNumberUtil.createRandomLowerLetterAndNumber(5) + ".xlsx"; dataFileSaveToS3(fileStream, oldFileBucket, s3FileName); - DataSourceContextHolder.clearCurrentDataSourceKey(); +// DataSourceContextHolder.clearCurrentDataSourceKey(); s3InfoMap.put("s3OldFileName", s3FileName); } } @@ -2353,11 +2465,18 @@ public class DeviceServiceImpl implements IDeviceService { } //process insert targetForwardConfig table - private void batchDeviceFowardConfig(DeviceInfo deviceInfo, Long userId, Long targetForwardCodeId){ + private void batchDeviceFowardConfig(DeviceInfo deviceInfo, Long userId, Long targetForwardCodeId, List deviceGroupRelationExcelList){ DeviceForwardConfig deviceForwardConfigItem = new DeviceForwardConfig();//Used to create device forward config. DeviceInfoExample deviceInfoExample2 = new DeviceInfoExample(); deviceInfoExample2.createCriteria().andDeviceIdEqualTo(deviceInfo.getDeviceId()).andCompanyIdEqualTo(deviceInfo.getCompanyId()).andFlagNotEqualTo(1); Integer deviceTableId = deviceInfoMapperExt.selectByExample(deviceInfoExample2).get(0).getId(); + + deviceGroupRelationExcelList.forEach(item -> { + if (deviceTableId != null) { + item.setDeviceInfoId(deviceTableId); + } + }); + //Remove if this device forward config exists. if (targetForwardCodeId>-1){ DeviceForwardConfigExample deviceForwardConfigExample = new DeviceForwardConfigExample();