<?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.moral.monitor.dao.MgrDao">
|
|
<!--随机点-->
|
<select id="randpoint" resultType="com.moral.monitor.entity.MonitorPoint">
|
SELECT * FROM monitorpoint ORDER BY RAND() LIMIT 7
|
</select>
|
|
|
<!--点在所有在线设备-->
|
<select id="pointequ" parameterType="String" resultType="com.moral.monitor.entity.Equipment">
|
SELECT * FROM equipment WHERE monitorpoint=#{monitorpoint} AND state!=0
|
</select>
|
|
|
<!--设备传感器即时数据-->
|
<select id="equsensorstate" parameterType="String" resultType="com.moral.monitor.entity.State">
|
select * from state WHERE mac=#{mac}
|
</select>
|
|
|
<!--所有点-->
|
<select id="allpoint" resultType="com.moral.monitor.entity.MonitorPoint">
|
SELECT * FROM monitorpoint
|
</select>
|
|
|
|
|
|
|
|
<!--所有监测点表-->
|
<select id="allPointsData" parameterType="com.moral.monitor.entity.QueryHelper" resultType="com.moral.monitor.entity.PointAvg">
|
select * from monitorpoint
|
<where>
|
<if test="search!=''">
|
and name LIKE '%${search}%'
|
</if>
|
</where>
|
limit #{offset},#{limit}
|
</select>
|
|
<select id="pointcount" parameterType="com.moral.monitor.entity.QueryHelper" resultType="int">
|
select COUNT(id) from monitorpoint
|
<where>
|
<if test="search!=''">
|
and name LIKE '%${search}%'
|
</if>
|
</where>
|
</select>
|
|
|
|
|
</mapper>
|