You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.4 KiB
XML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?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>