EntRiskPointMapLayerMapper.xml 6.3 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.zhyc.xps.aqpt.mapper.EntRiskPointMapLayerMapper">
  4. <resultMap id="RiskPointMapLayerDtoMap" type="com.zhyc.xps.aqpt.dto.EntRiskPointMapLayerDto">
  5. <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
  6. <result column="risk_point_id" property="riskPointId" jdbcType="BIGINT"/>
  7. <result column="map_id" property="mapId" jdbcType="BIGINT"/>
  8. <result column="layer_id" property="layerId" jdbcType="BIGINT"/>
  9. <result column="risk_point_title" property="riskPointTitle" jdbcType="VARCHAR"/>
  10. <result column="map_raster_layer" property="mapRasterLayer" jdbcType="VARCHAR"/>
  11. <result column="layer_title" property="layerTitle" jdbcType="VARCHAR"/>
  12. <result column="layer_marker" property="layerMarker" jdbcType="VARCHAR"/>
  13. <result column="layer_vector" property="layerVector" jdbcType="VARCHAR"/>
  14. <result column="layer_vector_type" property="layerVectorType" jdbcType="VARCHAR"/>
  15. </resultMap>
  16. <sql id="Ext_Column_List">
  17. A.oc_id,
  18. A.map_id,
  19. C.map_raster_layer,
  20. A.risk_point_id,
  21. B.risk_point_title,
  22. A.layer_id,
  23. D.layer_title,
  24. D.layer_marker,
  25. D.layer_vector,
  26. D.layer_vector_type
  27. </sql>
  28. <!--基于ID查询-->
  29. <select id="getById" resultMap="RiskPointMapLayerDtoMap">
  30. SELECT
  31. <include refid="Ext_Column_List"/>
  32. FROM ent_risk_point_map_layer AS A
  33. LEFT JOIN ent_risk_point AS B ON (A.oc_id = B.oc_id AND A.risk_point_id = B.risk_point_id)
  34. LEFT JOIN ent_map AS C ON (A.oc_id = C.oc_id AND A.map_id = C.map_id )
  35. LEFT JOIN ent_map_layer AS D ON (A.oc_id = D.oc_id AND A.map_id = D.map_id AND A.layer_id = D.layer_id)
  36. WHERE 1 = 1 AND A.deleted_flag = 0
  37. <if test="ocId != null">
  38. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  39. </if>
  40. <if test="riskPointId != null">
  41. AND A.risk_point_id = #{riskPointId ,jdbcType=BIGINT}
  42. </if>
  43. LIMIT 0, 1
  44. </select>
  45. <!--分页查询-->
  46. <select id="getByPage" parameterType="java.util.Map" resultMap="RiskPointMapLayerDtoMap">
  47. SELECT
  48. <include refid="Ext_Column_List"/>
  49. FROM ent_risk_point_map_layer AS A
  50. LEFT JOIN ent_risk_point AS B ON (A.oc_id = B.oc_id AND A.risk_point_id = B.risk_point_id)
  51. LEFT JOIN ent_map AS C ON (A.oc_id = C.oc_id AND A.map_id = C.map_id )
  52. LEFT JOIN ent_map_layer AS D ON (A.oc_id = D.oc_id AND A.map_id = D.map_id AND A.layer_id = D.layer_id)
  53. WHERE 1 = 1 AND A.deleted_flag = 0
  54. <if test="ocId != null">
  55. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  56. </if>
  57. <if test="mapId != null">
  58. AND A.map_id = #{mapId ,jdbcType=BIGINT}
  59. </if>
  60. <if test="keywords != null and keywords != ''">
  61. AND D.layer_title like "%"#{keywords}"%"
  62. </if>
  63. ORDER BY A.risk_point_id ASC
  64. </select>
  65. <!--列表查询-->
  66. <select id="getByList" parameterType="java.util.Map" resultMap="RiskPointMapLayerDtoMap">
  67. SELECT
  68. <include refid="Ext_Column_List"/>
  69. FROM ent_risk_point_map_layer AS A
  70. LEFT JOIN ent_risk_point AS B ON (A.oc_id = B.oc_id AND A.risk_point_id = B.risk_point_id)
  71. LEFT JOIN ent_map AS C ON (A.oc_id = C.oc_id AND A.map_id = C.map_id )
  72. LEFT JOIN ent_map_layer AS D ON (A.oc_id = D.oc_id AND A.map_id = D.map_id AND A.layer_id = D.layer_id)
  73. WHERE A.deleted_flag = 0 and B.deleted_flag = 0
  74. <if test="ocId != null">
  75. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  76. </if>
  77. <if test="mapId != null">
  78. AND A.map_id = #{mapId ,jdbcType=BIGINT}
  79. </if>
  80. <if test="keywords != null and keywords != ''">
  81. AND D.layer_title like "%"#{keywords}"%"
  82. </if>
  83. ORDER BY A.risk_point_id ASC
  84. </select>
  85. <insert id="create" parameterType="com.zhyc.xps.aqpt.entity.EntRiskPointMapLayer">
  86. INSERT INTO ent_risk_point_map_layer
  87. <trim prefix="(" suffix=")" suffixOverrides=",">
  88. <if test="ocId != null">
  89. oc_id,
  90. </if>
  91. <if test="riskPointId != null">
  92. risk_point_id,
  93. </if>
  94. <if test="mapId != null">
  95. map_id,
  96. </if>
  97. <if test="layerId != null">
  98. layer_id,
  99. </if>
  100. <if test="createdBy != null">
  101. created_by,
  102. </if>
  103. <if test="createdAt != null">
  104. created_at,
  105. </if>
  106. </trim>
  107. <trim prefix="values (" suffix=")" suffixOverrides=",">
  108. <if test="ocId != null">
  109. #{ocId ,jdbcType=BIGINT},
  110. </if>
  111. <if test="riskPointId != null">
  112. #{riskPointId ,jdbcType=BIGINT},
  113. </if>
  114. <if test="mapId != null">
  115. #{mapId ,jdbcType=BIGINT},
  116. </if>
  117. <if test="layerId != null">
  118. #{layerId ,jdbcType=BIGINT},
  119. </if>
  120. <if test="createdBy != null">
  121. #{createdBy ,jdbcType=BIGINT},
  122. </if>
  123. <if test="createdAt != null">
  124. #{createdAt ,jdbcType=TIMESTAMP},
  125. </if>
  126. </trim>
  127. </insert>
  128. <!--删除-->
  129. <delete id="delete" parameterType="java.util.Map">
  130. DELETE FROM ent_risk_point_map_layer
  131. WHERE 1 = 1
  132. <if test="ocId != null">
  133. AND oc_id = #{ocId ,jdbcType=BIGINT}
  134. </if>
  135. <if test="mapId != null">
  136. AND map_id = #{mapId ,jdbcType=BIGINT}
  137. </if>
  138. <if test="layerId != null">
  139. AND layer_id = #{layerId ,jdbcType=BIGINT}
  140. </if>
  141. <if test="riskPointId != null">
  142. AND risk_point_id = #{riskPointId ,jdbcType=BIGINT}
  143. </if>
  144. </delete>
  145. </mapper>