BisInspKeyRegisterDao.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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.BisInspKeyRegisterDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspKeyRegister" id="bisInspKeyRegisterResultMap">
  5. <result property="engSta" column="ENG_STA"/>
  6. <result property="buidTimeYear" column="BUID_TIME_YEAR"/>
  7. <result property="id" column="ID"/>
  8. <result property="objId" column="OBJ_ID"/>
  9. <result property="ptype" column="PTYPE"/>
  10. <result property="adCode" column="AD_CODE"/>
  11. <result property="nm" column="NM"/>
  12. <result property="stwktm" column="STWKTM"/>
  13. <result property="plantm" column="PLANTM"/>
  14. <result property="estapp" column="ESTAPP"/>
  15. <result property="lgtd" column="LGTD"/>
  16. <result property="lttd" column="LTTD"/>
  17. <result property="lgtdPc" column="LGTD_PC"/>
  18. <result property="lttdPc" column="LTTD_PC"/>
  19. <result property="unitId" column="UNIT_ID"/>
  20. <result property="unitNm" column="UNIT_NM"/>
  21. <result property="groupLeaderId" column="GROUP_LEADER_ID"/>
  22. <result property="groupLeader" column="GROUP_LEADER"/>
  23. <result property="groupLeaderTel" column="GROUP_LEADER_TEL"/>
  24. <result property="recPersId" column="REC_PERS_ID"/>
  25. <result property="recPers" column="REC_PERS"/>
  26. <result property="recPersTel" column="REC_PERS_TEL"/>
  27. <result property="intm" jdbcType="TIMESTAMP" column="INTM"/>
  28. <result property="uptm" jdbcType="TIMESTAMP" column="UPTM"/>
  29. <result property="note" column="NOTE"/>
  30. <result property="dataStat" column="DATA_STAT"/>
  31. <result property="state" column="STATE"/>
  32. <result property="secStat" column="SEC_STAT"/>
  33. <result property="oneUnitStat" column="ONE_UNIT_STAT"/>
  34. <result property="twoUnitStat" column="TWO_UNIT_STAT"/>
  35. <result property="threeUnitStat" column="THREE_UNIT_STAT"/>
  36. <result property="adName" column="AD_NAME"/>
  37. <result property="orgId" column="ORG_ID"/>
  38. <result property="engProfil" column="ENG_PROFIL"/>
  39. <result property="engBuild" column="ENG_BUILD"/>
  40. </resultMap>
  41. <resultMap type="cn.com.goldenwater.dcproj.dto.BisInspKeyRegisterDto" id="bisInspKeyRegisterListResultMap">
  42. <result property="code" column="CODE"/>
  43. <result property="engSta" column="ENG_STA"/>
  44. <result property="buidTimeYear" column="BUID_TIME_YEAR"/>
  45. <result property="id" column="ID"/>
  46. <result property="objId" column="OBJ_ID"/>
  47. <result property="ptype" column="PTYPE"/>
  48. <result property="nodeId" column="nodeId"/>
  49. <result property="adCode" column="AD_CODE"/>
  50. <result property="nm" column="NM"/>
  51. <result property="stwktm" column="STWKTM"/>
  52. <result property="plantm" column="PLANTM"/>
  53. <result property="estapp" column="ESTAPP"/>
  54. <result property="lgtd" column="LGTD"/>
  55. <result property="lttd" column="LTTD"/>
  56. <result property="lgtdPc" column="LGTD_PC"/>
  57. <result property="lttdPc" column="LTTD_PC"/>
  58. <result property="wtdstState" column="wtdstState"/>
  59. <result property="oneUnitName" column="oneUnitNm"/>
  60. <result property="oneUnitId" column="oneUnitId"/>
  61. <result property="engProfil" column="ENG_PROFIL"/>
  62. <result property="engBuild" column="ENG_BUILD"/>
  63. </resultMap>
  64. <sql id="table_columns">
  65. ENG_STA,ENG_PROFIL,ENG_BUILD,
  66. BUID_TIME_YEAR,
  67. ID,
  68. OBJ_ID,
  69. PTYPE,
  70. AD_CODE,
  71. NM,
  72. STWKTM,
  73. PLANTM,
  74. ESTAPP,
  75. LGTD,
  76. LTTD,
  77. LGTD_PC,
  78. LTTD_PC,
  79. UNIT_ID,
  80. UNIT_NM,
  81. GROUP_LEADER_ID,
  82. GROUP_LEADER,
  83. GROUP_LEADER_TEL,
  84. REC_PERS_ID,
  85. REC_PERS,
  86. REC_PERS_TEL,
  87. INTM,
  88. UPTM,
  89. NOTE,
  90. DATA_STAT,
  91. STATE,
  92. SEC_STAT,
  93. ONE_UNIT_STAT,
  94. TWO_UNIT_STAT,
  95. THREE_UNIT_STAT,
  96. AD_NAME,ORG_ID
  97. </sql>
  98. <sql id="entity_properties">
  99. #{engSta},#{engProfil},#{engBuild},
  100. #{buidTimeYear},
  101. #{id},
  102. #{objId},
  103. #{ptype},
  104. #{adCode},
  105. #{nm},
  106. #{stwktm},
  107. #{plantm},
  108. #{estapp},
  109. #{lgtd},
  110. #{lttd},
  111. #{lgtdPc},
  112. #{lttdPc},
  113. #{unitId},
  114. #{unitNm},
  115. #{groupLeaderId},
  116. #{groupLeader},
  117. #{groupLeaderTel},
  118. #{recPersId},
  119. #{recPers},
  120. #{recPersTel},
  121. #{intm},
  122. #{uptm},
  123. #{note},
  124. #{dataStat},
  125. #{state},
  126. #{secStat},
  127. #{oneUnitStat},
  128. #{twoUnitStat},
  129. #{threeUnitStat},
  130. #{adName},#{orgId}
  131. </sql>
  132. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  133. <sql id="page_where">
  134. <trim prefix="where" prefixOverrides="and | or ">
  135. <if test="engProfil != null and engProfil != ''">and eng_Profil = #{engProfil}</if>
  136. <if test="engBuild != null and engBuild != ''">and eng_Build = #{engBuild}</if>
  137. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  138. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  139. <if test="ptype != null and ptype != ''">and PTYPE = #{ptype}</if>
  140. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  141. <if test="nm != null and nm != ''">and NM = #{nm}</if>
  142. <if test="stwktm != null and stwktm != ''">and STWKTM = #{stwktm}</if>
  143. <if test="plantm != null and plantm != ''">and PLANTM = #{plantm}</if>
  144. <if test="estapp != null and estapp != ''">and ESTAPP = #{estapp}</if>
  145. <if test="lgtd != null and lgtd != ''">and LGTD = #{lgtd}</if>
  146. <if test="lttd != null and lttd != ''">and LTTD = #{lttd}</if>
  147. <if test="lgtdPc != null and lgtdPc != ''">and LGTD_PC = #{lgtdPc}</if>
  148. <if test="lttdPc != null and lttdPc != ''">and LTTD_PC = #{lttdPc}</if>
  149. <if test="unitId != null and unitId != ''">and UNIT_ID = #{unitId}</if>
  150. <if test="unitNm != null and unitNm != ''">and UNIT_NM = #{unitNm}</if>
  151. <if test="groupLeaderId != null and groupLeaderId != ''">and GROUP_LEADER_ID = #{groupLeaderId}</if>
  152. <if test="groupLeader != null and groupLeader != ''">and GROUP_LEADER = #{groupLeader}</if>
  153. <if test="groupLeaderTel != null and groupLeaderTel != ''">and GROUP_LEADER_TEL = #{groupLeaderTel}</if>
  154. <if test="recPersId != null and recPersId != ''">and REC_PERS_ID = #{recPersId}</if>
  155. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  156. <if test="recPersTel != null and recPersTel != ''">and REC_PERS_TEL = #{recPersTel}</if>
  157. <if test="intm != null">and INTM = #{intm}</if>
  158. <if test="uptm != null">and UPTM = #{uptm}</if>
  159. <if test="note != null and note != ''">and NOTE = #{note}</if>
  160. <if test="dataStat != null">and DATA_STAT = #{dataStat}</if>
  161. <if test="state != null">and STATE = #{state}</if>
  162. <if test="secStat != null">and SEC_STAT = #{secStat}</if>
  163. <if test="oneUnitStat != null">and ONE_UNIT_STAT = #{oneUnitStat}</if>
  164. <if test="twoUnitStat != null">and TWO_UNIT_STAT = #{twoUnitStat}</if>
  165. <if test="threeUnitStat != null">and THREE_UNIT_STAT = #{threeUnitStat}</if>
  166. </trim>
  167. </sql>
  168. <select id="getOne" resultMap="bisInspKeyRegisterResultMap">
  169. select
  170. <include refid="table_columns"/>
  171. from BIS_INSP_KEY_REGISTER r where r.nm like '%${nm}%'
  172. </select>
  173. <select id="get" resultMap="bisInspKeyRegisterResultMap" parameterType="String">
  174. select
  175. <include refid="table_columns"/>
  176. from BIS_INSP_KEY_REGISTER where ID = #{id}
  177. </select>
  178. <select id="getBy" resultMap="bisInspKeyRegisterResultMap">
  179. select
  180. <include refid="table_columns"/>
  181. from BIS_INSP_KEY_REGISTER
  182. <include refid="page_where"/>
  183. </select>
  184. <select id="findAll" resultMap="bisInspKeyRegisterResultMap">
  185. select
  186. <include refid="table_columns"/>
  187. from BIS_INSP_KEY_REGISTER
  188. </select>
  189. <select id="findList" resultMap="bisInspKeyRegisterResultMap">
  190. select
  191. <include refid="table_columns"/>
  192. from BIS_INSP_KEY_REGISTER
  193. <include refid="page_where"/>
  194. </select>
  195. <sql id="choseSql">
  196. <choose>
  197. <when test="province !=null and province !=''">
  198. and A.ad_code=#{province}
  199. </when>
  200. <otherwise>
  201. and A.ad_code is null
  202. </otherwise>
  203. </choose>
  204. </sql>
  205. <sql id="orgIdSql">
  206. <choose>
  207. <when test="orgId !=null and orgId !=''">
  208. and ORG_ID=#{orgId}
  209. </when>
  210. <otherwise>
  211. and ORG_ID is null
  212. </otherwise>
  213. </choose>
  214. </sql>
  215. <select id="findPageByType" resultMap="bisInspKeyRegisterListResultMap"
  216. parameterType="cn.com.goldenwater.dcproj.param.TypeParam">
  217. SELECT * FROM (
  218. select A.CODE,A.ID nodeId,
  219. A.NM,
  220. A.PTYPE PTYPE,
  221. B.ID,
  222. B.PTYPE ETYPE,
  223. B.STWKTM ,
  224. B.PLANTM ,
  225. B.ESTAPP,
  226. B.ENG_STA,
  227. B.BUID_TIME_YEAR,
  228. B.lgtd,
  229. B.lttd,
  230. B.lgtd_pc,
  231. B.eng_Profil,
  232. B.eng_Build,
  233. B.lttd_pc,
  234. (CASE WHEN B.STATE IS NULL THEN '0' ELSE B.STATE END) STATE,
  235. (CASE WHEN B.STATE IS NULL THEN '0' ELSE B.STATE END) WTDST_STATE,
  236. B.INTM,
  237. A.OBJ_ID,
  238. d.id oneUnitId,
  239. d.nm oneUnitNm
  240. FROM BIS_INSP_ALL_OBJ A
  241. JOIN BIS_INSP_KEY_REGISTER B ON A.OBJ_ID=B.OBJ_ID
  242. LEFT JOIN BIS_INSP_ALL IA ON A.ID=IA.ID
  243. LEFT JOIN ATT_EMPWTPRJ_BASE C ON A.CODE=C.ID
  244. LEFT JOIN (SELECT * FROM ATT_MAMPU_INFO WHERE LEV='1') D ON D.REG_ID=B.ID
  245. where A.ptype= #{pType}
  246. <if test='tabType =="2"'>
  247. and ia.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  248. </if>
  249. <if test="tabType =='1'.toString()">
  250. and ia.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')
  251. </if>
  252. <include refid="choseSql"/>
  253. and REGEXP_LIKE(
  254. A.Id,'^('||
  255. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  256. <include refid="orgIdSql"/>
  257. )>0 then
  258. (SELECT LISTAGG(id, '|') as
  259. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{presId}
  260. <include refid="orgIdSql"/> GROUP BY PERSID
  261. )
  262. else (select 'non' from dual) end)
  263. ||')')
  264. ) A
  265. <where>
  266. <if test="plnaId !=null and plnaId !=''">
  267. and a.nodeId like '${plnaId}%'
  268. </if>
  269. <if test="state !=null and state !=''">
  270. and STATE=#{state}
  271. </if>
  272. <if test="rsName !=null and rsName !=''">
  273. and a.nm like '%${rsName}%'
  274. </if>
  275. </where>
  276. order by nodeId asc
  277. <if test="orderBy != null and orderBy != ''">
  278. ,nlssort(nm,'NLS_SORT=SCHINESE_PINYIN_M')
  279. </if>
  280. </select>
  281. <select id="selectCount" resultType="int">
  282. select count(ID) from BIS_INSP_KEY_REGISTER
  283. <include refid="page_where"/>
  284. </select>
  285. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspKeyRegister">
  286. insert into BIS_INSP_KEY_REGISTER(
  287. <include refid="table_columns"/>
  288. )
  289. values (
  290. <include refid="entity_properties"/>
  291. )
  292. </insert>
  293. <delete id="delete" parameterType="java.lang.String">
  294. delete from BIS_INSP_KEY_REGISTER where ID = #{id}
  295. </delete>
  296. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspKeyRegister">
  297. delete from BIS_INSP_KEY_REGISTER
  298. <include refid="page_where"/>
  299. </delete>
  300. <update id="deleteInFlag" parameterType="java.lang.String">
  301. update BIS_INSP_KEY_REGISTER set flag_valid = 0 where ID = #{id}
  302. </update>
  303. <update id="updateBaseInfo" parameterType="cn.com.goldenwater.dcproj.model.AttEmpwtprjBase">
  304. update BIS_INSP_KEY_REGISTER
  305. <trim prefix="set" suffixOverrides=",">
  306. <if test="stwktm != null and stwktm != ''">STWKTM = #{stwktm},</if>
  307. <if test="plantm != null and plantm != ''">PLANTM = #{plantm},</if>
  308. <if test="estapp != null and estapp != ''">ESTAPP = #{estapp},</if>
  309. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  310. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  311. <if test="buidTimeYear != null and buidTimeYear != ''">BUID_TIME_YEAR = #{buidTimeYear},</if>
  312. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  313. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  314. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  315. <if test="engProfil != null and engProfil != ''">eng_Profil = #{engProfil},</if>
  316. <if test="engBuild != null and engBuild != ''">eng_Build = #{engBuild},</if>
  317. </trim>
  318. <where>OBJ_ID in (SELECT OBJ_ID FROM BIS_INSP_ALL_OBJ WHERE CODE=#{id})</where>
  319. </update>
  320. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspKeyRegister">
  321. update BIS_INSP_KEY_REGISTER
  322. <trim prefix="set" suffixOverrides=",">
  323. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  324. <if test="ptype != null and ptype != ''">PTYPE = #{ptype},</if>
  325. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  326. <if test="nm != null and nm != ''">NM = #{nm},</if>
  327. <if test="engProfil != null and engProfil != ''">eng_Profil = #{engProfil},</if>
  328. <if test="engBuild != null and engBuild != ''">eng_Build = #{engBuild},</if>
  329. <if test="stwktm != null and stwktm != ''">STWKTM = #{stwktm},</if>
  330. <if test="plantm != null and plantm != ''">PLANTM = #{plantm},</if>
  331. <if test="estapp != null and estapp != ''">ESTAPP = #{estapp},</if>
  332. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  333. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  334. <if test="lgtdPc != null and lgtdPc != ''">LGTD_PC = #{lgtdPc},</if>
  335. <if test="lttdPc != null and lttdPc != ''">LTTD_PC = #{lttdPc},</if>
  336. <if test="unitId != null and unitId != ''">UNIT_ID = #{unitId},</if>
  337. <if test="unitNm != null and unitNm != ''">UNIT_NM = #{unitNm},</if>
  338. <if test="groupLeaderId != null and groupLeaderId != ''">GROUP_LEADER_ID = #{groupLeaderId},</if>
  339. <if test="groupLeader != null and groupLeader != ''">GROUP_LEADER = #{groupLeader},</if>
  340. <if test="groupLeaderTel != null and groupLeaderTel != ''">GROUP_LEADER_TEL = #{groupLeaderTel},</if>
  341. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  342. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  343. <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
  344. <if test="intm != null">INTM = #{intm},</if>
  345. <if test="uptm != null">UPTM = #{uptm},</if>
  346. <if test="note != null and note != ''">NOTE = #{note},</if>
  347. <if test="dataStat != null">DATA_STAT = #{dataStat},</if>
  348. <if test="state != null">STATE = #{state},</if>
  349. <if test="secStat != null">SEC_STAT = #{secStat},</if>
  350. <if test="oneUnitStat != null">ONE_UNIT_STAT = #{oneUnitStat},</if>
  351. <if test="twoUnitStat != null">TWO_UNIT_STAT = #{twoUnitStat},</if>
  352. <if test="threeUnitStat != null">THREE_UNIT_STAT = #{threeUnitStat},</if>
  353. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  354. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  355. </trim>
  356. <where>ID = #{id}</where>
  357. </update>
  358. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspKeyRegister">
  359. update BIS_INSP_KEY_REGISTER
  360. <trim prefix="set" suffixOverrides=",">
  361. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  362. <if test="ptype != null and ptype != ''">PTYPE = #{ptype},</if>
  363. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  364. <if test="engProfil != null and engProfil != ''">eng_Profil = #{engProfil},</if>
  365. <if test="engBuild != null and engBuild != ''">eng_Build = #{engBuild},</if>
  366. <if test="nm != null and nm != ''">NM = #{nm},</if>
  367. <if test="stwktm != null and stwktm != ''">STWKTM = #{stwktm},</if>
  368. <if test="plantm != null and plantm != ''">PLANTM = #{plantm},</if>
  369. <if test="estapp != null and estapp != ''">ESTAPP = #{estapp},</if>
  370. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  371. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  372. <if test="lgtdPc != null and lgtdPc != ''">LGTD_PC = #{lgtdPc},</if>
  373. <if test="lttdPc != null and lttdPc != ''">LTTD_PC = #{lttdPc},</if>
  374. <if test="unitId != null and unitId != ''">UNIT_ID = #{unitId},</if>
  375. <if test="unitNm != null and unitNm != ''">UNIT_NM = #{unitNm},</if>
  376. <if test="groupLeaderId != null and groupLeaderId != ''">GROUP_LEADER_ID = #{groupLeaderId},</if>
  377. <if test="groupLeader != null and groupLeader != ''">GROUP_LEADER = #{groupLeader},</if>
  378. <if test="groupLeaderTel != null and groupLeaderTel != ''">GROUP_LEADER_TEL = #{groupLeaderTel},</if>
  379. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  380. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  381. <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
  382. <if test="intm != null">INTM = #{intm},</if>
  383. <if test="uptm != null">UPTM = #{uptm},</if>
  384. <if test="note != null and note != ''">NOTE = #{note},</if>
  385. <if test="dataStat != null">DATA_STAT = #{dataStat},</if>
  386. <if test="state != null">STATE = #{state},</if>
  387. <if test="secStat != null">SEC_STAT = #{secStat},</if>
  388. <if test="oneUnitStat != null">ONE_UNIT_STAT = #{oneUnitStat},</if>
  389. <if test="twoUnitStat != null">TWO_UNIT_STAT = #{twoUnitStat},</if>
  390. <if test="threeUnitStat != null">THREE_UNIT_STAT = #{threeUnitStat},</if>
  391. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  392. </trim>
  393. <include refid="page_where"/>
  394. </update>
  395. <!-- 其他自定义SQL -->
  396. <select id="getListByInspGroupIdObjTypeBuild" parameterType="cn.com.goldenwater.dcproj.param.PagePersObjParam"
  397. resultType="cn.com.goldenwater.dcproj.dto.BisInspKeyRegisterDto">
  398. select
  399. t.*,C.id groupId,C.PNM groupName,B.obj_id
  400. FROM ATT_EMPWTPRJ_BASE T
  401. LEFT JOIN BIS_INSP_ALL_OBJ B ON B.CODE = T.ID
  402. LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
  403. AND B.PTYPE = #{objType}
  404. where ENG_STA = '2'
  405. <if test='isAll == "0"'>and B.ID = #{inspGroupId}</if>
  406. <if test='isAll == "1"'>and B.ID LIKE '${inspGroupId}%'</if>
  407. <if test="wtdstNm !=null and wtdstNm !=''">
  408. and T.NM like '%${wtdstNm}%'
  409. </if>
  410. <choose>
  411. <when test="province != null and province != ''">
  412. and B.AD_CODE LIKE '${province}%'
  413. </when>
  414. <otherwise>
  415. and B.AD_CODE is null
  416. </otherwise>
  417. </choose>
  418. </select>
  419. <select id="getListByInspGroupIdObjTypeRun" parameterType="cn.com.goldenwater.dcproj.param.PagePersObjParam"
  420. resultType="cn.com.goldenwater.dcproj.dto.BisInspKeyRegisterDto">
  421. select t.*,C.id groupId,C.PNM groupName,B.obj_id
  422. from ATT_EMPWTPRJ_BASE t
  423. left join BIS_INSP_ALL_OBJ B
  424. on B.CODE = t.ID
  425. LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
  426. and B.ptype = #{objType}
  427. where 1 = 1 and ENG_STA='1'
  428. <if test='isAll == "0"'>and B.ID = #{inspGroupId}</if>
  429. <if test='isAll == "1"'>and B.ID LIKE '${inspGroupId}%'</if>
  430. <choose>
  431. <when test="province != null and province != ''">
  432. and B.AD_CODE LIKE '${province}%'
  433. </when>
  434. <otherwise>
  435. and B.AD_CODE is null
  436. </otherwise>
  437. </choose>
  438. </select>
  439. </mapper>