e5ea35f33ab713959a9d926e9b46f583ffb7a7fe.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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.AttHystBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttHystBase" id="attHystBaseResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="statisCode" column="STATIS_CODE"/>
  7. <result property="hystName" column="HYST_NAME"/>
  8. <result property="linkMan" column="LINK_MAN"/>
  9. <result property="linkTel" column="LINK_TEL"/>
  10. <result property="adCode" column="AD_CODE"/>
  11. <result property="adName" column="AD_NAME"/>
  12. <result property="hystSite" column="HYST_SITE"/>
  13. <result property="centerX" column="CENTER_X"/>
  14. <result property="centerY" column="CENTER_Y"/>
  15. <result property="gdX" column="GD_X"/>
  16. <result property="gdY" column="GD_Y"/>
  17. <result property="hystLong" column="HYST_LONG"/>
  18. <result property="hystLat" column="HYST_LAT"/>
  19. <result property="hystGdX" column="HYST_GD_X"/>
  20. <result property="hystGdY" column="HYST_GD_Y"/>
  21. <result property="rvName" column="RV_NAME"/>
  22. <result property="compDate" column="COMP_DATE"/>
  23. <result property="ownerType" column="OWNER_TYPE"/>
  24. <result property="exptType" column="EXPT_TYPE"/>
  25. <result property="insCap" column="INS_CAP"/>
  26. <result property="damHeig" column="DAM_HEIG"/>
  27. <result property="totCap" column="TOT_CAP"/>
  28. <result property="hystIsReg" column="HYST_IS_REG"/>
  29. <result property="regNo" column="REG_NO"/>
  30. <result property="isSafety" column="IS_SAFETY"/>
  31. <result property="zlgyFlow" column="ZLGY_FLOW"/>
  32. <result property="exmnType" column="EXMN_TYPE"/>
  33. <result property="intm" column="INTM"/>
  34. <result property="uptm" column="UPTM"/>
  35. <result property="note" column="NOTE"/>
  36. </resultMap>
  37. <sql id="table_columns">
  38. ID,
  39. STATIS_CODE,
  40. HYST_NAME,
  41. LINK_MAN,
  42. LINK_TEL,
  43. AD_CODE,
  44. AD_NAME,
  45. HYST_SITE,
  46. CENTER_X,
  47. CENTER_Y,
  48. GD_X,
  49. GD_Y,
  50. HYST_LONG,
  51. HYST_LAT,
  52. HYST_GD_X,
  53. HYST_GD_Y,
  54. RV_NAME,
  55. COMP_DATE,
  56. OWNER_TYPE,
  57. EXPT_TYPE,
  58. INS_CAP,
  59. DAM_HEIG,
  60. TOT_CAP,
  61. HYST_IS_REG,
  62. REG_NO,
  63. IS_SAFETY,
  64. ZLGY_FLOW,
  65. EXMN_TYPE,
  66. INTM,
  67. UPTM,
  68. NOTE
  69. </sql>
  70. <sql id="entity_properties">
  71. #{id},
  72. #{statisCode},
  73. #{hystName},
  74. #{linkMan},
  75. #{linkTel},
  76. #{adCode},
  77. #{adName},
  78. #{hystSite},
  79. #{centerX},
  80. #{centerY},
  81. #{gdX},
  82. #{gdY},
  83. #{hystLong},
  84. #{hystLat},
  85. #{hystGdX},
  86. #{hystGdY},
  87. #{rvName},
  88. #{compDate},
  89. #{ownerType},
  90. #{exptType},
  91. #{insCap},
  92. #{damHeig},
  93. #{totCap},
  94. #{hystIsReg},
  95. #{regNo},
  96. #{isSafety},
  97. #{zlgyFlow},
  98. #{exmnType},
  99. #{intm},
  100. #{uptm},
  101. #{note}
  102. </sql>
  103. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  104. <sql id="page_where">
  105. <trim prefix="where" prefixOverrides="and | or ">
  106. <if test="hystName != null and hystName != ''">and HYST_NAME = #{hystName}</if>
  107. <if test="linkMan != null and linkMan != ''">and LINK_MAN = #{linkMan}</if>
  108. <if test="linkTel != null and linkTel != ''">and LINK_TEL = #{linkTel}</if>
  109. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  110. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  111. <if test="hystSite != null and hystSite != ''">and HYST_SITE = #{hystSite}</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="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  115. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  116. <if test="hystLong != null and hystLong != ''">and HYST_LONG = #{hystLong}</if>
  117. <if test="hystLat != null and hystLat != ''">and HYST_LAT = #{hystLat}</if>
  118. <if test="hystGdX != null and hystGdX != ''">and HYST_GD_X = #{hystGdX}</if>
  119. <if test="hystGdY != null and hystGdY != ''">and HYST_GD_Y = #{hystGdY}</if>
  120. <if test="rvName != null and rvName != ''">and RV_NAME = #{rvName}</if>
  121. <if test="compDate != null and compDate != ''">and COMP_DATE = #{compDate}</if>
  122. <if test="ownerType != null and ownerType != ''">and OWNER_TYPE = #{ownerType}</if>
  123. <if test="exptType != null and exptType != ''">and EXPT_TYPE = #{exptType}</if>
  124. <if test="insCap != null and insCap != ''">and INS_CAP = #{insCap}</if>
  125. <if test="damHeig != null and damHeig != ''">and DAM_HEIG = #{damHeig}</if>
  126. <if test="totCap != null and totCap != ''">and TOT_CAP = #{totCap}</if>
  127. <if test="hystIsReg != null and hystIsReg != ''">and HYST_IS_REG = #{hystIsReg}</if>
  128. <if test="regNo != null and regNo != ''">and REG_NO = #{regNo}</if>
  129. <if test="isSafety != null and isSafety != ''">and IS_SAFETY = #{isSafety}</if>
  130. <if test="zlgyFlow != null and zlgyFlow != ''">and ZLGY_FLOW = #{zlgyFlow}</if>
  131. <if test="exmnType != null and exmnType != ''">and EXMN_TYPE = #{exmnType}</if>
  132. <if test="intm != null">and INTM = #{intm}</if>
  133. <if test="uptm != null">and UPTM = #{uptm}</if>
  134. <if test="note != null and note != ''">and NOTE = #{note}</if>
  135. <if test="statisCode != null and statisCode != ''">and STATIS_CODE = #{statisCode}</if>
  136. </trim>
  137. </sql>
  138. <select id="get" resultMap="attHystBaseResultMap" parameterType="String" >
  139. select <include refid="table_columns" /> from ATT_HYST_BASE where ID = #{id}
  140. </select>
  141. <select id="getBy" resultMap="attHystBaseResultMap">
  142. select <include refid="table_columns" /> from ATT_HYST_BASE <include refid="page_where" />
  143. </select>
  144. <select id="findAll" resultMap="attHystBaseResultMap">
  145. select <include refid="table_columns" /> from ATT_HYST_BASE
  146. </select>
  147. <select id="findList" resultMap="attHystBaseResultMap">
  148. select <include refid="table_columns" /> from ATT_HYST_BASE <include refid="page_where" />
  149. </select>
  150. <select id="selectCount" resultType="int" >
  151. select count(ID) from ATT_HYST_BASE <include refid="page_where" />
  152. </select>
  153. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttHystBase">
  154. insert into ATT_HYST_BASE( <include refid="table_columns" /> )
  155. values ( <include refid="entity_properties" /> )
  156. </insert>
  157. <delete id="delete" parameterType="java.lang.String">
  158. delete from ATT_HYST_BASE where ID = #{id}
  159. </delete>
  160. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttHystBase">
  161. delete from ATT_HYST_BASE <include refid="page_where" />
  162. </delete>
  163. <update id="deleteInFlag" parameterType="java.lang.String">
  164. update ATT_HYST_BASE set flag_valid = 0 where ID = #{id}
  165. </update>
  166. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttHystBase">
  167. update ATT_HYST_BASE
  168. <trim prefix="set" suffixOverrides=",">
  169. <if test="hystName != null and hystName != ''">HYST_NAME = #{hystName},</if>
  170. <if test="linkMan != null and linkMan != ''">LINK_MAN = #{linkMan},</if>
  171. <if test="linkTel != null and linkTel != ''">LINK_TEL = #{linkTel},</if>
  172. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  173. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  174. <if test="hystSite != null and hystSite != ''">HYST_SITE = #{hystSite},</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="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  178. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  179. <if test="hystLong != null and hystLong != ''">HYST_LONG = #{hystLong},</if>
  180. <if test="hystLat != null and hystLat != ''">HYST_LAT = #{hystLat},</if>
  181. <if test="hystGdX != null and hystGdX != ''">HYST_GD_X = #{hystGdX},</if>
  182. <if test="hystGdY != null and hystGdY != ''">HYST_GD_Y = #{hystGdY},</if>
  183. <if test="rvName != null and rvName != ''">RV_NAME = #{rvName},</if>
  184. <if test="compDate != null and compDate != ''">COMP_DATE = #{compDate},</if>
  185. <if test="ownerType != null and ownerType != ''">OWNER_TYPE = #{ownerType},</if>
  186. <if test="exptType != null and exptType != ''">EXPT_TYPE = #{exptType},</if>
  187. <if test="insCap != null and insCap != ''">INS_CAP = #{insCap},</if>
  188. <if test="damHeig != null and damHeig != ''">DAM_HEIG = #{damHeig},</if>
  189. <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
  190. <if test="hystIsReg != null and hystIsReg != ''">HYST_IS_REG = #{hystIsReg},</if>
  191. <if test="regNo != null and regNo != ''">REG_NO = #{regNo},</if>
  192. <if test="isSafety != null and isSafety != ''">IS_SAFETY = #{isSafety},</if>
  193. <if test="zlgyFlow != null and zlgyFlow != ''">ZLGY_FLOW = #{zlgyFlow},</if>
  194. <if test="exmnType != null and exmnType != ''">EXMN_TYPE = #{exmnType},</if>
  195. <if test="intm != null">INTM = #{intm},</if>
  196. <if test="uptm != null">UPTM = #{uptm},</if>
  197. <if test="note != null and note != ''">NOTE = #{note},</if>
  198. <if test="statisCode != null and statisCode != ''">STATIS_CODE = #{statisCode},</if>
  199. </trim>
  200. <where>ID = #{id}</where>
  201. </update>
  202. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttHystBase">
  203. update ATT_HYST_BASE
  204. <trim prefix="set" suffixOverrides=",">
  205. <if test="hystName != null and hystName != ''">HYST_NAME = #{hystName},</if>
  206. <if test="linkMan != null and linkMan != ''">LINK_MAN = #{linkMan},</if>
  207. <if test="linkTel != null and linkTel != ''">LINK_TEL = #{linkTel},</if>
  208. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  209. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  210. <if test="hystSite != null and hystSite != ''">HYST_SITE = #{hystSite},</if>
  211. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  212. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  213. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  214. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  215. <if test="hystLong != null and hystLong != ''">HYST_LONG = #{hystLong},</if>
  216. <if test="hystLat != null and hystLat != ''">HYST_LAT = #{hystLat},</if>
  217. <if test="hystGdX != null and hystGdX != ''">HYST_GD_X = #{hystGdX},</if>
  218. <if test="hystGdY != null and hystGdY != ''">HYST_GD_Y = #{hystGdY},</if>
  219. <if test="rvName != null and rvName != ''">RV_NAME = #{rvName},</if>
  220. <if test="compDate != null and compDate != ''">COMP_DATE = #{compDate},</if>
  221. <if test="ownerType != null and ownerType != ''">OWNER_TYPE = #{ownerType},</if>
  222. <if test="exptType != null and exptType != ''">EXPT_TYPE = #{exptType},</if>
  223. <if test="insCap != null and insCap != ''">INS_CAP = #{insCap},</if>
  224. <if test="damHeig != null and damHeig != ''">DAM_HEIG = #{damHeig},</if>
  225. <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
  226. <if test="hystIsReg != null and hystIsReg != ''">HYST_IS_REG = #{hystIsReg},</if>
  227. <if test="regNo != null and regNo != ''">REG_NO = #{regNo},</if>
  228. <if test="isSafety != null and isSafety != ''">IS_SAFETY = #{isSafety},</if>
  229. <if test="zlgyFlow != null and zlgyFlow != ''">ZLGY_FLOW = #{zlgyFlow},</if>
  230. <if test="exmnType != null and exmnType != ''">EXMN_TYPE = #{exmnType},</if>
  231. <if test="intm != null">INTM = #{intm},</if>
  232. <if test="uptm != null">UPTM = #{uptm},</if>
  233. <if test="note != null and note != ''">NOTE = #{note},</if>
  234. <if test="statisCode != null and statisCode != ''">STATIS_CODE = #{statisCode},</if>
  235. </trim>
  236. <include refid="page_where" />
  237. </update>
  238. <!-- 其他自定义SQL -->
  239. <select id="findListByParam" resultMap="attHystBaseResultMap"
  240. parameterType="cn.com.goldenwater.dcproj.param.BisInspHystInfoParam">
  241. select
  242. C.ID, C.HYST_NAME, C.LINK_MAN, C.LINK_TEL, C.AD_CODE,
  243. C.AD_NAME, C.HYST_SITE, C.CENTER_X, C.CENTER_Y,C.GD_X,C.GD_Y, C.HYST_LONG,
  244. C.HYST_LAT,C.HYST_GD_X,C.HYST_GD_Y, C.RV_NAME, C.COMP_DATE, C.OWNER_TYPE, C.EXPT_TYPE,
  245. C.INS_CAP, C.DAM_HEIG, C.TOT_CAP, C.HYST_IS_REG, C.REG_NO,
  246. C.IS_SAFETY, C.ZLGY_FLOW, C.EXMN_TYPE, C.INTM, C.UPTM, C.NOTE
  247. from ATT_HYST_BASE C
  248. where C.id not in (select D.BASE_ID from BIS_INSP_HYST_INFO D
  249. where 1=1
  250. <if test="rgstrId != null and rgstrId != ''">and D.RGSTR_ID = #{rgstrId}</if>)
  251. <if test="hystName != null and hystName != ''">and C.HYST_NAME like concat('%',concat(#{hystName},'%'))</if>
  252. <if test="adCode != null and adCode != ''">and C.AD_CODE like concat(#{adCode},'%')</if>
  253. <if test="exmnType != null and exmnType != ''">and C.EXMN_TYPE = #{exmnType}</if>
  254. </select>
  255. <update id="updateBatch" parameterType="java.util.List">
  256. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  257. update ATT_HYST_BASE
  258. <trim prefix="set" suffixOverrides=",">
  259. <if test="item.centerX != null and item.centerX != ''">CENTER_X = #{item.centerX},</if>
  260. <if test="item.centerY != null and item.centerY != ''">CENTER_Y = #{item.centerY},</if>
  261. <if test="item.gdX != null and item.gdX != ''">GD_X = #{item.gdX},</if>
  262. <if test="item.gdY != null and item.gdY != ''">GD_Y = #{item.gdY},</if>
  263. <if test="item.hystLong != null and item.hystLong != ''">HYST_LONG = #{item.hystLong},</if>
  264. <if test="item.hystLat != null and item.hystLat != ''">HYST_LAT = #{item.hystLat},</if>
  265. <if test="item.hystGdX != null and item.hystGdX != ''">HYST_GD_X = #{item.hystGdX},</if>
  266. <if test="item.hystGdY != null and item.hystGdY != ''">HYST_GD_Y = #{item.hystGdY},</if>
  267. </trim>
  268. <where>ID = #{id}</where>
  269. </foreach>
  270. </update>
  271. <update id="updateGdXy" parameterType="cn.com.goldenwater.dcproj.model.AttHystBase">
  272. update ATT_HYST_BASE
  273. <trim prefix="set" suffixOverrides=",">
  274. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  275. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  276. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  277. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  278. <if test="hystLong != null and hystLong != ''">HYST_LONG = #{hystLong},</if>
  279. <if test="hystLat != null and hystLat != ''">HYST_LAT = #{hystLat},</if>
  280. <if test="hystGdX != null and hystGdX != ''">HYST_GD_X = #{hystGdX},</if>
  281. <if test="hystGdY != null and hystGdY != ''">HYST_GD_Y = #{hystGdY},</if>
  282. </trim>
  283. <where>ID = #{id}</where>
  284. </update>
  285. <update id="updateBase" parameterType="cn.com.goldenwater.dcproj.model.AttHystBase">
  286. update ATT_HYST_BASE set COMP_DATE = #{compDate} where hyst_name = #{hystName}
  287. <if test="statisCode != null and statisCode != ''">
  288. and STATIS_CODE = #{statisCode}
  289. </if>
  290. </update>
  291. <select id="findHystList" resultType="cn.com.goldenwater.dcproj.model.AttHystBase">
  292. select * from ATT_HYST_BASE t where HYST_GD_X is null
  293. </select>
  294. </mapper>