新写一个小区统计业主签名的系统

CREATE TABLE `user` ( 
   `id` int(10) NOT NULL AUTO_INCREMENT, 
   `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '账号', 
   `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '密码', 
   `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '昵称', 
   `roles` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '身份', 
   `creationdt` datetime DEFAULT NULL, 
   `updatedt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 
   `forbidden` int(11) NOT NULL DEFAULT '0', 
   PRIMARY KEY (`id`) USING BTREE 
 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci






CREATE TABLE `user` ( 
   `id` int(10) NOT NULL AUTO_INCREMENT, 
   `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '账号', 
   `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '密码', 
   `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '昵称', 
   `roles` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '身份', 
   `creationdt` datetime DEFAULT NULL, 
   `updatedt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 
   `forbidden` int(11) NOT NULL DEFAULT '0', 
   PRIMARY KEY (`id`) USING BTREE 
 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 
 

 

 

DELIMITER $$
CREATE PROCEDURE addRoom4room4(IN in_count INT)
BEGIN
    DECLARE COUNT INT DEFAULT 301;
    while COUNT < in_count DO
    insert room(buildingID,cubeID,RoomNUmber) values(4,1,COUNT),(7,1,COUNT+1),(4,1,COUNT+2),(4,2,COUNT+3),(4,2,COUNT+4),(4,2,COUNT+5),(4,3,COUNT+6),(4,3,COUNT+7),(4,3,COUNT+8);
    SET COUNT = COUNT +100;
    END WHILE;
    SELECT COUNT;
END $$
DELIMITER ;


CALL addRoom4room73(1900);

 

posted @ 2021-04-08 15:59  巴黎爱工作  阅读(84)  评论(0编辑  收藏  举报