Newer
Older
huludao / src / main / resources / mapper / Sl6512014Dao.xml
<?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.newfiber.api.pc.dao.monitoring.Sl6512014Dao">

    <resultMap id="BaseResultMap" type="com.newfiber.api.pc.model.monitor.Sl6512014">
        <id column="serial" property="serial" jdbcType="BIGINT"/>
        <result column="UT" property="ut" jdbcType="TIMESTAMP"/>
        <result column="ST" property="st" jdbcType="VARCHAR"/>
        <result column="TT" property="tt" jdbcType="TIMESTAMP"/>
        <result column="AI" property="ai" jdbcType="NUMERIC"/>
<!--        <result column="C" property="c" jdbcType="NUMERIC"/>-->
        <result column="MST" property="mst" jdbcType="NUMERIC"/>
        <result column="PD" property="pd" jdbcType="NUMERIC"/>
        <result column="PJ" property="pj" jdbcType="NUMERIC"/>
        <result column="PT" property="pt" jdbcType="NUMERIC"/>
        <result column="PN01" property="pn01" jdbcType="NUMERIC"/>
        <result column="PN05" property="pn05" jdbcType="NUMERIC"/>
        <result column="PN10" property="pn10" jdbcType="NUMERIC"/>
        <result column="PN30" property="pn30" jdbcType="NUMERIC"/>
        <result column="Q" property="q" jdbcType="NUMERIC"/>
        <result column="Q1" property="q1" jdbcType="NUMERIC"/>
        <result column="Q2" property="q2" jdbcType="NUMERIC"/>
        <result column="VA" property="va" jdbcType="NUMERIC"/>
        <result column="VJ" property="vj" jdbcType="NUMERIC"/>
        <result column="VT" property="vt" jdbcType="NUMERIC"/>
        <result column="Z" property="z" jdbcType="NUMERIC"/>
        <result column="ZB" property="zb" jdbcType="NUMERIC"/>
        <result column="ZT" property="zt" jdbcType="INTEGER"/>
        <result column="SBL1" property="sbl1" jdbcType="NUMERIC"/>
        <result column="SBL2" property="sbl2" jdbcType="NUMERIC"/>
        <result column="pH" property="ph" jdbcType="NUMERIC"/>
        <result column="TURB" property="turb" jdbcType="NUMERIC"/>
        <result column="M10" property="m10" jdbcType="NUMERIC"/>
        <result column="M20" property="m20" jdbcType="NUMERIC"/>
        <result column="M30" property="m30" jdbcType="NUMERIC"/>
        <result column="M40" property="m40" jdbcType="NUMERIC"/>
        <result column="M50" property="m50" jdbcType="NUMERIC"/>
        <result column="M60" property="m60" jdbcType="NUMERIC"/>
        <result column="M80" property="m80" jdbcType="NUMERIC"/>
        <result column="M100" property="m100" jdbcType="NUMERIC"/>
        <result column="STT" property="stt" jdbcType="TIMESTAMP"/>
        <result column="RADIO" property="radio" jdbcType="NUMERIC"/>
        <result column="FL" property="fl" jdbcType="NUMERIC"/>
        <result column="UC" property="uc" jdbcType="NUMERIC"/>
        <result column="US" property="us" jdbcType="NUMERIC"/>
<!--        <result column="DO" property="DO" jdbcType="NUMERIC"/>-->
        <result column="PM25" property="pm25" jdbcType="NUMERIC"/>
        <result column="COND" property="cond" jdbcType="NUMERIC"/>
        <result column="SS" property="ss" jdbcType="NUMERIC"/>
        <result column="CODMN" property="codmn" jdbcType="NUMERIC"/>
        <result column="GTP" property="gtp" jdbcType="NUMERIC"/>
        <result column="UE" property="ue" jdbcType="NUMERIC"/>
        <result column="REDOX" property="redox" jdbcType="NUMERIC"/>
        <result column="NH4N" property="nh4n" jdbcType="NUMERIC"/>
        <result column="CHLA" property="chla" jdbcType="NUMERIC"/>
        <result column="HNO3" property="hno3" jdbcType="NUMERIC"/>
        <result column="ALGAE" property="algae" jdbcType="NUMERIC"/>
        <result column="T10" property="t10" jdbcType="NUMERIC"/>
<!--        <result column="SIGNAL" property="signal" jdbcType="NUMERIC"/>-->
<!--        <result column="LONG" property="LONG" jdbcType="NUMERIC"/>-->
        <result column="LATI" property="lati" jdbcType="NUMERIC"/>
        <result column="ALTI" property="alti" jdbcType="NUMERIC"/>
        <result column="WP1" property="wp1" jdbcType="NUMERIC"/>
        <result column="WP2" property="wp2" jdbcType="NUMERIC"/>
        <result column="ED" property="ed" jdbcType="NUMERIC"/>
        <result column="EJ" property="ej" jdbcType="NUMERIC"/>
    </resultMap>

    <sql id="Base_Column_List">
        <trim suffixOverrides=",">
            UT,ST,TT,AI,MST,PD,PJ,PT,PN01,PN05,PN10,PN30,Q,Q1,Q2,VA,VJ,VT,Z,ZB,ZT,
            SBL1,SBL2,pH,TURB,M10,M20,M30,M40,M50,M60,M80,M100,STT,RADIO,FL,UC,US,PM25,COND,SS,CODMN,GTP,
            UE,REDOX,NH4N,CHLA,HNO3,ALGAE,T10,LATI,ALTI,WP1,WP2,ED,EJ
        </trim>
    </sql>

    <select id="getList" resultMap="BaseResultMap">
        select <include refid="Base_Column_List"/>
        from sl651_2014
        where 1 = 1
        <if test="siteNo != null">
            and ST = #{siteNo}
        </if>
        <if test="startTime != null and endTime != null">
            and TT between #{startTime} and #{endTime}
        </if>
        order by TT desc
    </select>

    <select id="getTempData" resultMap="BaseResultMap">
        select <include refid="Base_Column_List"/>
        from TempData
        where 1 = 1
        <if test="siteNo != null">
            and ST = #{siteNo}
        </if>
        <if test="startTime != null and endTime != null">
            and TT between #{startTime} and #{endTime}
        </if>
        order by TT desc
    </select>

    <select id="getMaxProperty" resultMap="BaseResultMap">
        select <include refid="Base_Column_List"/>
        from TempData
        where 1 = 1
        <if test="siteNo != null">
            and ST = #{siteNo}
        </if>
        <if test="startTime != null and endTime != null">
            and TT between #{startTime} and #{endTime}
        </if>
        <if test="property != null">
            order by ${property} desc
        </if>
        limit 0,1
    </select>

</mapper>