<?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.tofly.scada.mapper.DeviceArchiveManageMapper">

    <resultMap id="BaseResultMap" type="com.tofly.scada.entity.DeviceArchiveManage">
            <id property="id" column="ID" jdbcType="DECIMAL"/>
            <result property="waterId" column="WATER_ID" jdbcType="DECIMAL"/>
            <result property="code" column="CODE" jdbcType="VARCHAR"/>
            <result property="name" column="NAME" jdbcType="VARCHAR"/>
            <result property="type" column="TYPE" jdbcType="VARCHAR"/>
            <result property="makeDate" column="MAKE_DATE" jdbcType="TIMESTAMP"/>
            <result property="deviceType" column="DEVICE_TYPE" jdbcType="VARCHAR"/>
            <result property="manufacturer" column="MANUFACTURER" jdbcType="VARCHAR"/>
            <result property="modelSpecification" column="MODEL_SPECIFICATION" jdbcType="VARCHAR"/>
            <result property="status" column="STATUS" jdbcType="VARCHAR"/>
            <result property="longitude" column="LONGITUDE" jdbcType="DECIMAL"/>
            <result property="latitude" column="LATITUDE" jdbcType="DECIMAL"/>
            <result property="leader" column="LEADER" jdbcType="VARCHAR"/>
            <result property="phone" column="PHONE" jdbcType="VARCHAR"/>
            <result property="describe" column="DESCRIBE" jdbcType="VARCHAR"/>
            <result property="createUser" column="CREATE_USER" jdbcType="DECIMAL"/>
            <result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
            <result property="address" column="ADDRESS" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        ID,WATER_ID,CODE,
        NAME,TYPE,MAKE_DATE,
        DEVICE_TYPE,MANUFACTURER,MODEL_SPECIFICATION,
        STATUS,LONGITUDE,LATITUDE,
        LEADER,PHONE,DESCRIBE,
        CREATE_USER,CREATE_TIME,ADDRESS
    </sql>

    <select id="getIOServerDeviceIndexList" resultType="com.tofly.scada.entity.vo.IOSever.IOServerParObjsDto">
        select t1.VARIABLE_CODE as N
        from  TF_INDEX_ALLOCATION t1 left join TF_DEVICE_ARCHIVE_MANAGE t2 on t2.id = t1.DEVICE_ID
        where t2.DEVICE_TYPE = '8' and t2.type = '2'
    </select>
</mapper>
