<?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.xintong.visualinspection.dao.cluster.WebcamDao">
	<resultMap id="BaseResultMap" type="com.xintong.visualinspection.bean.Webcam">
		<id column="id" property="id" jdbcType="INTEGER" />
		<result column="device_id" property="device_id" jdbcType="VARCHAR" />
		<result column="device_description" property="device_description"
			jdbcType="VARCHAR" />
		<result column="line_code" property="line_code"
			jdbcType="VARCHAR" />
		<result column="high_speedname" property="high_speedname"
			jdbcType="VARCHAR" />
		<result column="direction" property="direction"
			jdbcType="VARCHAR" />
		<result column="section_belongs" property="section_belongs"
			jdbcType="VARCHAR" />
		<result column="management_unit" property="management_unit"
			jdbcType="VARCHAR" />
		<result column="mileage_stake" property="mileage_stake"
			jdbcType="VARCHAR" />
		<result column="brand" property="brand"
			jdbcType="VARCHAR" />
		<result column="specification" property="specification"
			jdbcType="VARCHAR" />
		<result column="longitude" property="longitude"
			jdbcType="FLOAT" />
		<result column="latitude" property="latitude"
			jdbcType="FLOAT" />
		<result column="longitude_supermap" property="longitude_supermap"
			jdbcType="FLOAT" />
		<result column="latitude_supermap" property="latitude_supermap"
			jdbcType="FLOAT" />
		<result column="mileage_stake_supermap" property="mileage_stake_supermap"
			jdbcType="VARCHAR" />
		<result column="location" property="location"
			jdbcType="INTEGER" />
		<result column="type" property="type"
			jdbcType="VARCHAR" />
		<result column="device_status" property="device_status"
			jdbcType="VARCHAR" />
		<result column="remark" property="remark"
			jdbcType="VARCHAR" />
		<result column="devicemangetype" property="devicemangetype"
			jdbcType="VARCHAR" />
		<result column="update_time" property="update_time"
			jdbcType="DATE" />
		<result column="device_id_pre" property="device_id_pre"
			jdbcType="VARCHAR" />
		<result column="devicenumber" property="devicenumber"
			jdbcType="VARCHAR" />
		<result column="ip" property="ip"
			jdbcType="VARCHAR" />
		<result column="port" property="port"
			jdbcType="INTEGER" />
		<result column="channel" property="channel"
			jdbcType="INTEGER" />
			<result column="cameratype" property="cameratype"
			jdbcType="INTEGER" />
			<result column="playtype" property="playtype"
			jdbcType="INTEGER" />
	
	</resultMap>
	

	<select id="getAll" resultMap="BaseResultMap">
		SELECT
		*
		FROM
		t_br_layer_webcam
	</select>

	<select id="getOne" parameterType="String" resultMap="BaseResultMap">
		SELECT
		*
		FROM t_br_layer_webcam
		WHERE DEVICE_ID =  #{deviceid,jdbcType=VARCHAR} LIMIT 1
	</select>

	<select id="getWebcams" parameterType="com.xintong.visualinspection.bean.Webcam"
		resultMap="BaseResultMap">
		SELECT
		*
		FROM t_br_layer_webcam
		where 1=1
		<if test="management_unit != null">and management_unit = #{management_unit} </if>
		<if test="location != null and location != 0">and location = #{location} </if>
	</select>
</mapper>