LidarMapper.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.css.simulation.resource.model.mapper.LidarMapper" >
  4. <resultMap id="LidarVOMap" type="api.common.pojo.vo.model.LidarVO">
  5. <id column="ID" property="id" jdbcType="VARCHAR" />
  6. </resultMap>
  7. <select id="getLidarList" parameterType="api.common.pojo.param.model.LidarParam" resultMap="LidarVOMap">
  8. select
  9. id,
  10. sensor_name,
  11. description,
  12. share,
  13. fov_h,
  14. fov_v,
  15. far_distance,
  16. near_distance
  17. from model_sensor_lidar l
  18. where l.is_deleted = '0'
  19. <if test="sensorName != null and sensorName != ''">
  20. and l.sensor_name like CONCAT('%',#{sensorName,jdbcType=VARCHAR},'%')
  21. </if>
  22. <if test="share != null and share != ''">
  23. and l.create_user_id = #{createUserId,jdbcType=VARCHAR}
  24. and l.share = '0'
  25. </if>
  26. <if test="share == null or share == ''">
  27. and (l.create_user_id = #{createUserId,jdbcType=VARCHAR} or l.share = '1')
  28. </if>
  29. order by share asc
  30. </select>
  31. <select id="getLidarListGSy" parameterType="api.common.pojo.param.model.LidarParam" resultMap="LidarVOMap">
  32. select
  33. id,
  34. sensor_name,
  35. description,
  36. share,
  37. fov_h,
  38. fov_v,
  39. far_distance,
  40. near_distance
  41. from model_sensor_lidar l
  42. where l.is_deleted = '0'
  43. <if test="createUserId != null and createUserId != ''">
  44. and l.create_user_id = #{createUserId,jdbcType=VARCHAR}
  45. </if>
  46. <if test="share != null and share != ''">
  47. and l.share = #{share}
  48. </if>
  49. order by l.modify_time desc
  50. </select>
  51. <select id="getLidarInfo" parameterType="api.common.pojo.param.model.LidarParam" resultMap="LidarVOMap">
  52. select
  53. id,
  54. sensor_code,
  55. sensor_name,
  56. description,
  57. near_distance,
  58. far_distance,
  59. fov_h,
  60. fov_v,
  61. line_number,
  62. frame_rate,
  63. output_points,
  64. output_mode,
  65. share
  66. from model_sensor_lidar l
  67. where l.id = #{id,jdbcType=VARCHAR} limit 1
  68. </select>
  69. <select id="checkLidarName" parameterType="api.common.pojo.po.model.LidarPO" resultMap="LidarVOMap">
  70. select
  71. id
  72. from model_sensor_lidar
  73. where is_deleted = '0'
  74. and sensor_name = #{sensorName,jdbcType=VARCHAR}
  75. <if test="share != null and share != ''">
  76. and share = #{share,jdbcType=VARCHAR}
  77. </if>
  78. <if test="createUserId != null and createUserId != ''">
  79. and create_user_id = #{createUserId,jdbcType=VARCHAR}
  80. and id &lt;&gt; #{id,jdbcType=VARCHAR}
  81. </if>
  82. </select>
  83. <insert id="insert" parameterType="api.common.pojo.po.model.LidarPO">
  84. insert into model_sensor_lidar(
  85. id,
  86. sensor_code,
  87. sensor_name,
  88. description,
  89. near_distance,
  90. far_distance,
  91. fov_h,
  92. fov_v,
  93. line_number,
  94. frame_rate,
  95. output_points,
  96. output_mode,
  97. share,
  98. create_time,
  99. modify_time,
  100. create_user_id,
  101. modify_user_id,
  102. is_deleted
  103. )
  104. values(
  105. #{id,jdbcType=VARCHAR},
  106. #{sensorCode,jdbcType=VARCHAR},
  107. #{sensorName,jdbcType=VARCHAR},
  108. #{description,jdbcType=VARCHAR},
  109. #{nearDistance,jdbcType=DECIMAL},
  110. #{farDistance,jdbcType=DECIMAL},
  111. #{fovH,jdbcType=DECIMAL},
  112. #{fovV,jdbcType=DECIMAL},
  113. #{lineNumber,jdbcType=INTEGER},
  114. #{frameRate,jdbcType=DECIMAL},
  115. #{outputPoints,jdbcType=INTEGER},
  116. #{outputMode,jdbcType=VARCHAR},
  117. #{share,jdbcType=VARCHAR},
  118. #{createTime,jdbcType=TIMESTAMP},
  119. #{modifyTime,jdbcType=TIMESTAMP},
  120. #{createUserId,jdbcType=VARCHAR},
  121. #{modifyUserId,jdbcType=VARCHAR},
  122. #{isDeleted,jdbcType=VARCHAR}
  123. )
  124. </insert>
  125. <update id="update" parameterType="api.common.pojo.po.model.LidarPO">
  126. update model_sensor_lidar set
  127. sensor_name = #{sensorName,jdbcType=VARCHAR},
  128. description = #{description,jdbcType=VARCHAR},
  129. near_distance = #{nearDistance,jdbcType=DECIMAL},
  130. far_distance = #{farDistance,jdbcType=DECIMAL},
  131. fov_h = #{fovH,jdbcType=DECIMAL},
  132. fov_v = #{fovV,jdbcType=DECIMAL},
  133. line_number = #{lineNumber,jdbcType=INTEGER},
  134. frame_rate = #{frameRate,jdbcType=DECIMAL},
  135. output_points = #{outputPoints,jdbcType=INTEGER},
  136. output_mode = #{outputMode,jdbcType=VARCHAR},
  137. modify_time = #{modifyTime,jdbcType=TIMESTAMP},
  138. modify_user_id = #{modifyUserId,jdbcType=VARCHAR}
  139. where id = #{id,jdbcType=VARCHAR}
  140. </update>
  141. <update id="delLidarById" parameterType="api.common.pojo.po.model.LidarPO">
  142. update model_sensor_lidar set
  143. modify_time = #{modifyTime,jdbcType=TIMESTAMP},
  144. modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
  145. is_deleted = #{isDeleted,jdbcType=VARCHAR}
  146. where id = #{id,jdbcType=VARCHAR}
  147. </update>
  148. </mapper>