42c3fb0dac0b904ea65f6970c19d3c57f42dfe8c.svn-base 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  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.BisInspWagaSapRgstrDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspWagaSapRgstr" id="bisInspWagaSapRgstrResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="objId" column="OBJ_ID"/>
  7. <result property="sapId" column="SAP_ID"/>
  8. <result property="sapName" column="SAP_NAME"/>
  9. <result property="basCode" column="BAS_CODE"/>
  10. <result property="diskName" column="DISK_NAME"/>
  11. <result property="adCode" column="AD_CODE"/>
  12. <result property="adName" column="AD_NAME"/>
  13. <result property="startLoc" column="START_LOC"/>
  14. <result property="endLoc" column="END_LOC"/>
  15. <result property="centerX" column="CENTER_X"/>
  16. <result property="centerY" column="CENTER_Y"/>
  17. <result property="gdX" column="GD_X"/>
  18. <result property="gdY" column="GD_Y"/>
  19. <result property="riverBank" column="RIVER_BANK"/>
  20. <result property="lake" column="LAKE"/>
  21. <result property="coast" column="COAST"/>
  22. <result property="dikeGrad" column="DIKE_GRAD"/>
  23. <result property="sapLen" column="SAP_LEN"/>
  24. <result property="sapType" column="SAP_TYPE"/>
  25. <result property="chkState" column="CHK_STATE"/>
  26. <result property="mampu" column="MAMPU"/>
  27. <result property="mampuAttn" column="MAMPU_ATTN"/>
  28. <result property="mampuAttnTel" column="MAMPU_ATTN_TEL"/>
  29. <result property="compUnitAttn" column="COMP_UNIT_ATTN"/>
  30. <result property="compUnitAttnTel" column="COMP_UNIT_ATTN_TEL"/>
  31. <result property="gvmtFldWho" column="GVMT_FLD_WHO"/>
  32. <result property="gvmtFldWhoTel" column="GVMT_FLD_WHO_TEL"/>
  33. <result property="note" column="NOTE"/>
  34. <result property="state" column="STATE"/>
  35. <result property="mrsCiStat" column="MRS_CI_STAT"/>
  36. <result property="safeStat" column="SAFE_STAT"/>
  37. <result property="dmamStat" column="DMAM_STAT"/>
  38. <result property="proenStat" column="PROEN_STAT"/>
  39. <result property="baseStat" column="BASE_STAT"/>
  40. <result property="persId" column="PERS_ID"/>
  41. <result property="groupId" column="GROUP_ID"/>
  42. <result property="intm" column="INTM"/>
  43. <result property="uptm" column="UPTM"/>
  44. </resultMap>
  45. <sql id="table_columns">
  46. ID,
  47. OBJ_ID,
  48. SAP_ID,
  49. SAP_NAME,
  50. BAS_CODE,
  51. DISK_NAME,
  52. AD_CODE,
  53. AD_NAME,
  54. START_LOC,
  55. END_LOC,
  56. CENTER_X,
  57. CENTER_Y,
  58. GD_X,
  59. GD_Y,
  60. RIVER_BANK,
  61. LAKE,
  62. COAST,
  63. DIKE_GRAD,
  64. SAP_LEN,
  65. SAP_TYPE,
  66. CHK_STATE,
  67. MAMPU,
  68. MAMPU_ATTN,
  69. MAMPU_ATTN_TEL,
  70. COMP_UNIT_ATTN,
  71. COMP_UNIT_ATTN_TEL,
  72. GVMT_FLD_WHO,
  73. GVMT_FLD_WHO_TEL,
  74. NOTE,
  75. STATE,
  76. MRS_CI_STAT,
  77. SAFE_STAT,
  78. DMAM_STAT,
  79. PROEN_STAT,
  80. BASE_STAT,
  81. PERS_ID,
  82. GROUP_ID,
  83. INTM,
  84. UPTM
  85. </sql>
  86. <sql id="entity_properties">
  87. #{id},
  88. #{objId},
  89. #{sapId},
  90. #{sapName},
  91. #{basCode},
  92. #{diskName},
  93. #{adCode},
  94. #{adName},
  95. #{startLoc},
  96. #{endLoc},
  97. #{centerX},
  98. #{centerY},
  99. #{gdX},
  100. #{gdY},
  101. #{riverBank},
  102. #{lake},
  103. #{coast},
  104. #{dikeGrad},
  105. #{sapLen},
  106. #{sapType},
  107. #{chkState},
  108. #{mampu},
  109. #{mampuAttn},
  110. #{mampuAttnTel},
  111. #{compUnitAttn},
  112. #{compUnitAttnTel},
  113. #{gvmtFldWho},
  114. #{gvmtFldWhoTel},
  115. #{note},
  116. #{state},
  117. #{mrsCiStat},
  118. #{safeStat},
  119. #{dmamStat},
  120. #{proenStat},
  121. #{baseStat},
  122. #{persId},
  123. #{groupId},
  124. #{intm},
  125. #{uptm}
  126. </sql>
  127. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  128. <sql id="page_where">
  129. <trim prefix="where" prefixOverrides="and | or ">
  130. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  131. <if test="sapId != null and sapId != ''">and SAP_ID = #{sapId}</if>
  132. <if test="sapName != null and sapName != ''">and SAP_NAME = #{sapName}</if>
  133. <if test="basCode != null and basCode != ''">and BAS_CODE = #{basCode}</if>
  134. <if test="diskName != null and diskName != ''">and DISK_NAME = #{diskName}</if>
  135. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  136. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  137. <if test="startLoc != null and startLoc != ''">and START_LOC = #{startLoc}</if>
  138. <if test="endLoc != null and endLoc != ''">and END_LOC = #{endLoc}</if>
  139. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  140. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  141. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  142. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  143. <if test="riverBank != null and riverBank != ''">and RIVER_BANK = #{riverBank}</if>
  144. <if test="lake != null and lake != ''">and LAKE = #{lake}</if>
  145. <if test="coast != null and coast != ''">and COAST = #{coast}</if>
  146. <if test="dikeGrad != null and dikeGrad != ''">and DIKE_GRAD = #{dikeGrad}</if>
  147. <if test="sapLen != null and sapLen != ''">and SAP_LEN = #{sapLen}</if>
  148. <if test="sapType != null and sapType != ''">and SAP_TYPE = #{sapType}</if>
  149. <if test="chkState != null and chkState != ''">and CHK_STATE = #{chkState}</if>
  150. <if test="mampu != null and mampu != ''">and MAMPU = #{mampu}</if>
  151. <if test="mampuAttn != null and mampuAttn != ''">and MAMPU_ATTN = #{mampuAttn}</if>
  152. <if test="mampuAttnTel != null and mampuAttnTel != ''">and MAMPU_ATTN_TEL = #{mampuAttnTel}</if>
  153. <if test="compUnitAttn != null and compUnitAttn != ''">and COMP_UNIT_ATTN = #{compUnitAttn}</if>
  154. <if test="compUnitAttnTel != null and compUnitAttnTel != ''">and COMP_UNIT_ATTN_TEL = #{compUnitAttnTel}
  155. </if>
  156. <if test="gvmtFldWho != null and gvmtFldWho != ''">and GVMT_FLD_WHO = #{gvmtFldWho}</if>
  157. <if test="gvmtFldWhoTel != null and gvmtFldWhoTel != ''">and GVMT_FLD_WHO_TEL = #{gvmtFldWhoTel}</if>
  158. <if test="note != null and note != ''">and NOTE = #{note}</if>
  159. <if test="state != null and state != ''">and STATE = #{state}</if>
  160. <if test="mrsCiStat != null and mrsCiStat != ''">and MRS_CI_STAT = #{mrsCiStat}</if>
  161. <if test="safeStat != null and safeStat != ''">and SAFE_STAT = #{safeStat}</if>
  162. <if test="dmamStat != null and dmamStat != ''">and DMAM_STAT = #{dmamStat}</if>
  163. <if test="proenStat != null and proenStat != ''">and PROEN_STAT = #{proenStat}</if>
  164. <if test="baseStat != null and baseStat != ''">and BASE_STAT = #{baseStat}</if>
  165. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  166. <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
  167. <if test="intm != null">and INTM = #{intm}</if>
  168. <if test="uptm != null">and UPTM = #{uptm}</if>
  169. </trim>
  170. </sql>
  171. <select id="get" resultMap="bisInspWagaSapRgstrResultMap" parameterType="String">
  172. select
  173. <include refid="table_columns"/>
  174. from BIS_INSP_WAGA_SAP_RGSTR where ID = #{id}
  175. </select>
  176. <select id="getBy" resultMap="bisInspWagaSapRgstrResultMap">
  177. select
  178. <include refid="table_columns"/>
  179. from BIS_INSP_WAGA_SAP_RGSTR
  180. <include refid="page_where"/>
  181. </select>
  182. <select id="findAll" resultMap="bisInspWagaSapRgstrResultMap">
  183. select
  184. <include refid="table_columns"/>
  185. from BIS_INSP_WAGA_SAP_RGSTR
  186. </select>
  187. <select id="findList" resultMap="bisInspWagaSapRgstrResultMap">
  188. select
  189. <include refid="table_columns"/>
  190. from BIS_INSP_WAGA_SAP_RGSTR
  191. <include refid="page_where"/>
  192. </select>
  193. <select id="selectCount" resultType="int">
  194. select count(ID) from BIS_INSP_WAGA_SAP_RGSTR
  195. <include refid="page_where"/>
  196. </select>
  197. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspWagaSapRgstr">
  198. insert into BIS_INSP_WAGA_SAP_RGSTR(
  199. <include refid="table_columns"/>
  200. )
  201. values (
  202. <include refid="entity_properties"/>
  203. )
  204. </insert>
  205. <delete id="delete" parameterType="java.lang.String">
  206. update BIS_INSP_WAGA_SAP_RGSTR set DATA_STAT='9' where ID = #{id}
  207. </delete>
  208. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspWagaSapRgstr">
  209. update BIS_INSP_WAGA_SAP_RGSTR set DATA_STAT='9'
  210. <include refid="page_where"/>
  211. </delete>
  212. <update id="deleteInFlag" parameterType="java.lang.String">
  213. update BIS_INSP_WAGA_SAP_RGSTR set DATA_STAT = '9' where ID = #{id}
  214. </update>
  215. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspWagaSapRgstr">
  216. update BIS_INSP_WAGA_SAP_RGSTR
  217. <trim prefix="set" suffixOverrides=",">
  218. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  219. <if test="sapId != null and sapId != ''">SAP_ID = #{sapId},</if>
  220. <if test="sapName != null and sapName != ''">SAP_NAME = #{sapName},</if>
  221. <if test="basCode != null and basCode != ''">BAS_CODE = #{basCode},</if>
  222. <if test="diskName != null and diskName != ''">DISK_NAME = #{diskName},</if>
  223. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  224. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  225. <if test="startLoc != null and startLoc != ''">START_LOC = #{startLoc},</if>
  226. <if test="endLoc != null and endLoc != ''">END_LOC = #{endLoc},</if>
  227. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  228. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  229. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  230. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  231. <if test="riverBank != null and riverBank != ''">RIVER_BANK = #{riverBank},</if>
  232. <if test="lake != null and lake != ''">LAKE = #{lake},</if>
  233. <if test="coast != null and coast != ''">COAST = #{coast},</if>
  234. <if test="dikeGrad != null and dikeGrad != ''">DIKE_GRAD = #{dikeGrad},</if>
  235. <if test="sapLen != null and sapLen != ''">SAP_LEN = #{sapLen},</if>
  236. <if test="sapType != null and sapType != ''">SAP_TYPE = #{sapType},</if>
  237. <if test="chkState != null and chkState != ''">CHK_STATE = #{chkState},</if>
  238. <if test="mampu != null and mampu != ''">MAMPU = #{mampu},</if>
  239. <if test="mampuAttn != null and mampuAttn != ''">MAMPU_ATTN = #{mampuAttn},</if>
  240. <if test="mampuAttnTel != null and mampuAttnTel != ''">MAMPU_ATTN_TEL = #{mampuAttnTel},</if>
  241. <if test="compUnitAttn != null and compUnitAttn != ''">COMP_UNIT_ATTN = #{compUnitAttn},</if>
  242. <if test="compUnitAttnTel != null and compUnitAttnTel != ''">COMP_UNIT_ATTN_TEL = #{compUnitAttnTel},</if>
  243. <if test="gvmtFldWho != null and gvmtFldWho != ''">GVMT_FLD_WHO = #{gvmtFldWho},</if>
  244. <if test="gvmtFldWhoTel != null and gvmtFldWhoTel != ''">GVMT_FLD_WHO_TEL = #{gvmtFldWhoTel},</if>
  245. <if test="note != null and note != ''">NOTE = #{note},</if>
  246. <if test="state != null and state != ''">STATE = #{state},</if>
  247. <if test="mrsCiStat != null and mrsCiStat != ''">MRS_CI_STAT = #{mrsCiStat},</if>
  248. <if test="safeStat != null and safeStat != ''">SAFE_STAT = #{safeStat},</if>
  249. <if test="dmamStat != null and dmamStat != ''">DMAM_STAT = #{dmamStat},</if>
  250. <if test="proenStat != null and proenStat != ''">PROEN_STAT = #{proenStat},</if>
  251. <if test="baseStat != null and baseStat != ''">BASE_STAT = #{baseStat},</if>
  252. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  253. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  254. <if test="intm != null">INTM = #{intm},</if>
  255. <if test="uptm != null">UPTM = #{uptm},</if>
  256. </trim>
  257. <where>ID = #{id}</where>
  258. </update>
  259. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspWagaSapRgstr">
  260. update BIS_INSP_WAGA_SAP_RGSTR
  261. <trim prefix="set" suffixOverrides=",">
  262. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  263. <if test="sapId != null and sapId != ''">SAP_ID = #{sapId},</if>
  264. <if test="sapName != null and sapName != ''">SAP_NAME = #{sapName},</if>
  265. <if test="basCode != null and basCode != ''">BAS_CODE = #{basCode},</if>
  266. <if test="diskName != null and diskName != ''">DISK_NAME = #{diskName},</if>
  267. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  268. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  269. <if test="startLoc != null and startLoc != ''">START_LOC = #{startLoc},</if>
  270. <if test="endLoc != null and endLoc != ''">END_LOC = #{endLoc},</if>
  271. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  272. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  273. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  274. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  275. <if test="riverBank != null and riverBank != ''">RIVER_BANK = #{riverBank},</if>
  276. <if test="lake != null and lake != ''">LAKE = #{lake},</if>
  277. <if test="coast != null and coast != ''">COAST = #{coast},</if>
  278. <if test="dikeGrad != null and dikeGrad != ''">DIKE_GRAD = #{dikeGrad},</if>
  279. <if test="sapLen != null and sapLen != ''">SAP_LEN = #{sapLen},</if>
  280. <if test="sapType != null and sapType != ''">SAP_TYPE = #{sapType},</if>
  281. <if test="chkState != null and chkState != ''">CHK_STATE = #{chkState},</if>
  282. <if test="mampu != null and mampu != ''">MAMPU = #{mampu},</if>
  283. <if test="mampuAttn != null and mampuAttn != ''">MAMPU_ATTN = #{mampuAttn},</if>
  284. <if test="mampuAttnTel != null and mampuAttnTel != ''">MAMPU_ATTN_TEL = #{mampuAttnTel},</if>
  285. <if test="compUnitAttn != null and compUnitAttn != ''">COMP_UNIT_ATTN = #{compUnitAttn},</if>
  286. <if test="compUnitAttnTel != null and compUnitAttnTel != ''">COMP_UNIT_ATTN_TEL = #{compUnitAttnTel},</if>
  287. <if test="gvmtFldWho != null and gvmtFldWho != ''">GVMT_FLD_WHO = #{gvmtFldWho},</if>
  288. <if test="gvmtFldWhoTel != null and gvmtFldWhoTel != ''">GVMT_FLD_WHO_TEL = #{gvmtFldWhoTel},</if>
  289. <if test="note != null and note != ''">NOTE = #{note},</if>
  290. <if test="state != null and state != ''">STATE = #{state},</if>
  291. <if test="mrsCiStat != null and mrsCiStat != ''">MRS_CI_STAT = #{mrsCiStat},</if>
  292. <if test="safeStat != null and safeStat != ''">SAFE_STAT = #{safeStat},</if>
  293. <if test="dmamStat != null and dmamStat != ''">DMAM_STAT = #{dmamStat},</if>
  294. <if test="proenStat != null and proenStat != ''">PROEN_STAT = #{proenStat},</if>
  295. <if test="baseStat != null and baseStat != ''">BASE_STAT = #{baseStat},</if>
  296. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  297. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  298. <if test="intm != null">INTM = #{intm},</if>
  299. <if test="uptm != null">UPTM = #{uptm},</if>
  300. </trim>
  301. <include refid="page_where"/>
  302. </update>
  303. <!-- 其他自定义SQL -->
  304. <select id="getWagaSapRegstrInfo" resultType="cn.com.goldenwater.dcproj.dto.BisInspRgstrDto">
  305. SELECT
  306. *
  307. FROM
  308. (
  309. SELECT
  310. a.OBJ_ID AS objId,
  311. #{pType} AS ptype,
  312. ( CASE WHEN a.STATE IS NULL THEN '0' ELSE a.STATE END ) AS state,
  313. ( CASE WHEN a.AD_NAME IS NULL THEN to_char( e.AD_FULL_NAME ) ELSE a.AD_NAME END ) location,
  314. A.CENTER_X, A.CENTER_Y, A.GD_X, A.GD_Y,
  315. A.GD_X AS LGTD, A.GD_Y AS LTTD,
  316. a.INTM AS intm,
  317. a.UPTM AS uptm,
  318. b.id AS nodeId,
  319. a.id AS rgstrId,
  320. a.SAP_NAME AS nm,
  321. insp.pnm AS groupName,
  322. a.MRS_CI_STAT AS mrsCiStat,
  323. a.SAFE_STAT AS safeStat,
  324. a.DMAM_STAT AS dmamStat,
  325. a.PROEN_STAT AS proenStat,
  326. a.BASE_STAT AS baseStat,
  327. a.BASE_STAT AS baseInfoState,
  328. a.SAP_ID AS sapId,
  329. a.PERS_ID AS persId
  330. FROM
  331. BIS_INSP_WAGA_SAP_RGSTR A
  332. LEFT JOIN BIS_INSP_ALL_OBJ b ON a.OBJ_ID = b.OBJ_ID
  333. LEFT JOIN ATT_AD_X_BASE e ON A.AD_CODE = e.ad_code
  334. LEFT JOIN bis_insp_all insp ON b.id = insp.id
  335. WHERE
  336. 1=1
  337. <if test="tabType =='2'.toString()">
  338. and insp.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  339. </if>
  340. <if test="tabType =='1'.toString()">
  341. and insp.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')
  342. </if>
  343. AND B.Id in (
  344. select distinct id from (
  345. SELECT P.id FROM BIS_INSP_ALL P START WITH P.PID IN (SELECT id FROM BIS_INSP_ALL_RLATION A
  346. WHERE A.PERSID = #{presId} AND type= '29' and length(id) in (3,6,9)
  347. <include refid="choseSql"/>
  348. )
  349. CONNECT BY P.PID = PRIOR P.ID
  350. union all
  351. SELECT P.id FROM BIS_INSP_ALL P where p.id in (SELECT id FROM BIS_INSP_ALL_RLATION A
  352. WHERE A.PERSID =#{presId} AND type= '29' and length(id)=12
  353. <include refid="choseSql"/>
  354. )
  355. )
  356. )
  357. ) a
  358. WHERE
  359. 1 =1
  360. <if test="sttm !=null and sttm !='' and entm !=null and entm !=''">
  361. and intm&gt;=to_date(#{sttm},'yyyy-mm-dd') and intm &lt;=to_date(#{entm},'yyyy-mm-dd')
  362. </if>
  363. <if test="state !=null and state !=''">
  364. and state in (${state})
  365. </if>
  366. <if test="adName !=null and adName !=''">
  367. and location like '%${adName}%'
  368. </if>
  369. <if test="groupId !=null and groupId !=''">
  370. and nodeId like '${groupId}%'
  371. </if>
  372. <if test="plnaId !=null and plnaId !=''">
  373. and nodeId like '${plnaId}%'
  374. </if>
  375. <if test="rsName !=null and rsName !=''">
  376. and nm like '${rsName}%'
  377. </if>
  378. </select>
  379. <select id="getWagaSapRgstrInfoByObjId" resultType="java.lang.String">
  380. select id from BIS_INSP_WAGA_SAP_RGSTR where OBJ_ID = #{objId}
  381. </select>
  382. <delete id="deleteById">
  383. delete from BIS_INSP_WAGA_SAP_RGSTR where id = #{id}
  384. </delete>
  385. <sql id="choseSql">
  386. <choose>
  387. <when test="province !=null and province !=''">
  388. AND ad_code Like '${province}%'
  389. </when>
  390. <otherwise>
  391. AND ad_code is null
  392. </otherwise>
  393. </choose>
  394. </sql>
  395. <select id="getObjListNotInspGroupId" parameterType="String"
  396. resultType="cn.com.goldenwater.dcproj.model.AttWagaSapBase">
  397. select t.*
  398. from att_irr_base t
  399. where t.id not in (
  400. select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%') and B.obj_type=#{objType}
  401. <choose>
  402. <when test="province !=null and province !=''">
  403. and B.AD_CODE =#{province}
  404. </when>
  405. <otherwise>
  406. and B.AD_CODE is null
  407. </otherwise>
  408. </choose>
  409. )
  410. <if test="adName != null and adName != ''">and t.nm LIKE '%${adName}%'</if>
  411. <if test="adCode != null and adCode != ''">and t.AD_CODE LIKE '${adCode}%'</if>
  412. </select>
  413. <select id="getListByInspGroupIdObjType" resultType="cn.com.goldenwater.dcproj.model.AttWagaSapBase"
  414. parameterType="cn.com.goldenwater.dcproj.param.PagePersObjParam">
  415. select t.*,C.id groupId,C.PNM groupName,B.obj_id
  416. from att_waga_sap_base t
  417. left join BIS_INSP_ALL_OBJ B
  418. on B.CODE = t.id
  419. LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
  420. and B.ptype ='29'
  421. left join bis_insp_waga_sap_rgstr r on b.obj_id=r.obj_id
  422. where 1 = 1
  423. <if test='isAll == "0"'>and B.ID = #{inspGroupId}</if>
  424. <if test='isAll == "1"'>and B.ID LIKE '${inspGroupId}%'</if>
  425. <if test="adCode != null and adCode != ''">
  426. and t.AD_CODE like '${adCode}%'
  427. </if>
  428. <choose>
  429. <when test="province != null and province != ''">
  430. and B.AD_CODE LIKE '${province}%'
  431. </when>
  432. <otherwise>
  433. and B.AD_CODE is null
  434. </otherwise>
  435. </choose>
  436. </select>
  437. </mapper>