| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <?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.css.simulation.resource.model.mapper.OgtMapper" >
- <resultMap id="OgtVOMap" type="api.common.pojo.vo.model.OgtVO">
- <id column="ID" property="id" jdbcType="VARCHAR" />
- </resultMap>
- <select id="getOgtList" parameterType="api.common.pojo.param.model.OgtParam" resultMap="OgtVOMap">
- select
- id,
- sensor_name,
- description,
- share
- from model_sensor_ogt o
- where o.is_deleted = '0'
- <if test="sensorName != null and sensorName != ''">
- and o.sensor_name like CONCAT('%',#{sensorName,jdbcType=VARCHAR},'%')
- </if>
- <if test="share != null and share != ''">
- and o.create_user_id = #{createUserId,jdbcType=VARCHAR}
- and o.share = '0'
- </if>
- <if test="share == null or share == ''">
- and (o.create_user_id = #{createUserId,jdbcType=VARCHAR} or o.share = '1')
- </if>
- order by o.create_time desc
- </select>
- <select id="getOgtInfo" parameterType="api.common.pojo.param.model.OgtParam" resultMap="OgtVOMap">
- select
- id,
- sensor_code,
- sensor_name,
- description,
- near_distance,
- far_distance,
- fov_h_left,
- fov_h_right,
- fov_v_top,
- fov_v_bottom,
- range_display,
- max_objects,
- coordinate_system,
- target_filter,
- share
- from model_sensor_ogt o
- where o.id = #{id,jdbcType=VARCHAR} limit 1
- </select>
- <select id="checkOgtName" parameterType="api.common.pojo.po.model.OgtPO" resultMap="OgtVOMap">
- select
- id
- from model_sensor_ogt
- where is_deleted = '0' and share = '0'
- and sensor_name = #{sensorName,jdbcType=VARCHAR}
- and create_user_id = #{createUserId,jdbcType=VARCHAR}
- and id <> #{id,jdbcType=VARCHAR}
- </select>
- <insert id="insert" parameterType="api.common.pojo.po.model.OgtPO">
- insert into model_sensor_ogt(
- id,
- sensor_code,
- sensor_name,
- description,
- near_distance,
- far_distance,
- fov_h_left,
- fov_h_right,
- fov_v_top,
- fov_v_bottom,
- range_display,
- max_objects,
- coordinate_system,
- target_filter,
- share,
- create_time,
- modify_time,
- create_user_id,
- modify_user_id,
- is_deleted
- )
- values(
- #{id,jdbcType=VARCHAR},
- #{sensorCode,jdbcType=VARCHAR},
- #{sensorName,jdbcType=VARCHAR},
- #{description,jdbcType=VARCHAR},
- #{nearDistance,jdbcType=DECIMAL},
- #{farDistance,jdbcType=DECIMAL},
- #{fovHLeft,jdbcType=DECIMAL},
- #{fovHRight,jdbcType=DECIMAL},
- #{fovVTop,jdbcType=DECIMAL},
- #{fovVBottom,jdbcType=DECIMAL},
- #{rangeDisplay,jdbcType=VARCHAR},
- #{maxObjects,jdbcType=INTEGER},
- #{coordinateSystem,jdbcType=VARCHAR},
- #{targetFilter,jdbcType=VARCHAR},
- #{share,jdbcType=VARCHAR},
- #{createTime,jdbcType=TIMESTAMP},
- #{modifyTime,jdbcType=TIMESTAMP},
- #{createUserId,jdbcType=VARCHAR},
- #{modifyUserId,jdbcType=VARCHAR},
- #{isDeleted,jdbcType=VARCHAR}
- )
- </insert>
- <update id="update" parameterType="api.common.pojo.po.model.OgtPO">
- update model_sensor_ogt set
- sensor_code = #{sensorCode,jdbcType=VARCHAR},
- sensor_name = #{sensorName,jdbcType=VARCHAR},
- description = #{description,jdbcType=VARCHAR},
- near_distance = #{nearDistance,jdbcType=DECIMAL},
- far_distance = #{farDistance,jdbcType=DECIMAL},
- fov_h_left = #{fovHLeft,jdbcType=DECIMAL},
- fov_h_right = #{fovHRight,jdbcType=DECIMAL},
- fov_v_top = #{fovVTop,jdbcType=DECIMAL},
- fov_v_bottom = #{fovVBottom,jdbcType=DECIMAL},
- range_display = #{rangeDisplay,jdbcType=VARCHAR},
- max_objects = #{maxObjects,jdbcType=INTEGER},
- coordinate_system = #{coordinateSystem,jdbcType=VARCHAR},
- target_filter = #{targetFilter,jdbcType=VARCHAR},
- modify_time = #{modifyTime,jdbcType=TIMESTAMP},
- modify_user_id = #{modifyUserId,jdbcType=VARCHAR}
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="delOgtById" parameterType="api.common.pojo.po.model.OgtPO">
- update model_sensor_ogt set
- modify_time = #{modifyTime,jdbcType=TIMESTAMP},
- modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
- is_deleted = #{isDeleted,jdbcType=VARCHAR}
- where id = #{id,jdbcType=VARCHAR}
- </update>
- </mapper>
|