2022年5月24日14:34:18 增加初始化时创建数据库功能

This commit is contained in:
wxy001
2022-05-24 14:34:39 +08:00
parent f783503b51
commit 6c58e34bec
5 changed files with 68 additions and 74 deletions

View File

@@ -1,40 +0,0 @@
<?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.ruoyi.iot.tdengine.dao.DatabaseDAO">
<!-- 创建数据库-->
<update id="createDB" parameterType="java.lang.String">
create database if not exists ${dbName};
</update>
<!-- 删除数据库-->
<update id="dropDatabase" parameterType="java.lang.String">
DROP database if exists ${dbName};
</update>
<!-- 使用数据库-->
<update id="useDatabase" parameterType="java.lang.String">
use ${dbName};
</update>
<update id="createTable">
create stable if not exists ${tableName}
(ts timestamp,
log_id BIGINT,
identity NCHAR(100),
log_type NCHAR(20),
log_value NCHAR(100),
device_id BIGINT,
device_name NCHAR(100),
serial_number NCHAR(100),
is_monitor int,
create_by NCHAR(100),
create_time timestamp,
remark NCHAR(1000),
);
</update>
</mapper>

View File

@@ -42,7 +42,6 @@
</update>
<update id="createSTable">
create STABLE if not exists ${database}.device_log
(
ts timestamp,