1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.jiayue.biz.mapper.WindTowerInfoMapper">
- <resultMap type="WindTowerInfo" id="WindTowerInfoResult">
- <result property="id" column="id"/>
- <result property="name" column="name"/>
- <result property="modelNumber" column="model_number"/>
- <result property="equipmentNo" column="equipment_no"/>
- <result property="recorderNo" column="recorder_no"/>
- <result property="heights" column="heights"/>
- <result property="wdHeights" column="wd_heights"/>
- <result property="installationTime" column="installation_time"/>
- <result property="manufacturer" column="manufacturer"/>
- <result property="longitude" column="longitude"/>
- <result property="latitude" column="latitude"/>
- <result property="password" column="password"/>
- <result property="altitude" column="altitude"/>
- <result property="terrainComplexity" column="terrain_complexity"/>
- </resultMap>
- <!--建塔时新建该塔对应的测风塔子表-->
- <update id="createTable" parameterType="string">
- CREATE TABLE ${tableName}
- (
- `id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键ID',
- `parent_id` varchar(64) DEFAULT NULL COMMENT '父表ID',
- `layer_height` varchar(64) DEFAULT NULL COMMENT '层高',
- `ws_inst` decimal(13, 2) NULL DEFAULT NULL COMMENT '风速瞬时值(m/s)',
- `ws_max` decimal(13, 2) NULL DEFAULT NULL COMMENT '风速最大值(m/s)',
- `ws_min` decimal(13, 2) NULL DEFAULT NULL COMMENT '风速最小值(m/s)',
- `ws_ave` decimal(13, 2) NULL DEFAULT NULL COMMENT '风速平均值(m/s)',
- `ws_sta` decimal(13, 2) NULL DEFAULT NULL COMMENT '风速标准差(m/s)',
- `wd_inst` decimal(13, 2) NULL DEFAULT NULL COMMENT '风向瞬时值(°)',
- `wd_max` decimal(13, 2) NULL DEFAULT NULL COMMENT '风向最大值(°)',
- `wd_min` decimal(13, 2) NULL DEFAULT NULL COMMENT '风向最小值(°)',
- `wd_ave` decimal(13, 2) NULL DEFAULT NULL COMMENT '风向平均值(°)',
- `wd_sta` decimal(13, 2) NULL DEFAULT NULL COMMENT '风向标准差(°)',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测风塔数据子表' ROW_FORMAT = Dynamic;
- </update>
- <!--建塔时新建该塔对应的测风塔父表-->
- <update id="createParentTable" parameterType="string">
- CREATE TABLE ${parentTableName}
- (
- `id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键ID',
- `equipment_id` varchar(64) DEFAULT NULL COMMENT '设备主键ID',
- `time` datetime DEFAULT NULL COMMENT '时间',
- `t_inst` decimal(13, 2) NULL DEFAULT NULL COMMENT '温度瞬时值(℃)',
- `t_max` decimal(13, 2) NULL DEFAULT NULL COMMENT '温度最大值(℃)',
- `t_min` decimal(13, 2) NULL DEFAULT NULL COMMENT '温度最小值(℃)',
- `t_ave` decimal(13, 2) NULL DEFAULT NULL COMMENT '温度平均值(℃)',
- `t_sta` decimal(13, 2) NULL DEFAULT NULL COMMENT '温度标准差(℃)',
- `rh_inst` decimal(13, 2) NULL DEFAULT NULL COMMENT '湿度瞬时值(%)',
- `rh_max` decimal(13, 2) NULL DEFAULT NULL COMMENT '湿度最大值(%)',
- `rh_min` decimal(13, 2) NULL DEFAULT NULL COMMENT '湿度最小值(%)',
- `rh_ave` decimal(13, 2) NULL DEFAULT NULL COMMENT '湿度平均值(%)',
- `rh_sta` decimal(13, 2) NULL DEFAULT NULL COMMENT '湿度标准差(%)',
- `pa_inst` decimal(13, 2) NULL DEFAULT NULL COMMENT '气压瞬时值(hPa)',
- `pa_max` decimal(13, 2) NULL DEFAULT NULL COMMENT '气压最大值(hPa)',
- `pa_min` decimal(13, 2) NULL DEFAULT NULL COMMENT '气压最小值(hPa)',
- `pa_ave` decimal(13, 2) NULL DEFAULT NULL COMMENT '气压平均值(hPa)',
- `pa_sta` decimal(13, 2) NULL DEFAULT NULL COMMENT '气压标准差(hPa)',
- `air_density` decimal(13, 2) NULL DEFAULT NULL COMMENT '空气密度Kg/m³',
- `abnormal_data` varchar(16) NULL DEFAULT NULL COMMENT '数据是否异常',
- `abnormal_type` text NULL DEFAULT NULL COMMENT '异常数据类型',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测风塔数据子表' ROW_FORMAT = Dynamic;
- </update>
- <!--建塔时新建该塔对应的数据统计表-->
- <update id="createCalculationTable" parameterType="string">
- CREATE TABLE ${calculationTableName}
- (
- `id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键ID',
- `equipment_id` varchar(64) NOT NULL COMMENT '父表ID',
- `eb_id` varchar(64) NOT NULL COMMENT '数据类型id',
- `time` datetime NOT NULL COMMENT '时间',
- `value` decimal(64, 4) NULL DEFAULT NULL COMMENT '数值',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '统计数据子表' ROW_FORMAT = Dynamic;
- </update>
- <!--删除塔时删除该塔对应的数据统计表-->
- <update id="deleteCalculationTable">
- DROP TABLE ${calculationTableName}
- </update>
- <!--删除塔时删除该塔对应的测风塔子表-->
- <update id="deleteTable">
- DROP TABLE ${tableName}
- </update>
- <!--删除塔时删除该塔对应的测风塔父表-->
- <update id="deleteParentTable">
- DROP TABLE ${parentTableName}
- </update>
- </mapper>
|