GoafMapFlayerMapper.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  4. <mapper namespace="com.zhyc.xps.goaf.mapper.GoafMapFlayerMapper">
  5. <resultMap id="GoafMapDtoMapper" type="com.zhyc.xps.goaf.dto.GoafMapDto">
  6. <id column="goaflayer_id" property="goaflayerId" jdbcType="BIGINT"/>
  7. <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
  8. <result column="goaf_id" property="goafId" jdbcType="BIGINT"/>
  9. <result column="goaf_name" property="goafName" jdbcType="VARCHAR"/>
  10. <result column="map_id" property="mapId" jdbcType="BIGINT"/>
  11. <result column="layer_id" property="layerId" jdbcType="BIGINT"/>
  12. <result column="layer_cat_id" property="layerCatId" jdbcType="BIGINT"/>
  13. <result column="layer_title" property="layerTitle" jdbcType="VARCHAR"/>
  14. <result column="layer_marker" property="layerMarker" jdbcType="VARCHAR"/>
  15. <result column="layer_vector" property="layerVector" jdbcType="VARCHAR"/>
  16. <result column="layer_vector_type" property="layerVectorType" jdbcType="BIGINT"/>
  17. </resultMap>
  18. <select id="getByList" parameterType="java.util.Map" resultMap="GoafMapDtoMapper">
  19. SELECT A.goaflayer_id,
  20. A.oc_id,
  21. A.goaf_id,
  22. A.goaf_name,
  23. A.map_id,
  24. A.layer_id,
  25. B.layer_cat_id,
  26. B.layer_title,
  27. B.layer_marker,
  28. B.layer_vector,
  29. B.layer_vector_type
  30. FROM goaf_map_layer AS A
  31. left join ent_map_layer AS B ON B.layer_id = A.layer_id
  32. WHERE A.oc_id = #{ocId, jdbcType=BIGINT}
  33. <if test="mapId !=null">
  34. AND A.map_id = #{mapId ,jdbcType=BIGINT}
  35. </if>
  36. <if test="goafId !=null">
  37. AND A.goaf_id = #{goafId ,jdbcType=BIGINT}
  38. </if>
  39. <if test="layerId !=null">
  40. AND A.layer_id = #{layerId ,jdbcType=BIGINT}
  41. </if>
  42. <if test="goafName !=null and goafName != ''">
  43. AND A.goaf_name = #{goafName ,jdbcType=VARCHAR}
  44. </if>
  45. </select>
  46. <!--分页查询-->
  47. <select id="getByPage" parameterType="java.util.Map" resultMap="GoafMapDtoMapper">
  48. SELECT A.goaflayer_id,
  49. A.oc_id,
  50. A.goaf_id,
  51. A.goaf_name,
  52. A.map_id,
  53. A.layer_id,
  54. B.layer_cat_id,
  55. B.layer_title,
  56. B.layer_marker,
  57. B.layer_vector,
  58. B.layer_vector_type
  59. FROM goaf_map_layer AS A
  60. left join ent_map_layer AS B ON B.layer_id = A.layer_id
  61. WHERE A.oc_id = #{ocId, jdbcType=BIGINT}
  62. <if test="mapId !=null">
  63. AND A.map_id = #{mapId ,jdbcType=BIGINT}
  64. </if>
  65. <if test="goafId !=null">
  66. AND A.goaf_id = #{goafId ,jdbcType=BIGINT}
  67. </if>
  68. <if test="layerId !=null">
  69. AND A.layer_id = #{layerId ,jdbcType=BIGINT}
  70. </if>
  71. <if test="goafName !=null and goafName != ''">
  72. AND A.goaf_name = #{goafName ,jdbcType=VARCHAR}
  73. </if>
  74. </select>
  75. <select id="getById" resultMap="GoafMapDtoMapper">
  76. SELECT A.goaflayer_id,
  77. A.oc_id,
  78. A.goaf_id,
  79. A.goaf_name,
  80. A.map_id,
  81. A.layer_id,
  82. B.layer_cat_id,
  83. B.layer_title,
  84. B.layer_marker,
  85. B.layer_vector,
  86. B.layer_vector_type
  87. FROM goaf_map_layer AS A
  88. left join ent_map_layer AS B ON B.layer_id = A.layer_id
  89. WHERE A.goaflayer_id = #{goaflayerId, jdbcType=BIGINT}
  90. </select>
  91. <insert id="create" parameterType="com.zhyc.xps.goaf.entity.GoafMapFlayer">
  92. insert into goaf_map_layer
  93. <trim prefix="(" suffix=")" suffixOverrides=",">
  94. <if test="goaflayerId != null">
  95. goaflayer_id,
  96. </if>
  97. <if test="ocId != null">
  98. oc_id,
  99. </if>
  100. <if test="goafId != null">
  101. goaf_id,
  102. </if>
  103. <if test="goafName != null and goafName != ''">
  104. goaf_name,
  105. </if>
  106. <if test="mapId != null">
  107. map_id,
  108. </if>
  109. <if test="layerId != null">
  110. layer_id,
  111. </if>
  112. </trim>
  113. <trim prefix="values (" suffix=")" suffixOverrides=",">
  114. <if test="goaflayerId != null">
  115. #{goaflayerId, jdbcType=BIGINT},
  116. </if>
  117. <if test="ocId != null">
  118. #{ocId, jdbcType=BIGINT},
  119. </if>
  120. <if test="goafId != null">
  121. #{goafId, jdbcType=BIGINT},
  122. </if>
  123. <if test="goafName != null and goafName != ''">
  124. #{goafName, jdbcType=VARCHAR},
  125. </if>
  126. <if test="mapId != null">
  127. #{mapId, jdbcType=BIGINT},
  128. </if>
  129. <if test="layerId != null">
  130. #{layerId, jdbcType=BIGINT},
  131. </if>
  132. </trim>
  133. </insert>
  134. <!--Update更新-->
  135. <update id="update" parameterType="com.zhyc.xps.goaf.entity.GoafMapFlayer">
  136. UPDATE goaf_map_layer
  137. <trim suffixOverrides=",">
  138. <set>
  139. <if test="goafId != null">
  140. goaf_id = #{goafId, jdbcType=BIGINT},
  141. </if>
  142. <if test="goafName != null and goafName != ''">
  143. goaf_name = #{goafName, jdbcType=VARCHAR},
  144. </if>
  145. <if test="mapId != null">
  146. map_id = #{mapId, jdbcType=BIGINT},
  147. </if>
  148. <if test="layerId != null">
  149. layer_id = #{layerId, jdbcType=BIGINT},
  150. </if>
  151. </set>
  152. </trim>
  153. WHERE goaflayer_id = #{goaflayerId, jdbcType=BIGINT}
  154. </update>
  155. <delete id="delete" >
  156. DELETE FROM goaf_map_layer
  157. WHERE goaflayer_id = #{goaflayerId, jdbcType=BIGINT}
  158. </delete>
  159. </mapper>