diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java index 27f3207..17b73e9 100644 --- a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java @@ -32,28 +32,51 @@ public class Constants { public static final int CATEGORY_MEASURE = 3;//计测 public static final int CATEGORY_STATUS= 4;//状态 +// // 所有设备类型ID的总集合 +// public static final List ALL_DEVICE_TYPE_IDS = new ArrayList<>(); +// +// // 定义分类与设备类型的映射 +// public static final Map> CATEGORY_DEVICE_TYPE_MAP = new HashMap<>(); +// +// //温湿度 +// public static final List DEVICE_TYPE_TEMPERATURE_HUMIDITY = Arrays.asList(8888882,9999992); +// +// static { +// CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ALARM, new ArrayList<>(Arrays.asList(46, 110))); +// +// CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_MEASURE, new ArrayList<>(Arrays.asList(47, 111, 121))); +// CATEGORY_DEVICE_TYPE_MAP.get(CATEGORY_MEASURE).addAll(DEVICE_TYPE_TEMPERATURE_HUMIDITY); +// +// CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ACCUMULATE, new ArrayList<>(Arrays.asList(48, 112, 122))); +// +// CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_STATUS, new ArrayList<>(Arrays.asList(86, 113, 123))); +// +// // 收集所有的设备类型ID +// for (List ids : CATEGORY_DEVICE_TYPE_MAP.values()) { +// ALL_DEVICE_TYPE_IDS.addAll(ids); +// } +// } // 所有设备类型ID的总集合 - public static final List ALL_DEVICE_TYPE_IDS = new ArrayList<>(); + public static final List ALL_CATEGORY_IDS = new ArrayList<>(); // 定义分类与设备类型的映射 - public static final Map> CATEGORY_DEVICE_TYPE_MAP = new HashMap<>(); + public static final Map> CATEGORY_MAP = new HashMap<>(); //温湿度 - public static final List DEVICE_TYPE_TEMPERATURE_HUMIDITY = Arrays.asList(8888882,9999992); + public static final List DEVICE_TYPE_TEMPERATURE_HUMIDITY = Arrays.asList(8888882L,9999992L); static { - CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ALARM, new ArrayList<>(Arrays.asList(46, 110))); + CATEGORY_MAP.put(CATEGORY_ALARM, new ArrayList<>(List.of(1001L))); - CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_MEASURE, new ArrayList<>(Arrays.asList(47, 111, 121))); - CATEGORY_DEVICE_TYPE_MAP.get(CATEGORY_MEASURE).addAll(DEVICE_TYPE_TEMPERATURE_HUMIDITY); + CATEGORY_MAP.put(CATEGORY_MEASURE, new ArrayList<>(List.of(1003L))); - CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ACCUMULATE, new ArrayList<>(Arrays.asList(48, 112, 122))); + CATEGORY_MAP.put(CATEGORY_ACCUMULATE, new ArrayList<>(List.of(1002L))); - CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_STATUS, new ArrayList<>(Arrays.asList(86, 113, 123))); + CATEGORY_MAP.put(CATEGORY_STATUS, new ArrayList<>(List.of(1004L))); // 收集所有的设备类型ID - for (List ids : CATEGORY_DEVICE_TYPE_MAP.values()) { - ALL_DEVICE_TYPE_IDS.addAll(ids); + for (List ids : CATEGORY_MAP.values()) { + ALL_CATEGORY_IDS.addAll(ids); } } diff --git a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml index 866d528..d882e5e 100644 --- a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml +++ b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml @@ -58,7 +58,7 @@ msgcn: consecutiveLoginFail: 登录失败次数过多,请等待{0}分{1}秒后再登录 loginFailCount: 已登录失败{0}次,剩余尝试登录次数:{1} deviceGroupNameHasExisted: 此设备组名称已存在 - groupTypeNotMatch: 设备类型与分组类型不匹配 + invalidDeviceCategory: 无效的设备类别 monitoringPointCategoryNameHasExisted: 此监控点分类名称已存在 monitoringPointCategoryGroupNameHasExisted: 此监控点分组名称已存在 alertLevel_1: 正常 diff --git a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml index 8aaa156..4263fa6 100644 --- a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml +++ b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml @@ -58,7 +58,7 @@ msgen: consecutiveLoginFail: Too many failed login attempts. Please wait {0} minute(s) and {1} second(s) before trying again. loginFailCount: Login failed {0} times. Remaining login attempts:{1}. deviceGroupNameHasExisted: Device group name already exists. - groupTypeNotMatch: Device type does not match the group type + invalidDeviceCategory: Invalid device category monitoringPointCategoryNameHasExisted: This monitoring point category name already exists monitoringPointCategoryGroupNameHasExisted: The monitoring point group name already exists alertLevel_1: Normal diff --git a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml index 52c08e6..373e8f4 100644 --- a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml +++ b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml @@ -58,7 +58,7 @@ msgjp: consecutiveLoginFail: ログインの失敗が多すぎます。{0}分{1}秒待ってから再度ログインしてください。 loginFailCount: ログインに{0}回失敗しました。残りの試行回数:{1}回。 deviceGroupNameHasExisted: デバイスグループ名は既に存在しています。 - groupTypeNotMatch: デバイスタイプがグループタイプと一致しません。 + invalidDeviceCategory: サポートされていないデバイスタイプ。 monitoringPointCategoryNameHasExisted: この監視ポイントカテゴリ名は既に存在します monitoringPointCategoryGroupNameHasExisted: この監視ポイントグループ名は既に存在します alertLevel_1: 通常 diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceInfoMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceInfoMapper.java index afc1af1..cff17f5 100644 --- a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceInfoMapper.java +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceInfoMapper.java @@ -46,6 +46,14 @@ public interface DeviceInfoMapper { */ int insertSelective(DeviceInfo record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + List selectByExampleWithBLOBs(DeviceInfoExample example); + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table device_info @@ -70,6 +78,14 @@ public interface DeviceInfoMapper { */ int updateByExampleSelective(@Param("record") DeviceInfo record, @Param("example") DeviceInfoExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + int updateByExampleWithBLOBs(@Param("record") DeviceInfo record, @Param("example") DeviceInfoExample example); + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table device_info @@ -86,6 +102,14 @@ public interface DeviceInfoMapper { */ int updateByPrimaryKeySelective(DeviceInfo record); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table device_info + * + * @mbg.generated + */ + int updateByPrimaryKeyWithBLOBs(DeviceInfo record); + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table device_info diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceInfoMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceInfoMapper.xml index 699be02..8b8dd74 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceInfoMapper.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceInfoMapper.xml @@ -30,6 +30,14 @@ + + + + + + data_mapping + + @@ -169,8 +207,8 @@ created_timestamp, updated_by, updated_timestamp, project_id, floor_id, monitoring_point_name, monitoring_point_category_id, data_provider_id, - gateway_info_id, alarm_level, retain_alert - ) + gateway_info_id, alarm_level, retain_alert, + unit, data_mapping) values (#{deviceId,jdbcType=VARCHAR}, #{deviceSn,jdbcType=VARCHAR}, #{typeId,jdbcType=INTEGER}, #{wsclientId,jdbcType=INTEGER}, #{spaceId,jdbcType=BIGINT}, #{deviceName,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{buildingId,jdbcType=BIGINT}, #{assetId,jdbcType=BIGINT}, @@ -178,8 +216,8 @@ #{createdTimestamp,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}, #{updatedTimestamp,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{floorId,jdbcType=BIGINT}, #{monitoringPointName,jdbcType=VARCHAR}, #{monitoringPointCategoryId,jdbcType=BIGINT}, #{dataProviderId,jdbcType=BIGINT}, - #{gatewayInfoId,jdbcType=BIGINT}, #{alarmLevel,jdbcType=INTEGER}, #{retainAlert,jdbcType=INTEGER} - ) + #{gatewayInfoId,jdbcType=BIGINT}, #{alarmLevel,jdbcType=INTEGER}, #{retainAlert,jdbcType=INTEGER}, + #{unit,jdbcType=VARCHAR}, #{dataMapping,jdbcType=LONGVARCHAR}) + update device_info + set id = #{record.id,jdbcType=INTEGER}, + device_id = #{record.deviceId,jdbcType=VARCHAR}, + device_sn = #{record.deviceSn,jdbcType=VARCHAR}, + type_id = #{record.typeId,jdbcType=INTEGER}, + wsclient_id = #{record.wsclientId,jdbcType=INTEGER}, + space_id = #{record.spaceId,jdbcType=BIGINT}, + device_name = #{record.deviceName,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + building_id = #{record.buildingId,jdbcType=BIGINT}, + asset_id = #{record.assetId,jdbcType=BIGINT}, + flag = #{record.flag,jdbcType=INTEGER}, + company_id = #{record.companyId,jdbcType=BIGINT}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + created_timestamp = #{record.createdTimestamp,jdbcType=TIMESTAMP}, + updated_by = #{record.updatedBy,jdbcType=BIGINT}, + updated_timestamp = #{record.updatedTimestamp,jdbcType=BIGINT}, + project_id = #{record.projectId,jdbcType=BIGINT}, + floor_id = #{record.floorId,jdbcType=BIGINT}, + monitoring_point_name = #{record.monitoringPointName,jdbcType=VARCHAR}, + monitoring_point_category_id = #{record.monitoringPointCategoryId,jdbcType=BIGINT}, + data_provider_id = #{record.dataProviderId,jdbcType=BIGINT}, + gateway_info_id = #{record.gatewayInfoId,jdbcType=BIGINT}, + alarm_level = #{record.alarmLevel,jdbcType=INTEGER}, + retain_alert = #{record.retainAlert,jdbcType=INTEGER}, + unit = #{record.unit,jdbcType=VARCHAR}, + data_mapping = #{record.dataMapping,jdbcType=LONGVARCHAR} + + + + + update device_info + set device_id = #{deviceId,jdbcType=VARCHAR}, + device_sn = #{deviceSn,jdbcType=VARCHAR}, + type_id = #{typeId,jdbcType=INTEGER}, + wsclient_id = #{wsclientId,jdbcType=INTEGER}, + space_id = #{spaceId,jdbcType=BIGINT}, + device_name = #{deviceName,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + building_id = #{buildingId,jdbcType=BIGINT}, + asset_id = #{assetId,jdbcType=BIGINT}, + flag = #{flag,jdbcType=INTEGER}, + company_id = #{companyId,jdbcType=BIGINT}, + created_by = #{createdBy,jdbcType=BIGINT}, + created_timestamp = #{createdTimestamp,jdbcType=TIMESTAMP}, + updated_by = #{updatedBy,jdbcType=BIGINT}, + updated_timestamp = #{updatedTimestamp,jdbcType=BIGINT}, + project_id = #{projectId,jdbcType=BIGINT}, + floor_id = #{floorId,jdbcType=BIGINT}, + monitoring_point_name = #{monitoringPointName,jdbcType=VARCHAR}, + monitoring_point_category_id = #{monitoringPointCategoryId,jdbcType=BIGINT}, + data_provider_id = #{dataProviderId,jdbcType=BIGINT}, + gateway_info_id = #{gatewayInfoId,jdbcType=BIGINT}, + alarm_level = #{alarmLevel,jdbcType=INTEGER}, + retain_alert = #{retainAlert,jdbcType=INTEGER}, + unit = #{unit,jdbcType=VARCHAR}, + data_mapping = #{dataMapping,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} +