EntMapLayerMapper.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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.zhyc.xps.sys.mapper.EntMapLayerMapper">
  4. <resultMap id="MapLayerDtoMap" type="com.zhyc.xps.sys.dto.EntMapLayerDto" >
  5. <result column="oc_id" property="ocId" jdbcType="BIGINT" />
  6. <result column="map_id" property="mapId" jdbcType="BIGINT" />
  7. <result column="map_raster_layer" property="mapRasterLayer" jdbcType="BIGINT" />
  8. <result column="layer_id" property="layerId" jdbcType="BIGINT" />
  9. <result column="layer_cat_id" property="layerCatId" jdbcType="BIGINT" />
  10. <result column="layer_title" property="layerTitle" jdbcType="VARCHAR"/>
  11. <result column="layer_marker" property="layerMarker" jdbcType="VARCHAR"/>
  12. <result column="layer_vector" property="layerVector" jdbcType="VARCHAR"/>
  13. <result column="layer_vector_type" property="layerVectorType" jdbcType="BIGINT" />
  14. </resultMap>
  15. <sql id="MapLayerDto_Cols">
  16. A.oc_id,
  17. A.map_id,
  18. B.map_raster_layer,
  19. A.layer_id,
  20. A.layer_cat_id,
  21. A.layer_title,
  22. A.layer_marker,
  23. A.layer_vector,
  24. A.layer_vector_type
  25. </sql>
  26. <!--根据ID获取信息-->
  27. <select id="getById" resultMap="MapLayerDtoMap">
  28. SELECT
  29. <include refid="MapLayerDto_Cols"/>
  30. FROM ent_map_layer AS A
  31. LEFT JOIN ent_map AS B ON (A.oc_id = B.oc_id AND A.map_id = B.map_id)
  32. WHERE A.deleted_flag = 0
  33. <if test="ocId != null">
  34. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  35. </if>
  36. <if test="mapId != null">
  37. AND A.map_id = #{mapId ,jdbcType=BIGINT}
  38. </if>
  39. <if test="layerId != null">
  40. AND A.layer_id = #{layerId ,jdbcType=BIGINT}
  41. </if>
  42. LIMIT 0, 1
  43. </select>
  44. <!--分页查询信息-->
  45. <select id="getByPage" parameterType="java.util.Map" resultMap="MapLayerDtoMap">
  46. SELECT
  47. <include refid="MapLayerDto_Cols"/>
  48. FROM ent_map_layer AS A
  49. LEFT JOIN ent_map AS B ON (A.oc_id = B.oc_id AND A.map_id = B.map_id)
  50. WHERE 1 = 1 AND A.deleted_flag = 0
  51. <if test="ocId != null">
  52. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  53. </if>
  54. <if test="mapId != null">
  55. AND A.map_id = #{mapId ,jdbcType=BIGINT}
  56. </if>
  57. <if test="keywords != null and keywords != ''">
  58. AND A.layer_title like "%"#{keywords}"%"
  59. </if>
  60. ORDER BY A.layer_id ASC
  61. </select>
  62. <select id="getByList" parameterType="java.util.Map" resultMap="MapLayerDtoMap">
  63. SELECT
  64. <include refid="MapLayerDto_Cols"/>
  65. FROM ent_map_layer AS A
  66. LEFT JOIN ent_map AS B ON (A.oc_id = B.oc_id AND A.map_id = B.map_id)
  67. WHERE 1 = 1 AND A.deleted_flag = 0
  68. <if test="ocId != null">
  69. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  70. </if>
  71. <if test="mapId != null">
  72. AND A.map_id = #{mapId ,jdbcType=BIGINT}
  73. </if>
  74. <if test="keywords != null and keywords != ''">
  75. AND A.layer_title like "%"#{keywords}"%"
  76. </if>
  77. ORDER BY A.layer_id ASC
  78. </select>
  79. <insert id="create" parameterType="com.zhyc.xps.sys.entity.EntMapLayer">
  80. INSERT INTO ent_map_layer
  81. <trim prefix="(" suffix=")" suffixOverrides=",">
  82. <if test="ocId != null">
  83. oc_id,
  84. </if>
  85. <if test="mapId != null">
  86. map_id,
  87. </if>
  88. <if test="layerId != null">
  89. layer_id,
  90. </if>
  91. <if test="layerCatId != null">
  92. layer_cat_id,
  93. </if>
  94. <if test="layerTitle != null and layerTitle != ''">
  95. layer_title,
  96. </if>
  97. <if test="layerMarker != null and layerMarker != ''">
  98. layer_marker,
  99. </if>
  100. <if test="layerVector != null and layerVector != ''">
  101. layer_vector,
  102. </if>
  103. <if test="layerVectorType != null">
  104. layerVectorType,
  105. </if>
  106. <if test="createdBy != null">
  107. created_by,
  108. </if>
  109. <if test="createdAt != null">
  110. created_at,
  111. </if>
  112. </trim>
  113. <trim prefix="values (" suffix=")" suffixOverrides=",">
  114. <if test="ocId != null">
  115. #{ocId ,jdbcType=BIGINT},
  116. </if>
  117. <if test="mapId != null">
  118. #{mapId ,jdbcType=BIGINT},
  119. </if>
  120. <if test="layerId != null">
  121. #{layerId ,jdbcType=BIGINT},
  122. </if>
  123. <if test="layerCatId != null">
  124. #{layerCatId ,jdbcType=BIGINT},
  125. </if>
  126. <if test="layerTitle != null and layerTitle != ''">
  127. #{layerTitle ,jdbcType=VARCHAR},
  128. </if>
  129. <if test="layerMarker != null and layerMarker != ''">
  130. #{layerMarker ,jdbcType=VARCHAR},
  131. </if>
  132. <if test="layerVector != null and layerVector != ''">
  133. #{layerVector ,jdbcType=VARCHAR},
  134. </if>
  135. <if test="layerVectorType != null">
  136. #{layerVectorType ,jdbcType=BIGINT},
  137. </if>
  138. <if test="createdBy != null">
  139. #{createdBy ,jdbcType=BIGINT},
  140. </if>
  141. <if test="createdAt != null">
  142. #{createdAt ,jdbcType=TIMESTAMP},
  143. </if>
  144. </trim>
  145. </insert>
  146. <!--更新-->
  147. <update id="update" parameterType="com.zhyc.xps.sys.entity.EntMapLayer">
  148. UPDATE ent_map_layer
  149. <trim suffixOverrides=",">
  150. <set>
  151. <if test="mapId != null">
  152. map_id = #{mapId ,jdbcType=BIGINT},
  153. </if>
  154. <if test="layerTitle != null and layerTitle != ''">
  155. layer_title = #{layerTitle ,jdbcType=VARCHAR},
  156. </if>
  157. <if test="layerMarker != null and layerMarker != ''">
  158. layer_marker = #{layerMarker ,jdbcType=VARCHAR},
  159. </if>
  160. <if test="layerVector != null and layerVector != ''">
  161. layer_vector = #{layerVector ,jdbcType=VARCHAR},
  162. </if>
  163. <if test="layerVectorType != null">
  164. layer_vector_type = #{layerVectorType ,jdbcType=BIGINT},
  165. </if>
  166. <if test="updatedBy != null ">
  167. updated_by = #{updatedBy ,jdbcType=BIGINT},
  168. </if>
  169. <if test="updatedAt != null">
  170. updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
  171. </if>
  172. </set>
  173. </trim>
  174. WHERE oc_id = #{ocId ,jdbcType=BIGINT}
  175. AND layer_id = #{layerId ,jdbcType=BIGINT}
  176. </update>
  177. <!--删除-->
  178. <delete id="delete" parameterType="java.util.Map">
  179. DELETE FROM ent_map_layer
  180. WHERE 1 = 1
  181. <if test="ocId != null">
  182. AND oc_id = #{ocId ,jdbcType=BIGINT}
  183. </if>
  184. <if test="mapId != null">
  185. AND map_id = #{mapId ,jdbcType=BIGINT}
  186. </if>
  187. <if test="layerId != null">
  188. AND layer_id = #{layerId ,jdbcType=BIGINT}
  189. </if>
  190. </delete>
  191. </mapper>