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