add sql file
This commit is contained in:
101
server/OldPeopleHome/.idea/workspace.xml
generated
101
server/OldPeopleHome/.idea/workspace.xml
generated
@@ -7,8 +7,8 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="6bd3ae69-d707-4556-9602-b04e8d55fbdd" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/main/sql/add_table.sql" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../README.md" beforeDir="false" afterPath="$PROJECT_DIR$/../README.md" afterDir="false" />
|
||||
</list>
|
||||
<ignored path="$PROJECT_DIR$/target/" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
@@ -32,7 +32,7 @@
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/oldpeoplehome/web/HeartRateController.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="184">
|
||||
<caret line="57" column="8" lean-forward="true" selection-start-line="57" selection-start-column="8" selection-end-line="57" selection-end-column="66" />
|
||||
<caret line="57" column="8" selection-start-line="57" selection-start-column="8" selection-end-line="57" selection-end-column="66" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
@@ -44,19 +44,7 @@
|
||||
<entry file="file://$PROJECT_DIR$/src/main/resources/mapper/RoomStateDao.xml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="151">
|
||||
<caret line="20" column="57" lean-forward="true" selection-start-line="20" selection-start-column="57" selection-end-line="20" selection-end-column="83" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/oldpeoplehome/entity/RoomState.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="99">
|
||||
<caret line="45" column="4" selection-start-line="45" selection-start-column="4" selection-end-line="45" selection-end-column="65" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
<caret line="20" column="57" selection-start-line="20" selection-start-column="57" selection-end-line="20" selection-end-column="83" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -65,7 +53,7 @@
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/oldpeoplehome/entity/HeartRate.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="187">
|
||||
<caret line="21" column="44" lean-forward="true" selection-start-line="21" selection-start-column="44" selection-end-line="21" selection-end-column="44" />
|
||||
<caret line="21" column="44" selection-start-line="21" selection-start-column="44" selection-end-line="21" selection-end-column="44" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
@@ -89,7 +77,7 @@
|
||||
<entry file="file://$PROJECT_DIR$/src/main/webapp/index.jsp">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="99">
|
||||
<caret line="3" column="7" lean-forward="true" selection-start-line="3" selection-start-column="7" selection-end-line="3" selection-end-column="7" />
|
||||
<caret line="3" column="7" selection-start-line="3" selection-start-column="7" selection-end-line="3" selection-end-column="7" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -110,11 +98,20 @@
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/pom.xml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-5624">
|
||||
<caret line="27" column="25" lean-forward="true" selection-start-line="27" selection-start-column="25" selection-end-line="27" selection-end-column="25" />
|
||||
<caret line="27" column="25" selection-start-line="27" selection-start-column="25" selection-end-line="27" selection-end-column="25" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/sql/add_table.sql">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="132">
|
||||
<caret line="31" column="21" lean-forward="true" selection-start-line="31" selection-start-column="21" selection-end-line="31" selection-end-column="21" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -145,7 +142,6 @@
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/src/main/java/com/oldpeoplehome/dao/ChildDao.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/com/oldpeoplehome/service/ChildService.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/com/oldpeoplehome/service/impl/ChildServiceImpl.java" />
|
||||
<option value="$PROJECT_DIR$/src/test/java/com/oldpeoplehome/service/ParentServiceTest.java" />
|
||||
@@ -196,6 +192,7 @@
|
||||
<option value="$PROJECT_DIR$/src/main/resources/mapper/RoomStateDao.xml" />
|
||||
<option value="$PROJECT_DIR$/src/main/resources/mapper/HeartRateDao.xml" />
|
||||
<option value="$PROJECT_DIR$/src/test/java/com/oldpeoplehome/service/HeartRateServiceTest.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/sql/add_table.sql" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
@@ -250,30 +247,7 @@
|
||||
<item name="OldPeopleHome" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="main" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="resources" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="OldPeopleHome" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="OldPeopleHome" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="main" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="resources" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="mapper" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="OldPeopleHome" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="OldPeopleHome" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="main" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="webapp" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="OldPeopleHome" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="OldPeopleHome" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="main" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="webapp" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="WEB-INF" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="sql" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="OldPeopleHome" type="b2602c69:ProjectViewProjectNode" />
|
||||
@@ -290,7 +264,7 @@
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="aspect.path.notification.shown" value="true" />
|
||||
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1566541722623" />
|
||||
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1566547500231" />
|
||||
<property name="last_opened_file_path" value="E:/新建文件夹 (2)/TestDemo" />
|
||||
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
|
||||
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
|
||||
@@ -516,7 +490,7 @@
|
||||
<workItem from="1566531222223" duration="605000" />
|
||||
<workItem from="1566533277465" duration="598000" />
|
||||
<workItem from="1566536292540" duration="37000" />
|
||||
<workItem from="1566536413587" duration="4862000" />
|
||||
<workItem from="1566536413587" duration="6100000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
@@ -553,7 +527,7 @@
|
||||
</history-entry>
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="115880000" />
|
||||
<option name="totallyTimeSpent" value="117118000" />
|
||||
</component>
|
||||
<component name="TodoView">
|
||||
<todo-panel id="selected-file">
|
||||
@@ -642,22 +616,6 @@
|
||||
<option name="version" value="1" />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/oldpeoplehome/service/impl/ChildParentServiceImpl.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="121">
|
||||
<caret line="34" column="43" lean-forward="true" selection-start-line="34" selection-start-column="43" selection-end-line="34" selection-end-column="43" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
<element signature="e#443#444#0" expanded="true" />
|
||||
<element signature="e#470#471#0" expanded="true" />
|
||||
<element signature="e#538#539#0" expanded="true" />
|
||||
<element signature="e#565#566#0" expanded="true" />
|
||||
<element signature="e#927#928#0" expanded="true" />
|
||||
<element signature="e#966#967#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/oldpeoplehome/web/RoomController.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="39">
|
||||
@@ -1096,14 +1054,14 @@
|
||||
<entry file="file://$PROJECT_DIR$/src/main/resources/mapper/RoomStateDao.xml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="151">
|
||||
<caret line="20" column="57" lean-forward="true" selection-start-line="20" selection-start-column="57" selection-end-line="20" selection-end-column="83" />
|
||||
<caret line="20" column="57" selection-start-line="20" selection-start-column="57" selection-end-line="20" selection-end-column="83" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/oldpeoplehome/web/HeartRateController.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="184">
|
||||
<caret line="57" column="8" lean-forward="true" selection-start-line="57" selection-start-column="8" selection-end-line="57" selection-end-column="66" />
|
||||
<caret line="57" column="8" selection-start-line="57" selection-start-column="8" selection-end-line="57" selection-end-column="66" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
@@ -1113,7 +1071,7 @@
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/oldpeoplehome/entity/HeartRate.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="187">
|
||||
<caret line="21" column="44" lean-forward="true" selection-start-line="21" selection-start-column="44" selection-end-line="21" selection-end-column="44" />
|
||||
<caret line="21" column="44" selection-start-line="21" selection-start-column="44" selection-end-line="21" selection-end-column="44" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
@@ -1133,7 +1091,7 @@
|
||||
<entry file="file://$PROJECT_DIR$/src/main/webapp/index.jsp">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="99">
|
||||
<caret line="3" column="7" lean-forward="true" selection-start-line="3" selection-start-column="7" selection-end-line="3" selection-end-column="7" />
|
||||
<caret line="3" column="7" selection-start-line="3" selection-start-column="7" selection-end-line="3" selection-end-column="7" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -1152,7 +1110,14 @@
|
||||
<entry file="file://$PROJECT_DIR$/pom.xml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-5624">
|
||||
<caret line="27" column="25" lean-forward="true" selection-start-line="27" selection-start-column="25" selection-end-line="27" selection-end-column="25" />
|
||||
<caret line="27" column="25" selection-start-line="27" selection-start-column="25" selection-end-line="27" selection-end-column="25" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/sql/add_table.sql">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="132">
|
||||
<caret line="31" column="21" lean-forward="true" selection-start-line="31" selection-start-column="21" selection-end-line="31" selection-end-column="21" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
|
||||
94
server/OldPeopleHome/src/main/sql/add_table.sql
Normal file
94
server/OldPeopleHome/src/main/sql/add_table.sql
Normal file
@@ -0,0 +1,94 @@
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
DROP TABLE IF EXISTS `ssmtest`.`child`;
|
||||
DROP TABLE IF EXISTS `ssmtest`.`cp`;
|
||||
DROP TABLE IF EXISTS `ssmtest`.`heartrate`;
|
||||
DROP TABLE IF EXISTS `ssmtest`.`motion`;
|
||||
DROP TABLE IF EXISTS `ssmtest`.`parent`;
|
||||
DROP TABLE IF EXISTS `ssmtest`.`room`;
|
||||
DROP TABLE IF EXISTS `ssmtest`.`rstate`;
|
||||
DROP TABLE IF EXISTS `ssmtest`.`sleep`;
|
||||
CREATE TABLE `parent` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '老人id',
|
||||
`longid` char(18) NOT NULL COMMENT '老人身份证',
|
||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '姓名',
|
||||
`sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '性别',
|
||||
`account` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '账号',
|
||||
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '密码',
|
||||
`height` double DEFAULT NULL COMMENT '身高',
|
||||
`weight` double DEFAULT NULL COMMENT '体重',
|
||||
`birth` date NOT NULL COMMENT '生日',
|
||||
`phone` char(11) DEFAULT NULL COMMENT '电话号码',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `index_longid` (`longid`) USING BTREE,
|
||||
KEY `index_name` (`name`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
|
||||
CREATE TABLE `room` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '房间id',
|
||||
`location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '房间位置',
|
||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '房间名称(房间号)',
|
||||
`pid` bigint(20) DEFAULT NULL COMMENT '房间住人id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `index` (`pid`) USING BTREE,
|
||||
CONSTRAINT `room_fk_1` FOREIGN KEY (`pid`) REFERENCES `parent` (`id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
|
||||
|
||||
CREATE TABLE `child` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`longid` char(18) NOT NULL COMMENT '身份证',
|
||||
`name` varchar(255) NOT NULL COMMENT '姓名',
|
||||
`sex` varchar(255) NOT NULL COMMENT '性别',
|
||||
`account` varchar(255) NOT NULL COMMENT '账号',
|
||||
`password` varchar(255) NOT NULL COMMENT '密码',
|
||||
`phone` varchar(255) NOT NULL COMMENT '电话',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `index _longid` (`longid`) USING BTREE,
|
||||
KEY `index_name` (`name`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
CREATE TABLE `cp` (
|
||||
`pid` bigint(20) DEFAULT NULL,
|
||||
`cid` bigint(20) DEFAULT NULL,
|
||||
`relation` varchar(255) DEFAULT NULL,
|
||||
KEY `index_pid` (`pid`) USING BTREE,
|
||||
KEY `index_cid` (`cid`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
CREATE TABLE `heartrate` (
|
||||
`pid` bigint(20) DEFAULT NULL,
|
||||
`time` datetime DEFAULT NULL,
|
||||
`rate` double DEFAULT NULL,
|
||||
KEY `index_pid` (`pid`) USING BTREE,
|
||||
KEY `time` (`time`) USING BTREE,
|
||||
CONSTRAINT `fk_pid2` FOREIGN KEY (`pid`) REFERENCES `parent` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
CREATE TABLE `motion` (
|
||||
`pid` bigint(20) DEFAULT NULL COMMENT 'parent id',
|
||||
`date` date DEFAULT NULL COMMENT '当日日期',
|
||||
`count` bigint(20) DEFAULT NULL COMMENT '步数',
|
||||
`distance` double DEFAULT NULL COMMENT '距离',
|
||||
`time` time DEFAULT NULL COMMENT '运动时长',
|
||||
KEY `index_date` (`date`) USING BTREE,
|
||||
KEY `index_pid` (`pid`) USING BTREE,
|
||||
CONSTRAINT `fk_pid` FOREIGN KEY (`pid`) REFERENCES `parent` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
CREATE TABLE `rstate` (
|
||||
`rid` int(11) DEFAULT NULL,
|
||||
`time` timestamp NULL DEFAULT NULL,
|
||||
`temperature` double DEFAULT NULL,
|
||||
`humidity` double DEFAULT NULL,
|
||||
`isin` int(11) DEFAULT NULL,
|
||||
KEY `index_rid` (`rid`) USING BTREE,
|
||||
KEY `index_time` (`time`) USING BTREE,
|
||||
CONSTRAINT `fk_rid1` FOREIGN KEY (`rid`) REFERENCES `room` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
CREATE TABLE `sleep` (
|
||||
`pid` bigint(20) DEFAULT NULL COMMENT 'parent id',
|
||||
`date` date DEFAULT NULL COMMENT '当天日期',
|
||||
`deep` time DEFAULT NULL COMMENT '深睡时长',
|
||||
`light` time DEFAULT NULL COMMENT '浅睡时长',
|
||||
`awake` time DEFAULT NULL COMMENT '清醒时长',
|
||||
KEY `index_date` (`date`) USING BTREE,
|
||||
KEY `index_pid` (`pid`) USING BTREE,
|
||||
KEY `index_pid_date` (`pid`,`date`) USING BTREE,
|
||||
CONSTRAINT `fk_pid1` FOREIGN KEY (`pid`) REFERENCES `parent` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
Reference in New Issue
Block a user