<?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.yssh.dao.YsshQxshMapper">
|
<resultMap id="YsshQxshResult" type="com.yssh.entity.YsshQxsh">
|
<id column="id" property="id" javaType="java.lang.Integer" />
|
<id column="name" property="name" javaType="java.lang.String" jdbcType="VARCHAR" />
|
<id column="lon" property="lon" javaType="java.lang.Float" jdbcType="DOUBLE"/>
|
<id column="lat" property="lat" javaType="java.lang.Float" jdbcType="DOUBLE"/>
|
<id column="value" property="value" javaType="java.lang.String" jdbcType="VARCHAR"/>
|
<id column="time" property="time" javaType="java.lang.String" jdbcType="VARCHAR"/>
|
<id column="property" property="property" javaType="java.lang.Integer" jdbcType="INTEGER"/>
|
<id column="wg100" property="wg100" javaType="java.lang.String" jdbcType="VARCHAR"/>
|
<id column="wg200" property="wg200" javaType="java.lang.String" jdbcType="VARCHAR"/>
|
<id column="wg300" property="wg300" javaType="java.lang.String" jdbcType="VARCHAR"/>
|
<id column="wg500" property="wg500" javaType="java.lang.String" jdbcType="VARCHAR"/>
|
</resultMap>
|
<select id="query" resultType="com.yssh.entity.YsshQxsh">
|
select * from yssh_qxsh where 1=1
|
<if test="name != null and name != ''">
|
and name = #{name}
|
</if>
|
order by time desc
|
</select>
|
<select id="queryByTime" resultType="com.yssh.entity.YsshQxsh">
|
select * from yssh_qxsh where 1=1
|
<if test="leftTime != null and leftTime != ''">
|
and time >= #{leftTime}
|
</if>
|
<if test="rightTime != null and rightTime != ''">
|
and time <= #{rightTime}
|
</if>
|
<if test="name != null and name != ''">
|
and name = #{name}
|
</if>
|
order by time desc
|
</select>
|
<select id="getAll" resultType="com.yssh.entity.YsshQxsh">
|
select * from yssh_qxsh where 1=1
|
</select>
|
|
<insert id="insert" parameterType="com.yssh.entity.YsshQxsh">
|
insert into yssh_qxsh (
|
name, lon, lat, value, time, property, wg100,wg200,wg300,wg500
|
)
|
values (
|
#{name},#{lon},#{lat},#{value},#{time},#{property},#{wg100},#{wg200},#{wg300},#{wg500}
|
)
|
</insert>
|
<delete id="delete">
|
delete from yssh_qxsh where id = #{id}
|
</delete>
|
<select id="querySevenAccuracyStatic" resultType="java.lang.Double">
|
select sum(accuracy)/count(*) from yssh_qxsh where accuracy != 0 and time >= #{lastDay}
|
</select>
|
</mapper>
|