| <?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.dy.pipIrrGlobal.daoVi.ViCameraMapper"> | 
|   <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoVi.ViCamera"> | 
|     <!--@mbg.generated--> | 
|     <!--@Table vi_camera--> | 
|     <id column="id" jdbcType="BIGINT" property="id" /> | 
|     <result column="type" jdbcType="TINYINT" property="type" /> | 
|     <result column="dev_no" jdbcType="VARCHAR" property="devNo" /> | 
|     <result column="name" jdbcType="VARCHAR" property="name" /> | 
|     <result column="lng" jdbcType="DOUBLE" property="lng" /> | 
|     <result column="lat" jdbcType="DOUBLE" property="lat" /> | 
|     <result column="on_screen" jdbcType="TINYINT" property="onScreen" /> | 
|     <result column="on_sort" jdbcType="INTEGER" property="onSort" /> | 
|     <result column="remark" jdbcType="VARCHAR" property="remark" /> | 
|     <result column="deleted" jdbcType="TINYINT" property="deleted" /> | 
|   </resultMap> | 
|   <sql id="Base_Column_List"> | 
|     <!--@mbg.generated--> | 
|     id, `type`, dev_no, `name`, lng, lat, on_screen, on_sort, remark, deleted | 
|   </sql> | 
|   <sql id="part_Column_List"> | 
|     <!--@mbg.generated--> | 
|     id, `type`, dev_no, `name`, lng, lat, on_screen, on_sort, remark | 
|   </sql> | 
|   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | 
|     <!--@mbg.generated--> | 
|     select  | 
|     <include refid="Base_Column_List" /> | 
|     from vi_camera | 
|     where id = #{id,jdbcType=BIGINT} | 
|   </select> | 
|   | 
|   <select id="selectTotal" parameterType="java.util.Map" resultType="java.lang.Long"> | 
|     select | 
|     count(*) | 
|     from vi_camera tb | 
|     where tb.deleted != 1 | 
|     <trim prefix="and" suffixOverrides="and"> | 
|       <if test="name != null and name != ''"> | 
|         tb.`name` like concat('%', #{name}, '%') and | 
|       </if> | 
|     </trim> | 
|   </select> | 
|   <select id="selectSome" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voVi.VoCamera"> | 
|     <!--@mbg.generated--> | 
|     select | 
|     <include refid="part_Column_List" > | 
|       <property name="alias" value="tb"/> | 
|     </include> | 
|     from vi_camera tb | 
|     where tb.deleted != 1 | 
|     <trim prefix="and" suffixOverrides="and"> | 
|       <if test="name != null"> | 
|         tb.`name` like concat('%', #{name}, '%') and | 
|       </if> | 
|     </trim> | 
|     order by tb.on_sort ASC, tb.id DESC | 
|     <trim prefix="limit " > | 
|       <if test="start != null and count != null"> | 
|         #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} | 
|       </if> | 
|     </trim> | 
|   </select> | 
|   | 
|   <select id="selectTotal4Monitor" parameterType="java.util.Map" resultType="java.lang.Long"> | 
|     select | 
|     count(*) | 
|     from vi_camera tb | 
|     where tb.deleted != 1 and tb.on_screen = 1 | 
|     <trim prefix="and" suffixOverrides="and"> | 
|       <if test="name != null and name != ''"> | 
|         tb.`name` like concat('%', #{name}, '%') and | 
|       </if> | 
|     </trim> | 
|   </select> | 
|   <select id="selectSome4Monitor" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voVi.VoCamera"> | 
|     <!--@mbg.generated--> | 
|     select | 
|     <include refid="part_Column_List" > | 
|       <property name="alias" value="tb"/> | 
|     </include> | 
|     from vi_camera tb | 
|     where tb.deleted != 1 and tb.on_screen = 1 | 
|     <trim prefix="and" suffixOverrides="and"> | 
|       <if test="name != null"> | 
|         tb.`name` like concat('%', #{name}, '%') and | 
|       </if> | 
|     </trim> | 
|     order by tb.on_sort ASC, tb.id DESC | 
|     <trim prefix="limit " > | 
|       <if test="start != null and count != null"> | 
|         #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} | 
|       </if> | 
|     </trim> | 
|   </select> | 
|   <select id="selectAll4Monitor" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voVi.VoCamera"> | 
|     <!--@mbg.generated--> | 
|     select | 
|     <include refid="part_Column_List" > | 
|       <property name="alias" value="tb"/> | 
|     </include> | 
|     from vi_camera tb | 
|     where tb.deleted != 1 and tb.on_screen = 1 | 
|     order by tb.on_sort ASC, tb.id DESC | 
|   </select> | 
|   | 
|   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | 
|     <!--@mbg.generated--> | 
|     delete from vi_camera | 
|     where id = #{id,jdbcType=BIGINT} | 
|   </delete> | 
|   <delete id="deleteLogicById" parameterType="java.lang.Long"> | 
|     <!--@mbg.generated--> | 
|     update vi_camera set deleted = 1 | 
|     where id = #{id,jdbcType=BIGINT} | 
|   </delete> | 
|   | 
|   <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoVi.ViCamera"> | 
|     <!--@mbg.generated--> | 
|     insert into vi_camera (id, `type`, dev_no,  | 
|       `name`, lng, lat, on_screen,  | 
|       on_sort, remark, deleted | 
|       ) | 
|     values (#{id,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, #{devNo,jdbcType=VARCHAR},  | 
|       #{name,jdbcType=VARCHAR}, #{lng,jdbcType=DOUBLE}, #{lat,jdbcType=DOUBLE}, #{onScreen,jdbcType=TINYINT},  | 
|       #{onSort,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{deleted,jdbcType=TINYINT} | 
|       ) | 
|   </insert> | 
|   <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoVi.ViCamera"> | 
|     <!--@mbg.generated--> | 
|     insert into vi_camera | 
|     <trim prefix="(" suffix=")" suffixOverrides=","> | 
|       <if test="id != null"> | 
|         id, | 
|       </if> | 
|       <if test="type != null"> | 
|         `type`, | 
|       </if> | 
|       <if test="devNo != null"> | 
|         dev_no, | 
|       </if> | 
|       <if test="name != null"> | 
|         `name`, | 
|       </if> | 
|       <if test="lng != null"> | 
|         lng, | 
|       </if> | 
|       <if test="lat != null"> | 
|         lat, | 
|       </if> | 
|       <if test="onScreen != null"> | 
|         on_screen, | 
|       </if> | 
|       <if test="onSort != null"> | 
|         on_sort, | 
|       </if> | 
|       <if test="remark != null"> | 
|         remark, | 
|       </if> | 
|       <if test="deleted != null"> | 
|         deleted, | 
|       </if> | 
|     </trim> | 
|     <trim prefix="values (" suffix=")" suffixOverrides=","> | 
|       <if test="id != null"> | 
|         #{id,jdbcType=BIGINT}, | 
|       </if> | 
|       <if test="type != null"> | 
|         #{type,jdbcType=TINYINT}, | 
|       </if> | 
|       <if test="devNo != null"> | 
|         #{devNo,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="name != null"> | 
|         #{name,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="lng != null"> | 
|         #{lng,jdbcType=DOUBLE}, | 
|       </if> | 
|       <if test="lat != null"> | 
|         #{lat,jdbcType=DOUBLE}, | 
|       </if> | 
|       <if test="onScreen != null"> | 
|         #{onScreen,jdbcType=TINYINT}, | 
|       </if> | 
|       <if test="onSort != null"> | 
|         #{onSort,jdbcType=INTEGER}, | 
|       </if> | 
|       <if test="remark != null"> | 
|         #{remark,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="deleted != null"> | 
|         #{deleted,jdbcType=TINYINT}, | 
|       </if> | 
|     </trim> | 
|   </insert> | 
|   <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoVi.ViCamera"> | 
|     <!--@mbg.generated--> | 
|     update vi_camera | 
|     <set> | 
|       <if test="type != null"> | 
|         `type` = #{type,jdbcType=TINYINT}, | 
|       </if> | 
|       <if test="devNo != null"> | 
|         dev_no = #{devNo,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="name != null"> | 
|         `name` = #{name,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="lng != null"> | 
|         lng = #{lng,jdbcType=DOUBLE}, | 
|       </if> | 
|       <if test="lat != null"> | 
|         lat = #{lat,jdbcType=DOUBLE}, | 
|       </if> | 
|       <if test="onScreen != null"> | 
|         on_screen = #{onScreen,jdbcType=TINYINT}, | 
|       </if> | 
|       <if test="onSort != null"> | 
|         on_sort = #{onSort,jdbcType=INTEGER}, | 
|       </if> | 
|       <if test="remark != null"> | 
|         remark = #{remark,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="deleted != null"> | 
|         deleted = #{deleted,jdbcType=TINYINT}, | 
|       </if> | 
|     </set> | 
|     where id = #{id,jdbcType=BIGINT} | 
|   </update> | 
|   <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoVi.ViCamera"> | 
|     <!--@mbg.generated--> | 
|     update vi_camera | 
|     set `type` = #{type,jdbcType=TINYINT}, | 
|       dev_no = #{devNo,jdbcType=VARCHAR}, | 
|       `name` = #{name,jdbcType=VARCHAR}, | 
|       lng = #{lng,jdbcType=DOUBLE}, | 
|       lat = #{lat,jdbcType=DOUBLE}, | 
|       on_screen = #{onScreen,jdbcType=TINYINT}, | 
|       on_sort = #{onSort,jdbcType=INTEGER}, | 
|       remark = #{remark,jdbcType=VARCHAR}, | 
|       deleted = #{deleted,jdbcType=TINYINT} | 
|     where id = #{id,jdbcType=BIGINT} | 
|   </update> | 
| </mapper> |