AttIrrBaseDao.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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.AttIrrBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttIrrBase" id="attIrrBaseResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="irrCode" column="IRR_CODE"/>
  7. <result property="irrName" column="IRR_NAME"/>
  8. <result property="adCode" column="AD_CODE"/>
  9. <result property="adName" column="AD_NAME"/>
  10. <result property="location" column="LOCATION"/>
  11. <result property="centerXGd" column="CENTER_X_GD"/>
  12. <result property="centerYGd" column="CENTER_Y_GD"/>
  13. <result property="centerX" column="CENTER_X"/>
  14. <result property="centerY" column="CENTER_Y"/>
  15. <result property="lowLeftLong" column="LOW_LEFT_LONG"/>
  16. <result property="lowLeftLat" column="LOW_LEFT_LAT"/>
  17. <result property="upRightLong" column="UP_RIGHT_LONG"/>
  18. <result property="upRightLat" column="UP_RIGHT_LAT"/>
  19. <result property="src" column="SRC"/>
  20. <result property="irrRang" column="IRR_RANG"/>
  21. <result property="totIrrArea" column="TOT_IRR_AREA"/>
  22. <result property="effIrrArea" column="EFF_IRR_AREA"/>
  23. <result property="desIrrArea" column="DES_IRR_AREA"/>
  24. <result property="engStat" column="ENG_STAT"/>
  25. <result property="runStat" column="RUN_STAT"/>
  26. <result property="irrEngScal" column="IRR_ENG_SCAL"/>
  27. <result property="startDate" column="START_DATE"/>
  28. <result property="compDate" column="COMP_DATE"/>
  29. <result property="intm" column="INTM"/>
  30. <result property="uptm" column="UPTM"/>
  31. <result property="dataStat" column="DATA_STAT"/>
  32. <result property="state" column="STATE"/>
  33. <result property="gdX" column="GD_X"/>
  34. <result property="gdY" column="GD_Y"/>
  35. </resultMap>
  36. <sql id="table_columns">
  37. GD_X,
  38. GD_Y,
  39. ID,
  40. IRR_CODE,
  41. IRR_NAME,
  42. AD_CODE,
  43. AD_NAME,
  44. LOCATION,
  45. CENTER_X_GD,
  46. CENTER_Y_GD,
  47. CENTER_X,
  48. CENTER_Y,
  49. LOW_LEFT_LONG,
  50. LOW_LEFT_LAT,
  51. UP_RIGHT_LONG,
  52. UP_RIGHT_LAT,
  53. SRC,
  54. IRR_RANG,
  55. TOT_IRR_AREA,
  56. EFF_IRR_AREA,
  57. DES_IRR_AREA,
  58. ENG_STAT,
  59. RUN_STAT,
  60. IRR_ENG_SCAL,
  61. START_DATE,
  62. COMP_DATE,
  63. INTM,
  64. UPTM,
  65. DATA_STAT,
  66. STATE
  67. </sql>
  68. <sql id="entity_properties">
  69. #{gdX},
  70. #{gdY},
  71. #{id},
  72. #{irrCode},
  73. #{irrName},
  74. #{adCode},
  75. #{adName},
  76. #{location},
  77. #{centerXGd},
  78. #{centerYGd},
  79. #{centerX},
  80. #{centerY},
  81. #{lowLeftLong},
  82. #{lowLeftLat},
  83. #{upRightLong},
  84. #{upRightLat},
  85. #{src},
  86. #{irrRang},
  87. #{totIrrArea},
  88. #{effIrrArea},
  89. #{desIrrArea},
  90. #{engStat},
  91. #{runStat},
  92. #{irrEngScal},
  93. #{startDate},
  94. #{compDate},
  95. #{intm},
  96. #{uptm},
  97. #{dataStat},
  98. #{state}
  99. </sql>
  100. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  101. <sql id="page_where">
  102. <trim prefix="where" prefixOverrides="and | or ">
  103. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  104. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  105. <if test="irrCode != null and irrCode != ''">and IRR_CODE = #{irrCode}</if>
  106. <if test="irrName != null and irrName != ''">and IRR_NAME like '%${irrName}%'</if>
  107. <if test="adCode != null and adCode != ''">and AD_CODE like concat(#{adCode},'%')</if>
  108. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  109. <if test="location != null and location != ''">and LOCATION = #{location}</if>
  110. <if test="centerXGd != null and centerXGd != ''">and CENTER_X_GD = #{centerXGd}</if>
  111. <if test="centerYGd != null and centerYGd != ''">and CENTER_Y_GD = #{centerYGd}</if>
  112. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  113. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  114. <if test="lowLeftLong != null and lowLeftLong != ''">and LOW_LEFT_LONG = #{lowLeftLong}</if>
  115. <if test="lowLeftLat != null and lowLeftLat != ''">and LOW_LEFT_LAT = #{lowLeftLat}</if>
  116. <if test="upRightLong != null and upRightLong != ''">and UP_RIGHT_LONG = #{upRightLong}</if>
  117. <if test="upRightLat != null and upRightLat != ''">and UP_RIGHT_LAT = #{upRightLat}</if>
  118. <if test="src != null and src != ''">and SRC = #{src}</if>
  119. <if test="irrRang != null and irrRang != ''">and IRR_RANG = #{irrRang}</if>
  120. <if test="totIrrArea != null and totIrrArea != ''">and TOT_IRR_AREA = #{totIrrArea}</if>
  121. <if test="effIrrArea != null and effIrrArea != ''">and EFF_IRR_AREA = #{effIrrArea}</if>
  122. <if test="desIrrArea != null and desIrrArea != ''">and DES_IRR_AREA = #{desIrrArea}</if>
  123. <if test="engStat != null and engStat != ''">and ENG_STAT = #{engStat}</if>
  124. <if test="runStat != null and runStat != ''">and RUN_STAT = #{runStat}</if>
  125. <if test="irrEngScal != null and irrEngScal != ''">and IRR_ENG_SCAL = #{irrEngScal}</if>
  126. <if test="startDate != null">and START_DATE = #{startDate}</if>
  127. <if test="compDate != null">and COMP_DATE = #{compDate}</if>
  128. <if test="intm != null">and INTM = #{intm}</if>
  129. <if test="uptm != null">and UPTM = #{uptm}</if>
  130. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  131. <if test="state != null and state != ''">and STATE = #{state}</if>
  132. and DATA_STAT='0'
  133. </trim>
  134. </sql>
  135. <select id="get" resultMap="attIrrBaseResultMap" parameterType="String" >
  136. select <include refid="table_columns" /> from ATT_IRR_BASE where ID = #{id}
  137. </select>
  138. <select id="getBy" resultMap="attIrrBaseResultMap">
  139. select <include refid="table_columns" /> from ATT_IRR_BASE <include refid="page_where" />
  140. </select>
  141. <select id="findAll" resultMap="attIrrBaseResultMap">
  142. select <include refid="table_columns" /> from ATT_IRR_BASE
  143. </select>
  144. <select id="findList" resultMap="attIrrBaseResultMap">
  145. select <include refid="table_columns" /> from ATT_IRR_BASE <include refid="page_where" />
  146. </select>
  147. <select id="selectCount" resultType="int" >
  148. select count(ID) from ATT_IRR_BASE <include refid="page_where" />
  149. </select>
  150. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttIrrBase">
  151. insert into ATT_IRR_BASE( <include refid="table_columns" /> )
  152. values ( <include refid="entity_properties" /> )
  153. </insert>
  154. <delete id="delete" parameterType="java.lang.String">
  155. update ATT_IRR_BASE set DATA_STAT='9' where ID = #{id}
  156. </delete>
  157. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttIrrBase">
  158. update ATT_IRR_BASE set DATA_STAT='9' <include refid="page_where" />
  159. </delete>
  160. <update id="deleteInFlag" parameterType="java.lang.String">
  161. update ATT_IRR_BASE set DATA_STAT = '9' where ID = #{id}
  162. </update>
  163. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttIrrBase">
  164. update ATT_IRR_BASE
  165. <trim prefix="set" suffixOverrides=",">
  166. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  167. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  168. <if test="irrCode != null and irrCode != ''">IRR_CODE = #{irrCode},</if>
  169. <if test="irrName != null and irrName != ''">IRR_NAME = #{irrName},</if>
  170. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  171. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  172. <if test="location != null and location != ''">LOCATION = #{location},</if>
  173. <if test="centerXGd != null and centerXGd != ''">CENTER_X_GD = #{centerXGd},</if>
  174. <if test="centerYGd != null and centerYGd != ''">CENTER_Y_GD = #{centerYGd},</if>
  175. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  176. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  177. <if test="lowLeftLong != null and lowLeftLong != ''">LOW_LEFT_LONG = #{lowLeftLong},</if>
  178. <if test="lowLeftLat != null and lowLeftLat != ''">LOW_LEFT_LAT = #{lowLeftLat},</if>
  179. <if test="upRightLong != null and upRightLong != ''">UP_RIGHT_LONG = #{upRightLong},</if>
  180. <if test="upRightLat != null and upRightLat != ''">UP_RIGHT_LAT = #{upRightLat},</if>
  181. <if test="src != null and src != ''">SRC = #{src},</if>
  182. <if test="irrRang != null and irrRang != ''">IRR_RANG = #{irrRang},</if>
  183. <if test="totIrrArea != null and totIrrArea != ''">TOT_IRR_AREA = #{totIrrArea},</if>
  184. <if test="effIrrArea != null and effIrrArea != ''">EFF_IRR_AREA = #{effIrrArea},</if>
  185. <if test="desIrrArea != null and desIrrArea != ''">DES_IRR_AREA = #{desIrrArea},</if>
  186. <if test="engStat != null and engStat != ''">ENG_STAT = #{engStat},</if>
  187. <if test="runStat != null and runStat != ''">RUN_STAT = #{runStat},</if>
  188. <if test="irrEngScal != null and irrEngScal != ''">IRR_ENG_SCAL = #{irrEngScal},</if>
  189. <if test="startDate != null">START_DATE = #{startDate},</if>
  190. <if test="compDate != null">COMP_DATE = #{compDate},</if>
  191. <if test="intm != null">INTM = #{intm},</if>
  192. <if test="uptm != null">UPTM = #{uptm},</if>
  193. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  194. <if test="state != null and state != ''">STATE = #{state},</if>
  195. </trim>
  196. <where>ID = #{id}</where>
  197. </update>
  198. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttIrrBase">
  199. update ATT_IRR_BASE
  200. <trim prefix="set" suffixOverrides=",">
  201. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  202. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  203. <if test="irrCode != null and irrCode != ''">IRR_CODE = #{irrCode},</if>
  204. <if test="irrName != null and irrName != ''">IRR_NAME = #{irrName},</if>
  205. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  206. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  207. <if test="location != null and location != ''">LOCATION = #{location},</if>
  208. <if test="centerXGd != null and centerXGd != ''">CENTER_X_GD = #{centerXGd},</if>
  209. <if test="centerYGd != null and centerYGd != ''">CENTER_Y_GD = #{centerYGd},</if>
  210. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  211. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  212. <if test="lowLeftLong != null and lowLeftLong != ''">LOW_LEFT_LONG = #{lowLeftLong},</if>
  213. <if test="lowLeftLat != null and lowLeftLat != ''">LOW_LEFT_LAT = #{lowLeftLat},</if>
  214. <if test="upRightLong != null and upRightLong != ''">UP_RIGHT_LONG = #{upRightLong},</if>
  215. <if test="upRightLat != null and upRightLat != ''">UP_RIGHT_LAT = #{upRightLat},</if>
  216. <if test="src != null and src != ''">SRC = #{src},</if>
  217. <if test="irrRang != null and irrRang != ''">IRR_RANG = #{irrRang},</if>
  218. <if test="totIrrArea != null and totIrrArea != ''">TOT_IRR_AREA = #{totIrrArea},</if>
  219. <if test="effIrrArea != null and effIrrArea != ''">EFF_IRR_AREA = #{effIrrArea},</if>
  220. <if test="desIrrArea != null and desIrrArea != ''">DES_IRR_AREA = #{desIrrArea},</if>
  221. <if test="engStat != null and engStat != ''">ENG_STAT = #{engStat},</if>
  222. <if test="runStat != null and runStat != ''">RUN_STAT = #{runStat},</if>
  223. <if test="irrEngScal != null and irrEngScal != ''">IRR_ENG_SCAL = #{irrEngScal},</if>
  224. <if test="startDate != null">START_DATE = #{startDate},</if>
  225. <if test="compDate != null">COMP_DATE = #{compDate},</if>
  226. <if test="intm != null">INTM = #{intm},</if>
  227. <if test="uptm != null">UPTM = #{uptm},</if>
  228. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  229. <if test="state != null and state != ''">STATE = #{state},</if>
  230. </trim>
  231. <include refid="page_where" />
  232. </update>
  233. <!-- 其他自定义SQL -->
  234. <update id="updateList" parameterType="java.util.List">
  235. <foreach collection="list" index="index" item="item" open="begin" close=";end;" separator=";">
  236. UPDATE ATT_IRR_BASE
  237. <set>
  238. GD_X = #{item.gdX},
  239. GD_Y = #{item.gdY}
  240. </set>
  241. <where>
  242. ID = #{item.id}
  243. </where>
  244. </foreach>
  245. </update>
  246. </mapper>