提交 5454f092 编写于 作者: Z zyyang

change

上级 c6c7ab3b
......@@ -2,14 +2,20 @@ package com.taosdata.example.mybatisplusdemo.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.taosdata.example.mybatisplusdemo.domain.Temperature;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
public interface TemperatureMapper extends BaseMapper<Temperature> {
@Update("CREATE TABLE if not exists temperature(ts timestamp, temperature float) tags(location nchar(64), tbIndex int)")
int createSuperTable();
@Update("create table #{tbName} using temperature tags( #{location} )")
int createTable(String tbName, String location);
@Update("drop table if exists temperature")
void dropSuperTable();
@Insert("insert into t${tbIndex}(ts, temperature) values(ts, temperature)")
int insertOne(Temperature one);
}
<?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.taosdata.example.mybatisplusdemo.mapper.TemperatureMapper">
<update id="createSuperTable">
CREATE TABLE if not exists temperature(ts timestamp, temperature float) tags(location nchar(64), tbIndex int);
</update>
<update id="createTable" parameterType="java.lang.String">
create table #{tbname} using temperature tags( #{location} );
</update>
<update id="dropSuperTable">
drop table if exists temperature
</update>
<insert id="insertOne" parameterType="com.taosdata.example.mybatisplusdemo.domain.Temperature">
insert into t${tbIndex}(ts, temperature) values(ts, temperature)
</insert>
</mapper>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册