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 edc44ac..e3679f4 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 @@ -199,3 +199,4 @@ msgcn: levelReferencedByChildren: 已被下级层级绑定,请先解绑后再删除 levelRoleNameExist: 层级角色已存在 roleHasBinded: 角色已绑定用户,请先解绑再删除 + dataMappingFormatError: 数据映射格式错误 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 3c3f01e..2303bda 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 @@ -198,4 +198,5 @@ msgen: invalidParentLevel: Invalid parent level levelReferencedByChildren: It is bound by child levels. Please unbind them before deleting. levelRoleNameExist: The role already exists. - roleHasBinded: The role is assigned to users. Please unbind them before deleting. \ No newline at end of file + roleHasBinded: The role is assigned to users. Please unbind them before deleting. + dataMappingFormatError: Invalid data mapping format \ 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 cd2225b..21bf390 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 @@ -198,4 +198,5 @@ msgjp: invalidParentLevel: 無効な上位階層です levelReferencedByChildren: 下位階層に紐づいています。削除する前に紐付けを解除してください。 levelRoleNameExist: 役割名が既に登録済み - roleHasBinded: 役割はユーザーにバインドされている ので、削除する前にバインドを解除してください \ No newline at end of file + roleHasBinded: 役割はユーザーにバインドされている ので、削除する前にバインドを解除してください + dataMappingFormatError: データマッピング形式が不正です \ No newline at end of file diff --git a/data-center-business-controller/src/main/resources/db/migration/V61__device_adapt_category.sql b/data-center-business-controller/src/main/resources/db/migration/V61__device_adapt_category.sql new file mode 100644 index 0000000..b90d53b --- /dev/null +++ b/data-center-business-controller/src/main/resources/db/migration/V61__device_adapt_category.sql @@ -0,0 +1,4 @@ +ALTER TABLE device_info ADD ( + `unit` varchar(45) DEFAULT NULL, + `data_mapping` json DEFAULT NULL COMMENT '数据映射关系,格式为:{"default":{"1":"漏水","2":"漏电","3":"起火"},"status":{"1":"开门","2":"关门"}},默认只有default一个字段,预留多字段设计' +); \ 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 813faba..0a73421 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 cf79a62..025f49f 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 146f808..8c93e20 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/DeviceInfoMapper.java b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/DeviceInfoMapper.java index 47c1d62..8acdbe0 100644 --- a/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/DeviceInfoMapper.java +++ b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/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/data-center-business-dao/src/main/resources/mappers/auto/DeviceInfoMapper.xml b/data-center-business-dao/src/main/resources/mappers/auto/DeviceInfoMapper.xml index 6d8a5f0..06fb28f 100644 --- a/data-center-business-dao/src/main/resources/mappers/auto/DeviceInfoMapper.xml +++ b/data-center-business-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} +