<?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.njcn.mapper.configuration.DeviceInfoMapper'>
	<resultMap type="LineInfo" id="deviceMap" autoMapping="true">
		<id column="Gd_index" property="nodeIndex"/>
	</resultMap>
	<select id="getDeviceInfo" resultMap="deviceMap" >
		select 
	      a.name,a.subv_name,b.updatetime,d.dic_name as manufacturer,b.devtype,b.ip,b.status,
          a.scale,a.pt1,a.pt2,a.ct1,a.ct2,a.jzcmp,a.dlcmp,a.xycmp,a.devcmp
        from pq_line a,pq_device b ,pq_devicedetail c,pqs_dicdata d
	    where 
	      a.dev_index = b.dev_index and  b.dev_index = c.dev_index and c.manufacturer = d.dic_index and
		  a.line_index = #{line_index} 
	</select>

	<select id="getRunInfo" resultType="ComInformation" >
		select UpdateTime,Type
          from PQS_COMINFORMATION
         where State = 1
         and Line_Index = #{line_index}
         and UpdateTime between #{startTime} and #{endTime}
         order by UpdateTime
	</select>
</mapper>