工业级运维app手机api
fengxiang
2017-09-21 6af76482cc57d2c59a44a2fe0ffec903987b7944
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?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.MonitorPointDao">
 
    <!--所有监测点-->
    <select id="allMonitorPoint"  parameterType="com.moral.monitor.entity.QueryHelper" resultType="com.moral.monitor.entity.MonitorPoint">
        select * from monitorpoint
        <where>
            <if test="search!=''">
                and name LIKE '%${search}%'
            </if>
        </where>
        limit #{offset},#{limit}
    </select>
 
    <select id="monitorCount"  parameterType="com.moral.monitor.entity.QueryHelper" resultType="int">
        select COUNT(id)  from monitorpoint
        <where>
            <if test="search!=''">
                and name LIKE '%${search}%'
            </if>
        </where>
    </select>
 
 
 
    <!-- 删除监测点-->
    <select id="deleteMonitor"  parameterType="String"  >
        DELETE FROM `monitorpoint` WHERE id=#{id}
    </select>
 
 
    <!--增加监测点-->
    <select id="addMonitorpoint" parameterType="com.moral.monitor.entity.MonitorPoint">
        insert into `monitorpoint`(name,address,owner,create_time) VALUES(#{name},#{address},#{owner},NOW())
    </select>
 
 
    <!--增加监测点-->
    <select id="updateMonitorpoint" parameterType="com.moral.monitor.entity.MonitorPoint">
        update   monitorpoint set  name=#{name}, address=#{address} WHERE id=#{id}
    </select>
 
 
</mapper>