CesiumMapConfigMapper.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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.ruoyi.system.mapper.CesiumMapConfigMapper">
  6. <resultMap type="com.ruoyi.system.domain.CesiumMapConfig" id="CesiumMapConfigResult">
  7. <result property="configId" column="config_id" />
  8. <result property="userId" column="user_id" />
  9. <result property="configName" column="config_name" />
  10. <result property="baseLayerType" column="base_layer_type" />
  11. <result property="baseLayerName" column="base_layer_name" />
  12. <result property="baseLayerUrl" column="base_layer_url" />
  13. <result property="terrainLayerType" column="terrain_layer_type" />
  14. <result property="terrainLayerName" column="terrain_layer_name" />
  15. <result property="terrainLayerUrl" column="terrain_layer_url" />
  16. <result property="webServices" column="web_services" />
  17. <result property="loadedModels" column="loaded_models" />
  18. <result property="loadedCustomServices" column="loaded_custom_services" />
  19. <result property="isDefault" column="is_default" />
  20. <result property="createBy" column="create_by" />
  21. <result property="createTime" column="create_time" />
  22. <result property="updateBy" column="update_by" />
  23. <result property="updateTime" column="update_time" />
  24. <result property="remark" column="remark" />
  25. </resultMap>
  26. <sql id="selectCesiumMapConfigVo">
  27. select config_id, user_id, config_name, base_layer_type, base_layer_name, base_layer_url,
  28. terrain_layer_type, terrain_layer_name, terrain_layer_url, web_services, loaded_models, loaded_custom_services,
  29. is_default, create_by, create_time, update_by, update_time, remark
  30. from cesium_map_config
  31. </sql>
  32. <select id="selectCesiumMapConfigByConfigId" parameterType="Long" resultMap="CesiumMapConfigResult">
  33. <include refid="selectCesiumMapConfigVo"/>
  34. where config_id = #{configId}
  35. </select>
  36. <select id="selectCesiumMapConfigList" parameterType="com.ruoyi.system.domain.CesiumMapConfig" resultMap="CesiumMapConfigResult">
  37. <include refid="selectCesiumMapConfigVo"/>
  38. <where>
  39. <if test="userId != null"> and user_id = #{userId}</if>
  40. <if test="configName != null and configName != ''"> and config_name like concat('%', #{configName}, '%')</if>
  41. <if test="baseLayerType != null and baseLayerType != ''"> and base_layer_type = #{baseLayerType}</if>
  42. <if test="baseLayerName != null and baseLayerName != ''"> and base_layer_name like concat('%', #{baseLayerName}, '%')</if>
  43. <if test="terrainLayerType != null and terrainLayerType != ''"> and terrain_layer_type = #{terrainLayerType}</if>
  44. <if test="terrainLayerName != null and terrainLayerName != ''"> and terrain_layer_name like concat('%', #{terrainLayerName}, '%')</if>
  45. <if test="isDefault != null"> and is_default = #{isDefault}</if>
  46. </where>
  47. order by create_time desc
  48. </select>
  49. <select id="selectDefaultConfigByUserId" parameterType="Long" resultMap="CesiumMapConfigResult">
  50. <include refid="selectCesiumMapConfigVo"/>
  51. where user_id = #{userId} and is_default = 1
  52. order by update_time desc
  53. limit 1
  54. </select>
  55. <insert id="insertCesiumMapConfig" parameterType="com.ruoyi.system.domain.CesiumMapConfig" useGeneratedKeys="true" keyProperty="configId">
  56. insert into cesium_map_config
  57. <trim prefix="(" suffix=")" suffixOverrides=",">
  58. <if test="userId != null">user_id,</if>
  59. <if test="configName != null and configName != ''">config_name,</if>
  60. <if test="baseLayerType != null and baseLayerType != ''">base_layer_type,</if>
  61. <if test="baseLayerName != null and baseLayerName != ''">base_layer_name,</if>
  62. <if test="baseLayerUrl != null and baseLayerUrl != ''">base_layer_url,</if>
  63. <if test="terrainLayerType != null and terrainLayerType != ''">terrain_layer_type,</if>
  64. <if test="terrainLayerName != null and terrainLayerName != ''">terrain_layer_name,</if>
  65. <if test="terrainLayerUrl != null and terrainLayerUrl != ''">terrain_layer_url,</if>
  66. <if test="webServices != null and webServices != ''">web_services,</if>
  67. <if test="loadedModels != null and loadedModels != ''">loaded_models,</if>
  68. <if test="loadedCustomServices != null and loadedCustomServices != ''">loaded_custom_services,</if>
  69. <if test="isDefault != null">is_default,</if>
  70. <if test="createBy != null and createBy != ''">create_by,</if>
  71. <if test="createTime != null">create_time,</if>
  72. <if test="updateBy != null and updateBy != ''">update_by,</if>
  73. <if test="updateTime != null">update_time,</if>
  74. <if test="remark != null and remark != ''">remark,</if>
  75. </trim>
  76. <trim prefix="values (" suffix=")" suffixOverrides=",">
  77. <if test="userId != null">#{userId},</if>
  78. <if test="configName != null and configName != ''">#{configName},</if>
  79. <if test="baseLayerType != null and baseLayerType != ''">#{baseLayerType},</if>
  80. <if test="baseLayerName != null and baseLayerName != ''">#{baseLayerName},</if>
  81. <if test="baseLayerUrl != null and baseLayerUrl != ''">#{baseLayerUrl},</if>
  82. <if test="terrainLayerType != null and terrainLayerType != ''">#{terrainLayerType},</if>
  83. <if test="terrainLayerName != null and terrainLayerName != ''">#{terrainLayerName},</if>
  84. <if test="terrainLayerUrl != null and terrainLayerUrl != ''">#{terrainLayerUrl},</if>
  85. <if test="webServices != null and webServices != ''">#{webServices},</if>
  86. <if test="loadedModels != null and loadedModels != ''">#{loadedModels},</if>
  87. <if test="loadedCustomServices != null and loadedCustomServices != ''">#{loadedCustomServices},</if>
  88. <if test="isDefault != null">#{isDefault},</if>
  89. <if test="createBy != null and createBy != ''">#{createBy},</if>
  90. <if test="createTime != null">#{createTime},</if>
  91. <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
  92. <if test="updateTime != null">#{updateTime},</if>
  93. <if test="remark != null and remark != ''">#{remark},</if>
  94. </trim>
  95. </insert>
  96. <update id="updateCesiumMapConfig" parameterType="com.ruoyi.system.domain.CesiumMapConfig">
  97. update cesium_map_config
  98. <trim prefix="SET" suffixOverrides=",">
  99. <if test="userId != null">user_id = #{userId},</if>
  100. <if test="configName != null">config_name = #{configName},</if>
  101. <if test="baseLayerType != null">base_layer_type = #{baseLayerType},</if>
  102. <if test="baseLayerName != null">base_layer_name = #{baseLayerName},</if>
  103. <if test="baseLayerUrl != null">base_layer_url = #{baseLayerUrl},</if>
  104. <if test="terrainLayerType != null">terrain_layer_type = #{terrainLayerType},</if>
  105. <if test="terrainLayerType == null">terrain_layer_type = NULL,</if>
  106. <if test="terrainLayerName != null">terrain_layer_name = #{terrainLayerName},</if>
  107. <if test="terrainLayerName == null">terrain_layer_name = NULL,</if>
  108. <if test="terrainLayerUrl != null">terrain_layer_url = #{terrainLayerUrl},</if>
  109. <if test="terrainLayerUrl == null">terrain_layer_url = NULL,</if>
  110. <if test="webServices != null">web_services = #{webServices},</if>
  111. <if test="loadedModels != null">loaded_models = #{loadedModels},</if>
  112. <if test="loadedCustomServices != null">loaded_custom_services = #{loadedCustomServices},</if>
  113. <if test="isDefault != null">is_default = #{isDefault},</if>
  114. <if test="createBy != null">create_by = #{createBy},</if>
  115. <if test="createTime != null">create_time = #{createTime},</if>
  116. <if test="updateBy != null">update_by = #{updateBy},</if>
  117. <if test="updateTime != null">update_time = #{updateTime},</if>
  118. <if test="remark != null">remark = #{remark},</if>
  119. </trim>
  120. where config_id = #{configId}
  121. </update>
  122. <delete id="deleteCesiumMapConfigByConfigId" parameterType="Long">
  123. delete from cesium_map_config where config_id = #{configId}
  124. </delete>
  125. <delete id="deleteCesiumMapConfigByConfigIds" parameterType="String">
  126. delete from cesium_map_config where config_id in
  127. <foreach item="configId" collection="array" open="(" separator="," close=")">
  128. #{configId}
  129. </foreach>
  130. </delete>
  131. </mapper>