BisInspFjpjlglDao.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  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.BisInspFjpjlglDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspFjpjlgl" id="bisInspFjpjlglResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="objId" column="OBJ_ID"/>
  7. <result property="name" column="NAME"/>
  8. <result property="adCode" column="AD_CODE"/>
  9. <result property="adName" column="AD_NAME"/>
  10. <result property="regAddr" column="REG_ADDR"/>
  11. <result property="busAddr" column="BUS_ADDR"/>
  12. <result property="conPers" column="CON_PERS"/>
  13. <result property="conPersTel" column="CON_PERS_TEL"/>
  14. <result property="centerX" column="CENTER_X"/>
  15. <result property="centerY" column="CENTER_Y"/>
  16. <result property="gdX" column="GD_X"/>
  17. <result property="gdY" column="GD_Y"/>
  18. <result property="persId" column="PERS_ID"/>
  19. <result property="intm" column="INTM"/>
  20. <result property="uptm" column="UPTM"/>
  21. <result property="note" column="NOTE"/>
  22. <result property="dataStat" column="DATA_STAT"/>
  23. <result property="trgtStat" column="TRGT_STAT"/>
  24. <result property="systemStat" column="SYSTEM_STAT"/>
  25. <result property="tvetStat" column="TVET_STAT"/>
  26. <result property="imgrStat" column="IMGR_STAT"/>
  27. <result property="safdlStat" column="SAFDL_STAT"/>
  28. <result property="emStat" column="EM_STAT"/>
  29. <result property="amStat" column="AM_STAT"/>
  30. <result property="cimtStat" column="CIMT_STAT"/>
  31. <result property="trgtTatl" column="TRGT_TATL"/>
  32. <result property="systemTatl" column="SYSTEM_TATL"/>
  33. <result property="tvetTatl" column="TVET_TATL"/>
  34. <result property="imgrTatl" column="IMGR_TATL"/>
  35. <result property="safdlTatl" column="SAFDL_TATL"/>
  36. <result property="emTatl" column="EM_TATL"/>
  37. <result property="amTatl" column="AM_TATL"/>
  38. <result property="cimtTatl" column="CIMT_TATL"/>
  39. <result property="tatl" column="TATL"/>
  40. <result property="trgtLac" column="TRGT_LAC"/>
  41. <result property="systemLac" column="SYSTEM_LAC"/>
  42. <result property="tvetLac" column="TVET_LAC"/>
  43. <result property="imgrLac" column="IMGR_LAC"/>
  44. <result property="safdlLac" column="SAFDL_LAC"/>
  45. <result property="emLac" column="EM_LAC"/>
  46. <result property="amLac" column="AM_LAC"/>
  47. <result property="cimtLac" column="CIMT_LAC"/>
  48. <result property="ratSoc" column="RAT_SOC"/>
  49. <result property="state" column="STATE"/>
  50. <result property="isCnfm" column="IS_CNFM"/>
  51. </resultMap>
  52. <sql id="table_columns">
  53. ID,
  54. OBJ_ID,
  55. NAME,
  56. AD_CODE,
  57. AD_NAME,
  58. REG_ADDR,
  59. BUS_ADDR,
  60. CON_PERS,
  61. CON_PERS_TEL,
  62. CENTER_X,
  63. CENTER_Y,
  64. GD_X,
  65. GD_Y,
  66. PERS_ID,
  67. INTM,
  68. UPTM,
  69. NOTE,
  70. DATA_STAT,
  71. TRGT_STAT,
  72. SYSTEM_STAT,
  73. TVET_STAT,
  74. IMGR_STAT,
  75. SAFDL_STAT,
  76. EM_STAT,
  77. AM_STAT,
  78. CIMT_STAT,
  79. TRGT_TATL,
  80. SYSTEM_TATL,
  81. TVET_TATL,
  82. IMGR_TATL,
  83. SAFDL_TATL,
  84. EM_TATL,
  85. AM_TATL,
  86. CIMT_TATL,
  87. TATL,
  88. TRGT_LAC,
  89. SYSTEM_LAC,
  90. TVET_LAC,
  91. IMGR_LAC,
  92. SAFDL_LAC,
  93. EM_LAC,
  94. AM_LAC,
  95. CIMT_LAC,
  96. RAT_SOC,
  97. STATE,
  98. IS_CNFM
  99. </sql>
  100. <sql id="entity_properties">
  101. #{id},
  102. #{objId},
  103. #{name},
  104. #{adCode},
  105. #{adName},
  106. #{regAddr},
  107. #{busAddr},
  108. #{conPers},
  109. #{conPersTel},
  110. #{centerX},
  111. #{centerY},
  112. #{gdX},
  113. #{gdY},
  114. #{persId},
  115. #{intm},
  116. #{uptm},
  117. #{note},
  118. #{dataStat},
  119. #{trgtStat},
  120. #{systemStat},
  121. #{tvetStat},
  122. #{imgrStat},
  123. #{safdlStat},
  124. #{emStat},
  125. #{amStat},
  126. #{cimtStat},
  127. #{trgtTatl},
  128. #{systemTatl},
  129. #{tvetTatl},
  130. #{imgrTatl},
  131. #{safdlTatl},
  132. #{emTatl},
  133. #{amTatl},
  134. #{cimtTatl},
  135. #{tatl},
  136. #{trgtLac},
  137. #{systemLac},
  138. #{tvetLac},
  139. #{imgrLac},
  140. #{safdlLac},
  141. #{emLac},
  142. #{amLac},
  143. #{cimtLac},
  144. #{ratSoc},
  145. #{state},
  146. #{isCnfm}
  147. </sql>
  148. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  149. <sql id="page_where">
  150. <trim prefix="where" prefixOverrides="and | or ">
  151. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  152. <if test="name != null and name != ''">and NAME = #{name}</if>
  153. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  154. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  155. <if test="regAddr != null and regAddr != ''">and REG_ADDR = #{regAddr}</if>
  156. <if test="busAddr != null and busAddr != ''">and BUS_ADDR = #{busAddr}</if>
  157. <if test="conPers != null and conPers != ''">and CON_PERS = #{conPers}</if>
  158. <if test="conPersTel != null and conPersTel != ''">and CON_PERS_TEL = #{conPersTel}</if>
  159. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  160. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  161. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  162. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  163. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  164. <if test="intm != null">and INTM = #{intm}</if>
  165. <if test="uptm != null">and UPTM = #{uptm}</if>
  166. <if test="note != null and note != ''">and NOTE = #{note}</if>
  167. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  168. <if test="trgtStat != null and trgtStat != ''">and TRGT_STAT = #{trgtStat}</if>
  169. <if test="systemStat != null and systemStat != ''">and SYSTEM_STAT = #{systemStat}</if>
  170. <if test="tvetStat != null and tvetStat != ''">and TVET_STAT = #{tvetStat}</if>
  171. <if test="imgrStat != null and imgrStat != ''">and IMGR_STAT = #{imgrStat}</if>
  172. <if test="safdlStat != null and safdlStat != ''">and SAFDL_STAT = #{safdlStat}</if>
  173. <if test="emStat != null and emStat != ''">and EM_STAT = #{emStat}</if>
  174. <if test="amStat != null and amStat != ''">and AM_STAT = #{amStat}</if>
  175. <if test="cimtStat != null and cimtStat != ''">and CIMT_STAT = #{cimtStat}</if>
  176. <if test="trgtTatl != null and trgtTatl != ''">and TRGT_TATL = #{trgtTatl}</if>
  177. <if test="systemTatl != null and systemTatl != ''">and SYSTEM_TATL = #{systemTatl}</if>
  178. <if test="tvetTatl != null and tvetTatl != ''">and TVET_TATL = #{tvetTatl}</if>
  179. <if test="imgrTatl != null and imgrTatl != ''">and IMGR_TATL = #{imgrTatl}</if>
  180. <if test="safdlTatl != null and safdlTatl != ''">and SAFDL_TATL = #{safdlTatl}</if>
  181. <if test="emTatl != null and emTatl != ''">and EM_TATL = #{emTatl}</if>
  182. <if test="amTatl != null and amTatl != ''">and AM_TATL = #{amTatl}</if>
  183. <if test="cimtTatl != null and cimtTatl != ''">and CIMT_TATL = #{cimtTatl}</if>
  184. <if test="tatl != null and tatl != ''">and TATL = #{tatl}</if>
  185. <if test="trgtLac != null and trgtLac != ''">and TRGT_LAC = #{trgtLac}</if>
  186. <if test="systemLac != null and systemLac != ''">and SYSTEM_LAC = #{systemLac}</if>
  187. <if test="tvetLac != null and tvetLac != ''">and TVET_LAC = #{tvetLac}</if>
  188. <if test="imgrLac != null and imgrLac != ''">and IMGR_LAC = #{imgrLac}</if>
  189. <if test="safdlLac != null and safdlLac != ''">and SAFDL_LAC = #{safdlLac}</if>
  190. <if test="emLac != null and emLac != ''">and EM_LAC = #{emLac}</if>
  191. <if test="amLac != null and amLac != ''">and AM_LAC = #{amLac}</if>
  192. <if test="cimtLac != null and cimtLac != ''">and CIMT_LAC = #{cimtLac}</if>
  193. <if test="ratSoc != null and ratSoc != ''">and RAT_SOC = #{ratSoc}</if>
  194. <if test="state != null and state != ''">and STATE = #{state}</if>
  195. <if test="isCnfm != null and isCnfm != ''">and IS_CNFM = #{isCnfm}</if>
  196. </trim>
  197. </sql>
  198. <select id="get" resultMap="bisInspFjpjlglResultMap" parameterType="String" >
  199. select <include refid="table_columns" /> from BIS_INSP_FJPJLGL where ID = #{id}
  200. </select>
  201. <select id="getBy" resultMap="bisInspFjpjlglResultMap">
  202. select <include refid="table_columns" /> from BIS_INSP_FJPJLGL <include refid="page_where" />
  203. </select>
  204. <select id="findAll" resultMap="bisInspFjpjlglResultMap">
  205. select <include refid="table_columns" /> from BIS_INSP_FJPJLGL
  206. </select>
  207. <select id="findList" resultMap="bisInspFjpjlglResultMap">
  208. select <include refid="table_columns" /> from BIS_INSP_FJPJLGL <include refid="page_where" />
  209. </select>
  210. <select id="selectCount" resultType="int" >
  211. select count(ID) from BIS_INSP_FJPJLGL <include refid="page_where" />
  212. </select>
  213. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspFjpjlgl">
  214. insert into BIS_INSP_FJPJLGL( <include refid="table_columns" /> )
  215. values ( <include refid="entity_properties" /> )
  216. </insert>
  217. <delete id="delete" parameterType="java.lang.String">
  218. update BIS_INSP_FJPJLGL set DATA_STAT='9' where ID = #{id}
  219. </delete>
  220. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspFjpjlgl">
  221. delete from BIS_INSP_FJPJLGL <include refid="page_where" />
  222. </delete>
  223. <update id="deleteInFlag" parameterType="java.lang.String">
  224. update BIS_INSP_FJPJLGL set flag_valid = 0 where ID = #{id}
  225. </update>
  226. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspFjpjlgl">
  227. update BIS_INSP_FJPJLGL
  228. <trim prefix="set" suffixOverrides=",">
  229. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  230. <if test="name != null and name != ''">NAME = #{name},</if>
  231. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  232. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  233. <if test="regAddr != null and regAddr != ''">REG_ADDR = #{regAddr},</if>
  234. <if test="busAddr != null and busAddr != ''">BUS_ADDR = #{busAddr},</if>
  235. <if test="conPers != null and conPers != ''">CON_PERS = #{conPers},</if>
  236. <if test="conPersTel != null and conPersTel != ''">CON_PERS_TEL = #{conPersTel},</if>
  237. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  238. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  239. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  240. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  241. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  242. <if test="intm != null">INTM = #{intm},</if>
  243. <if test="uptm != null">UPTM = #{uptm},</if>
  244. <if test="note != null and note != ''">NOTE = #{note},</if>
  245. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  246. <if test="trgtStat != null and trgtStat != ''">TRGT_STAT = #{trgtStat},</if>
  247. <if test="systemStat != null and systemStat != ''">SYSTEM_STAT = #{systemStat},</if>
  248. <if test="tvetStat != null and tvetStat != ''">TVET_STAT = #{tvetStat},</if>
  249. <if test="imgrStat != null and imgrStat != ''">IMGR_STAT = #{imgrStat},</if>
  250. <if test="safdlStat != null and safdlStat != ''">SAFDL_STAT = #{safdlStat},</if>
  251. <if test="emStat != null and emStat != ''">EM_STAT = #{emStat},</if>
  252. <if test="amStat != null and amStat != ''">AM_STAT = #{amStat},</if>
  253. <if test="cimtStat != null and cimtStat != ''">CIMT_STAT = #{cimtStat},</if>
  254. <if test="trgtTatl != null and trgtTatl != ''">TRGT_TATL = #{trgtTatl},</if>
  255. <if test="systemTatl != null and systemTatl != ''">SYSTEM_TATL = #{systemTatl},</if>
  256. <if test="tvetTatl != null and tvetTatl != ''">TVET_TATL = #{tvetTatl},</if>
  257. <if test="imgrTatl != null and imgrTatl != ''">IMGR_TATL = #{imgrTatl},</if>
  258. <if test="safdlTatl != null and safdlTatl != ''">SAFDL_TATL = #{safdlTatl},</if>
  259. <if test="emTatl != null and emTatl != ''">EM_TATL = #{emTatl},</if>
  260. <if test="amTatl != null and amTatl != ''">AM_TATL = #{amTatl},</if>
  261. <if test="cimtTatl != null and cimtTatl != ''">CIMT_TATL = #{cimtTatl},</if>
  262. <if test="tatl != null and tatl != ''">TATL = #{tatl},</if>
  263. <if test="trgtLac != null">TRGT_LAC = #{trgtLac},</if>
  264. <if test="systemLac != null">SYSTEM_LAC = #{systemLac},</if>
  265. <if test="tvetLac != null">TVET_LAC = #{tvetLac},</if>
  266. <if test="imgrLac != null">IMGR_LAC = #{imgrLac},</if>
  267. <if test="safdlLac != null">SAFDL_LAC = #{safdlLac},</if>
  268. <if test="emLac != null">EM_LAC = #{emLac},</if>
  269. <if test="amLac != null">AM_LAC = #{amLac},</if>
  270. <if test="cimtLac != null">CIMT_LAC = #{cimtLac},</if>
  271. <if test="ratSoc != null and ratSoc != ''">RAT_SOC = #{ratSoc},</if>
  272. <if test="state != null and state != ''">STATE = #{state},</if>
  273. <if test="isCnfm != null and isCnfm != ''">IS_CNFM = #{isCnfm},</if>
  274. </trim>
  275. <where>ID = #{id}</where>
  276. </update>
  277. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspFjpjlgl">
  278. update BIS_INSP_FJPJLGL
  279. <trim prefix="set" suffixOverrides=",">
  280. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  281. <if test="name != null and name != ''">NAME = #{name},</if>
  282. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  283. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  284. <if test="regAddr != null and regAddr != ''">REG_ADDR = #{regAddr},</if>
  285. <if test="busAddr != null and busAddr != ''">BUS_ADDR = #{busAddr},</if>
  286. <if test="conPers != null and conPers != ''">CON_PERS = #{conPers},</if>
  287. <if test="conPersTel != null and conPersTel != ''">CON_PERS_TEL = #{conPersTel},</if>
  288. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  289. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  290. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  291. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  292. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  293. <if test="intm != null">INTM = #{intm},</if>
  294. <if test="uptm != null">UPTM = #{uptm},</if>
  295. <if test="note != null and note != ''">NOTE = #{note},</if>
  296. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  297. <if test="trgtStat != null and trgtStat != ''">TRGT_STAT = #{trgtStat},</if>
  298. <if test="systemStat != null and systemStat != ''">SYSTEM_STAT = #{systemStat},</if>
  299. <if test="tvetStat != null and tvetStat != ''">TVET_STAT = #{tvetStat},</if>
  300. <if test="imgrStat != null and imgrStat != ''">IMGR_STAT = #{imgrStat},</if>
  301. <if test="safdlStat != null and safdlStat != ''">SAFDL_STAT = #{safdlStat},</if>
  302. <if test="emStat != null and emStat != ''">EM_STAT = #{emStat},</if>
  303. <if test="amStat != null and amStat != ''">AM_STAT = #{amStat},</if>
  304. <if test="cimtStat != null and cimtStat != ''">CIMT_STAT = #{cimtStat},</if>
  305. <if test="trgtTatl != null and trgtTatl != ''">TRGT_TATL = #{trgtTatl},</if>
  306. <if test="systemTatl != null and systemTatl != ''">SYSTEM_TATL = #{systemTatl},</if>
  307. <if test="tvetTatl != null and tvetTatl != ''">TVET_TATL = #{tvetTatl},</if>
  308. <if test="imgrTatl != null and imgrTatl != ''">IMGR_TATL = #{imgrTatl},</if>
  309. <if test="safdlTatl != null and safdlTatl != ''">SAFDL_TATL = #{safdlTatl},</if>
  310. <if test="emTatl != null and emTatl != ''">EM_TATL = #{emTatl},</if>
  311. <if test="amTatl != null and amTatl != ''">AM_TATL = #{amTatl},</if>
  312. <if test="cimtTatl != null and cimtTatl != ''">CIMT_TATL = #{cimtTatl},</if>
  313. <if test="tatl != null and tatl != ''">TATL = #{tatl},</if>
  314. <if test="tatl != null and tatl != ''">TATL = #{tatl},</if>
  315. <if test="trgtLac != null">TRGT_LAC = #{trgtLac},</if>
  316. <if test="systemLac != null">SYSTEM_LAC = #{systemLac},</if>
  317. <if test="tvetLac != null">TVET_LAC = #{tvetLac},</if>
  318. <if test="imgrLac != null">IMGR_LAC = #{imgrLac},</if>
  319. <if test="safdlLac != null">SAFDL_LAC = #{safdlLac},</if>
  320. <if test="emLac != null">EM_LAC = #{emLac},</if>
  321. <if test="amLac != null">AM_LAC = #{amLac},</if>
  322. <if test="cimtLac != null">CIMT_LAC = #{cimtLac},</if>
  323. <if test="ratSoc != null and ratSoc != ''">RAT_SOC = #{ratSoc},</if>
  324. <if test="state != null and state != ''">STATE = #{state},</if>
  325. <if test="isCnfm != null and isCnfm != ''">IS_CNFM = #{isCnfm},</if>
  326. </trim>
  327. <include refid="page_where" />
  328. </update>
  329. <!-- 其他自定义SQL -->
  330. <select id="findFjpjlglPage" resultType="cn.com.goldenwater.dcproj.dto.BisInspFjpjlglDto">
  331. SELECT * FROM (
  332. select A.CODE,
  333. A.ID AS nodeId,
  334. B.NAME as NM,
  335. A.PTYPE,
  336. A.OBJ_ID,
  337. IA.PNM AS groupName,
  338. B.ID AS rgstrId,
  339. AW.AD_FULL_NAME,
  340. (CASE WHEN B.STATE IS NULL THEN '0' ELSE B.STATE END) AS STATE,
  341. B.ID,
  342. B.AD_CODE,
  343. B.AD_NAME,
  344. B.REG_ADDR,
  345. B.BUS_ADDR,
  346. B.CON_PERS,
  347. B.CON_PERS_TEL,
  348. B.CENTER_X,
  349. B.CENTER_Y,
  350. B.GD_X,
  351. B.GD_Y,
  352. B.PERS_ID,
  353. B.INTM,
  354. B.UPTM,
  355. B.NOTE,
  356. B.DATA_STAT,
  357. B.TRGT_STAT,
  358. B.SYSTEM_STAT,
  359. B.TVET_STAT,
  360. B.IMGR_STAT,
  361. B.SAFDL_STAT,
  362. B.EM_STAT,
  363. B.AM_STAT,
  364. B.CIMT_STAT,
  365. B.TRGT_TATL,
  366. B.SYSTEM_TATL,
  367. B.TVET_TATL,
  368. B.IMGR_TATL,
  369. B.SAFDL_TATL,
  370. B.EM_TATL,
  371. B.AM_TATL,
  372. B.CIMT_TATL,
  373. B.TATL,
  374. B.TRGT_LAC,
  375. B.SYSTEM_LAC,
  376. B.TVET_LAC,
  377. B.IMGR_LAC,
  378. B.SAFDL_LAC,
  379. B.EM_LAC,
  380. B.AM_LAC,
  381. B.CIMT_LAC,
  382. B.RAT_SOC,
  383. B.IS_CNFM
  384. FROM BIS_INSP_ALL_OBJ A
  385. JOIN BIS_INSP_FJPJLGL B ON A.OBJ_ID = B.OBJ_ID
  386. LEFT JOIN BIS_INSP_ALL IA ON A.ID = IA.ID
  387. LEFT JOIN ATT_AD_BASE AW ON B.AD_CODE = AW.AD_CODE
  388. <where>
  389. <if test="adCodes ==null or adCodes ==''">
  390. <choose>
  391. <when test='isAll =="1"'>
  392. </when>
  393. <otherwise>
  394. AND A.Id in (
  395. select distinct id from (
  396. SELECT P.id FROM BIS_INSP_ALL P START WITH P.PID IN (SELECT id FROM BIS_INSP_ALL_RLATION A
  397. WHERE A.PERSID = #{presId} and TYPE = #{pType} and length(id) in (3,6,9))
  398. CONNECT BY P.PID = PRIOR P.ID
  399. union all
  400. SELECT P.id FROM BIS_INSP_ALL P where p.id in (SELECT id FROM BIS_INSP_ALL_RLATION A
  401. WHERE A.PERSID =#{presId} and TYPE = #{pType} and length(id)=12 )
  402. )
  403. )
  404. </otherwise>
  405. </choose>
  406. </if>
  407. <if test="adCodes !=null and adCodes !=''">
  408. and
  409. <foreach item="item" index="index" collection="adCodes.split(',')" open="(" separator="or" close=")">
  410. b.ad_code like concat('${item}','%')
  411. </foreach>
  412. </if>
  413. <if test="tabType =='2'.toString()">
  414. AND IA.ENTM &lt; TO_DATE(#{nowTime},'yyyy-MM-dd')+1
  415. </if>
  416. <if test="tabType =='1'.toString()">
  417. AND IA.ENTM &gt;= TO_DATE(#{nowTime},'yyyy-MM-dd')
  418. </if>
  419. </where>
  420. ) A
  421. <where>
  422. <if test="id !=null and id !=''">and a.nodeId like '${id}%'</if>
  423. <if test="plnaId !=null and plnaId !=''">and a.nodeId like '${plnaId}%'</if>
  424. <if test="state !=null and state !=''">and STATE in (${state})</if>
  425. <if test="nm !=null and nm !=''">and a.nm like '%${nm}%'</if>
  426. <if test="code !=null and code !=''">and a.code = #{code}</if>
  427. <if test="adName != null and adName != ''">and a.AD_NAME like '%${adName}%'</if>
  428. <if test="sttm != null and sttm != ''">and a.INTM &gt;= TO_DATE(#{sttm},'YYYY-MM-DD')</if>
  429. <if test="entm != null and entm != ''">and a.INTM &lt; To_DATE(#{entm},'yyyy-MM-dd') + 1</if>
  430. <if test="groupId != null and groupId != ''">and a.nodeId = #{groupId}</if>
  431. </where>
  432. order by nodeId asc
  433. <if test="orderBy != null and orderBy != ''">
  434. ,nlssort(nm,'NLS_SORT=SCHINESE_PINYIN_M')
  435. </if>
  436. </select>
  437. <select id="findPageOfficeList" resultType="cn.com.goldenwater.dcproj.dto.BisInspFjpjlglDto">
  438. SELECT * FROM (
  439. select A.CODE,
  440. A.ID AS nodeId,
  441. B.NAME as NM,
  442. A.PTYPE,
  443. A.OBJ_ID,
  444. IA.PNM AS groupName,
  445. B.ID AS rgstrId,
  446. (CASE WHEN B.STATE IS NULL THEN '0' ELSE B.STATE END) AS STATE,
  447. B.ID,
  448. B.AD_CODE,
  449. B.AD_NAME
  450. FROM BIS_INSP_ALL_OBJ A
  451. JOIN BIS_INSP_FJPJLGL B ON A.OBJ_ID = B.OBJ_ID
  452. LEFT JOIN BIS_INSP_ALL IA ON A.ID = IA.ID
  453. <where>
  454. <if test="adCodes ==null or adCodes ==''">
  455. <choose>
  456. <when test='isAll =="1"'>
  457. </when>
  458. <otherwise>
  459. AND A.Id in (
  460. select distinct id from (
  461. SELECT P.id FROM BIS_INSP_ALL P START WITH P.PID IN (SELECT id FROM BIS_INSP_ALL_RLATION A
  462. WHERE A.PERSID = #{presId} and TYPE = #{pType} and length(id) in (3,6,9))
  463. CONNECT BY P.PID = PRIOR P.ID
  464. union all
  465. SELECT P.id FROM BIS_INSP_ALL P where p.id in (SELECT id FROM BIS_INSP_ALL_RLATION A
  466. WHERE A.PERSID =#{presId} and TYPE = #{pType} and length(id)=12 )
  467. )
  468. )
  469. </otherwise>
  470. </choose>
  471. </if>
  472. <if test="adCodes !=null and adCodes !=''">
  473. and
  474. <foreach item="item" index="index" collection="adCodes.split(',')" open="(" separator="or" close=")">
  475. b.ad_code like concat('${item}','%')
  476. </foreach>
  477. </if>
  478. <if test="tabType =='2'.toString()">
  479. AND IA.ENTM &lt; TO_DATE(#{nowTime},'yyyy-MM-dd')+1
  480. </if>
  481. <if test="tabType =='1'.toString()">
  482. AND IA.ENTM &gt;= TO_DATE(#{nowTime},'yyyy-MM-dd')
  483. </if>
  484. </where>
  485. ) A
  486. <where>
  487. <if test="id !=null and id !=''">and a.nodeId like '${id}%'</if>
  488. <if test="plnaId !=null and plnaId !=''">and a.nodeId like '${plnaId}%'</if>
  489. <if test="state !=null and state !=''">and STATE in (${state})</if>
  490. <if test="nm !=null and nm !=''">and a.nm like '%${nm}%'</if>
  491. <if test="code !=null and code !=''">and a.code = #{code}</if>
  492. <if test="adName != null and adName != ''">and a.AD_NAME like '%${adName}%'</if>
  493. <if test="groupId != null and groupId != ''">and a.nodeId = #{groupId}</if>
  494. </where>
  495. order by nodeId asc
  496. <if test="orderBy != null and orderBy != ''">
  497. ,nlssort(nm,'NLS_SORT=SCHINESE_PINYIN_M')
  498. </if>
  499. </select>
  500. </mapper>