|
@@ -0,0 +1,195 @@
|
|
|
+<?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.zhjq.mapper.ZhjqCameraMapper">
|
|
|
+
|
|
|
+ <resultMap type="ZhjqCamera" id="ZhjqCameraResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="encodeDevIndexCode" column="encode_dev_index_code"/>
|
|
|
+ <result property="cameraIndexCode" column="camera_index_code"/>
|
|
|
+ <result property="cameraName" column="camera_name"/>
|
|
|
+ <result property="cameraType" column="camera_type"/>
|
|
|
+ <result property="cameraTypeName" column="camera_type_name"/>
|
|
|
+ <result property="longitude" column="longitude"/>
|
|
|
+ <result property="latitude" column="latitude"/>
|
|
|
+ <result property="deptId" column="dept_id"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectZhjqCameraVo">
|
|
|
+ select id,
|
|
|
+ camera_index_code,
|
|
|
+ encode_dev_index_code,
|
|
|
+ camera_name,
|
|
|
+ camera_type,
|
|
|
+ camera_type_name,
|
|
|
+ longitude,
|
|
|
+ latitude,
|
|
|
+ dept_id,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time
|
|
|
+ from zhjq_camera
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectZhjqCameraList" parameterType="ZhjqCamera" resultMap="ZhjqCameraResult">
|
|
|
+ <include refid="selectZhjqCameraVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="encodeDevIndexCode != null and encodeDevIndexCode != ''">
|
|
|
+ and encode_dev_index_code = #{encodeDevIndexCode}
|
|
|
+ </if>
|
|
|
+ <if test="cameraName != null and cameraName != ''">
|
|
|
+ and camera_name like concat('%', #{cameraName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="cameraType != null ">
|
|
|
+ and camera_type = #{cameraType}
|
|
|
+ </if>
|
|
|
+ <if test="longitude != null and longitude != ''">
|
|
|
+ and longitude = #{longitude}
|
|
|
+ </if>
|
|
|
+ <if test="latitude != null and latitude != ''">
|
|
|
+ and latitude = #{latitude}
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null ">
|
|
|
+ and dept_id = #{deptId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectZhjqCameraById" parameterType="String"
|
|
|
+ resultMap="ZhjqCameraResult">
|
|
|
+ <include refid="selectZhjqCameraVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertZhjqCamera" parameterType="ZhjqCamera">
|
|
|
+ insert into zhjq_camera
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,
|
|
|
+ </if>
|
|
|
+ <if test="encodeDevIndexCode != null">encode_dev_index_code,
|
|
|
+ </if>
|
|
|
+ <if test="cameraIndexCode != null">camera_index_code,
|
|
|
+ </if>
|
|
|
+ <if test="cameraName != null">camera_name,
|
|
|
+ </if>
|
|
|
+ <if test="cameraType != null">camera_type,
|
|
|
+ </if>
|
|
|
+ <if test="cameraTypeName != null">camera_type_name,
|
|
|
+ </if>
|
|
|
+ <if test="longitude != null">longitude,
|
|
|
+ </if>
|
|
|
+ <if test="latitude != null">latitude,
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null">dept_id,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">create_by,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">create_time,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">update_by,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">update_time,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},
|
|
|
+ </if>
|
|
|
+ <if test="encodeDevIndexCode != null">#{encodeDevIndexCode},
|
|
|
+ </if>
|
|
|
+ <if test="cameraIndexCode != null">#{cameraIndexCode},
|
|
|
+ </if>
|
|
|
+ <if test="cameraName != null">#{cameraName},
|
|
|
+ </if>
|
|
|
+ <if test="cameraType != null">#{cameraType},
|
|
|
+ </if>
|
|
|
+ <if test="cameraTypeName != null">#{cameraTypeName},
|
|
|
+ </if>
|
|
|
+ <if test="longitude != null">#{longitude},
|
|
|
+ </if>
|
|
|
+ <if test="latitude != null">#{latitude},
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null">#{deptId},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">#{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">#{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">#{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">#{updateTime},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateZhjqCamera" parameterType="ZhjqCamera">
|
|
|
+ update zhjq_camera
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="encodeDevIndexCode != null">encode_dev_index_code =
|
|
|
+ #{encodeDevIndexCode},
|
|
|
+ </if>
|
|
|
+ <if test="cameraIndexCode != null">camera_index_code =
|
|
|
+ #{cameraIndexCode},
|
|
|
+ </if>
|
|
|
+ <if test="cameraName != null">camera_name =
|
|
|
+ #{cameraName},
|
|
|
+ </if>
|
|
|
+ <if test="cameraType != null">camera_type =
|
|
|
+ #{cameraType},
|
|
|
+ </if>
|
|
|
+ <if test="cameraTypeName != null">camera_type_name =
|
|
|
+ #{cameraTypeName},
|
|
|
+ </if>
|
|
|
+ <if test="longitude != null">longitude =
|
|
|
+ #{longitude},
|
|
|
+ </if>
|
|
|
+ <if test="latitude != null">latitude =
|
|
|
+ #{latitude},
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null">dept_id =
|
|
|
+ #{deptId},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">create_by =
|
|
|
+ #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">create_time =
|
|
|
+ #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">update_by =
|
|
|
+ #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">update_time =
|
|
|
+ #{updateTime},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteZhjqCameraById" parameterType="String">
|
|
|
+ delete
|
|
|
+ from zhjq_camera
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteZhjqCameraByIds" parameterType="String">
|
|
|
+ delete from zhjq_camera where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <insert id="insertBatchZhjqCamera" parameterType="String">
|
|
|
+ insert into zhjq_camera (camera_index_code,encode_dev_index_code, camera_name, camera_type,camera_type_name,
|
|
|
+ longitude, latitude,create_time)
|
|
|
+ values
|
|
|
+ <foreach collection="list" item="item" separator="," index="index">
|
|
|
+ (#{item.cameraIndexCode},#{item.encodeDevIndexCode}, #{item.cameraName}, #{item.cameraType},
|
|
|
+ #{item.cameraTypeName}, #{item.longitude},
|
|
|
+ #{item.latitude}, now())
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+</mapper>
|