BisInspHystInfoDao.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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.BisInspHystInfoDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspHystInfo" id="bisInspHystInfoResultMap">
  5. <result property="baseId" column="BASE_ID"/>
  6. <result property="statisCode" column="STATIS_CODE"/>
  7. <result property="isNeedRuleAsWfip" column="IS_NEED_RULE_AS_WFIP"/>
  8. <result property="rectState" column="RECT_STATE"/>
  9. <result property="oocState" column="OOC_STATE"/>
  10. <result property="sfmngState" column="SFMNG_STATE"/>
  11. <result property="fillInfoIsFake" column="FILL_INFO_IS_FAKE"/>
  12. <result property="isRuleAsWfip" column="IS_RULE_AS_WFIP"/>
  13. <result property="note" column="NOTE"/>
  14. <result property="status" column="STATUS"/>
  15. <result property="persId" column="PERS_ID"/>
  16. <result property="intm" column="INTM"/>
  17. <result property="uptm" column="UPTM"/>
  18. <result property="id" column="ID"/>
  19. <result property="rgstrId" column="RGSTR_ID"/>
  20. <result property="hystName" column="HYST_NAME"/>
  21. <result property="linkMan" column="LINK_MAN"/>
  22. <result property="linkTel" column="LINK_TEL"/>
  23. <result property="adCode" column="AD_CODE"/>
  24. <result property="adName" column="AD_NAME"/>
  25. <result property="hystSite" column="HYST_SITE"/>
  26. <result property="centerX" column="CENTER_X"/>
  27. <result property="centerY" column="CENTER_Y"/>
  28. <result property="gdX" column="GD_X"/>
  29. <result property="gdY" column="GD_Y"/>
  30. <result property="hystLong" column="HYST_LONG"/>
  31. <result property="hystLat" column="HYST_LAT"/>
  32. <result property="hystGdX" column="HYST_GD_X"/>
  33. <result property="hystGdY" column="HYST_GD_Y"/>
  34. <result property="rvName" column="RV_NAME"/>
  35. <result property="compDate" column="COMP_DATE"/>
  36. <result property="ownerType" column="OWNER_TYPE"/>
  37. <result property="exptType" column="EXPT_TYPE"/>
  38. <result property="insCap" column="INS_CAP"/>
  39. <result property="damHeig" column="DAM_HEIG"/>
  40. <result property="totCap" column="TOT_CAP"/>
  41. <result property="hystIsReg" column="HYST_IS_REG"/>
  42. <result property="regNo" column="REG_NO"/>
  43. <result property="isSafety" column="IS_SAFETY"/>
  44. <result property="zlgyFlow" column="ZLGY_FLOW"/>
  45. <result property="exmnType" column="EXMN_TYPE"/>
  46. <result property="platInfoIsFullAwr" column="PLAT_INFO_IS_FULL_AWR"/>
  47. <result property="awrInfoNo" column="AWR_INFO_NO"/>
  48. </resultMap>
  49. <sql id="table_columns">
  50. BASE_ID,
  51. STATIS_CODE,
  52. IS_NEED_RULE_AS_WFIP,
  53. RECT_STATE,
  54. OOC_STATE,
  55. SFMNG_STATE,
  56. FILL_INFO_IS_FAKE,
  57. IS_RULE_AS_WFIP,
  58. NOTE,
  59. STATUS,
  60. PERS_ID,
  61. INTM,
  62. UPTM,
  63. ID,
  64. RGSTR_ID,
  65. HYST_NAME,
  66. LINK_MAN,
  67. LINK_TEL,
  68. AD_CODE,
  69. AD_NAME,
  70. HYST_SITE,
  71. CENTER_X,
  72. CENTER_Y,
  73. GD_X,
  74. GD_Y,
  75. HYST_LONG,
  76. HYST_LAT,
  77. HYST_GD_X,
  78. HYST_GD_Y,
  79. RV_NAME,
  80. COMP_DATE,
  81. OWNER_TYPE,
  82. EXPT_TYPE,
  83. INS_CAP,
  84. DAM_HEIG,
  85. TOT_CAP,
  86. HYST_IS_REG,
  87. REG_NO,
  88. IS_SAFETY,
  89. ZLGY_FLOW,
  90. EXMN_TYPE,
  91. PLAT_INFO_IS_FULL_AWR,
  92. AWR_INFO_NO
  93. </sql>
  94. <sql id="entity_properties">
  95. #{baseId},
  96. #{statisCode},
  97. #{isNeedRuleAsWfip},
  98. #{rectState},
  99. #{oocState},
  100. #{sfmngState},
  101. #{fillInfoIsFake},
  102. #{isRuleAsWfip},
  103. #{note},
  104. #{status},
  105. #{persId},
  106. #{intm},
  107. #{uptm},
  108. #{id},
  109. #{rgstrId},
  110. #{hystName},
  111. #{linkMan},
  112. #{linkTel},
  113. #{adCode},
  114. #{adName},
  115. #{hystSite},
  116. #{centerX},
  117. #{centerY},
  118. #{gdX},
  119. #{gdY},
  120. #{hystLong},
  121. #{hystLat},
  122. #{hystGdX},
  123. #{hystGdY},
  124. #{rvName},
  125. #{compDate},
  126. #{ownerType},
  127. #{exptType},
  128. #{insCap},
  129. #{damHeig},
  130. #{totCap},
  131. #{hystIsReg},
  132. #{regNo},
  133. #{isSafety},
  134. #{zlgyFlow},
  135. #{exmnType},
  136. #{platInfoIsFullAwr},
  137. #{awrInfoNo}
  138. </sql>
  139. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  140. <sql id="page_where">
  141. <trim prefix="where" prefixOverrides="and | or ">
  142. <if test="statisCode != null and statisCode != ''">and STATIS_CODE = #{statisCode}</if>
  143. <if test="isNeedRuleAsWfip != null and isNeedRuleAsWfip != ''">and IS_NEED_RULE_AS_WFIP = #{isNeedRuleAsWfip}</if>
  144. <if test="rectState != null and rectState != ''">and RECT_STATE = #{rectState}</if>
  145. <if test="oocState != null and oocState != ''">and OOC_STATE = #{oocState}</if>
  146. <if test="sfmngState != null and sfmngState != ''">and SFMNG_STATE = #{sfmngState}</if>
  147. <if test="fillInfoIsFake != null and fillInfoIsFake != ''">and FILL_INFO_IS_FAKE = #{fillInfoIsFake}</if>
  148. <if test="isRuleAsWfip != null and isRuleAsWfip != ''">and IS_RULE_AS_WFIP = #{isRuleAsWfip}</if>
  149. <if test="note != null and note != ''">and NOTE = #{note}</if>
  150. <if test="status != null and status != ''">and STATUS = #{status}</if>
  151. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  152. <if test="intm != null">and INTM = #{intm}</if>
  153. <if test="uptm != null">and UPTM = #{uptm}</if>
  154. <if test="id != null and id != ''">and ID = #{id}</if>
  155. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  156. <if test="hystName != null and hystName != ''">and HYST_NAME = #{hystName}</if>
  157. <if test="linkMan != null and linkMan != ''">and LINK_MAN = #{linkMan}</if>
  158. <if test="linkTel != null and linkTel != ''">and LINK_TEL = #{linkTel}</if>
  159. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  160. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  161. <if test="hystSite != null and hystSite != ''">and HYST_SITE = #{hystSite}</if>
  162. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  163. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  164. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  165. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  166. <if test="hystLong != null and hystLong != ''">and HYST_LONG = #{hystLong}</if>
  167. <if test="hystLat != null and hystLat != ''">and HYST_LAT = #{hystLat}</if>
  168. <if test="hystGdX != null and hystGdX != ''">and HYST_GD_X = #{hystGdX}</if>
  169. <if test="hystGdY != null and hystGdY != ''">and HYST_GD_Y = #{hystGdY}</if>
  170. <if test="rvName != null and rvName != ''">and RV_NAME = #{rvName}</if>
  171. <if test="compDate != null and compDate != ''">and COMP_DATE = #{compDate}</if>
  172. <if test="ownerType != null and ownerType != ''">and OWNER_TYPE = #{ownerType}</if>
  173. <if test="exptType != null and exptType != ''">and EXPT_TYPE = #{exptType}</if>
  174. <if test="insCap != null and insCap != ''">and INS_CAP = #{insCap}</if>
  175. <if test="damHeig != null and damHeig != ''">and DAM_HEIG = #{damHeig}</if>
  176. <if test="totCap != null and totCap != ''">and TOT_CAP = #{totCap}</if>
  177. <if test="hystIsReg != null and hystIsReg != ''">and HYST_IS_REG = #{hystIsReg}</if>
  178. <if test="regNo != null and regNo != ''">and REG_NO = #{regNo}</if>
  179. <if test="isSafety != null and isSafety != ''">and IS_SAFETY = #{isSafety}</if>
  180. <if test="zlgyFlow != null and zlgyFlow != ''">and ZLGY_FLOW = #{zlgyFlow}</if>
  181. <if test="exmnType != null and exmnType != ''">and EXMN_TYPE = #{exmnType}</if>
  182. <if test="platInfoIsFullAwr != null and platInfoIsFullAwr != ''">and PLAT_INFO_IS_FULL_AWR = #{platInfoIsFullAwr}</if>
  183. <if test="awrInfoNo != null and awrInfoNo != ''">and AWR_INFO_NO = #{awrInfoNo}</if>
  184. </trim>
  185. </sql>
  186. <select id="get" resultMap="bisInspHystInfoResultMap" parameterType="String" >
  187. select <include refid="table_columns" /> from BIS_INSP_HYST_INFO where ID = #{id}
  188. </select>
  189. <select id="getBy" resultMap="bisInspHystInfoResultMap">
  190. select <include refid="table_columns" /> from BIS_INSP_HYST_INFO <include refid="page_where" />
  191. </select>
  192. <select id="findAll" resultMap="bisInspHystInfoResultMap">
  193. select <include refid="table_columns" /> from BIS_INSP_HYST_INFO
  194. </select>
  195. <select id="findList" resultMap="bisInspHystInfoResultMap">
  196. select <include refid="table_columns" /> from BIS_INSP_HYST_INFO <include refid="page_where" />
  197. </select>
  198. <select id="selectCount" resultType="int" >
  199. select count(ID) from BIS_INSP_HYST_INFO <include refid="page_where" />
  200. </select>
  201. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystInfo">
  202. insert into BIS_INSP_HYST_INFO( <include refid="table_columns" /> )
  203. values ( <include refid="entity_properties" /> )
  204. </insert>
  205. <delete id="delete" parameterType="java.lang.String">
  206. delete from BIS_INSP_HYST_INFO where ID = #{id}
  207. </delete>
  208. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystInfo">
  209. delete from BIS_INSP_HYST_INFO <include refid="page_where" />
  210. </delete>
  211. <update id="deleteInFlag" parameterType="java.lang.String">
  212. update BIS_INSP_HYST_INFO set flag_valid = 0 where ID = #{id}
  213. </update>
  214. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystInfo">
  215. update BIS_INSP_HYST_INFO
  216. <trim prefix="set" suffixOverrides=",">
  217. <if test="statisCode != null">STATIS_CODE = #{statisCode},</if>
  218. <if test="isNeedRuleAsWfip != null">IS_NEED_RULE_AS_WFIP = #{isNeedRuleAsWfip},</if>
  219. <if test="rectState != null">RECT_STATE = #{rectState},</if>
  220. <if test="oocState != null">OOC_STATE = #{oocState},</if>
  221. <if test="sfmngState != null">SFMNG_STATE = #{sfmngState},</if>
  222. <if test="fillInfoIsFake != null">FILL_INFO_IS_FAKE = #{fillInfoIsFake},</if>
  223. <if test="isRuleAsWfip != null">IS_RULE_AS_WFIP = #{isRuleAsWfip},</if>
  224. <if test="note != null">NOTE = #{note},</if>
  225. <if test="status != null">STATUS = #{status},</if>
  226. <if test="persId != null">PERS_ID = #{persId},</if>
  227. <if test="intm != null">INTM = #{intm},</if>
  228. <if test="uptm != null">UPTM = #{uptm},</if>
  229. <if test="id != null and id != ''">ID = #{id},</if>
  230. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  231. <if test="hystName != null">HYST_NAME = #{hystName},</if>
  232. <if test="linkMan != null">LINK_MAN = #{linkMan},</if>
  233. <if test="linkTel != null">LINK_TEL = #{linkTel},</if>
  234. <if test="adCode != null">AD_CODE = #{adCode},</if>
  235. <if test="adName != null">AD_NAME = #{adName},</if>
  236. <if test="hystSite != null">HYST_SITE = #{hystSite},</if>
  237. <if test="centerX != null">CENTER_X = #{centerX},</if>
  238. <if test="centerY != null">CENTER_Y = #{centerY},</if>
  239. <if test="gdX != null">GD_X = #{gdX},</if>
  240. <if test="gdY != null">GD_Y = #{gdY},</if>
  241. <if test="hystLong != null">HYST_LONG = #{hystLong},</if>
  242. <if test="hystLat != null">HYST_LAT = #{hystLat},</if>
  243. <if test="hystGdX != null">HYST_GD_X = #{hystGdX},</if>
  244. <if test="hystGdY != null">HYST_GD_Y = #{hystGdY},</if>
  245. <if test="rvName != null">RV_NAME = #{rvName},</if>
  246. <if test="compDate != null">COMP_DATE = #{compDate},</if>
  247. <if test="ownerType != null">OWNER_TYPE = #{ownerType},</if>
  248. <if test="exptType != null">EXPT_TYPE = #{exptType},</if>
  249. <if test="insCap != null">INS_CAP = #{insCap},</if>
  250. <if test="damHeig != null">DAM_HEIG = #{damHeig},</if>
  251. <if test="totCap != null">TOT_CAP = #{totCap},</if>
  252. <if test="hystIsReg != null">HYST_IS_REG = #{hystIsReg},</if>
  253. <if test="regNo != null">REG_NO = #{regNo},</if>
  254. <if test="isSafety != null">IS_SAFETY = #{isSafety},</if>
  255. <if test="zlgyFlow != null">ZLGY_FLOW = #{zlgyFlow},</if>
  256. <if test="exmnType != null">EXMN_TYPE = #{exmnType},</if>
  257. <if test="platInfoIsFullAwr != null">PLAT_INFO_IS_FULL_AWR = #{platInfoIsFullAwr},</if>
  258. <if test="awrInfoNo != null">AWR_INFO_NO = #{awrInfoNo},</if>
  259. </trim>
  260. <where>ID = #{id}</where>
  261. </update>
  262. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystInfo">
  263. update BIS_INSP_HYST_INFO
  264. <trim prefix="set" suffixOverrides=",">
  265. <if test="statisCode != null">STATIS_CODE = #{statisCode},</if>
  266. <if test="isNeedRuleAsWfip != null">IS_NEED_RULE_AS_WFIP = #{isNeedRuleAsWfip},</if>
  267. <if test="rectState != null">RECT_STATE = #{rectState},</if>
  268. <if test="oocState != null">OOC_STATE = #{oocState},</if>
  269. <if test="sfmngState != null">SFMNG_STATE = #{sfmngState},</if>
  270. <if test="fillInfoIsFake != null">FILL_INFO_IS_FAKE = #{fillInfoIsFake},</if>
  271. <if test="isRuleAsWfip != null">IS_RULE_AS_WFIP = #{isRuleAsWfip},</if>
  272. <if test="note != null">NOTE = #{note},</if>
  273. <if test="status != null">STATUS = #{status},</if>
  274. <if test="persId != null">PERS_ID = #{persId},</if>
  275. <if test="intm != null">INTM = #{intm},</if>
  276. <if test="uptm != null">UPTM = #{uptm},</if>
  277. <if test="id != null and id != ''">ID = #{id},</if>
  278. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  279. <if test="hystName != null">HYST_NAME = #{hystName},</if>
  280. <if test="linkMan != null">LINK_MAN = #{linkMan},</if>
  281. <if test="linkTel != null">LINK_TEL = #{linkTel},</if>
  282. <if test="adCode != null">AD_CODE = #{adCode},</if>
  283. <if test="adName != null">AD_NAME = #{adName},</if>
  284. <if test="hystSite != null">HYST_SITE = #{hystSite},</if>
  285. <if test="centerX != null">CENTER_X = #{centerX},</if>
  286. <if test="centerY != null">CENTER_Y = #{centerY},</if>
  287. <if test="gdX != null">GD_X = #{gdX},</if>
  288. <if test="gdY != null">GD_Y = #{gdY},</if>
  289. <if test="hystLong != null">HYST_LONG = #{hystLong},</if>
  290. <if test="hystLat != null">HYST_LAT = #{hystLat},</if>
  291. <if test="hystGdX != null">HYST_GD_X = #{hystGdX},</if>
  292. <if test="hystGdY != null">HYST_GD_Y = #{hystGdY},</if>
  293. <if test="rvName != null">RV_NAME = #{rvName},</if>
  294. <if test="compDate != null">COMP_DATE = #{compDate},</if>
  295. <if test="ownerType != null">OWNER_TYPE = #{ownerType},</if>
  296. <if test="exptType != null">EXPT_TYPE = #{exptType},</if>
  297. <if test="insCap != null">INS_CAP = #{insCap},</if>
  298. <if test="damHeig != null">DAM_HEIG = #{damHeig},</if>
  299. <if test="totCap != null">TOT_CAP = #{totCap},</if>
  300. <if test="hystIsReg != null">HYST_IS_REG = #{hystIsReg},</if>
  301. <if test="regNo != null">REG_NO = #{regNo},</if>
  302. <if test="isSafety != null">IS_SAFETY = #{isSafety},</if>
  303. <if test="zlgyFlow != null">ZLGY_FLOW = #{zlgyFlow},</if>
  304. <if test="exmnType != null">EXMN_TYPE = #{exmnType},</if>
  305. <if test="platInfoIsFullAwr != null">PLAT_INFO_IS_FULL_AWR = #{platInfoIsFullAwr},</if>
  306. <if test="awrInfoNo != null">AWR_INFO_NO = #{awrInfoNo},</if>
  307. </trim>
  308. <include refid="page_where" />
  309. </update>
  310. <!-- 其他自定义SQL -->
  311. <update id="updateGdXy" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystInfo">
  312. update BIS_INSP_HYST_INFO
  313. <trim prefix="set" suffixOverrides=",">
  314. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  315. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  316. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  317. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  318. <if test="hystLong != null and hystLong != ''">HYST_LONG = #{hystLong},</if>
  319. <if test="hystLat != null and hystLat != ''">HYST_LAT = #{hystLat},</if>
  320. <if test="hystGdX != null and hystGdX != ''">HYST_GD_X = #{hystGdX},</if>
  321. <if test="hystGdY != null and hystGdY != ''">HYST_GD_Y = #{hystGdY},</if>
  322. </trim>
  323. <where>ID = #{id}</where>
  324. </update>
  325. <select id="findHystList" resultType="cn.com.goldenwater.dcproj.dto.BisInspRgstrDto">
  326. SELECT * FROM (
  327. select B.OBJ_ID AS objId, A.HYST_NAME AS nm, #{pType} pType, A.ID, B.ID as rgstrId, A.LINK_MAN AS attn, A.BASE_ID as code,
  328. A.CENTER_X AS CENTERX, A.CENTER_Y AS CENTERY,
  329. A.HYST_LONG AS LGTD, A.HYST_LAT AS LTTD,
  330. A.HYST_GD_X AS gdX, A.HYST_GD_Y AS gdY,
  331. A.ID AS wintCode,
  332. (case when A.STATUS is null then '0' else A.STATUS end) STATUS,
  333. A.INTM,A.UPTM,
  334. (CASE WHEN B.AD_FULL_NAME IS NULL THEN to_char( e.AD_FULL_NAME ) ELSE B.AD_FULL_NAME END ) adName
  335. from BIS_INSP_HYST_INFO A
  336. LEFT JOIN BIS_INSP_HYST_RGSTR B ON A.RGSTR_ID=B.ID
  337. LEFT JOIN ATT_AD_X_BASE e on B.AD_CODE = e.ad_code
  338. LEFT JOIN BIS_INSP_ALL_OBJ C ON B.OBJ_ID = C.OBJ_ID
  339. WHERE C.Id in (
  340. select distinct id from (
  341. SELECT P.id FROM BIS_INSP_ALL P START WITH P.PID IN (SELECT id FROM BIS_INSP_ALL_RLATION A
  342. WHERE A.PERSID = #{presId} AND Type=#{pType}
  343. and (length(id) between 2 and 20))
  344. CONNECT BY P.PID = PRIOR P.ID
  345. union all
  346. SELECT P.id FROM BIS_INSP_ALL P where p.id in (SELECT id FROM BIS_INSP_ALL_RLATION A
  347. WHERE A.PERSID = #{presId} AND Type=#{pType}
  348. and length(id)&gt; 11 )
  349. )
  350. )
  351. <if test="adCodes !=null and adCodes !=''">
  352. and
  353. <foreach item="item" index="index" collection="adCodes.split(',')" open="(" separator="or" close=")">
  354. b.ad_code like concat('${item}','%')
  355. </foreach>
  356. </if>
  357. ) A WHERE a.PTYPE=#{pType}
  358. <if test="status !=null and status !=''">
  359. and STATUS in (${status})
  360. </if>
  361. <if test="rsName !=null and rsName !=''">
  362. and a.nm like '%${rsName}%'
  363. </if>
  364. <if test="code !=null and code !=''">
  365. and a.code = #{code}
  366. </if>
  367. <if test="adName != null and adName != ''">and a.adName like '%${adName}%'</if>
  368. <if test="sttm != null and sttm != ''">and a.Intm&gt;= TO_DATE(#{sttm},'YYYY-MM-DD')</if>
  369. <if test="entm != null and entm != ''">and a.Intm &lt; To_DATE(#{entm},'yyyy-MM-dd') + 1</if>
  370. </select>
  371. </mapper>