wenhua.zhou 2 years ago
parent 1aaf188daa
commit 09c1251b33

7
.gitignore vendored

@ -20,7 +20,14 @@
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
.classpath
.project
.settings
target
.idea
*.iml

@ -1,27 +0,0 @@
#端口号
server:
port: 8098
#数据源配置
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/cac?characterEncoding=utf-8&serverTimezone=UTC
username: root
password: root
#sql:
#init:
#指定脚本文件位置
#schema-locations: classpath:user.sql
#初始化方式
#mode: always
#设置数据源类型C
type: com.alibaba.druid.pool.DruidDataSource
mybatis:
configuration:
map-underscore-to-camel-case: true
#mybatis:
#指定mybatis配置文件的位置
#config-location: classpath:mybatis/mybatis-config.xml
#指定映射文件的位置
mapper-locations: classpath:mybatis/mapper/*.xml

@ -1,62 +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">
<!--MyBatis的映射文件 编写sql-->
<!--一个数据表对应一个实体类一个实体类对应一个mapper映射文件-->
<mapper namespace="com.xydl.mapper.EaifMapper">
<!-- <resultMap id="EiaResultMap" type="com.xydl.model.Eia">-->
<!-- <result column="SubDeviceID" property="subDeviceID"/>-->
<!-- <result column="sensorid" property="sensorId"/>-->
<!-- <result column="capturetime" property="captureTime"/>-->
<!-- <result column="maxtemp" property="maxTemp"/>-->
<!-- <result column="mintemp" property="minTemp"/>-->
<!-- <result column="avgtemp" property="avgTemp"/>-->
<!-- <result column="Phase" property="phase"/>-->
<!-- </resultMap>-->
<select id="getEaif" resultType="com.xydl.model.Eaif">
SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.capturetime, t1.maxtemp, t1.mintemp, t1.avgtemp, t2.phase
FROM `data_eaif_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid
WHERE t1.eqmid=165 AND t1.capturetime>'2017-01-17 16:00:00' ORDER BY t1.capturetime LIMIT 10
</select>
<!--int insertEmp(Employee employee);-->
<insert id="insertEmp">
insert into employee values (#{id},#{lastName},#{email},#{gender},#{department.id})
</insert>
<update id="update">
update employee
<set>
<if test="employee.lastName!=null">
last_name=#{employee.lastName},
</if>
<if test="employee.email!=null">
email=#{employee.email},
</if>
<if test="employee.gender!=null">
gender=#{employee.gender},
</if>
<if test="employee.department!=null">
d_id=#{employee.department.id}
</if>
</set>
where id = #{id}
</update>
<!--int deleteEmpById(Integer id);-->
<delete id="deleteEmpById">
delete from employee where id=#{id}
</delete>
</mapper>

@ -1,69 +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">
<!--MyBatis的映射文件 编写sql-->
<!--一个数据表对应一个实体类一个实体类对应一个mapper映射文件-->
<mapper namespace="com.xydl.mapper.EiaMapper">
<!-- <resultMap id="EiaResultMap" type="com.xydl.model.Eia">-->
<!-- <result column="SubDeviceID" property="subDeviceID"/>-->
<!-- <result column="sensorid" property="sensorId"/>-->
<!-- <result column="capturetime" property="captureTime"/>-->
<!-- <result column="maxtemp" property="maxTemp"/>-->
<!-- <result column="mintemp" property="minTemp"/>-->
<!-- <result column="avgtemp" property="avgTemp"/>-->
<!-- <result column="Phase" property="phase"/>-->
<!-- </resultMap>-->
<!-- <select id="getEia" resultType="com.xydl.model.Eia">-->
<!-- SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.capturetime,t1.maxtemp,t1.mintemp,t1.avgtemp,t2.`Phase`-->
<!-- FROM `data_eaif_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid-->
<!-- WHERE t1.eqmid=394 AND t1.capturetime>'2019-12-19 04:55:31' ORDER BY t1.capturetime LIMIT 1000-->
<!-- </select>-->
<select id="getEia" resultType="com.xydl.model.Eia">
SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.d_time, t1.d_ct_1, t2.phase
FROM `data_eia_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid
WHERE t1.eqmid=152 AND t1.d_time>'2017-01-17 16:00:00' ORDER BY t1.d_time LIMIT 10
</select>
<!--int insertEmp(Employee employee);-->
<insert id="insertEmp">
insert into employee values (#{id},#{lastName},#{email},#{gender},#{department.id})
</insert>
<update id="update">
update employee
<set>
<if test="employee.lastName!=null">
last_name=#{employee.lastName},
</if>
<if test="employee.email!=null">
email=#{employee.email},
</if>
<if test="employee.gender!=null">
gender=#{employee.gender},
</if>
<if test="employee.department!=null">
d_id=#{employee.department.id}
</if>
</set>
where id = #{id}
</update>
<!--int deleteEmpById(Integer id);-->
<delete id="deleteEmpById">
delete from employee where id=#{id}
</delete>
</mapper>

@ -1,86 +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">
<!--MyBatis的映射文件 编写sql-->
<!--一个数据表对应一个实体类一个实体类对应一个mapper映射文件-->
<mapper namespace="com.xydl.mapper.EpaMapper">
<!-- <resultMap id="EiaResultMap" type="com.xydl.model.Eia">-->
<!-- <result column="SubDeviceID" property="subDeviceID"/>-->
<!-- <result column="sensorid" property="sensorId"/>-->
<!-- <result column="capturetime" property="captureTime"/>-->
<!-- <result column="maxtemp" property="maxTemp"/>-->
<!-- <result column="mintemp" property="minTemp"/>-->
<!-- <result column="avgtemp" property="avgTemp"/>-->
<!-- <result column="Phase" property="phase"/>-->
<!-- </resultMap>-->
<!-- <select id="getEia" resultType="com.xydl.model.Eia">-->
<!-- SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.capturetime,t1.maxtemp,t1.mintemp,t1.avgtemp,t2.`Phase`-->
<!-- FROM `data_eaif_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid-->
<!-- WHERE t1.eqmid=394 AND t1.capturetime>'2019-12-19 04:55:31' ORDER BY t1.capturetime LIMIT 1000-->
<!-- </select>-->
<select id="getEpa" resultType="com.xydl.model.Epa">
SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.d_time,t1.h2ppm,t1.ch4ppm,t1.c2h6ppm,t1.c2h4ppm,t1.c2h2ppm,t1.coppm,t1.co2ppm,t1.o2ppm,t1.n2ppm,t1.totalhydrocarbon,t1.gaspress,t1.h2oppm,t2.`Phase`
FROM `data_epa_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid
WHERE t1.eqmid=#{devid} AND t1.d_time>(select DISTINCT syrec.field_val2 from sync_records as syrec, sync_tables_info as sytab, data_epa_h as epa
where sytab.client_id = 10 and syrec.client_id = sytab.client_id and syrec.table_name = sytab.table_name and epa.eqmid = syrec.devid_val and epa.eqmid = #{devid})
ORDER BY t1.d_time LIMIT 1000
</select>
<select id="getData" resultType="com.xydl.model.SuperModel">
${value}
</select>
<select id="getEqmidsByTableName" resultType="java.lang.Integer">
select DISTINCT tableName.eqmid from ${tableName} as tableName
</select>
<select id="getTableNamesBySyncTable" resultType="java.lang.String">
select DISTINCT syncTableName.table_name from ${sycTableName} as syncTableName
</select>
<select id="getSqlBySyncTable" resultType="java.lang.String">
select syncTable.sql from ${syncTable} as syncTable where table_name=#{tableName}
</select>
<!--int insertEmp(Employee employee);-->
<insert id="insertEmp">
insert into employee values (#{id},#{lastName},#{email},#{gender},#{department.id})
</insert>
<update id="update">
update employee
<set>
<if test="employee.lastName!=null">
last_name=#{employee.lastName},
</if>
<if test="employee.email!=null">
email=#{employee.email},
</if>
<if test="employee.gender!=null">
gender=#{employee.gender},
</if>
<if test="employee.department!=null">
d_id=#{employee.department.id}
</if>
</set>
where id = #{id}
</update>
<!--int deleteEmpById(Integer id);-->
<delete id="deleteEmpById">
delete from employee where id=#{id}
</delete>
</mapper>

@ -1,69 +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">
<!--MyBatis的映射文件 编写sql-->
<!--一个数据表对应一个实体类一个实体类对应一个mapper映射文件-->
<mapper namespace="com.xydl.mapper.EtpMapper">
<!-- <resultMap id="EiaResultMap" type="com.xydl.model.Eia">-->
<!-- <result column="SubDeviceID" property="subDeviceID"/>-->
<!-- <result column="sensorid" property="sensorId"/>-->
<!-- <result column="capturetime" property="captureTime"/>-->
<!-- <result column="maxtemp" property="maxTemp"/>-->
<!-- <result column="mintemp" property="minTemp"/>-->
<!-- <result column="avgtemp" property="avgTemp"/>-->
<!-- <result column="Phase" property="phase"/>-->
<!-- </resultMap>-->
<!-- <select id="getEia" resultType="com.xydl.model.Eia">-->
<!-- SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.capturetime,t1.maxtemp,t1.mintemp,t1.avgtemp,t2.`Phase`-->
<!-- FROM `data_eaif_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid-->
<!-- WHERE t1.eqmid=394 AND t1.capturetime>'2019-12-19 04:55:31' ORDER BY t1.capturetime LIMIT 1000-->
<!-- </select>-->
<select id="getEtp" resultType="com.xydl.model.Etp">
SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.d_time,t1.t1
FROM `data_etp_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid
WHERE t1.eqmid=160 AND t1.d_time>'2017-01-17 16:00:00' ORDER BY t1.d_time LIMIT 10
</select>
<!--int insertEmp(Employee employee);-->
<insert id="insertEmp">
insert into employee values (#{id},#{lastName},#{email},#{gender},#{department.id})
</insert>
<update id="update">
update employee
<set>
<if test="employee.lastName!=null">
last_name=#{employee.lastName},
</if>
<if test="employee.email!=null">
email=#{employee.email},
</if>
<if test="employee.gender!=null">
gender=#{employee.gender},
</if>
<if test="employee.department!=null">
d_id=#{employee.department.id}
</if>
</set>
where id = #{id}
</update>
<!--int deleteEmpById(Integer id);-->
<delete id="deleteEmpById">
delete from employee where id=#{id}
</delete>
</mapper>

@ -1,70 +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">
<!--MyBatis的映射文件 编写sql-->
<!--一个数据表对应一个实体类一个实体类对应一个mapper映射文件-->
<mapper namespace="com.xydl.mapper.MicMapper">
<!-- <resultMap id="EiaResultMap" type="com.xydl.model.Eia">-->
<!-- <result column="SubDeviceID" property="subDeviceID"/>-->
<!-- <result column="sensorid" property="sensorId"/>-->
<!-- <result column="capturetime" property="captureTime"/>-->
<!-- <result column="maxtemp" property="maxTemp"/>-->
<!-- <result column="mintemp" property="minTemp"/>-->
<!-- <result column="avgtemp" property="avgTemp"/>-->
<!-- <result column="Phase" property="phase"/>-->
<!-- </resultMap>-->
<!-- <select id="getEia" resultType="com.xydl.model.Eia">-->
<!-- SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.capturetime,t1.maxtemp,t1.mintemp,t1.avgtemp,t2.`Phase`-->
<!-- FROM `data_eaif_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid-->
<!-- WHERE t1.eqmid=394 AND t1.capturetime>'2019-12-19 04:55:31' ORDER BY t1.capturetime LIMIT 1000-->
<!-- </select>-->
<select id="getMicroclimate" resultType="com.xydl.model.Microclimate">
SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.d_time, t1.envtmp, t1.envpres, t1.envhum, t1.rnfll, t2.phase
FROM `data_microclimate_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid
WHERE t1.eqmid=152 AND t1.d_time>'2017-01-17 16:00:00' ORDER BY t1.d_time LIMIT 10
</select>
<!--int insertEmp(Employee employee);-->
<insert id="insertEmp">
insert into employee values (#{id},#{lastName},#{email},#{gender},#{department.id})
</insert>
<update id="update">
update employee
<set>
<if test="employee.lastName!=null">
last_name=#{employee.lastName},
</if>
<if test="employee.email!=null">
email=#{employee.email},
</if>
<if test="employee.gender!=null">
gender=#{employee.gender},
</if>
<if test="employee.department!=null">
d_id=#{employee.department.id}
</if>
</set>
where id = #{id}
</update>
<!--int deleteEmpById(Integer id);-->
<delete id="deleteEmpById">
delete from employee where id=#{id}
</delete>
</mapper>

@ -1,68 +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">
<!--MyBatis的映射文件 编写sql-->
<!--一个数据表对应一个实体类一个实体类对应一个mapper映射文件-->
<mapper namespace="com.xydl.mapper.MoaMapper">
<!-- <resultMap id="EiaResultMap" type="com.xydl.model.Eia">-->
<!-- <result column="SubDeviceID" property="subDeviceID"/>-->
<!-- <result column="sensorid" property="sensorId"/>-->
<!-- <result column="capturetime" property="captureTime"/>-->
<!-- <result column="maxtemp" property="maxTemp"/>-->
<!-- <result column="mintemp" property="minTemp"/>-->
<!-- <result column="avgtemp" property="avgTemp"/>-->
<!-- <result column="Phase" property="phase"/>-->
<!-- </resultMap>-->
<!-- <select id="getEia" resultType="com.xydl.model.Eia">-->
<!-- SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.capturetime,t1.maxtemp,t1.mintemp,t1.avgtemp,t2.`Phase`-->
<!-- FROM `data_eaif_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid-->
<!-- WHERE t1.eqmid=394 AND t1.capturetime>'2019-12-19 04:55:31' ORDER BY t1.capturetime LIMIT 1000-->
<!-- </select>-->
<select id="getMoa" resultType="com.xydl.model.Moa">
SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.d_time, t1.pt1, t1.lc1, t1.rc1, t1.ligcnt1, t1.lastligtm1, t2.phase
FROM `data_moa_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid
WHERE t1.eqmid=163 AND t1.d_time>'2017-01-17 16:00:00' ORDER BY t1.d_time LIMIT 10
</select>
<!--int insertEmp(Employee employee);-->
<insert id="insertEmp">
insert into employee values (#{id},#{lastName},#{email},#{gender},#{department.id})
</insert>
<update id="update">
update employee
<set>
<if test="employee.lastName!=null">
last_name=#{employee.lastName},
</if>
<if test="employee.email!=null">
email=#{employee.email},
</if>
<if test="employee.gender!=null">
gender=#{employee.gender},
</if>
<if test="employee.department!=null">
d_id=#{employee.department.id}
</if>
</set>
where id = #{id}
</update>
<!--int deleteEmpById(Integer id);-->
<delete id="deleteEmpById">
delete from employee where id=#{id}
</delete>
</mapper>

@ -1,69 +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">
<!--MyBatis的映射文件 编写sql-->
<!--一个数据表对应一个实体类一个实体类对应一个mapper映射文件-->
<mapper namespace="com.xydl.mapper.PdMapper">
<!-- <resultMap id="EiaResultMap" type="com.xydl.model.Eia">-->
<!-- <result column="SubDeviceID" property="subDeviceID"/>-->
<!-- <result column="sensorid" property="sensorId"/>-->
<!-- <result column="capturetime" property="captureTime"/>-->
<!-- <result column="maxtemp" property="maxTemp"/>-->
<!-- <result column="mintemp" property="minTemp"/>-->
<!-- <result column="avgtemp" property="avgTemp"/>-->
<!-- <result column="Phase" property="phase"/>-->
<!-- </resultMap>-->
<!-- <select id="getEia" resultType="com.xydl.model.Eia">-->
<!-- SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.capturetime,t1.maxtemp,t1.mintemp,t1.avgtemp,t2.`Phase`-->
<!-- FROM `data_eaif_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid-->
<!-- WHERE t1.eqmid=394 AND t1.capturetime>'2019-12-19 04:55:31' ORDER BY t1.capturetime LIMIT 1000-->
<!-- </select>-->
<select id="getPd" resultType="com.xydl.model.Pd">
SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.d_time, t1.waveform, t1.plsnum, t1.apppadsch, t2.phase
FROM `data_pd_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid
WHERE t1.eqmid=242 AND t1.d_time>'2017-01-17 16:00:00' ORDER BY t1.d_time LIMIT 10
</select>
<!--int insertEmp(Employee employee);-->
<insert id="insertEmp">
insert into employee values (#{id},#{lastName},#{email},#{gender},#{department.id})
</insert>
<update id="update">
update employee
<set>
<if test="employee.lastName!=null">
last_name=#{employee.lastName},
</if>
<if test="employee.email!=null">
email=#{employee.email},
</if>
<if test="employee.gender!=null">
gender=#{employee.gender},
</if>
<if test="employee.department!=null">
d_id=#{employee.department.id}
</if>
</set>
where id = #{id}
</update>
<!--int deleteEmpById(Integer id);-->
<delete id="deleteEmpById">
delete from employee where id=#{id}
</delete>
</mapper>

@ -1,68 +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">
<!--MyBatis的映射文件 编写sql-->
<!--一个数据表对应一个实体类一个实体类对应一个mapper映射文件-->
<mapper namespace="com.xydl.mapper.RptTemperMapper">
<!-- <resultMap id="EiaResultMap" type="com.xydl.model.Eia">-->
<!-- <result column="SubDeviceID" property="subDeviceID"/>-->
<!-- <result column="sensorid" property="sensorId"/>-->
<!-- <result column="capturetime" property="captureTime"/>-->
<!-- <result column="maxtemp" property="maxTemp"/>-->
<!-- <result column="mintemp" property="minTemp"/>-->
<!-- <result column="avgtemp" property="avgTemp"/>-->
<!-- <result column="Phase" property="phase"/>-->
<!-- </resultMap>-->
<!-- <select id="getEia" resultType="com.xydl.model.Eia">-->
<!-- SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.capturetime,t1.maxtemp,t1.mintemp,t1.avgtemp,t2.`Phase`-->
<!-- FROM `data_eaif_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid-->
<!-- WHERE t1.eqmid=394 AND t1.capturetime>'2019-12-19 04:55:31' ORDER BY t1.capturetime LIMIT 1000-->
<!-- </select>-->
<select id="getRptTemper" resultType="com.xydl.model.RptTemper">
SELECT t2.equipmentid AS SubDeviceID, t2.sensorid, t1.create_time, t1.a_o_temper, t1.b_o_temper, t1.c_o_temper, t1.a_i_temper, t1.b_i_temper, t1.c_i_temper, t1.box_temper,t2.phase
FROM `rpt_temper` AS t1 JOIN i2relation AS t2 ON t1.eqm_id=t2.eqmid
WHERE t1.eqm_id=165 AND t1.create_time>'2017-01-17 16:00:00' ORDER BY t1.create_time LIMIT 10
</select>
<!--int insertEmp(Employee employee);-->
<insert id="insertEmp">
insert into employee values (#{id},#{lastName},#{email},#{gender},#{department.id})
</insert>
<update id="update">
update employee
<set>
<if test="employee.lastName!=null">
last_name=#{employee.lastName},
</if>
<if test="employee.email!=null">
email=#{employee.email},
</if>
<if test="employee.gender!=null">
gender=#{employee.gender},
</if>
<if test="employee.department!=null">
d_id=#{employee.department.id}
</if>
</set>
where id = #{id}
</update>
<!--int deleteEmpById(Integer id);-->
<delete id="deleteEmpById">
delete from employee where id=#{id}
</delete>
</mapper>

@ -1,68 +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">
<!--MyBatis的映射文件 编写sql-->
<!--一个数据表对应一个实体类一个实体类对应一个mapper映射文件-->
<mapper namespace="com.xydl.mapper.ScurMapper">
<!-- <resultMap id="EiaResultMap" type="com.xydl.model.Eia">-->
<!-- <result column="SubDeviceID" property="subDeviceID"/>-->
<!-- <result column="sensorid" property="sensorId"/>-->
<!-- <result column="capturetime" property="captureTime"/>-->
<!-- <result column="maxtemp" property="maxTemp"/>-->
<!-- <result column="mintemp" property="minTemp"/>-->
<!-- <result column="avgtemp" property="avgTemp"/>-->
<!-- <result column="Phase" property="phase"/>-->
<!-- </resultMap>-->
<!-- <select id="getEia" resultType="com.xydl.model.Eia">-->
<!-- SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.capturetime,t1.maxtemp,t1.mintemp,t1.avgtemp,t2.`Phase`-->
<!-- FROM `data_eaif_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid-->
<!-- WHERE t1.eqmid=394 AND t1.capturetime>'2019-12-19 04:55:31' ORDER BY t1.capturetime LIMIT 1000-->
<!-- </select>-->
<select id="getScur" resultType="com.xydl.model.Scur">
SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.d_time, t1.current_val, t2.phase
FROM `data_scur_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid
WHERE t1.eqmid=395 AND t1.d_time>'2017-01-17 16:00:00' ORDER BY t1.d_time LIMIT 10
</select>
<!--int insertEmp(Employee employee);-->
<insert id="insertEmp">
insert into employee values (#{id},#{lastName},#{email},#{gender},#{department.id})
</insert>
<update id="update">
update employee
<set>
<if test="employee.lastName!=null">
last_name=#{employee.lastName},
</if>
<if test="employee.email!=null">
email=#{employee.email},
</if>
<if test="employee.gender!=null">
gender=#{employee.gender},
</if>
<if test="employee.department!=null">
d_id=#{employee.department.id}
</if>
</set>
where id = #{id}
</update>
<!--int deleteEmpById(Integer id);-->
<delete id="deleteEmpById">
delete from employee where id=#{id}
</delete>
</mapper>

@ -1,67 +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">
<!--MyBatis的映射文件 编写sql-->
<!--一个数据表对应一个实体类一个实体类对应一个mapper映射文件-->
<mapper namespace="com.xydl.mapper.Sf6Mapper">
<!-- <resultMap id="EiaResultMap" type="com.xydl.model.Eia">-->
<!-- <result column="SubDeviceID" property="subDeviceID"/>-->
<!-- <result column="sensorid" property="sensorId"/>-->
<!-- <result column="capturetime" property="captureTime"/>-->
<!-- <result column="maxtemp" property="maxTemp"/>-->
<!-- <result column="mintemp" property="minTemp"/>-->
<!-- <result column="avgtemp" property="avgTemp"/>-->
<!-- <result column="Phase" property="phase"/>-->
<!-- </resultMap>-->
<!-- <select id="getEia" resultType="com.xydl.model.Eia">-->
<!-- SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.capturetime,t1.maxtemp,t1.mintemp,t1.avgtemp,t2.`Phase`-->
<!-- FROM `data_eaif_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid-->
<!-- WHERE t1.eqmid=394 AND t1.capturetime>'2019-12-19 04:55:31' ORDER BY t1.capturetime LIMIT 1000-->
<!-- </select>-->
<select id="getSf6" resultType="com.xydl.model.Sf6">
SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.d_time, t1.temp1, t1.md1, t1.pressure1+900, t1.pressure1, t1.pm1, t2.phase
FROM `data_sf6_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid
WHERE t1.eqmid=164 AND t1.d_time>'2017-01-17 16:00:00' ORDER BY t1.d_time LIMIT 10
</select>
<!--int insertEmp(Employee employee);-->
<insert id="insertEmp">
insert into employee values (#{id},#{lastName},#{email},#{gender},#{department.id})
</insert>
<update id="update">
update employee
<set>
<if test="employee.lastName!=null">
last_name=#{employee.lastName},
</if>
<if test="employee.email!=null">
email=#{employee.email},
</if>
<if test="employee.gender!=null">
gender=#{employee.gender},
</if>
<if test="employee.department!=null">
d_id=#{employee.department.id}
</if>
</set>
where id = #{id}
</update>
<!--int deleteEmpById(Integer id);-->
<delete id="deleteEmpById">
delete from employee where id=#{id}
</delete>
</mapper>

@ -1,68 +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">
<!--MyBatis的映射文件 编写sql-->
<!--一个数据表对应一个实体类一个实体类对应一个mapper映射文件-->
<mapper namespace="com.xydl.mapper.Sf6envMapper">
<!-- <resultMap id="EiaResultMap" type="com.xydl.model.Eia">-->
<!-- <result column="SubDeviceID" property="subDeviceID"/>-->
<!-- <result column="sensorid" property="sensorId"/>-->
<!-- <result column="capturetime" property="captureTime"/>-->
<!-- <result column="maxtemp" property="maxTemp"/>-->
<!-- <result column="mintemp" property="minTemp"/>-->
<!-- <result column="avgtemp" property="avgTemp"/>-->
<!-- <result column="Phase" property="phase"/>-->
<!-- </resultMap>-->
<!-- <select id="getEia" resultType="com.xydl.model.Eia">-->
<!-- SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.capturetime,t1.maxtemp,t1.mintemp,t1.avgtemp,t2.`Phase`-->
<!-- FROM `data_eaif_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid-->
<!-- WHERE t1.eqmid=394 AND t1.capturetime>'2019-12-19 04:55:31' ORDER BY t1.capturetime LIMIT 1000-->
<!-- </select>-->
<select id="getSf6env" resultType="com.xydl.model.Sf6env">
SELECT t2.equipmentid AS SubDeviceID, t2.sensorid,t1.d_time, t1.gas1, t1.yq1, t1.md1, t1.pm1, t1.gascnt1, t1.hmcnt1,t1.sf6warn1, t1.o2warn1,t2.phase
FROM `data_sf6env_h` AS t1 JOIN i2relation AS t2 ON t1.eqmid=t2.eqmid
WHERE t1.eqmid=165 AND t1.d_time>'2017-01-17 16:00:00' ORDER BY t1.d_time LIMIT 10
</select>
<!--int insertEmp(Employee employee);-->
<insert id="insertEmp">
insert into employee values (#{id},#{lastName},#{email},#{gender},#{department.id})
</insert>
<update id="update">
update employee
<set>
<if test="employee.lastName!=null">
last_name=#{employee.lastName},
</if>
<if test="employee.email!=null">
email=#{employee.email},
</if>
<if test="employee.gender!=null">
gender=#{employee.gender},
</if>
<if test="employee.department!=null">
d_id=#{employee.department.id}
</if>
</set>
where id = #{id}
</update>
<!--int deleteEmpById(Integer id);-->
<delete id="deleteEmpById">
delete from employee where id=#{id}
</delete>
</mapper>

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h1> ${list}</h1>
<h1> ${name}</h1>
</body>
</html>

@ -1,3 +0,0 @@
artifactId=mqtt
groupId=com.xydl
version=1.0-SNAPSHOT
Loading…
Cancel
Save