TResObservationtowerMapper.xml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.business.slfh.manager.observationtowermanager.mapper.TResObservationtowerMapper">
  6. <resultMap type="TResObservationtower" id="TResObservationtowerResult">
  7. <result property="id" column="id" />
  8. <result property="status" column="status" />
  9. <result property="remark" column="remark" />
  10. <result property="delFlag" column="del_flag" />
  11. <result property="createBy" column="create_by" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateBy" column="update_by" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="name" column="name" />
  16. <result property="height" column="height" />
  17. <result property="longitude" column="longitude" />
  18. <result property="latitude" column="latitude" />
  19. <result property="image" column="image" />
  20. <result property="radius" column="radius" />
  21. <result property="size" column="size" />
  22. <result property="volume" column="volume" />
  23. <result property="supermapId" column="supermap_id" />
  24. <result property="deptId" column="dept_id" />
  25. <result property="deptName" column="dept_name" />
  26. <result property="createUserId" column="create_user_id" />
  27. </resultMap>
  28. <sql id="selectTResObservationtowerVo">
  29. select t.dept_id,
  30. (select dept_name from sys_dept where dept_id=t.dept_id) dept_name,
  31. t.create_user_id, t.supermap_id, t.id, t.status, t.remark, t.del_flag, t.create_by, t.create_time, t.update_by, t.update_time, t.name, t.height, t.longitude, t.latitude, t.image, t.radius, t.size, t.volume,(select name from t_res_camera a where a.id = t.remark) cameraLabel from t_res_observationtower t
  32. </sql>
  33. <select id="selectTResObservationtowerList" parameterType="TResObservationtower" resultMap="TResObservationtowerResult">
  34. <include refid="selectTResObservationtowerVo"/>
  35. <where>
  36. 1=1
  37. <if test="status != null and status != ''"> and status = #{status}</if>
  38. <if test="supermapId != null and supermapId != ''"> and supermap_id = #{supermapId}</if>
  39. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  40. <if test="height != null "> and height = #{height}</if>
  41. <if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
  42. <if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
  43. <if test="image != null and image != ''"> and image = #{image}</if>
  44. <if test="radius != null "> and radius = #{radius}</if>
  45. <if test="size != null "> and size = #{size}</if>
  46. <if test="volume != null "> and volume = #{volume}</if>
  47. <if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
  48. <if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId}</if>
  49. </where>
  50. <!-- 数据范围过滤 -->
  51. ${params.dataScope}
  52. </select>
  53. <select id="selectTResObservationtowerById" parameterType="String" resultMap="TResObservationtowerResult">
  54. <include refid="selectTResObservationtowerVo"/>
  55. where id = #{id}
  56. </select>
  57. <insert id="insertTResObservationtower" parameterType="TResObservationtower">
  58. insert into t_res_observationtower
  59. <trim prefix="(" suffix=")" suffixOverrides=",">
  60. <if test="id != null and id != ''">id,</if>
  61. <if test="status != null">status,</if>
  62. <if test="supermapId != null">supermap_id,</if>
  63. <if test="remark != null">remark,</if>
  64. <if test="delFlag != null">del_flag,</if>
  65. <if test="createBy != null">create_by,</if>
  66. <if test="createTime != null">create_time,</if>
  67. <if test="updateBy != null">update_by,</if>
  68. <if test="updateTime != null">update_time,</if>
  69. <if test="name != null">name,</if>
  70. <if test="height != null">height,</if>
  71. <if test="longitude != null">longitude,</if>
  72. <if test="latitude != null">latitude,</if>
  73. <if test="image != null">image,</if>
  74. <if test="radius != null">radius,</if>
  75. <if test="size != null">size,</if>
  76. <if test="volume != null">volume,</if>
  77. <if test="deptId != null">dept_id,</if>
  78. <if test="createUserId != null">create_user_id,</if>
  79. </trim>
  80. <trim prefix="values (" suffix=")" suffixOverrides=",">
  81. <if test="id != null and id != ''">#{id},</if>
  82. <if test="status != null">#{status},</if>
  83. <if test="supermapId != null">#{supermapId},</if>
  84. <if test="remark != null">#{remark},</if>
  85. <if test="delFlag != null">#{delFlag},</if>
  86. <if test="createBy != null">#{createBy},</if>
  87. <if test="createTime != null">#{createTime},</if>
  88. <if test="updateBy != null">#{updateBy},</if>
  89. <if test="updateTime != null">#{updateTime},</if>
  90. <if test="name != null">#{name},</if>
  91. <if test="height != null">#{height},</if>
  92. <if test="longitude != null">#{longitude},</if>
  93. <if test="latitude != null">#{latitude},</if>
  94. <if test="image != null">#{image},</if>
  95. <if test="radius != null">#{radius},</if>
  96. <if test="size != null">#{size},</if>
  97. <if test="volume != null">#{volume},</if>
  98. <if test="deptId != null">#{deptId},</if>
  99. <if test="createUserId != null">#{createUserId},</if>
  100. </trim>
  101. </insert>
  102. <update id="updateTResObservationtower" parameterType="TResObservationtower">
  103. update t_res_observationtower
  104. <trim prefix="SET" suffixOverrides=",">
  105. <if test="status != null">status = #{status},</if>
  106. <if test="supermapId != null">supermap_id = #{supermapId},</if>
  107. <if test="remark != null">remark = #{remark},</if>
  108. <if test="delFlag != null">del_flag = #{delFlag},</if>
  109. <if test="createBy != null">create_by = #{createBy},</if>
  110. <if test="createTime != null">create_time = #{createTime},</if>
  111. <if test="updateBy != null">update_by = #{updateBy},</if>
  112. <if test="updateTime != null">update_time = #{updateTime},</if>
  113. <if test="name != null">name = #{name},</if>
  114. <if test="height != null">height = #{height},</if>
  115. <if test="longitude != null">longitude = #{longitude},</if>
  116. <if test="latitude != null">latitude = #{latitude},</if>
  117. <if test="image != null">image = #{image},</if>
  118. <if test="radius != null">radius = #{radius},</if>
  119. <if test="size != null">size = #{size},</if>
  120. <if test="volume != null">volume = #{volume},</if>
  121. <if test="deptId != null">dept_id = #{deptId},</if>
  122. <if test="createUserId != null">create_user_id = #{createUserId},</if>
  123. </trim>
  124. where id = #{id}
  125. </update>
  126. <delete id="deleteTResObservationtowerById" parameterType="String">
  127. delete from t_res_observationtower where id = #{id}
  128. </delete>
  129. <delete id="deleteTResObservationtowerByIds" parameterType="String">
  130. delete from t_res_observationtower where id in
  131. <foreach item="id" collection="array" open="(" separator="," close=")">
  132. #{id}
  133. </foreach>
  134. </delete>
  135. </mapper>