AttFloodqhBaseDao.xml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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="cn.com.goldenwater.dcproj.dao.AttFloodqhBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttFloodqhBase" id="attFloodqhBaseResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="nm" column="NM"/>
  7. <result property="floodType" column="FLOOD_TYPE"/>
  8. <result property="adCode" column="AD_CODE"/>
  9. <result property="adName" column="AD_NAME"/>
  10. <result property="loc" column="LOC"/>
  11. <result property="centerX" column="CENTER_X"/>
  12. <result property="centerY" column="CENTER_Y"/>
  13. <result property="gdX" column="GD_X"/>
  14. <result property="gdY" column="GD_Y"/>
  15. <result property="intm" column="INTM"/>
  16. <result property="uptm" column="UPTM"/>
  17. <result property="dataStat" column="DATA_STAT"/>
  18. </resultMap>
  19. <sql id="table_columns">
  20. ID,
  21. NM,
  22. FLOOD_TYPE,
  23. AD_CODE,
  24. AD_NAME,
  25. LOC,
  26. CENTER_X,
  27. CENTER_Y,
  28. GD_X,
  29. GD_Y,
  30. INTM,
  31. UPTM,
  32. DATA_STAT
  33. </sql>
  34. <sql id="entity_properties">
  35. #{id},
  36. #{nm},
  37. #{floodType},
  38. #{adCode},
  39. #{adName},
  40. #{loc},
  41. #{centerX},
  42. #{centerY},
  43. #{gdX},
  44. #{gdY},
  45. #{intm},
  46. #{uptm},
  47. #{dataStat}
  48. </sql>
  49. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  50. <sql id="page_where">
  51. <trim prefix="where" prefixOverrides="and | or ">
  52. <if test="nm != null and nm != ''">
  53. and NM = #{nm}
  54. </if>
  55. <if test="floodType != null and floodType != ''">
  56. and FLOOD_TYPE = #{floodType}
  57. </if>
  58. <if test="adCode != null and adCode != ''">
  59. and AD_CODE = #{adCode}
  60. </if>
  61. <if test="adName != null and adName != ''">
  62. and AD_NAME = #{adName}
  63. </if>
  64. <if test="loc != null and loc != ''">
  65. and LOC = #{loc}
  66. </if>
  67. <if test="centerX != null and centerX != ''">
  68. and CENTER_X = #{centerX}
  69. </if>
  70. <if test="centerY != null and centerY != ''">
  71. and CENTER_Y = #{centerY}
  72. </if>
  73. <if test="gdX != null and gdX != ''">
  74. and GD_X = #{gdX}
  75. </if>
  76. <if test="gdY != null and gdY != ''">
  77. and GD_Y = #{gdY}
  78. </if>
  79. <if test="intm != null">
  80. and INTM = #{intm}
  81. </if>
  82. <if test="uptm != null">
  83. and UPTM = #{uptm}
  84. </if>
  85. <if test="dataStat != null and dataStat != ''">
  86. and DATA_STAT = #{dataStat}
  87. </if>
  88. and DATA_STAT='0'
  89. </trim>
  90. </sql>
  91. <select id="get" resultMap="attFloodqhBaseResultMap" parameterType="String">
  92. select
  93. <include refid="table_columns"/>
  94. from ATT_FLOODQH_BASE where ID = #{id}
  95. </select>
  96. <select id="getBy" resultMap="attFloodqhBaseResultMap">
  97. select
  98. <include refid="table_columns"/>
  99. from ATT_FLOODQH_BASE
  100. <include refid="page_where"/>
  101. </select>
  102. <select id="findAll" resultMap="attFloodqhBaseResultMap">
  103. select
  104. <include refid="table_columns"/>
  105. from ATT_FLOODQH_BASE
  106. </select>
  107. <select id="findList" resultMap="attFloodqhBaseResultMap">
  108. select
  109. <include refid="table_columns"/>
  110. from ATT_FLOODQH_BASE
  111. <include refid="page_where"/>
  112. </select>
  113. <select id="selectCount" resultType="int">
  114. select count(ID) from ATT_FLOODQH_BASE
  115. <include refid="page_where"/>
  116. </select>
  117. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttFloodqhBase">
  118. insert into ATT_FLOODQH_BASE(
  119. <include refid="table_columns"/>
  120. )
  121. values (
  122. <include refid="entity_properties"/>
  123. )
  124. </insert>
  125. <delete id="delete" parameterType="java.lang.String">
  126. update ATT_FLOODQH_BASE set DATA_STAT='9' where ID = #{id}
  127. </delete>
  128. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttFloodqhBase">
  129. update ATT_FLOODQH_BASE set DATA_STAT='9'
  130. <include refid="page_where"/>
  131. </delete>
  132. <update id="deleteInFlag" parameterType="java.lang.String">
  133. update ATT_FLOODQH_BASE set DATA_STAT = '9' where ID = #{id}
  134. </update>
  135. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttFloodqhBase">
  136. update ATT_FLOODQH_BASE
  137. <trim prefix="set" suffixOverrides=",">
  138. <if test="nm != null and nm != ''">NM
  139. = #{nm},
  140. </if>
  141. <if test="floodType != null and floodType != ''">FLOOD_TYPE
  142. = #{floodType},
  143. </if>
  144. <if test="adCode != null and adCode != ''">AD_CODE
  145. = #{adCode},
  146. </if>
  147. <if test="adName != null and adName != ''">AD_NAME
  148. = #{adName},
  149. </if>
  150. <if test="loc != null and loc != ''">LOC
  151. = #{loc},
  152. </if>
  153. <if test="centerX != null and centerX != ''">CENTER_X
  154. = #{centerX},
  155. </if>
  156. <if test="centerY != null and centerY != ''">CENTER_Y
  157. = #{centerY},
  158. </if>
  159. <if test="gdX != null and gdX != ''">GD_X
  160. = #{gdX},
  161. </if>
  162. <if test="gdY != null and gdY != ''">GD_Y
  163. = #{gdY},
  164. </if>
  165. <if test="intm != null">INTM
  166. = #{intm},
  167. </if>
  168. <if test="uptm != null">UPTM
  169. = #{uptm},
  170. </if>
  171. <if test="dataStat != null and dataStat != ''">DATA_STAT
  172. = #{dataStat},
  173. </if>
  174. </trim>
  175. <where>ID = #{id}</where>
  176. </update>
  177. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttFloodqhBase">
  178. update ATT_FLOODQH_BASE
  179. <trim prefix="set" suffixOverrides=",">
  180. <if test="nm != null and nm != ''">NM
  181. = #{nm},
  182. </if>
  183. <if test="floodType != null and floodType != ''">FLOOD_TYPE
  184. = #{floodType},
  185. </if>
  186. <if test="adCode != null and adCode != ''">AD_CODE
  187. = #{adCode},
  188. </if>
  189. <if test="adName != null and adName != ''">AD_NAME
  190. = #{adName},
  191. </if>
  192. <if test="loc != null and loc != ''">LOC
  193. = #{loc},
  194. </if>
  195. <if test="centerX != null and centerX != ''">CENTER_X
  196. = #{centerX},
  197. </if>
  198. <if test="centerY != null and centerY != ''">CENTER_Y
  199. = #{centerY},
  200. </if>
  201. <if test="gdX != null and gdX != ''">GD_X
  202. = #{gdX},
  203. </if>
  204. <if test="gdY != null and gdY != ''">GD_Y
  205. = #{gdY},
  206. </if>
  207. <if test="intm != null">INTM
  208. = #{intm},
  209. </if>
  210. <if test="uptm != null">UPTM
  211. = #{uptm},
  212. </if>
  213. <if test="dataStat != null and dataStat != ''">DATA_STAT
  214. = #{dataStat},
  215. </if>
  216. </trim>
  217. <include refid="page_where"/>
  218. </update>
  219. <!-- 其他自定义SQL -->
  220. <select id="getObjId" resultType="cn.com.goldenwater.dcproj.model.AttFloodqhBase">
  221. SELECT
  222. <include refid="table_columns"/>
  223. FROM ATT_FLOODQH_BASE
  224. WHERE ID = (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE OBJ_ID = #{objId})
  225. </select>
  226. </mapper>