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