AttWagaBaseDao.xml 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  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.AttWagaBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttWagaBase" id="attWagaBaseResultMap">
  5. <result property="gateAdmOrg" column="GATE_ADM_ORG"/>
  6. <result property="staTimeYear" column="STA_TIME_YEAR"/>
  7. <result property="staTimeMon" column="STA_TIME_MON"/>
  8. <result property="engGrad" column="ENG_GRAD"/>
  9. <result property="mainConGrad" column="MAIN_CON_GRAD"/>
  10. <result property="holeNum" column="HOLE_NUM"/>
  11. <result property="holeWid" column="HOLE_WID"/>
  12. <result property="subGateNum" column="SUB_GATE_NUM"/>
  13. <result property="subGateWid" column="SUB_GATE_WID"/>
  14. <result property="locationXiang" column="LOCATION_XIANG"/>
  15. <result property="locationCun" column="LOCATION_CUN"/>
  16. <result property="gateAdmName" column="GATE_ADM_NAME"/>
  17. <result property="gateAdmDep" column="GATE_ADM_DEP"/>
  18. <result property="ifDem" column="IF_DEM"/>
  19. <result property="ifAffRi" column="IF_AFF_RI"/>
  20. <result property="admAttRel" column="ADM_ATT_REL"/>
  21. <result property="centerX" column="CENTER_X"/>
  22. <result property="centerY" column="CENTER_Y"/>
  23. <result property="gdX" column="GD_X"/>
  24. <result property="gdY" column="GD_Y"/>
  25. <result property="objCode" column="OBJ_CODE"/>
  26. <result property="gateName" column="GATE_NAME"/>
  27. <result property="adCode" column="AD_CODE"/>
  28. <result property="locRvName" column="LOC_RV_NAME"/>
  29. <result property="gateType" column="GATE_TYPE"/>
  30. <result property="gateFlow" column="GATE_FLOW"/>
  31. <result property="engScal" column="ENG_SCAL"/>
  32. <result property="flGateFlow" column="FL_GATE_FLOW"/>
  33. <result property="desFlSta" column="DES_FL_STA"/>
  34. <result property="cheFlSta" column="CHE_FL_STA"/>
  35. <result property="cheGateFlow" column="CHE_GATE_FLOW"/>
  36. <result property="cheDesFlSta" column="CHE_DES_FL_STA"/>
  37. <result property="cheCheFlSta" column="CHE_CHE_FL_STA"/>
  38. <result property="draGateFlow" column="DRA_GATE_FLOW"/>
  39. <result property="draDesFlSta" column="DRA_DES_FL_STA"/>
  40. <result property="draCheFlSta" column="DRA_CHE_FL_STA"/>
  41. <result property="ifDraDou" column="IF_DRA_DOU"/>
  42. <result property="intGateFlow" column="INT_GATE_FLOW"/>
  43. <result property="intDesFlSta" column="INT_DES_FL_STA"/>
  44. <result property="intCheFlSta" column="INT_CHE_FL_STA"/>
  45. <result property="intDivAb" column="INT_DIV_AB"/>
  46. <result property="intUse" column="INT_USE"/>
  47. <result property="intUseIrrName" column="INT_USE_IRR_NAME"/>
  48. <result property="ifIntDou" column="IF_INT_DOU"/>
  49. <result property="tideGateFlow" column="TIDE_GATE_FLOW"/>
  50. <result property="tideDesSta" column="TIDE_DES_STA"/>
  51. <result property="tideCheSta" column="TIDE_CHE_STA"/>
  52. <result property="ifGate" column="IF_GATE"/>
  53. <result property="ifDouDile" column="IF_DOU_DILE"/>
  54. <result property="engSta" column="ENG_STA"/>
  55. <result property="buidTimeYear" column="BUID_TIME_YEAR"/>
  56. <result property="buidTimeMon" column="BUID_TIME_MON"/>
  57. <result property="persId" column="PERS_ID"/>
  58. <result property="displayLevel" column="DISPLAY_LEVEL"/>
  59. <result property="provincial" column="PROVINCIAL"/>
  60. </resultMap>
  61. <sql id="table_columns">
  62. GATE_ADM_ORG,PERS_ID,
  63. STA_TIME_YEAR,
  64. STA_TIME_MON,
  65. ENG_GRAD,
  66. MAIN_CON_GRAD,
  67. HOLE_NUM,
  68. HOLE_WID,
  69. SUB_GATE_NUM,
  70. SUB_GATE_WID,
  71. LOCATION_XIANG,
  72. LOCATION_CUN,
  73. GATE_ADM_NAME,
  74. GATE_ADM_DEP,
  75. IF_DEM,
  76. IF_AFF_RI,
  77. ADM_ATT_REL,
  78. CENTER_X,
  79. CENTER_Y,
  80. GD_X,
  81. GD_Y,
  82. OBJ_CODE,
  83. GATE_NAME,
  84. AD_CODE,
  85. LOC_RV_NAME,
  86. GATE_TYPE,
  87. GATE_FLOW,
  88. ENG_SCAL,
  89. FL_GATE_FLOW,
  90. DES_FL_STA,
  91. CHE_FL_STA,
  92. CHE_GATE_FLOW,
  93. CHE_DES_FL_STA,
  94. CHE_CHE_FL_STA,
  95. DRA_GATE_FLOW,
  96. DRA_DES_FL_STA,
  97. DRA_CHE_FL_STA,
  98. IF_DRA_DOU,
  99. INT_GATE_FLOW,
  100. INT_DES_FL_STA,
  101. INT_CHE_FL_STA,
  102. INT_DIV_AB,
  103. INT_USE,
  104. INT_USE_IRR_NAME,
  105. IF_INT_DOU,
  106. TIDE_GATE_FLOW,
  107. TIDE_DES_STA,
  108. TIDE_CHE_STA,
  109. IF_GATE,
  110. IF_DOU_DILE,
  111. ENG_STA,
  112. BUID_TIME_YEAR,
  113. BUID_TIME_MON,
  114. DISPLAY_LEVEL,
  115. PROVINCIAL
  116. </sql>
  117. <sql id="entity_properties">
  118. #{gateAdmOrg},#{persId},
  119. #{staTimeYear},
  120. #{staTimeMon},
  121. #{engGrad},
  122. #{mainConGrad},
  123. #{holeNum},
  124. #{holeWid},
  125. #{subGateNum},
  126. #{subGateWid},
  127. #{locationXiang},
  128. #{locationCun},
  129. #{gateAdmName},
  130. #{gateAdmDep},
  131. #{ifDem},
  132. #{ifAffRi},
  133. #{admAttRel},
  134. #{centerX},
  135. #{centerY},
  136. #{gdX},
  137. #{gdY},
  138. #{objCode},
  139. #{gateName},
  140. #{adCode},
  141. #{locRvName},
  142. #{gateType},
  143. #{gateFlow},
  144. #{engScal},
  145. #{flGateFlow},
  146. #{desFlSta},
  147. #{cheFlSta},
  148. #{cheGateFlow},
  149. #{cheDesFlSta},
  150. #{cheCheFlSta},
  151. #{draGateFlow},
  152. #{draDesFlSta},
  153. #{draCheFlSta},
  154. #{ifDraDou},
  155. #{intGateFlow},
  156. #{intDesFlSta},
  157. #{intCheFlSta},
  158. #{intDivAb},
  159. #{intUse},
  160. #{intUseIrrName},
  161. #{ifIntDou},
  162. #{tideGateFlow},
  163. #{tideDesSta},
  164. #{tideCheSta},
  165. #{ifGate},
  166. #{ifDouDile},
  167. #{engSta},
  168. #{buidTimeYear},
  169. #{buidTimeMon},
  170. #{displayLevel},
  171. #{provincial}
  172. </sql>
  173. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  174. <sql id="page_where">
  175. <trim prefix="where" prefixOverrides="and | or ">
  176. <if test="staTimeYear != null and staTimeYear != ''">and STA_TIME_YEAR = #{staTimeYear}</if>
  177. <if test="staTimeMon != null and staTimeMon != ''">and STA_TIME_MON = #{staTimeMon}</if>
  178. <if test="engGrad != null and engGrad != ''">and ENG_GRAD = #{engGrad}</if>
  179. <if test="mainConGrad != null and mainConGrad != ''">and MAIN_CON_GRAD = #{mainConGrad}</if>
  180. <if test="holeNum != null and holeNum != ''">and HOLE_NUM = #{holeNum}</if>
  181. <if test="holeWid != null and holeWid != ''">and HOLE_WID = #{holeWid}</if>
  182. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  183. <if test="subGateNum != null and subGateNum != ''">and SUB_GATE_NUM = #{subGateNum}</if>
  184. <if test="subGateWid != null and subGateWid != ''">and SUB_GATE_WID = #{subGateWid}</if>
  185. <if test="locationXiang != null and locationXiang != ''">and LOCATION_XIANG = #{locationXiang}</if>
  186. <if test="locationCun != null and locationCun != ''">and LOCATION_CUN = #{locationCun}</if>
  187. <if test="gateAdmName != null and gateAdmName != ''">and GATE_ADM_NAME = #{gateAdmName}</if>
  188. <if test="gateAdmDep != null and gateAdmDep != ''">and GATE_ADM_DEP = #{gateAdmDep}</if>
  189. <if test="ifDem != null and ifDem != ''">and IF_DEM = #{ifDem}</if>
  190. <if test="ifAffRi != null and ifAffRi != ''">and IF_AFF_RI = #{ifAffRi}</if>
  191. <if test="admAttRel != null and admAttRel != ''">and ADM_ATT_REL = #{admAttRel}</if>
  192. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  193. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  194. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  195. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  196. <if test="objCode != null and objCode != ''">and OBJ_CODE = #{objCode}</if>
  197. <if test="gateName != null and gateName != ''">and GATE_NAME = #{gateName}</if>
  198. <if test="adCode != null and adCode != ''">and AD_CODE like '${adCode}%'</if>
  199. <if test="locRvName != null and locRvName != ''">and LOC_RV_NAME = #{locRvName}</if>
  200. <if test="gateType != null and gateType != ''">and GATE_TYPE = #{gateType}</if>
  201. <if test="gateFlow != null and gateFlow != ''">and GATE_FLOW = #{gateFlow}</if>
  202. <if test="engScal != null and engScal != ''">and ENG_SCAL = #{engScal}</if>
  203. <if test="flGateFlow != null and flGateFlow != ''">and FL_GATE_FLOW = #{flGateFlow}</if>
  204. <if test="desFlSta != null and desFlSta != ''">and DES_FL_STA = #{desFlSta}</if>
  205. <if test="cheFlSta != null and cheFlSta != ''">and CHE_FL_STA = #{cheFlSta}</if>
  206. <if test="cheGateFlow != null and cheGateFlow != ''">and CHE_GATE_FLOW = #{cheGateFlow}</if>
  207. <if test="cheDesFlSta != null and cheDesFlSta != ''">and CHE_DES_FL_STA = #{cheDesFlSta}</if>
  208. <if test="cheCheFlSta != null and cheCheFlSta != ''">and CHE_CHE_FL_STA = #{cheCheFlSta}</if>
  209. <if test="draGateFlow != null and draGateFlow != ''">and DRA_GATE_FLOW = #{draGateFlow}</if>
  210. <if test="draDesFlSta != null and draDesFlSta != ''">and DRA_DES_FL_STA = #{draDesFlSta}</if>
  211. <if test="draCheFlSta != null and draCheFlSta != ''">and DRA_CHE_FL_STA = #{draCheFlSta}</if>
  212. <if test="ifDraDou != null and ifDraDou != ''">and IF_DRA_DOU = #{ifDraDou}</if>
  213. <if test="intGateFlow != null and intGateFlow != ''">and INT_GATE_FLOW = #{intGateFlow}</if>
  214. <if test="intDesFlSta != null and intDesFlSta != ''">and INT_DES_FL_STA = #{intDesFlSta}</if>
  215. <if test="intCheFlSta != null and intCheFlSta != ''">and INT_CHE_FL_STA = #{intCheFlSta}</if>
  216. <if test="intDivAb != null and intDivAb != ''">and INT_DIV_AB = #{intDivAb}</if>
  217. <if test="intUse != null and intUse != ''">and INT_USE = #{intUse}</if>
  218. <if test="intUseIrrName != null and intUseIrrName != ''">and INT_USE_IRR_NAME = #{intUseIrrName}</if>
  219. <if test="ifIntDou != null and ifIntDou != ''">and IF_INT_DOU = #{ifIntDou}</if>
  220. <if test="tideGateFlow != null and tideGateFlow != ''">and TIDE_GATE_FLOW = #{tideGateFlow}</if>
  221. <if test="tideDesSta != null and tideDesSta != ''">and TIDE_DES_STA = #{tideDesSta}</if>
  222. <if test="tideCheSta != null and tideCheSta != ''">and TIDE_CHE_STA = #{tideCheSta}</if>
  223. <if test="ifGate != null and ifGate != ''">and IF_GATE = #{ifGate}</if>
  224. <if test="ifDouDile != null and ifDouDile != ''">and IF_DOU_DILE = #{ifDouDile}</if>
  225. <if test="engSta != null and engSta != ''">and ENG_STA = #{engSta}</if>
  226. <if test="buidTimeYear != null and buidTimeYear != ''">and BUID_TIME_YEAR = #{buidTimeYear}</if>
  227. <if test="buidTimeMon != null and buidTimeMon != ''">and BUID_TIME_MON = #{buidTimeMon}</if>
  228. <if test="provincial != null and provincial != ''">and PROVINCIAL = #{provincial}</if>
  229. </trim>
  230. </sql>
  231. <select id="get" resultMap="attWagaBaseResultMap" parameterType="String">
  232. select
  233. <include refid="table_columns"/>
  234. from ATT_WAGA_BASE where OBJ_CODE = #{id}
  235. </select>
  236. <select id="getBy" resultMap="attWagaBaseResultMap">
  237. select
  238. <include refid="table_columns"/>
  239. from ATT_WAGA_BASE
  240. <include refid="page_where"/>
  241. </select>
  242. <select id="findAll" resultMap="attWagaBaseResultMap">
  243. select
  244. <include refid="table_columns"/>
  245. from ATT_WAGA_BASE
  246. </select>
  247. <select id="findList" resultMap="attWagaBaseResultMap">
  248. select
  249. <include refid="table_columns"/>
  250. from ATT_WAGA_BASE
  251. <include refid="page_where"/>
  252. </select>
  253. <select id="selectCount" resultType="int">
  254. select count(ID) from ATT_WAGA_BASE
  255. <include refid="page_where"/>
  256. </select>
  257. <select id="getMax" resultType="java.lang.String" parameterType="java.lang.String">
  258. select max(obj_code) as objCode from att_waga_base e where e.ad_code like '${adCode}%'
  259. </select>
  260. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttWagaBase">
  261. insert into ATT_WAGA_BASE(
  262. <include refid="table_columns"/>
  263. )
  264. values (
  265. <include refid="entity_properties"/>
  266. )
  267. </insert>
  268. <delete id="delete" parameterType="java.lang.String">
  269. delete from ATT_WAGA_BASE where OBJ_CODE = #{id}
  270. </delete>
  271. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttWagaBase">
  272. delete from ATT_WAGA_BASE
  273. <include refid="page_where"/>
  274. </delete>
  275. <update id="deleteInFlag" parameterType="java.lang.String">
  276. update ATT_WAGA_BASE set flag_valid = 0 where objCode = #{id}
  277. </update>
  278. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttWagaBase">
  279. update ATT_WAGA_BASE
  280. <trim prefix="set" suffixOverrides=",">
  281. <if test="staTimeYear != null and staTimeYear != ''">STA_TIME_YEAR = #{staTimeYear},</if>
  282. <if test="staTimeMon != null and staTimeMon != ''">STA_TIME_MON = #{staTimeMon},</if>
  283. <if test="engGrad != null and engGrad != ''">ENG_GRAD = #{engGrad},</if>
  284. <if test="mainConGrad != null and mainConGrad != ''">MAIN_CON_GRAD = #{mainConGrad},</if>
  285. <if test="holeNum != null and holeNum != ''">HOLE_NUM = #{holeNum},</if>
  286. <if test="holeWid != null and holeWid != ''">HOLE_WID = #{holeWid},</if>
  287. <if test="subGateNum != null and subGateNum != ''">SUB_GATE_NUM = #{subGateNum},</if>
  288. <if test="subGateWid != null and subGateWid != ''">SUB_GATE_WID = #{subGateWid},</if>
  289. <if test="locationXiang != null and locationXiang != ''">LOCATION_XIANG = #{locationXiang},</if>
  290. <if test="locationCun != null and locationCun != ''">LOCATION_CUN = #{locationCun},</if>
  291. <if test="gateAdmName != null and gateAdmName != ''">GATE_ADM_NAME = #{gateAdmName},</if>
  292. <if test="gateAdmDep != null and gateAdmDep != ''">GATE_ADM_DEP = #{gateAdmDep},</if>
  293. <if test="ifDem != null and ifDem != ''">IF_DEM = #{ifDem},</if>
  294. <if test="ifAffRi != null and ifAffRi != ''">IF_AFF_RI = #{ifAffRi},</if>
  295. <if test="admAttRel != null and admAttRel != ''">ADM_ATT_REL = #{admAttRel},</if>
  296. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  297. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  298. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  299. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  300. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  301. <if test="objCode != null and objCode != ''">OBJ_CODE = #{objCode},</if>
  302. <if test="gateName != null and gateName != ''">GATE_NAME = #{gateName},</if>
  303. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  304. <if test="locRvName != null and locRvName != ''">LOC_RV_NAME = #{locRvName},</if>
  305. <if test="gateType != null and gateType != ''">GATE_TYPE = #{gateType},</if>
  306. <if test="gateFlow != null and gateFlow != ''">GATE_FLOW = #{gateFlow},</if>
  307. <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
  308. <if test="flGateFlow != null and flGateFlow != ''">FL_GATE_FLOW = #{flGateFlow},</if>
  309. <if test="desFlSta != null and desFlSta != ''">DES_FL_STA = #{desFlSta},</if>
  310. <if test="cheFlSta != null and cheFlSta != ''">CHE_FL_STA = #{cheFlSta},</if>
  311. <if test="cheGateFlow != null and cheGateFlow != ''">CHE_GATE_FLOW = #{cheGateFlow},</if>
  312. <if test="cheDesFlSta != null and cheDesFlSta != ''">CHE_DES_FL_STA = #{cheDesFlSta},</if>
  313. <if test="cheCheFlSta != null and cheCheFlSta != ''">CHE_CHE_FL_STA = #{cheCheFlSta},</if>
  314. <if test="draGateFlow != null and draGateFlow != ''">DRA_GATE_FLOW = #{draGateFlow},</if>
  315. <if test="draDesFlSta != null and draDesFlSta != ''">DRA_DES_FL_STA = #{draDesFlSta},</if>
  316. <if test="draCheFlSta != null and draCheFlSta != ''">DRA_CHE_FL_STA = #{draCheFlSta},</if>
  317. <if test="ifDraDou != null and ifDraDou != ''">IF_DRA_DOU = #{ifDraDou},</if>
  318. <if test="intGateFlow != null and intGateFlow != ''">INT_GATE_FLOW = #{intGateFlow},</if>
  319. <if test="intDesFlSta != null and intDesFlSta != ''">INT_DES_FL_STA = #{intDesFlSta},</if>
  320. <if test="intCheFlSta != null and intCheFlSta != ''">INT_CHE_FL_STA = #{intCheFlSta},</if>
  321. <if test="intDivAb != null and intDivAb != ''">INT_DIV_AB = #{intDivAb},</if>
  322. <if test="intUse != null and intUse != ''">INT_USE = #{intUse},</if>
  323. <if test="intUseIrrName != null and intUseIrrName != ''">INT_USE_IRR_NAME = #{intUseIrrName},</if>
  324. <if test="ifIntDou != null and ifIntDou != ''">IF_INT_DOU = #{ifIntDou},</if>
  325. <if test="tideGateFlow != null and tideGateFlow != ''">TIDE_GATE_FLOW = #{tideGateFlow},</if>
  326. <if test="tideDesSta != null and tideDesSta != ''">TIDE_DES_STA = #{tideDesSta},</if>
  327. <if test="tideCheSta != null and tideCheSta != ''">TIDE_CHE_STA = #{tideCheSta},</if>
  328. <if test="ifGate != null and ifGate != ''">IF_GATE = #{ifGate},</if>
  329. <if test="ifDouDile != null and ifDouDile != ''">IF_DOU_DILE = #{ifDouDile},</if>
  330. <if test="engSta != null and engSta != ''">ENG_STA = #{engSta},</if>
  331. <if test="buidTimeYear != null and buidTimeYear != ''">BUID_TIME_YEAR = #{buidTimeYear},</if>
  332. <if test="buidTimeMon != null and buidTimeMon != ''">BUID_TIME_MON = #{buidTimeMon},</if>
  333. <if test="displayLevel != null and displayLevel != ''">DISPLAY_LEVEL = #{displayLevel},</if>
  334. <if test="provincial != null and provincial != ''">PROVINCIAL = #{provincial},</if>
  335. </trim>
  336. <where>OBJ_CODE = #{objCode}</where>
  337. </update>
  338. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttWagaBase">
  339. update ATT_WAGA_BASE
  340. <trim prefix="set" suffixOverrides=",">
  341. <if test="staTimeYear != null and staTimeYear != ''">STA_TIME_YEAR = #{staTimeYear},</if>
  342. <if test="staTimeMon != null and staTimeMon != ''">STA_TIME_MON = #{staTimeMon},</if>
  343. <if test="engGrad != null and engGrad != ''">ENG_GRAD = #{engGrad},</if>
  344. <if test="mainConGrad != null and mainConGrad != ''">MAIN_CON_GRAD = #{mainConGrad},</if>
  345. <if test="holeNum != null and holeNum != ''">HOLE_NUM = #{holeNum},</if>
  346. <if test="holeWid != null and holeWid != ''">HOLE_WID = #{holeWid},</if>
  347. <if test="subGateNum != null and subGateNum != ''">SUB_GATE_NUM = #{subGateNum},</if>
  348. <if test="subGateWid != null and subGateWid != ''">SUB_GATE_WID = #{subGateWid},</if>
  349. <if test="locationXiang != null and locationXiang != ''">LOCATION_XIANG = #{locationXiang},</if>
  350. <if test="locationCun != null and locationCun != ''">LOCATION_CUN = #{locationCun},</if>
  351. <if test="gateAdmName != null and gateAdmName != ''">GATE_ADM_NAME = #{gateAdmName},</if>
  352. <if test="gateAdmDep != null and gateAdmDep != ''">GATE_ADM_DEP = #{gateAdmDep},</if>
  353. <if test="ifDem != null and ifDem != ''">IF_DEM = #{ifDem},</if>
  354. <if test="ifAffRi != null and ifAffRi != ''">IF_AFF_RI = #{ifAffRi},</if>
  355. <if test="admAttRel != null and admAttRel != ''">ADM_ATT_REL = #{admAttRel},</if>
  356. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  357. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  358. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  359. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  360. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  361. <if test="objCode != null and objCode != ''">OBJ_CODE = #{objCode},</if>
  362. <if test="gateName != null and gateName != ''">GATE_NAME = #{gateName},</if>
  363. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  364. <if test="locRvName != null and locRvName != ''">LOC_RV_NAME = #{locRvName},</if>
  365. <if test="gateType != null and gateType != ''">GATE_TYPE = #{gateType},</if>
  366. <if test="gateFlow != null and gateFlow != ''">GATE_FLOW = #{gateFlow},</if>
  367. <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
  368. <if test="flGateFlow != null and flGateFlow != ''">FL_GATE_FLOW = #{flGateFlow},</if>
  369. <if test="desFlSta != null and desFlSta != ''">DES_FL_STA = #{desFlSta},</if>
  370. <if test="cheFlSta != null and cheFlSta != ''">CHE_FL_STA = #{cheFlSta},</if>
  371. <if test="cheGateFlow != null and cheGateFlow != ''">CHE_GATE_FLOW = #{cheGateFlow},</if>
  372. <if test="cheDesFlSta != null and cheDesFlSta != ''">CHE_DES_FL_STA = #{cheDesFlSta},</if>
  373. <if test="cheCheFlSta != null and cheCheFlSta != ''">CHE_CHE_FL_STA = #{cheCheFlSta},</if>
  374. <if test="draGateFlow != null and draGateFlow != ''">DRA_GATE_FLOW = #{draGateFlow},</if>
  375. <if test="draDesFlSta != null and draDesFlSta != ''">DRA_DES_FL_STA = #{draDesFlSta},</if>
  376. <if test="draCheFlSta != null and draCheFlSta != ''">DRA_CHE_FL_STA = #{draCheFlSta},</if>
  377. <if test="ifDraDou != null and ifDraDou != ''">IF_DRA_DOU = #{ifDraDou},</if>
  378. <if test="intGateFlow != null and intGateFlow != ''">INT_GATE_FLOW = #{intGateFlow},</if>
  379. <if test="intDesFlSta != null and intDesFlSta != ''">INT_DES_FL_STA = #{intDesFlSta},</if>
  380. <if test="intCheFlSta != null and intCheFlSta != ''">INT_CHE_FL_STA = #{intCheFlSta},</if>
  381. <if test="intDivAb != null and intDivAb != ''">INT_DIV_AB = #{intDivAb},</if>
  382. <if test="intUse != null and intUse != ''">INT_USE = #{intUse},</if>
  383. <if test="intUseIrrName != null and intUseIrrName != ''">INT_USE_IRR_NAME = #{intUseIrrName},</if>
  384. <if test="ifIntDou != null and ifIntDou != ''">IF_INT_DOU = #{ifIntDou},</if>
  385. <if test="tideGateFlow != null and tideGateFlow != ''">TIDE_GATE_FLOW = #{tideGateFlow},</if>
  386. <if test="tideDesSta != null and tideDesSta != ''">TIDE_DES_STA = #{tideDesSta},</if>
  387. <if test="tideCheSta != null and tideCheSta != ''">TIDE_CHE_STA = #{tideCheSta},</if>
  388. <if test="ifGate != null and ifGate != ''">IF_GATE = #{ifGate},</if>
  389. <if test="ifDouDile != null and ifDouDile != ''">IF_DOU_DILE = #{ifDouDile},</if>
  390. <if test="engSta != null and engSta != ''">ENG_STA = #{engSta},</if>
  391. <if test="buidTimeYear != null and buidTimeYear != ''">BUID_TIME_YEAR = #{buidTimeYear},</if>
  392. <if test="buidTimeMon != null and buidTimeMon != ''">BUID_TIME_MON = #{buidTimeMon},</if>
  393. <if test="displayLevel != null and displayLevel != ''">DISPLAY_LEVEL = #{displayLevel},</if>
  394. <if test="provincial != null and provincial != ''">PROVINCIAL = #{provincial},</if>
  395. </trim>
  396. <include refid="page_where"/>
  397. </update>
  398. <sql id="orgIdSql">
  399. <choose>
  400. <when test="orgId !=null and orgId !=''">
  401. and ORG_ID=#{orgId}
  402. </when>
  403. <otherwise>
  404. and ORG_ID is null
  405. </otherwise>
  406. </choose>
  407. </sql>
  408. <!-- 其他自定义SQL -->
  409. <select id="getObjByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  410. resultType="cn.com.goldenwater.dcproj.model.AttWagaBase">
  411. SELECT A.OBJ_CODE,
  412. A.GATE_NAME,
  413. A.AD_CODE,
  414. A.LOC_RV_NAME,
  415. A.GATE_TYPE,
  416. A.GATE_FLOW,
  417. A.ENG_SCAL,
  418. A.FL_GATE_FLOW,
  419. A.DES_FL_STA,
  420. A.CHE_FL_STA,
  421. A.CHE_GATE_FLOW,
  422. A.CHE_DES_FL_STA,
  423. A.CHE_CHE_FL_STA,
  424. A.DRA_GATE_FLOW,
  425. A.DRA_DES_FL_STA,
  426. A.DRA_CHE_FL_STA,
  427. A.IF_DRA_DOU,
  428. A.INT_GATE_FLOW,
  429. A.INT_DES_FL_STA,
  430. A.INT_CHE_FL_STA,
  431. A.INT_DIV_AB,
  432. A.INT_USE,
  433. A.INT_USE_IRR_NAME,
  434. A.IF_INT_DOU,
  435. A.TIDE_GATE_FLOW,
  436. A.TIDE_DES_STA,
  437. A.TIDE_CHE_STA,
  438. A.IF_GATE,
  439. A.IF_DOU_DILE,
  440. A.ENG_STA,
  441. A.BUID_TIME_YEAR,
  442. A.BUID_TIME_MON,
  443. A.STA_TIME_YEAR,
  444. A.STA_TIME_MON,
  445. A.ENG_GRAD,
  446. A.MAIN_CON_GRAD,
  447. A.HOLE_NUM,
  448. A.HOLE_WID,
  449. A.SUB_GATE_NUM,
  450. A.SUB_GATE_WID,
  451. A.LOCATION_XIANG,
  452. A.LOCATION_CUN,
  453. A.GATE_ADM_NAME,
  454. A.GATE_ADM_DEP,
  455. A.IF_DEM,
  456. A.IF_AFF_RI,
  457. A.ADM_ATT_REL,
  458. A.CENTER_X,
  459. A.CENTER_Y,
  460. A.GD_X,B.OBJ_ID,B.ID groupId,C.ID rgstrId,
  461. A.GD_Y,A.PROVINCIAL FROM ATT_WAGA_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_CODE = B.CODE
  462. LEFT JOIN ATT_WAGA_RGSTR C ON B.OBJ_ID = C.OBJ_ID
  463. WHERE B.PTYPE = #{objType}
  464. <choose>
  465. <when test="province !=null and province !=''">
  466. and B.AD_CODE like '${province}%'
  467. </when>
  468. <otherwise>
  469. and B.AD_CODE is null
  470. </otherwise>
  471. </choose>
  472. AND REGEXP_LIKE(
  473. B.Id,'^('||
  474. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid}
  475. <choose>
  476. <when test="province !=null and province !=''">
  477. and B.AD_CODE like '${province}%'
  478. </when>
  479. <otherwise>
  480. and B.AD_CODE is null
  481. </otherwise>
  482. </choose>
  483. )>0 then
  484. (SELECT LISTAGG(id, '|') as
  485. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid}
  486. <include refid="orgIdSql"/> GROUP BY PERSID
  487. )
  488. else (select 'non' from dual) end)
  489. ||')')
  490. <if test="adName != null and adName != ''">and A.GATE_NAME LIKE '%${adName}%'</if>
  491. <if test="adCode != null and adCode != ''">and A.AD_CODE LIKE '${adCode}%'</if>
  492. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and A.CENTER_X BETWEEN
  493. #{minLgtd} AND #{maxLgtd}
  494. </if>
  495. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and A.CENTER_Y BETWEEN
  496. #{minLttd} AND #{maxLttd}
  497. </if>
  498. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  499. A.GD_X BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  500. </if>
  501. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  502. A.GD_Y BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  503. </if>
  504. <if test="gateFlow != null and gateFlow != ''">and A.GATE_Flow &gt;= #{gateFlow}</if>
  505. <if test="displayLevel != null and displayLevel != ''">
  506. AND to_number(A.DISPLAY_LEVEL) &lt;= to_number(#{displayLevel})
  507. </if>
  508. </select>
  509. <select id="getWagaList" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  510. resultType="cn.com.goldenwater.dcproj.model.AttWagaBase">
  511. SELECT A.OBJ_CODE,
  512. A.GATE_NAME,
  513. A.AD_CODE,
  514. A.LOC_RV_NAME,
  515. A.GATE_TYPE,
  516. A.GATE_FLOW,
  517. A.ENG_SCAL,
  518. A.FL_GATE_FLOW,
  519. A.DES_FL_STA,
  520. A.CHE_FL_STA,
  521. A.CHE_GATE_FLOW,
  522. A.CHE_DES_FL_STA,
  523. A.CHE_CHE_FL_STA,
  524. A.DRA_GATE_FLOW,
  525. A.DRA_DES_FL_STA,
  526. A.DRA_CHE_FL_STA,
  527. A.IF_DRA_DOU,
  528. A.INT_GATE_FLOW,
  529. A.INT_DES_FL_STA,
  530. A.INT_CHE_FL_STA,
  531. A.INT_DIV_AB,
  532. A.INT_USE,
  533. A.INT_USE_IRR_NAME,
  534. A.IF_INT_DOU,
  535. A.TIDE_GATE_FLOW,
  536. A.TIDE_DES_STA,
  537. A.TIDE_CHE_STA,
  538. A.IF_GATE,
  539. A.IF_DOU_DILE,
  540. A.ENG_STA,
  541. A.BUID_TIME_YEAR,
  542. A.BUID_TIME_MON,
  543. A.STA_TIME_YEAR,
  544. A.STA_TIME_MON,
  545. A.ENG_GRAD,
  546. A.MAIN_CON_GRAD,
  547. A.HOLE_NUM,
  548. A.HOLE_WID,
  549. A.SUB_GATE_NUM,
  550. A.SUB_GATE_WID,
  551. A.LOCATION_XIANG,
  552. A.LOCATION_CUN,
  553. A.GATE_ADM_NAME,
  554. A.GATE_ADM_DEP,
  555. A.IF_DEM,
  556. A.IF_AFF_RI,
  557. A.ADM_ATT_REL,
  558. A.CENTER_X,
  559. A.CENTER_Y,
  560. A.GD_X,
  561. A.GD_Y,
  562. A.GATE_ADM_ORG,C.ID,
  563. A.PERS_ID,
  564. A.DISPLAY_LEVEL,
  565. C.STATE,
  566. C.ID rgstrId,
  567. C.OBJ_ID,
  568. C.GROUP_ID,
  569. A.PROVINCIAL FROM ATT_WAGA_BASE A
  570. LEFT JOIN (select a.obj_id,a.OBJ_CODE,a.ID,a.state,a.group_id from ATT_WAGA_RGSTR a join ( select OBJ_CODE,max(intm) intm from ATT_WAGA_RGSTR GROUP BY obj_code ) b on a.OBJ_CODE = b.OBJ_CODE where a.intm = b.intm
  571. ) C ON A.OBJ_CODE = C.OBJ_CODE
  572. WHERE 1 = 1
  573. <if test="adCode != null and adCode != ''">and A.AD_CODE LIKE '${adCode}%'</if>
  574. <if test="province != null and province != ''">
  575. and A.ad_code like '${province}%'
  576. </if>
  577. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and A.CENTER_X BETWEEN
  578. #{minLgtd} AND #{maxLgtd}
  579. </if>
  580. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and A.CENTER_Y BETWEEN
  581. #{minLttd} AND #{maxLttd}
  582. </if>
  583. <if test="gateFlow != null and gateFlow != ''">and A.GATE_Flow &gt;= #{gateFlow}</if>
  584. <if test="stnm != null and stnm != ''">and A.GATE_NAME LIKE '%${stnm}%'</if>
  585. <if test="engScal != null and engScal != ''">and A.ENG_SCAL = #{engScal}</if>
  586. <if test="displayLevel != null and displayLevel != ''">and to_number(A.DISPLAY_LEVEL) &lt;=
  587. to_number(#{displayLevel})
  588. </if>
  589. </select>
  590. <select id="getWagaBaseList" parameterType="cn.com.goldenwater.dcproj.param.AttWagaBaseParam"
  591. resultType="cn.com.goldenwater.dcproj.model.AttWagaBase">
  592. select
  593. <include refid="table_columns"/>
  594. from ATT_WAGA_BASE A
  595. <where>
  596. <if test="adCode != null and adCode != ''">and A.AD_CODE LIKE '${adCode}%'</if>
  597. <if test="gateName != null and gateName != ''">and A.GATE_NAME LIKE '%${gateName}%'</if>
  598. <if test="engScal != null and engScal != ''">and A.ENG_SCAL = #{engScal}</if>
  599. <if test="gateType != null and gateType != ''">and A.GATE_TYPE = #{gateType}</if>
  600. <if test="province != null and province != ''">and A.ad_code LIKE '${province}%'</if>
  601. </where>
  602. ORDER BY OBJ_CODE ASC
  603. </select>
  604. <select id="getListByInspGroupIdObjType" parameterType="cn.com.goldenwater.dcproj.param.PagePersObjParam"
  605. resultType="cn.com.goldenwater.dcproj.model.BisInspWagaRgstrDto">
  606. select t.*,C.id groupId,C.PNM groupName,o.obj_id
  607. from ATT_WAGA_BASE t
  608. join BIS_INSP_ALL_OBJ o on o.CODE = t.obj_code
  609. LEFT JOIN BIS_INSP_ALL C ON o.ID = C.ID
  610. and o.ptype = #{objType}
  611. where 1 = 1
  612. <if test='isAll == "0"'>and o.ID = #{inspGroupId}</if>
  613. <if test='isAll == "1"'>and o.ID LIKE '${inspGroupId}%'</if>
  614. <if test="rsName != null and rsName != ''">and t.GATE_NAME LIKE '%${rsName}%'</if>
  615. <if test="engScal != null and engScal != ''">and t.ENG_SCAL = #{engScal}</if>
  616. <if test="rsAdmDep != null and rsAdmDep != ''">and t.LOCATION_XIANG = #{rsAdmDep}</if>
  617. <if test="adCode != null and adCode != ''">and t.AD_CODE LIKE '${adCode}%'</if>
  618. <choose>
  619. <when test="province !=null and province !=''">
  620. and o.ad_code like '${province}%'
  621. </when>
  622. <otherwise>
  623. and o.ad_code is null
  624. </otherwise>
  625. </choose>
  626. </select>
  627. <update id="updateBatchProvincial" parameterType="cn.com.goldenwater.dcproj.param.AttWagaBaseParam">
  628. update ATT_WAGA_BASE set PROVINCIAL = #{provincial}
  629. where OBJ_CODE in
  630. <foreach item="objCode" collection="objCodes" open="(" separator="," close=")">
  631. #{objCode}
  632. </foreach>
  633. </update>
  634. </mapper>