GeneralInfoDao.xml 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  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.GeneralInfoDao">
  4. <select id="getGroup" resultType="cn.com.goldenwater.dcproj.dto.PersInfoDto">
  5. SELECT A.ID,A.PNM NM FROM BIS_INSP_ALL A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.ID = B.ID
  6. WHERE B.PERSID = #{persid}
  7. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  8. AND A.STTM &gt;= TO_DATE(#{sttm},'YYYY-MM-DD') AND A.ENTM &lt;= TO_DATE(#{entm},'YYYY-MM-DD')
  9. </if>
  10. <include refid="choseSql"/>
  11. ORDER BY A.ID
  12. </select>
  13. <sql id="choseSql">
  14. <choose>
  15. <when test="province !=null and province !=''">
  16. and B.ad_code=#{province}
  17. </when>
  18. <otherwise>
  19. and B.ad_code is null
  20. </otherwise>
  21. </choose>
  22. </sql>
  23. <sql id="chose_Sql">
  24. <choose>
  25. <when test="province !=null and province !=''">
  26. and C.ad_code=#{province}
  27. </when>
  28. <otherwise>
  29. and C.ad_code is null
  30. </otherwise>
  31. </choose>
  32. </sql>
  33. <select id="getPersResInfoDtoList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersResInfoDto">
  34. SELECT A.* FROM ATT_RS_BASE A LEFT JOIN BIS_INSP_ALL_OBJ C ON A.RS_CODE = C.CODE
  35. left join BIS_INSP_ALL_RLATION B on C.id=B.id
  36. WHERE C.PTYPE = #{ptype} AND C.ID = #{id}
  37. <include refid="choseSql"/>
  38. <if test="ptype =='1'.toString()">
  39. AND A.ENG_SCAL in(4,5)
  40. </if>
  41. <if test="ptype =='36'.toString()">
  42. AND A.ENG_SCAL in(1,2,3)
  43. </if>
  44. </select>
  45. <select id="getPersCwsInfoDtoList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersCwsInfoDto">
  46. SELECT A.* FROM ATT_CWS_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.ADDVCD = B.CODE
  47. left join BIS_INSP_ALL_RLATION C on C.id=B.id
  48. WHERE B.PTYPE = '2' AND B.ID = #{id}
  49. <include refid="chose_Sql"/>
  50. </select>
  51. <select id="getPersWtdstInfoDtoList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersWtdstInfoDto">
  52. SELECT A.* FROM BIS_INSP_WTDST A LEFT JOIN BIS_INSP_ALL_OBJ C ON A.WTDST_ID = C.CODE
  53. left join BIS_INSP_ALL_RLATION B on C.id=B.id
  54. WHERE C.PTYPE = '3' AND C.ID = #{id}
  55. <include refid="choseSql"/>
  56. </select>
  57. <select id="getPersGrwInfoDtoList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.PersGrwInfoDto">
  58. SELECT A.* FROM ATT_GRW_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.STCD = B.CODE
  59. left join BIS_INSP_ALL_RLATION C on C.id=B.id
  60. WHERE B.PTYPE = '5' AND B.ID = #{id}
  61. <include refid="chose_Sql"/>
  62. </select>
  63. <select id="getRsSupData" parameterType="cn.com.goldenwater.dcproj.param.RsStatusInfoParam" resultType="cn.com.goldenwater.dcproj.dto.RsStatusInfoDto">
  64. select A1.RS_CODE,
  65. A1.RS_NAME,
  66. A1.LONGITUDE,
  67. A1.LATITUDE,
  68. A1.LOCATION,
  69. A1.ENG_SCAL,
  70. A1.LIM_STAG,
  71. A1.TOT_CAP,
  72. A1.RS_ADM_NAME,
  73. A1.RS_ADM_CODE,
  74. A1.RS_ADM_DEP,
  75. A1.ADM_ATT_REL,
  76. A1.ADM_DIV,
  77. A1.RS_TYPE,
  78. A1.DAM_TYPE_MAT,
  79. A1.DAM_TYPE_STR,
  80. A1.DAM_SIZE_HIG,
  81. A1.CENTER_X,
  82. A1.CENTER_Y,
  83. A1.SRC,
  84. A1.DATA_QUALITY,
  85. A1.CENTER_X_GD,
  86. A1.CENTER_Y_GD,
  87. A1.RS_LOC,
  88. A1.REG_CODE,
  89. A1.COMP_DATE,
  90. A1.INTM,
  91. A1.REG_NO,
  92. A1.HST_INSP,
  93. A1.PERS_ID,
  94. A1.CHK_STATE,
  95. A1.EDTR_PESR,
  96. A1.SLPC_ADM_DIV,
  97. A1.DISPLAY_LEVEL,
  98. A1.ADM_DIV_NAME,
  99. T.RGSTR_ID,T.OBJ_ID,T.rgstrStatus,to_char(T.UPTM,'yyyy')UPTM
  100. from ATT_RS_BASE A1
  101. LEFT JOIN ( select A.RS_CODE, a.OBJ_ID, a.STATE rgstrStatus, a.RGSTR_ID,A.UPTM from BIS_INSP_RSVR_RGSTR A JOIN (
  102. select rs_code,max(uptm)uptm from BIS_INSP_RSVR_RGSTR group by rs_code ) B ON A.RS_CODE=B.RS_CODE AND A.UPTM=B.UPTM
  103. ) T
  104. ON A1.rs_code = T.RS_CODE where 1=1
  105. <if test="engScal != null and engScal != ''">and A1.ENG_SCAL = #{engScal}</if>
  106. <choose>
  107. <when test="province !=null and province !=''">
  108. and A1.RS_CODE like '${adCode}%'
  109. </when>
  110. <otherwise>
  111. and A2.RS_CODE is null
  112. </otherwise>
  113. </choose>
  114. <if test="status != null and status != ''">
  115. <choose>
  116. <when test='status=="0"'>
  117. and (T.rgstrStatus = #{status} or T.rgstrStatus is null)
  118. </when>
  119. <otherwise>
  120. and T.rgstrStatus = #{status}
  121. </otherwise>
  122. </choose>
  123. </if>
  124. <if test="rsName != null and rsName != ''">and A1.RS_NAME like '%${rsName}%'</if>
  125. <if test="adCode != null and adCode != ''">and A1.ADM_DIV like '${adCode}%'</if>
  126. <if test="totCap != null and totCap != ''">and A1.TOT_CAP &gt;= #{totCap}</if>
  127. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and A1.CENTER_X BETWEEN #{minLgtd} AND #{maxLgtd}</if>
  128. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and A1.CENTER_Y BETWEEN #{minLttd} AND #{maxLttd}</if>
  129. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and A1.CENTER_X_GD BETWEEN #{mincenterXGd} AND #{maxcenterXGd}</if>
  130. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and A1.CENTER_Y_GD BETWEEN #{mincenterYGd} AND #{maxcenterYGd}</if>
  131. <if test="displayLevel != null and displayLevel != ''">
  132. AND to_number(A1.DISPLAY_LEVEL) &lt;= to_number(#{displayLevel})
  133. </if>
  134. </select>
  135. <select id="getEmptprjData" parameterType="cn.com.goldenwater.dcproj.param.EmptprjPadMapInfoParam" resultType="cn.com.goldenwater.dcproj.dto.EmpwtprjPadMapDto">
  136. select A1.*,
  137. T.OBJ_ID,T.rgstrStatus rgstrStatus from ATT_EMPWTPRJ_BASE A1
  138. LEFT JOIN BIS_INSP_ALL_OBJ A2 ON A1.ID = A2.CODE
  139. LEFT JOIN
  140. (SELECT A.ID,B.OBJ_ID,C.STATE rgstrStatus,C.ID RGSTR_ID FROM ATT_EMPWTPRJ_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.ID = B.CODE
  141. LEFT JOIN BIS_INSP_KEY_REGISTER C ON B.OBJ_ID = C.OBJ_ID
  142. <if test="rgstrStatus != null and rgstrStatus != ''">and C.STATE = #{rsvrState}</if>
  143. ) T ON A2.CODE = T.ID WHERE 1 = 1
  144. <if test="nm != null and nm != ''">and A1.NM like '%${nm}%'</if>
  145. <if test="adCode != null and adCode != ''">and A1.AD_CODE like '${adCode}%'</if>
  146. <if test="ptype != null and ptype != ''">and A1.ptype = #{ptype}</if>
  147. <if test="engSta != null and engSta != ''">and A1.ENG_STA = #{engSta}</if>
  148. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and A1.LGTD_PC BETWEEN #{minLgtd} AND #{maxLgtd}</if>
  149. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and A1.LTTD_PC BETWEEN #{minLttd} AND #{maxLttd}</if>
  150. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and A1.LGTD BETWEEN #{mincenterXGd} AND #{maxcenterXGd}</if>
  151. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and A1.LTTD BETWEEN #{mincenterYGd} AND #{maxcenterYGd}</if>
  152. <if test='status == "1"'>and A1.HST_INSP = '1' and T.OBJ_ID IS NULL</if>
  153. <if test='status == "2"'>and A1.HST_INSP ! = '1' AND T.OBJ_ID IS NOT NULL
  154. AND
  155. REGEXP_LIKE(
  156. A2.Id,'^('||
  157. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION C WHERE PERSID = #{persGuid}
  158. <include refid="orgIdSql"/>
  159. )>0 then
  160. (SELECT LISTAGG(id, '|') as
  161. id FROM BIS_INSP_ALL_RLATION C WHERE PERSID = #{persGuid}
  162. <include refid="orgIdSql"/> GROUP BY PERSID
  163. )
  164. else (select 'non' from dual) end)
  165. ||')')</if>
  166. <if test='status == "3"'>and A1.HST_INSP = '1' AND T.OBJ_ID IS NOT NULL
  167. AND
  168. REGEXP_LIKE(
  169. A2.Id,'^('||
  170. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION C WHERE PERSID = #{persGuid}
  171. <include refid="orgIdSql"/>
  172. )>0 then
  173. (SELECT LISTAGG(id, '|') as
  174. id FROM BIS_INSP_ALL_RLATION C WHERE PERSID = #{persGuid}
  175. <include refid="orgIdSql"/> GROUP BY PERSID
  176. )
  177. else (select 'non' from dual) end)
  178. ||')')</if>
  179. <if test='status == "4"'>and A1.HST_INSP ! = '1' AND T.OBJ_ID IS NULL</if>
  180. </select>
  181. <sql id="table_columns_inte">
  182. ID,
  183. INTE_NAME,
  184. PERSID,
  185. LGTD,
  186. LTTD,
  187. INTE_TIME,
  188. DES
  189. </sql>
  190. <sql id="entity_properties_inte">
  191. #{id},
  192. #{inteName},
  193. #{persid},
  194. #{lgtd},
  195. #{lttd},
  196. to_date(#{inteTime},'YYYY-MM-DD HH24:MI:SS'),
  197. #{des}
  198. </sql>
  199. <insert id="insertInte" parameterType="cn.com.goldenwater.dcproj.model.AttInteBase">
  200. insert into ATT_INTE_BASE( <include refid="table_columns_inte" /> )
  201. values ( <include refid="entity_properties_inte" /> )
  202. </insert>
  203. <select id="getIntePage" parameterType="cn.com.goldenwater.dcproj.param.StartAndEndTimeParam" resultType="cn.com.goldenwater.dcproj.model.AttInteBase">
  204. SELECT ID,INTE_NAME,PERSID,LGTD,LTTD,TO_CHAR(INTE_TIME,'YYYY-MM-DD HH24:MI:SS') INTE_TIME,DES
  205. FROM ATT_INTE_BASE WHERE 1 = 1 AND PERSID = #{persGuid}
  206. <if test="name != null and name != ''">and INTE_NAME LIKE '%${name}%'</if>
  207. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  208. and INTE_TIME BETWEEN TO_DATE(#{sttm},'YYYY-MM-DD HH24:MI:SS') AND TO_DATE(#{entm},'YYYY-MM-DD HH24:MI:SS')
  209. ORDER BY INTE_TIME DESC
  210. </if>
  211. </select>
  212. <delete id="deleteInte" parameterType="String">
  213. DELETE FROM ATT_INTE_BASE WHERE ID = #{id}
  214. </delete>
  215. <update id="updateInte" parameterType="cn.com.goldenwater.dcproj.model.AttInteBase">
  216. update ATT_INTE_BASE
  217. <trim prefix="set" suffixOverrides=",">
  218. <if test="inteName != null and inteName != ''">INTE_NAME = #{inteName},</if>
  219. <if test="persid != null and persid != ''">PERSID = #{persid},</if>
  220. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  221. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  222. <if test="inteTime != null">INTE_TIME = to_date(#{inteTime},'YYYY-MM-DD HH24:MI:SS'),</if>
  223. <if test="des != null and des != ''">DES = #{des},</if>
  224. </trim>
  225. <where>ID = #{id}</where>
  226. </update>
  227. <select id="getWorkInfoByPersId" parameterType="String" resultType="cn.com.goldenwater.dcproj.model.BisInspWorkInfo">
  228. SELECT A.CODE,A.PTYPE "TYPE",A.NM "NAME",A.LGTD LON,A.LTTD LAT,B.PERSID "PERS_ID",A.OBJ_ID FROM
  229. BIS_INSP_ALL_OBJ A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.ID = B.ID
  230. <where>
  231. A.obj_id not in (select obj_id from BIS_INSP_WORK_INFO o where o.type=#{ptype})
  232. <if test="ptype !=null and ptype !=''">
  233. and A.ptype=#{ptype}
  234. </if>
  235. </where>
  236. </select>
  237. <select id="getWorkDetailByPersId" parameterType="String" resultType="cn.com.goldenwater.dcproj.model.BisInspWorkInfo">
  238. SELECT A.CODE,A.PTYPE TYPE,A.NM NAME,A.LGTD LON,A.LTTD LAT,B.PERS_ID,B.STTM,B.ENTM,B.OBJ_ID FROM
  239. BIS_INSP_ALL_OBJ A JOIN BIS_INSP_WORK_INFO B ON A.OBJ_ID = B.OBJ_ID
  240. where B.PERS_ID=#{persId}
  241. </select>
  242. <select id="getSttmEntm" resultType="cn.com.goldenwater.dcproj.model.PersLoc">
  243. SELECT a.pers_id,a.pers_name,a.lon,a.latitude,a.longitude,
  244. a.lat,to_char(a.operate_time,'YYYY-MM-DD HH24:MI:SS') operateTime
  245. FROM pers_position a
  246. WHERE
  247. a.pers_id in( #{persId}) and
  248. SQRT(
  249. (((#{lon} - a.lon) * ACOS(-1) * 12656 *
  250. COS(((#{lon} + a.lon) / 2) * ACOS(-1) / 180) / 180) *
  251. ((#{lon} - a.lon) * ACOS(-1) * 12656 *
  252. COS(((#{lon} + a.lon) / 2) * ACOS(-1) / 180) / 180)) +
  253. (((#{lat} - a.lat) * ACOS(-1) * 12656 / 180) *
  254. ((#{lat} - a.lat) * ACOS(-1) * 12656 / 180))) &lt; 2
  255. order by a.operate_time
  256. </select>
  257. <select id="getMaxSttmEntm" resultType="cn.com.goldenwater.dcproj.model.SttmEntm">
  258. SELECT max(a.operate_time) entm,min(a.operate_time) sttm
  259. FROM pers_position a
  260. WHERE
  261. a.pers_id in( #{persId}) and
  262. SQRT(
  263. (((#{lon} - a.lon) * ACOS(-1) * 12656 *
  264. COS(((#{lon} + a.lon) / 2) * ACOS(-1) / 180) / 180) *
  265. ((#{lon} - a.lon) * ACOS(-1) * 12656 *
  266. COS(((#{lon} + a.lon) / 2) * ACOS(-1) / 180) / 180)) +
  267. (((#{lat} - a.lat) * ACOS(-1) * 12656 / 180) *
  268. ((#{lat} - a.lat) * ACOS(-1) * 12656 / 180))) &lt; 2
  269. </select>
  270. <sql id="orgIdSql">
  271. <choose>
  272. <when test="orgId !=null and orgId !=''">
  273. and ORG_ID=#{orgId}
  274. </when>
  275. <otherwise>
  276. and ORG_ID is null
  277. </otherwise>
  278. </choose>
  279. </sql>
  280. <!--水库综合展示数量-->
  281. <select id="getObjRsCount" parameterType="cn.com.goldenwater.dcproj.param.GeneralInfoParam"
  282. resultType="cn.com.goldenwater.dcproj.dto.RsCountDto">
  283. select count(b.ad_code) rsCount,b.ad_code,b.ad_name,b.lgtd,b.lttd from (
  284. select A1.RS_CODE,
  285. A1.RS_NAME,
  286. A1.LONGITUDE,
  287. A1.LATITUDE,
  288. A1.LOCATION,
  289. A1.ENG_SCAL,
  290. A1.LIM_STAG,
  291. A1.TOT_CAP,
  292. A1.RS_ADM_NAME,
  293. A1.RS_ADM_CODE,
  294. A1.RS_ADM_DEP,
  295. A1.ADM_ATT_REL,
  296. A1.ADM_DIV,
  297. A1.RS_TYPE,
  298. A1.DAM_TYPE_MAT,
  299. A1.DAM_TYPE_STR,
  300. A1.DAM_SIZE_HIG,
  301. A1.CENTER_X,
  302. A1.CENTER_Y,
  303. A1.SRC,
  304. A1.DATA_QUALITY,
  305. A1.CENTER_X_GD,
  306. A1.CENTER_Y_GD,
  307. A1.RS_LOC,
  308. A1.REG_CODE,
  309. A1.COMP_DATE,
  310. A1.INTM,
  311. A1.REG_NO,
  312. A1.HST_INSP,
  313. A1.PERS_ID,
  314. A1.UPTM,
  315. A1.CHK_STATE,
  316. A1.EDTR_PESR,
  317. A1.SLPC_ADM_DIV,T.RGSTR_ID,
  318. A1.DISPLAY_LEVEL,
  319. A1.ADM_DIV_NAME,T.OBJ_ID,T.rgstrStatus rgstrStatus
  320. from ATT_RS_BASE A1 LEFT JOIN BIS_INSP_ALL_OBJ A2 ON A1.RS_CODE = A2.CODE
  321. LEFT JOIN
  322. (SELECT A.RS_CODE,B.OBJ_ID,C.STATE rgstrStatus,C.RGSTR_ID FROM ATT_RS_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON
  323. A.RS_CODE = B.CODE
  324. LEFT JOIN BIS_INSP_RSVR_RGSTR C ON B.OBJ_ID = C.OBJ_ID
  325. ) T ON A2.CODE = T.RS_CODE
  326. where 1 = 1
  327. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  328. A1.CENTER_X_GD BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  329. </if>
  330. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  331. A1.CENTER_Y_GD BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  332. </if>
  333. <if test='status == "1"'>and A1.HST_INSP = '1' and T.OBJ_ID IS NULL</if>
  334. <if test='status == "2"'>and A1.HST_INSP ! = '1' AND T.OBJ_ID IS NOT NULL
  335. AND
  336. REGEXP_LIKE(
  337. A2.Id,'^('||
  338. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persId}
  339. <include refid="orgIdSql"/>
  340. )>0 then
  341. (SELECT LISTAGG(id, '|') as
  342. id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persId}
  343. <include refid="orgIdSql"/> GROUP BY PERSID
  344. )
  345. else (select 'non' from dual) end)
  346. ||')')
  347. </if>
  348. <if test='status == "3"'>and A1.HST_INSP = '1' AND T.OBJ_ID IS NOT NULL
  349. AND
  350. REGEXP_LIKE(
  351. A2.Id,'^('||
  352. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persId}
  353. <include refid="orgIdSql"/>
  354. )>0 then
  355. (SELECT LISTAGG(id, '|') as
  356. id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persId}
  357. <include refid="orgIdSql"/> group by persid
  358. )
  359. else (select 'non' from dual) end)
  360. ||')')
  361. </if>
  362. <if test='status == "4"'>and A1.HST_INSP ! = '1' AND T.OBJ_ID IS NULL</if>
  363. ) x LEFT JOIN ATT_AD_X_BASE b
  364. <if test="adGrad == 2">
  365. on concat(substr(x.ADM_DIV,0,2),'0000000000') = b.AD_code
  366. </if>
  367. <if test="adGrad == 3">
  368. on concat(substr(x.ADM_DIV,0,4),'00000000') = b.AD_code
  369. </if>
  370. where b.ad_Grad = ${adGrad}
  371. group by b.ad_code,b.ad_name,b.lgtd,b.lttd
  372. </select>
  373. <!-- 督查行政村 综合展示统计-->
  374. <select id="getObjVlgCount" parameterType="cn.com.goldenwater.dcproj.param.GeneralInfoParam"
  375. resultType="cn.com.goldenwater.dcproj.dto.RsCountDto">
  376. select count(b.ad_code) rsCount,b.ad_code,b.ad_name,b.lgtd,b.lttd from (
  377. SELECT A.VILL_ID,
  378. A.ENG_ID,
  379. A.VILLAGE_CODE,
  380. A.IS_POVERTY,
  381. A.IS_FLUEXC,
  382. A.IS_MTAREA,
  383. A.IS_CENWT_SUPPLY,
  384. A.WATERSUPPLY_PER,
  385. A.VISIT_DATE,
  386. A.REC_PERS_ID,
  387. A.REC_PERS2,
  388. A.REC_PERS_TEL,
  389. A.CREATE_TIME,
  390. A.UPDATE_TIME,
  391. A.STATUS,
  392. A.AD_NM,C.OBJ_ID,
  393. A.WAS_POVERTY,ad.LGTD lgtdPc,ad.LTTD lttdPc,ad.AD_LONG centerXGd,ad.AD_LAT centerYGd
  394. FROM BIS_INSP_SECSURVEY_VLG A LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.ENG_ID = B.ENG_ID
  395. LEFT JOIN BIS_INSP_ALL_OBJ C ON B.OBJ_ID = C.OBJ_ID
  396. LEFT JOIN ATT_AD_X_BASE ad on A.VILLAGE_CODE = ad.AD_CODE
  397. WHERE 1 = 1 AND C.PTYPE = #{objType}
  398. AND
  399. REGEXP_LIKE(
  400. C.Id,'^('||
  401. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persId}
  402. <include refid="orgIdSql"/>
  403. )>0 then
  404. (SELECT LISTAGG(id, '|') as
  405. id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persId}
  406. <include refid="orgIdSql"/> group by persid
  407. )
  408. else (select 'non' from dual) end)
  409. ||')')
  410. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  411. ad.AD_LONG BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  412. </if>
  413. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  414. ad.AD_LAT BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  415. </if>
  416. ) x LEFT JOIN ATT_AD_X_BASE b
  417. <if test="adGrad == 2">
  418. on concat(substr(x.VILLAGE_CODE,0,2),'0000000000') = b.AD_code
  419. </if>
  420. <if test="adGrad == 3">
  421. on concat(substr(x.VILLAGE_CODE,0,4),'00000000') = b.AD_code
  422. </if>
  423. where b.ad_Grad = ${adGrad}
  424. group by b.ad_code,b.ad_name,b.lgtd,b.lttd
  425. </select>
  426. <select id="getObjCwsCount" parameterType="cn.com.goldenwater.dcproj.param.GeneralInfoParam"
  427. resultType="cn.com.goldenwater.dcproj.dto.RsCountDto">
  428. select count(b.ad_code) rsCount,b.ad_code,b.ad_name,b.lgtd,b.lttd from (
  429. SELECT A.GUID,
  430. A.CWS_CODE,
  431. A.CWS_NAME,
  432. A.CWS_LONG,
  433. A.CWS_LAT,
  434. A.CWS_LOC,
  435. A.ENG_TYPE,
  436. A.WASU_TYPE,
  437. A.WASU_RANG,
  438. A.DES_WASU_SCAL,
  439. A.DES_WASU_POP,
  440. A.ENG_STAT,
  441. A.START_DATE,
  442. A.COMP_DATE,
  443. A.NOTE,
  444. A.EFF_DATE,
  445. A.EXPR_DATE,
  446. A.ADDVCD,
  447. A.CENTER_X_GD,
  448. A.CENTER_Y_GD,
  449. A.INTM,
  450. A.EDTR_PESR,
  451. A.UPTM,C.OBJ_ID,
  452. A.CHK_STATE FROM ATT_CWS_BASE A
  453. LEFT JOIN BIS_INSP_ALL_OBJ C ON A.ADDVCD = C.CODE
  454. WHERE 1 = 1 AND C.PTYPE = #{objType}
  455. AND
  456. REGEXP_LIKE(
  457. C.Id,'^('||
  458. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persId}
  459. <include refid="orgIdSql"/>
  460. )>0 then
  461. (SELECT LISTAGG(id, '|') as
  462. id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persId}
  463. <include refid="orgIdSql"/> group by persid
  464. )
  465. else (select 'non' from dual) end)
  466. ||')')
  467. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  468. A.CENTER_X_GD BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  469. </if>
  470. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  471. A.CENTER_Y_GD BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  472. </if>
  473. ) x LEFT JOIN ATT_AD_X_BASE b
  474. <if test="adGrad == 2">
  475. on concat(substr(x.ADDVCD,0,2),'0000000000') = b.AD_code
  476. </if>
  477. <if test="adGrad == 3">
  478. on concat(substr(x.ADDVCD,0,4),'00000000') = b.AD_code
  479. </if>
  480. where b.ad_Grad = ${adGrad}
  481. group by b.ad_code,b.ad_name,b.lgtd,b.lttd
  482. </select>
  483. <select id="getObjPspCount" parameterType="cn.com.goldenwater.dcproj.param.GeneralInfoParam"
  484. resultType="cn.com.goldenwater.dcproj.dto.RsCountDto">
  485. select count(b.ad_code) rsCount,b.ad_code,b.ad_name,b.lgtd,b.lttd from (
  486. SELECT A.ENG_SUR_ID,
  487. A.ENG_ID,
  488. A.WATER_SOURCE_NM,
  489. A.VILLAGE_NM,
  490. A.CWS_CODE,
  491. A.PLAN_INS_AMOUNT,
  492. A.SOURCE_TYPE,
  493. A.IS_PROTECT_AREA,
  494. A.WATER_QUALITY,
  495. A.IS_PROTECT_MARK,
  496. A.IS_POLL_SOURCE,
  497. A.IS_SPARE,
  498. A.VISIT_DATE,
  499. A.REC_PERS_ID,
  500. A.REC_PERS2,
  501. A.REC_PERS_TEL,
  502. A.CREATE_TIME,
  503. A.UPDATE_TIME,
  504. A.STATUS,
  505. A.WTSR_CD,
  506. A.PRO_PLBM,
  507. A.MK_PLBM,
  508. A.POLL_PLBM,
  509. A.SP_PLBM,
  510. A.LGTD,
  511. A.LTTD,
  512. A.LGTD centerXGd,
  513. A.LTTD centerYGd,
  514. A.LGTDPC lgtdPc,
  515. A.LTTDPC lttdPc,C.OBJ_ID,c.code,
  516. A.POLL_NOTE FROM BIS_INSP_PRO_SOURCE_PROTECT A LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.ENG_ID = B.ENG_ID
  517. LEFT JOIN BIS_INSP_ALL_OBJ C ON B.OBJ_ID = C.OBJ_ID
  518. WHERE 1 = 1 AND C.PTYPE = #{objType} AND B.ENG_ID IS NOT NULL
  519. AND
  520. REGEXP_LIKE(
  521. C.Id,'^('||
  522. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persId} <include refid="orgIdSql"/>)>0 then
  523. (SELECT LISTAGG(id, '|') as
  524. id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persId} <include refid="orgIdSql"/> group by persid)
  525. else (select 'non' from dual) end)
  526. ||')')
  527. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  528. A.LGTD BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  529. </if>
  530. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  531. A.LTTD BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  532. </if>
  533. ) x LEFT JOIN ATT_AD_X_BASE b
  534. <if test="adGrad == 2">
  535. on concat(substr(x.code,0,2),'0000000000') = b.AD_code
  536. </if>
  537. <if test="adGrad == 3">
  538. on concat(substr(x.code,0,4),'00000000') = b.AD_code
  539. </if>
  540. where b.ad_Grad = ${adGrad}
  541. group by b.ad_code,b.ad_name,b.lgtd,b.lttd
  542. </select>
  543. <select id="getObjAdBaseCount" parameterType="cn.com.goldenwater.dcproj.param.GeneralInfoParam"
  544. resultType="cn.com.goldenwater.dcproj.dto.RsCountDto">
  545. select count(b.ad_code) rsCount,b.ad_code,b.ad_name,b.lgtd,b.lttd from (
  546. SELECT * FROM BIS_INSP_ALL_OBJ A LEFT JOIN ATT_AD_BASE B ON A.CODE = B.AD_CODE
  547. WHERE A.PTYPE = '2'
  548. AND
  549. REGEXP_LIKE(
  550. A.Id,'^('||
  551. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persId} <include refid="orgIdSql"/>)>0 then
  552. (SELECT LISTAGG(id, '|') as
  553. id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persId} <include refid="orgIdSql"/> group by persid)
  554. else (select 'non' from dual) end)
  555. ||')')
  556. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  557. B.AD_LONG BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  558. </if>
  559. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  560. B.AD_LAT BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  561. </if>
  562. ) x LEFT JOIN ATT_AD_X_BASE b
  563. <if test="adGrad == 2">
  564. on concat(substr(x.code,0,2),'0000000000') = b.AD_code
  565. </if>
  566. <if test="adGrad == 3">
  567. on concat(substr(x.code,0,4),'00000000') = b.AD_code
  568. </if>
  569. where b.ad_Grad = ${adGrad}
  570. group by b.ad_code,b.ad_name,b.lgtd,b.lttd
  571. </select>
  572. <select id="getObjWtdstCount" parameterType="cn.com.goldenwater.dcproj.param.GeneralInfoParam"
  573. resultType="cn.com.goldenwater.dcproj.dto.RsCountDto">
  574. select count(b.ad_code) rsCount,b.ad_code,b.ad_name,b.lgtd,b.lttd from (
  575. SELECT A.WTDST_ID,
  576. A.WTDST_TYPE,
  577. A.WTDST_NM,
  578. A.WTDST_STATE,
  579. A.LOC_AD,
  580. A.WTDST_DTLE,
  581. A.WTDST_WRKAM,
  582. A.PLAN_RCVR_TM,
  583. A.INTM,
  584. A.UPTM,
  585. A.NOTE,
  586. A.WTDST_LGTD,
  587. A.WTDST_LTTD,
  588. A.LOC_NM,B.ID,
  589. A.CENTER_X_GD,
  590. A.CENTER_Y_GD,
  591. B.NM,
  592. B.PTYPE,
  593. B.LGTD,
  594. B.LTTD,AD.AD_NAME adName,
  595. B.OBJ_ID,
  596. TR.AD_NM
  597. FROM BIS_INSP_WTDST A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.WTDST_ID = B.CODE
  598. LEFT JOIN ATT_AD_BASE AD ON A.LOC_AD = AD.AD_CODE
  599. LEFT JOIN BIS_INSP_WTDST_TRACK TR ON B.OBJ_ID = TR.OBJ_ID
  600. WHERE B.PTYPE = #{objType} AND
  601. <!--
  602. REGEXP_LIKE(
  603. B.Id,'^('||(SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persGuid})||')'
  604. )
  605. -->
  606. REGEXP_LIKE(
  607. B.Id,'^('||
  608. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId} <include refid="orgIdSql"/>)>0 then
  609. (SELECT LISTAGG(id, '|') as
  610. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId} <include refid="orgIdSql"/> group by persid)
  611. else (select 'non' from dual) end)
  612. ||')')
  613. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  614. A.CENTER_X_GD BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  615. </if>
  616. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  617. A.CENTER_Y_GD BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  618. </if>
  619. ) x LEFT JOIN ATT_AD_X_BASE b
  620. <if test="adGrad == 2">
  621. on concat(substr(x.LOC_AD,0,2),'0000000000') = b.AD_code
  622. </if>
  623. <if test="adGrad == 3">
  624. on concat(substr(x.LOC_AD,0,4),'00000000') = b.AD_code
  625. </if>
  626. where b.ad_Grad = ${adGrad}
  627. group by b.ad_code,b.ad_name,b.lgtd,b.lttd
  628. </select>
  629. <select id="getObjEmpwtCount" parameterType="cn.com.goldenwater.dcproj.param.GeneralInfoParam"
  630. resultType="cn.com.goldenwater.dcproj.dto.RsCountDto">
  631. select count(b.ad_code) rsCount,b.ad_code,b.ad_name,b.lgtd,b.lttd from (
  632. select A1.*,
  633. T.OBJ_ID,T.rgstrStatus rgstrStatus from ATT_EMPWTPRJ_BASE A1
  634. LEFT JOIN BIS_INSP_ALL_OBJ A2 ON A1.ID = A2.CODE
  635. LEFT JOIN
  636. (SELECT A.ID,B.OBJ_ID,C.STATE rgstrStatus,C.ID RGSTR_ID FROM ATT_EMPWTPRJ_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON
  637. A.ID = B.CODE
  638. LEFT JOIN BIS_INSP_KEY_REGISTER C ON B.OBJ_ID = C.OBJ_ID
  639. ) T ON A2.CODE = T.ID WHERE 1 = 1
  640. <if test="engSta != null and engSta != ''">and A1.ENG_STA = #{engSta}</if>
  641. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  642. A1.LGTD BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  643. </if>
  644. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  645. A1.LTTD BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  646. </if>
  647. <if test='status == "1"'>and A1.HST_INSP = '1' and T.OBJ_ID IS NULL</if>
  648. <if test='status == "2"'>and A1.HST_INSP ! = '1' AND T.OBJ_ID IS NOT NULL
  649. AND
  650. REGEXP_LIKE(
  651. A2.Id,'^('||
  652. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persId} <include refid="orgIdSql"/>)>0 then
  653. (SELECT LISTAGG(id, '|') as
  654. id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persId} <include refid="orgIdSql"/> group by persid)
  655. else (select 'non' from dual) end)
  656. ||')')
  657. </if>
  658. <if test='status == "3"'>and A1.HST_INSP = '1' AND T.OBJ_ID IS NOT NULL
  659. AND
  660. REGEXP_LIKE(
  661. A2.Id,'^('||
  662. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persId} <include refid="orgIdSql"/>)>0 then
  663. (SELECT LISTAGG(id, '|') as
  664. id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persId} <include refid="orgIdSql"/> group by persid)
  665. else (select 'non' from dual) end)
  666. ||')')
  667. </if>
  668. <if test='status == "4"'>and A1.HST_INSP ! = '1' AND T.OBJ_ID IS NULL</if>
  669. ) x LEFT JOIN ATT_AD_X_BASE b
  670. <if test="adGrad == 2">
  671. on concat(substr(x.AD_CODE,0,2),'0000000000') = b.AD_code
  672. </if>
  673. <if test="adGrad == 3">
  674. on concat(substr(x.AD_CODE,0,4),'00000000') = b.AD_code
  675. </if>
  676. where b.ad_Grad = ${adGrad}
  677. group by b.ad_code,b.ad_name,b.lgtd,b.lttd
  678. </select>
  679. <select id="getObjWagaCount" parameterType="cn.com.goldenwater.dcproj.param.GeneralInfoParam"
  680. resultType="cn.com.goldenwater.dcproj.dto.RsCountDto">
  681. select count(b.ad_code) rsCount,b.ad_code,b.ad_name,b.lgtd,b.lttd from (
  682. SELECT A.OBJ_CODE,
  683. A.GATE_NAME,
  684. A.AD_CODE,
  685. A.LOC_RV_NAME,
  686. A.GATE_TYPE,
  687. A.GATE_FLOW,
  688. A.ENG_SCAL,
  689. A.FL_GATE_FLOW,
  690. A.DES_FL_STA,
  691. A.CHE_FL_STA,
  692. A.CHE_GATE_FLOW,
  693. A.CHE_DES_FL_STA,
  694. A.CHE_CHE_FL_STA,
  695. A.DRA_GATE_FLOW,
  696. A.DRA_DES_FL_STA,
  697. A.DRA_CHE_FL_STA,
  698. A.IF_DRA_DOU,
  699. A.INT_GATE_FLOW,
  700. A.INT_DES_FL_STA,
  701. A.INT_CHE_FL_STA,
  702. A.INT_DIV_AB,
  703. A.INT_USE,
  704. A.INT_USE_IRR_NAME,
  705. A.IF_INT_DOU,
  706. A.TIDE_GATE_FLOW,
  707. A.TIDE_DES_STA,
  708. A.TIDE_CHE_STA,
  709. A.IF_GATE,
  710. A.IF_DOU_DILE,
  711. A.ENG_STA,
  712. A.BUID_TIME_YEAR,
  713. A.BUID_TIME_MON,
  714. A.STA_TIME_YEAR,
  715. A.STA_TIME_MON,
  716. A.ENG_GRAD,
  717. A.MAIN_CON_GRAD,
  718. A.HOLE_NUM,
  719. A.HOLE_WID,
  720. A.SUB_GATE_NUM,
  721. A.SUB_GATE_WID,
  722. A.LOCATION_XIANG,
  723. A.LOCATION_CUN,
  724. A.GATE_ADM_NAME,
  725. A.GATE_ADM_DEP,
  726. A.IF_DEM,
  727. A.IF_AFF_RI,
  728. A.ADM_ATT_REL,
  729. A.CENTER_X,
  730. A.CENTER_Y,
  731. A.GD_X,B.OBJ_ID,B.ID groupId,C.ID rgstrId,
  732. A.GD_Y FROM ATT_WAGA_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.OBJ_CODE = B.CODE
  733. LEFT JOIN ATT_WAGA_RGSTR C ON B.OBJ_ID = C.OBJ_ID
  734. WHERE B.PTYPE = #{objType} AND
  735. <!--
  736. REGEXP_LIKE(
  737. B.Id,'^('||(SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persGuid})||')'
  738. )
  739. -->
  740. REGEXP_LIKE(
  741. B.Id,'^('||
  742. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId} <include refid="orgIdSql"/>)>0 then
  743. (SELECT LISTAGG(id, '|') as
  744. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId} <include refid="orgIdSql"/> group by persid)
  745. else (select 'non' from dual) end)
  746. ||')')
  747. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  748. A.GD_X BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  749. </if>
  750. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  751. A.GD_Y BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  752. </if>
  753. ) x LEFT JOIN ATT_AD_X_BASE b
  754. <if test="adGrad == 2">
  755. on concat(substr(x.AD_CODE,0,2),'0000000000') = b.AD_code
  756. </if>
  757. <if test="adGrad == 3">
  758. on concat(substr(x.AD_CODE,0,4),'00000000') = b.AD_code
  759. </if>
  760. where b.ad_Grad = ${adGrad}
  761. group by b.ad_code,b.ad_name,b.lgtd,b.lttd
  762. </select>
  763. <select id="getBaseList" resultType="cn.com.goldenwater.dcproj.dto.BisInspBaseListDto" parameterType="cn.com.goldenwater.dcproj.param.GeneralInfoParam">
  764. select * from VIEW_BASE_LIST t where t.objType = #{objType}
  765. <if test="name != null and name != ''"> and t.nm like '%${name}%'</if>
  766. <if test="adCode != null and adCode != ''">
  767. and t.adCode like '${adCode}%'
  768. </if>
  769. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and t.PCX BETWEEN
  770. #{minLgtd} AND #{maxLgtd}
  771. </if>
  772. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and t.PCY BETWEEN
  773. #{minLttd} AND #{maxLttd}
  774. </if>
  775. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  776. t.GDX BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  777. </if>
  778. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  779. t.GDY BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  780. </if>
  781. <if test="displayLevel != null and displayLevel != ''">
  782. AND to_number(t.DISPLAY_LEVEL) &lt;= to_number(#{displayLevel})
  783. </if>
  784. </select>
  785. <select id="getObjTypeList" parameterType="cn.com.goldenwater.dcproj.param.GeneralInfoParam"
  786. resultType="cn.com.goldenwater.dcproj.model.AttInspType">
  787. select * FROM ATT_INSP_TYPE
  788. where code IN (select rot.INSP_TYPE FROM REL_ORG_INSP_TYPE rot
  789. <where>
  790. <if test="orgId != null and orgId != '' ">
  791. AND rot.ORG_ID = #{orgId}
  792. </if>
  793. </where>
  794. )
  795. </select>
  796. <resultMap type="cn.com.goldenwater.dcproj.vo.BisInspPblmMapVo" id="BisInspPblmVoMap">
  797. <result property="pblmsTypeId" column="PBLMS_TYPE_ID"/>
  798. <result property="regid" column="REGID"/>
  799. <result property="commonFileIds" column="COMMON_FILE_IDS"/>
  800. <result property="fileNo" column="FILE_NO"/>
  801. <result property="fileNoNumber" column="FILE_NO_NUMBER"/>
  802. <result property="pblmsId" column="PBLMS_ID"/>
  803. <result property="pblmId" column="PBLM_ID"/>
  804. <result property="quote" column="QUOTE"/>
  805. <result property="waterUserId" column="WATER_USER_ID"/>
  806. <result property="objId" column="OBJ_ID"/>
  807. <result property="objType" column="OBJ_TYPE"/>
  808. <result property="inspGroupId" column="INSP_GROUP_ID"/>
  809. <result property="pguid" column="PGUID"/>
  810. <result property="inspPblmType" column="INSP_PBLM_TYPE"/>
  811. <result property="inspPblmCode" column="INSP_PBLM_CODE"/>
  812. <result property="inspPblmName" column="INSP_PBLM_NAME"/>
  813. <result property="inspPblmDesc" column="INSP_PBLM_DESC"/>
  814. <result property="inspAddDesc" column="INSP_ADD_DESC"/>
  815. <result property="pblmLong" column="PBLM_LONG"/>
  816. <result property="pblmLat" column="PBLM_LAT"/>
  817. <result property="ifCasePblm" column="IF_CASE_PBLM"/>
  818. <result property="inspPblmOrgName" column="INSP_PBLM_ORG_NAME"/>
  819. <result property="pblmPersName" column="PBLM_PERS_NAME"/>
  820. <result property="inspPblmCate" column="INSP_PBLM_CATE"/>
  821. <result property="pblmStat" column="PBLM_STAT"/>
  822. <result property="reviOpin" column="REVI_OPIN"/>
  823. <result property="reviConc" column="REVI_CONC"/>
  824. <result property="reviOrgGuid" column="REVI_ORG_GUID"/>
  825. <result property="dataStat" column="DATA_STAT"/>
  826. <result property="collTime" column="COLL_TIME"/>
  827. <result property="villType" column="VILL_TYPE"/>
  828. <result property="recPers" column="REC_PERS"/>
  829. <result property="note" column="NOTE"/>
  830. <result property="persName" column="PERS_NAME"/>
  831. <result property="inspPblmsName" column="insp_pblms_name"/>
  832. <result property="checkPoint" column="check_point"/>
  833. <result property="nm" column="nm"/>
  834. <result property="objNm" column="obj_nm"/>
  835. <result property="cwsName" column="cws_name"/>
  836. <result property="cwsCode" column="CWS_CODE"/>
  837. <result property="villageCode" column="VILLAGE_CODE"/>
  838. <result property="pblmDesc" column="pblm_desc"/>
  839. <result property="state" column="state"/>
  840. <result property="code" column="CODE"/>
  841. <result property="adFullName" column="AD_FULL_NAME"/>
  842. <result property="adCode" column="AD_CODE"/>
  843. <result property="orgNm" column="ORG_NM"/>
  844. <result property="orgId" column="ORG_ID"/>
  845. <result property="rsName" column="rs_name"/>
  846. <result property="hasVedio" column="HAS_VEDIO"/>
  847. <result property="problemType" column="PROBLEM_TYPE"/>
  848. <result property="nature" column="NATURE"/>
  849. <result property="reviOrg" column="revi_org"/>
  850. <result property="qualityTypeId" column="QUALITY_TYPE_ID"/>
  851. <result property="defectTypeId" column="DEFECT_TYPE_ID"/>
  852. <result property="fdbkId" column="FDBK_ID"/>
  853. <result property="unitNm" column="unit_nm"/>
  854. <result property="itemId" column="ITEM_ID"/>
  855. <result property="snNum" column="sn_num"/>
  856. <result property="attach" column="attach"/>
  857. <result property="sheet" column="sheet"/>
  858. <result property="engScal" column="eng_scal"/>
  859. <result property="wagaScal" column="waga_Scal"/>
  860. <result property="gateType" column="gate_type"/>
  861. <result property="sttp" column="sttp"/>
  862. <result property="rePtype" column="re_ptype"/>
  863. <result property="pnm" column="pnm"/>
  864. <result property="oid" column="oid"/>
  865. <result property="uptm" column="UP_TM"/>
  866. <result property="pblmNameBz" column="PBLM_NAME_BZ"/>
  867. <result property="checkPointBz" column="CHECK_POINT_BZ"/>
  868. <result property="checkPoint" column="CHECK_POINT"/>
  869. <result property="snNumBz" column="SN_NUM_BZ"/>
  870. <result property="pblmDescBz" column="PBLM_DESC_BZ"/>
  871. <result property="pblmReason" column="PBLM_REASON"/>
  872. <result property="pblmSggtn" column="PBLM_SGGTN"/>
  873. <result property="gongdiBzId" column="GONGDI_BZ_ID"/>
  874. <result property="objCode" column="OBJ_CODE"/>
  875. <result property="objName" column="OBJ_NAME"/>
  876. <result property="objAdCode" column="OBJ_AD_CODE"/>
  877. <result property="attachBz" column="attach_bz"/>
  878. <result property="wtdstNote" column="WTDST_NOTE"/>
  879. <result property="score" column="SCORE"/>
  880. <result property="provincial" column="PROVINCIAL"/>
  881. <result property="belongOrgId" column="BELONG_ORG_ID"/>
  882. <result property="belongAdCode" column="BELONG_AD_CODE"/>
  883. <!-- pblist -->
  884. <result property="id" column="ID"/>
  885. <result property="dutyName" column="DUTY_NAME"/>
  886. <result property="pblmClassify" column="PBLM_CLASSIFY"/>
  887. <result property="pblmNub" column="PBLM_NUB"/>
  888. <result property="pblmNubName" column="PBLM_NUB_NAME"/>
  889. <result property="pblmNo" column="PBLM_NO"/>
  890. <result property="pblmAdName" column="PBLM_AD_NAME"/>
  891. <result property="pblmTm" column="PBLM_TM"/>
  892. <result property="pblmCrtm" column="PBLM_CRTM"/>
  893. <result property="isRect" column="IS_RECT"/>
  894. <result property="pblmPltm" column="PBLM_PLTM"/>
  895. <result property="pblmActm" column="PBLM_ACTM"/>
  896. <result property="crtState" column="CRT_STATE"/>
  897. <result property="crtInfo" column="CRT_INFO"/>
  898. <result property="crtNote" column="CRT_NOTE"/>
  899. <result property="pblmState" column="PBLM_STATE"/>
  900. <result property="pblmOut" column="PBLM_OUT"/>
  901. <result property="sendOrgId" column="SEND_ORG_ID"/>
  902. <result property="sendOrgName" column="SEND_ORG_NAME"/>
  903. <result property="recvOrgId" column="RECV_ORG_ID"/>
  904. <result property="recvOrgName" column="RECV_ORG_NAME"/>
  905. <result property="tranOrgId" column="TRAN_ORG_ID"/>
  906. <result property="tranOrgName" column="TRAN_ORG_NAME"/>
  907. <result property="persId" column="PERS_ID"/>
  908. <result property="plIntm" column="PL_INTM"/>
  909. <result property="plDataStat" column="PL_DATA_STAT"/>
  910. <result property="isStart" column="IS_START"/>
  911. <result property="impSource" column="IMP_SOURCE"/>
  912. <result property="isSite" column="IS_SITE"/>
  913. <result property="chkDept" column="CHK_DEPT"/>
  914. <result property="dcBatch" column="DC_BATCH"/>
  915. <result property="selfInspProcessState" column="SELF_INSP_PROCESS_STATE"/>
  916. <result property="damRegCode" column="DAM_REG_CODE"/>
  917. <result property="reviewStat" column="REVIEW_STAT"/>
  918. <result property="reviewResult" column="REVIEW_RESULT"/>
  919. <result property="reviewNote" column="REVIEW_NOTE"/>
  920. <result property="reviewTm" column="REVIEW_TM"/>
  921. </resultMap>
  922. <select id="selectPblmListByObjType" parameterType="cn.com.goldenwater.dcproj.param.GeneralInfoParam" resultMap="BisInspPblmVoMap">
  923. select p.*,
  924. pl.ID,
  925. pl.DUTY_NAME,
  926. pl.PBLM_CLASSIFY,
  927. pl.PBLM_NUB,
  928. pl.PBLM_NUB_NAME,
  929. pl.PBLM_NO,
  930. pl.PBLM_AD_NAME,
  931. pl.PBLM_TM,
  932. pl.PBLM_CRTM,
  933. pl.IS_RECT,
  934. pl.PBLM_PLTM,
  935. pl.PBLM_ACTM,
  936. pl.CRT_STATE,
  937. pl.CRT_INFO,
  938. pl.CRT_NOTE,
  939. pl.PBLM_STATE,
  940. pl.PBLM_OUT,
  941. pl.SEND_ORG_ID,
  942. pl.SEND_ORG_NAME,
  943. pl.RECV_ORG_ID,
  944. pl.RECV_ORG_NAME,
  945. pl.TRAN_ORG_ID,
  946. pl.TRAN_ORG_NAME,
  947. pl.PERS_ID,
  948. pl.INTM as PL_INTM,
  949. pl.DATA_STAT as PL_DATA_STAT,
  950. pl.IS_START,
  951. pl.IMP_SOURCE,
  952. pl.IS_SITE,
  953. pl.CHK_DEPT,
  954. pl.DC_BATCH,
  955. pl.SELF_INSP_PROCESS_STATE,
  956. pl.DAM_REG_CODE,
  957. pl.REVIEW_STAT,
  958. pl.REVIEW_RESULT,
  959. pl.REVIEW_NOTE,
  960. pl.REVIEW_TM
  961. from BIS_INSP_PBLM p
  962. left join BIS_INSP_PBLM_PLIST pl on pl.PBLM_ID = p.PBLM_ID
  963. <where>
  964. <if test="adCode != null and adCode != ''">and p.OBJ_AD_CODE like '${adCode}%'</if>
  965. <if test="startTime != null and startTime != ''">AND p.COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')</if>
  966. <if test="endTime != null and endTime != ''">AND p.COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1</if>
  967. <if test="lv != null and lv != ''">AND p.INSP_PBLM_CATE = #{lv}</if>
  968. <if test="objType != null and objType != ''">and p.OBJ_TYPE = #{objType}</if>
  969. </where>
  970. ORDER BY p.OBJ_AD_CODE, p.OBJ_TYPE, p.OBJ_NAME
  971. </select>
  972. </mapper>