Loading... ![微信截图_20240509154005.png](https://lil.cx/usr/uploads/2024/05/304952122.png) ![微信截图_20240509155159.png](https://lil.cx/usr/uploads/2024/05/4256250453.png) ``` CREATE TABLE `alarm_indicator_recording2` ( `id` varchar(64) NOT NULL COMMENT 'ID', `sn_num` varchar(10) DEFAULT NULL COMMENT '网关号', `num` varchar(64) DEFAULT NULL COMMENT '传感器位号', `indicator_name` varchar(255) DEFAULT NULL COMMENT '传感器名称', `indicator_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '传感器检测项', `indicator_factor` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '传感器检测因子', `indicator_num` decimal(20,15) DEFAULT NULL COMMENT '数值', `quality` tinyint(2) DEFAULT NULL COMMENT '设备质量 0 good 1 bad', `alarm_level` varchar(20) DEFAULT NULL COMMENT '报警级别', `alarm_location` varchar(255) DEFAULT NULL COMMENT '报警位置(报警的设备名称)', `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人', `create_time` datetime NOT NULL COMMENT '创建时间', `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新人', `update_time` datetime DEFAULT NULL COMMENT '更新时间', `del_flag` int(3) NOT NULL COMMENT '是否删除 0:未删除1:已删除', `description` varchar(255) DEFAULT NULL COMMENT '描述(设备设施类型+几级报警)' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='传感器管理表' PARTITION BY RANGE(TO_DAYS(create_time))( PARTITION p2404 VALUES LESS THAN (TO_DAYS('2024-04-01')), PARTITION p2405 VALUES LESS THAN (TO_DAYS('2024-05-01')), PARTITION p2406 VALUES LESS THAN (TO_DAYS('2024-06-01')), PARTITION p2407 VALUES LESS THAN (TO_DAYS('2024-07-01')), PARTITION p2408 VALUES LESS THAN (TO_DAYS('2024-08-01')), PARTITION p2409 VALUES LESS THAN (TO_DAYS('2024-09-01')), PARTITION p2410 VALUES LESS THAN (TO_DAYS('2024-10-01')), PARTITION p2411 VALUES LESS THAN (TO_DAYS('2024-11-01')), PARTITION p2412 VALUES LESS THAN (TO_DAYS('2024-12-01')), PARTITION p2501 VALUES LESS THAN (TO_DAYS('2025-01-01')), PARTITION p2502 VALUES LESS THAN (TO_DAYS('2025-02-01')), PARTITION p2503 VALUES LESS THAN (TO_DAYS('2025-03-01')), PARTITION p2504 VALUES LESS THAN (TO_DAYS('2025-04-01')), PARTITION p2505 VALUES LESS THAN (TO_DAYS('2025-05-01')), PARTITION p2506 VALUES LESS THAN (TO_DAYS('2025-06-01')), PARTITION p2507 VALUES LESS THAN (TO_DAYS('2025-07-01')), PARTITION p2508 VALUES LESS THAN (TO_DAYS('2025-08-01')), PARTITION p2509 VALUES LESS THAN (TO_DAYS('2025-09-01')), PARTITION p2510 VALUES LESS THAN (TO_DAYS('2025-10-01')), PARTITION p2511 VALUES LESS THAN (TO_DAYS('2025-11-01')), PARTITION p2512 VALUES LESS THAN (TO_DAYS('2025-12-01')), PARTITION p2601 VALUES LESS THAN (TO_DAYS('2026-01-01')), PARTITION p2602 VALUES LESS THAN (TO_DAYS('2026-02-01')), PARTITION p2603 VALUES LESS THAN (TO_DAYS('2026-03-01')), PARTITION p2604 VALUES LESS THAN (TO_DAYS('2026-04-01')), PARTITION p2605 VALUES LESS THAN (TO_DAYS('2026-05-01')), PARTITION p2606 VALUES LESS THAN (TO_DAYS('2026-06-01')), PARTITION p2607 VALUES LESS THAN (TO_DAYS('2026-07-01')), PARTITION p2608 VALUES LESS THAN (TO_DAYS('2026-08-01')), PARTITION p2609 VALUES LESS THAN (TO_DAYS('2026-09-01')), PARTITION p2610 VALUES LESS THAN (TO_DAYS('2026-10-01')), PARTITION p2611 VALUES LESS THAN (TO_DAYS('2026-11-01')), PARTITION p2612 VALUES LESS THAN (TO_DAYS('2026-12-01')), PARTITION p2701 VALUES LESS THAN (TO_DAYS('2027-01-01')), PARTITION p2702 VALUES LESS THAN (TO_DAYS('2027-02-01')), PARTITION p2703 VALUES LESS THAN (TO_DAYS('2027-03-01')), PARTITION p2704 VALUES LESS THAN (TO_DAYS('2027-04-01')), PARTITION p2705 VALUES LESS THAN (TO_DAYS('2027-05-01')), PARTITION p2706 VALUES LESS THAN (TO_DAYS('2027-06-01')), PARTITION p2707 VALUES LESS THAN (TO_DAYS('2027-07-01')), PARTITION p2708 VALUES LESS THAN (TO_DAYS('2027-08-01')), PARTITION p2709 VALUES LESS THAN (TO_DAYS('2027-09-01')), PARTITION p2710 VALUES LESS THAN (TO_DAYS('2027-10-01')), PARTITION p2711 VALUES LESS THAN (TO_DAYS('2027-11-01')), PARTITION p2712 VALUES LESS THAN (TO_DAYS('2027-12-01')), PARTITION p2801 VALUES LESS THAN (TO_DAYS('2028-01-01')), PARTITION p2802 VALUES LESS THAN (TO_DAYS('2028-02-01')), PARTITION p2803 VALUES LESS THAN (TO_DAYS('2028-03-01')), PARTITION p2804 VALUES LESS THAN (TO_DAYS('2028-04-01')), PARTITION p2805 VALUES LESS THAN (TO_DAYS('2028-05-01')), PARTITION p2806 VALUES LESS THAN (TO_DAYS('2028-06-01')), PARTITION p2807 VALUES LESS THAN (TO_DAYS('2028-07-01')), PARTITION p2808 VALUES LESS THAN (TO_DAYS('2028-08-01')), PARTITION p2809 VALUES LESS THAN (TO_DAYS('2028-09-01')), PARTITION p2810 VALUES LESS THAN (TO_DAYS('2028-10-01')), PARTITION p2811 VALUES LESS THAN (TO_DAYS('2028-11-01')), PARTITION p2812 VALUES LESS THAN (TO_DAYS('2028-12-01')), PARTITION p2901 VALUES LESS THAN (TO_DAYS('2029-01-01')), PARTITION p2902 VALUES LESS THAN (TO_DAYS('2029-02-01')), PARTITION p2903 VALUES LESS THAN (TO_DAYS('2029-03-01')), PARTITION p2904 VALUES LESS THAN (TO_DAYS('2029-04-01')), PARTITION p2905 VALUES LESS THAN (TO_DAYS('2029-05-01')), PARTITION p2906 VALUES LESS THAN (TO_DAYS('2029-06-01')), PARTITION p2907 VALUES LESS THAN (TO_DAYS('2029-07-01')), PARTITION p2908 VALUES LESS THAN (TO_DAYS('2029-08-01')), PARTITION p2909 VALUES LESS THAN (TO_DAYS('2029-09-01')), PARTITION p2910 VALUES LESS THAN (TO_DAYS('2029-10-01')), PARTITION p2911 VALUES LESS THAN (TO_DAYS('2029-11-01')), PARTITION p2912 VALUES LESS THAN (TO_DAYS('2029-12-01')), PARTITION p3001 VALUES LESS THAN (TO_DAYS('2030-01-01')), PARTITION p3002 VALUES LESS THAN (TO_DAYS('2030-02-01')), PARTITION p3003 VALUES LESS THAN (TO_DAYS('2030-03-01')), PARTITION p3004 VALUES LESS THAN (TO_DAYS('2030-04-01')), PARTITION p3005 VALUES LESS THAN (TO_DAYS('2030-05-01')), PARTITION p3006 VALUES LESS THAN (TO_DAYS('2030-06-01')), PARTITION p3007 VALUES LESS THAN (TO_DAYS('2030-07-01')), PARTITION p3008 VALUES LESS THAN (TO_DAYS('2030-08-01')), PARTITION p3009 VALUES LESS THAN (TO_DAYS('2030-09-01')), PARTITION p3010 VALUES LESS THAN (TO_DAYS('2030-10-01')), PARTITION p3011 VALUES LESS THAN (TO_DAYS('2030-11-01')), PARTITION p3012 VALUES LESS THAN (TO_DAYS('2030-12-01')), PARTITION p3101 VALUES LESS THAN (TO_DAYS('2031-01-01')), PARTITION p3102 VALUES LESS THAN (TO_DAYS('2031-02-01')), PARTITION p3103 VALUES LESS THAN (TO_DAYS('2031-03-01')), PARTITION p3104 VALUES LESS THAN (TO_DAYS('2031-04-01')), PARTITION p3105 VALUES LESS THAN (TO_DAYS('2031-05-01')), PARTITION p3106 VALUES LESS THAN (TO_DAYS('2031-06-01')), PARTITION p3107 VALUES LESS THAN (TO_DAYS('2031-07-01')), PARTITION p3108 VALUES LESS THAN (TO_DAYS('2031-08-01')), PARTITION p3109 VALUES LESS THAN (TO_DAYS('2031-09-01')), PARTITION p3110 VALUES LESS THAN (TO_DAYS('2031-10-01')), PARTITION p3111 VALUES LESS THAN (TO_DAYS('2031-11-01')), PARTITION p3112 VALUES LESS THAN (TO_DAYS('2031-12-01')), PARTITION p3201 VALUES LESS THAN (TO_DAYS('2032-01-01')), PARTITION p3202 VALUES LESS THAN (TO_DAYS('2032-02-01')), PARTITION p3203 VALUES LESS THAN (TO_DAYS('2032-03-01')), PARTITION p3204 VALUES LESS THAN (TO_DAYS('2032-04-01')), PARTITION p3205 VALUES LESS THAN (TO_DAYS('2032-05-01')), PARTITION p3206 VALUES LESS THAN (TO_DAYS('2032-06-01')), PARTITION p3207 VALUES LESS THAN (TO_DAYS('2032-07-01')), PARTITION p3208 VALUES LESS THAN (TO_DAYS('2032-08-01')), PARTITION p3209 VALUES LESS THAN (TO_DAYS('2032-09-01')), PARTITION p3210 VALUES LESS THAN (TO_DAYS('2032-10-01')), PARTITION p3211 VALUES LESS THAN (TO_DAYS('2032-11-01')), PARTITION p3212 VALUES LESS THAN (TO_DAYS('2032-12-01')), PARTITION p3301 VALUES LESS THAN (TO_DAYS('2033-01-01')), PARTITION p3302 VALUES LESS THAN (TO_DAYS('2033-02-01')), PARTITION p3303 VALUES LESS THAN (TO_DAYS('2033-03-01')), PARTITION p3304 VALUES LESS THAN (TO_DAYS('2033-04-01')), PARTITION p3305 VALUES LESS THAN (TO_DAYS('2033-05-01')), PARTITION p3306 VALUES LESS THAN (TO_DAYS('2033-06-01')), PARTITION p3307 VALUES LESS THAN (TO_DAYS('2033-07-01')), PARTITION p3308 VALUES LESS THAN (TO_DAYS('2033-08-01')), PARTITION p3309 VALUES LESS THAN (TO_DAYS('2033-09-01')), PARTITION p3310 VALUES LESS THAN (TO_DAYS('2033-10-01')), PARTITION p3311 VALUES LESS THAN (TO_DAYS('2033-11-01')), PARTITION p3312 VALUES LESS THAN (TO_DAYS('2033-12-01')), PARTITION p3401 VALUES LESS THAN (TO_DAYS('2034-01-01')), PARTITION p3402 VALUES LESS THAN (TO_DAYS('2034-02-01')), PARTITION p3403 VALUES LESS THAN (TO_DAYS('2034-03-01')), PARTITION p3404 VALUES LESS THAN (TO_DAYS('2034-04-01')), PARTITION p3405 VALUES LESS THAN (TO_DAYS('2034-05-01')), PARTITION p3406 VALUES LESS THAN (TO_DAYS('2034-06-01')), PARTITION p3407 VALUES LESS THAN (TO_DAYS('2034-07-01')), PARTITION p3408 VALUES LESS THAN (TO_DAYS('2034-08-01')), PARTITION p3409 VALUES LESS THAN (TO_DAYS('2034-09-01')), PARTITION p3410 VALUES LESS THAN (TO_DAYS('2034-10-01')), PARTITION p3411 VALUES LESS THAN (TO_DAYS('2034-11-01')), PARTITION p3412 VALUES LESS THAN (TO_DAYS('2034-12-01')), PARTITION p3501 VALUES LESS THAN (TO_DAYS('2035-01-01')), PARTITION p3502 VALUES LESS THAN (TO_DAYS('2035-02-01')), PARTITION p3503 VALUES LESS THAN (TO_DAYS('2035-03-01')), PARTITION p3504 VALUES LESS THAN (TO_DAYS('2035-04-01')), PARTITION p3505 VALUES LESS THAN (TO_DAYS('2035-05-01')), PARTITION p3506 VALUES LESS THAN (TO_DAYS('2035-06-01')), PARTITION p3507 VALUES LESS THAN (TO_DAYS('2035-07-01')), PARTITION p3508 VALUES LESS THAN (TO_DAYS('2035-08-01')), PARTITION p3509 VALUES LESS THAN (TO_DAYS('2035-09-01')), PARTITION p3510 VALUES LESS THAN (TO_DAYS('2035-10-01')), PARTITION p3511 VALUES LESS THAN (TO_DAYS('2035-11-01')), PARTITION p3512 VALUES LESS THAN (TO_DAYS('2035-12-01')), PARTITION p3601 VALUES LESS THAN (TO_DAYS('2036-01-01')), PARTITION p3602 VALUES LESS THAN (TO_DAYS('2036-02-01')), PARTITION p3603 VALUES LESS THAN (TO_DAYS('2036-03-01')), PARTITION p3604 VALUES LESS THAN (TO_DAYS('2036-04-01')), PARTITION p3605 VALUES LESS THAN (TO_DAYS('2036-05-01')), PARTITION p3606 VALUES LESS THAN (TO_DAYS('2036-06-01')), PARTITION p3607 VALUES LESS THAN (TO_DAYS('2036-07-01')), PARTITION p3608 VALUES LESS THAN (TO_DAYS('2036-08-01')), PARTITION p3609 VALUES LESS THAN (TO_DAYS('2036-09-01')), PARTITION p3610 VALUES LESS THAN (TO_DAYS('2036-10-01')), PARTITION p3611 VALUES LESS THAN (TO_DAYS('2036-11-01')), PARTITION p3612 VALUES LESS THAN (TO_DAYS('2036-12-01')), PARTITION p3701 VALUES LESS THAN (TO_DAYS('2037-01-01')), PARTITION p3702 VALUES LESS THAN (TO_DAYS('2037-02-01')), PARTITION p3703 VALUES LESS THAN (TO_DAYS('2037-03-01')), PARTITION p3704 VALUES LESS THAN (TO_DAYS('2037-04-01')), PARTITION p3705 VALUES LESS THAN (TO_DAYS('2037-05-01')), PARTITION p3706 VALUES LESS THAN (TO_DAYS('2037-06-01')), PARTITION p3707 VALUES LESS THAN (TO_DAYS('2037-07-01')), PARTITION p3708 VALUES LESS THAN (TO_DAYS('2037-08-01')), PARTITION p3709 VALUES LESS THAN (TO_DAYS('2037-09-01')), PARTITION p3710 VALUES LESS THAN (TO_DAYS('2037-10-01')), PARTITION p3711 VALUES LESS THAN (TO_DAYS('2037-11-01')), PARTITION p3712 VALUES LESS THAN (TO_DAYS('2037-12-01')), PARTITION p3801 VALUES LESS THAN (TO_DAYS('2038-01-01')), PARTITION p3802 VALUES LESS THAN (TO_DAYS('2038-02-01')), PARTITION p3803 VALUES LESS THAN (TO_DAYS('2038-03-01')), PARTITION p3804 VALUES LESS THAN (TO_DAYS('2038-04-01')), PARTITION p3805 VALUES LESS THAN (TO_DAYS('2038-05-01')), PARTITION p3806 VALUES LESS THAN (TO_DAYS('2038-06-01')), PARTITION p3807 VALUES LESS THAN (TO_DAYS('2038-07-01')), PARTITION p3808 VALUES LESS THAN (TO_DAYS('2038-08-01')), PARTITION p3809 VALUES LESS THAN (TO_DAYS('2038-09-01')), PARTITION p3810 VALUES LESS THAN (TO_DAYS('2038-10-01')), PARTITION p3811 VALUES LESS THAN (TO_DAYS('2038-11-01')), PARTITION p3812 VALUES LESS THAN (TO_DAYS('2038-12-01')), PARTITION p3901 VALUES LESS THAN (TO_DAYS('2039-01-01')), PARTITION p3902 VALUES LESS THAN (TO_DAYS('2039-02-01')), PARTITION p3903 VALUES LESS THAN (TO_DAYS('2039-03-01')), PARTITION p3904 VALUES LESS THAN (TO_DAYS('2039-04-01')), PARTITION p3905 VALUES LESS THAN (TO_DAYS('2039-05-01')), PARTITION p3906 VALUES LESS THAN (TO_DAYS('2039-06-01')), PARTITION p3907 VALUES LESS THAN (TO_DAYS('2039-07-01')), PARTITION p3908 VALUES LESS THAN (TO_DAYS('2039-08-01')), PARTITION p3909 VALUES LESS THAN (TO_DAYS('2039-09-01')), PARTITION p3910 VALUES LESS THAN (TO_DAYS('2039-10-01')), PARTITION p3911 VALUES LESS THAN (TO_DAYS('2039-11-01')), PARTITION p3912 VALUES LESS THAN (TO_DAYS('2039-12-01')), PARTITION p4001 VALUES LESS THAN (TO_DAYS('2040-01-01')), PARTITION p4002 VALUES LESS THAN (TO_DAYS('2040-02-01')), PARTITION p4003 VALUES LESS THAN (TO_DAYS('2040-03-01')), PARTITION p4004 VALUES LESS THAN (TO_DAYS('2040-04-01')), PARTITION p4005 VALUES LESS THAN (TO_DAYS('2040-05-01')), PARTITION p4006 VALUES LESS THAN (TO_DAYS('2040-06-01')), PARTITION p4007 VALUES LESS THAN (TO_DAYS('2040-07-01')), PARTITION p4008 VALUES LESS THAN (TO_DAYS('2040-08-01')), PARTITION p4009 VALUES LESS THAN (TO_DAYS('2040-09-01')), PARTITION p4010 VALUES LESS THAN (TO_DAYS('2040-10-01')), PARTITION p4011 VALUES LESS THAN (TO_DAYS('2040-11-01')), PARTITION p4012 VALUES LESS THAN (TO_DAYS('2040-12-01')) ); ``` 最后修改:2024 年 05 月 13 日 © 允许规范转载 打赏 赞赏作者 赞 如果觉得我的文章对你有用,请随意赞赏