AttPersBaseDao.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  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.AttPersBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttPersBase" id="attPersBaseResultMap">
  5. <result property="toDate" column="TO_DATE"/>
  6. <result property="note" column="NOTE"/>
  7. <result property="admDuty" column="ADM_DUTY"/>
  8. <result property="nodeCode" column="NODE_CODE"/>
  9. <result property="guid" column="GUID"/>
  10. <result property="persName" column="PERS_NAME"/>
  11. <result property="persCode" column="PERS_CODE"/>
  12. <result property="orgGuid" column="ORG_GUID"/>
  13. <result property="persType" column="PERS_TYPE"/>
  14. <result property="sex" column="SEX"/>
  15. <result property="telnumb" column="TELNUMB"/>
  16. <result property="faxnumb" column="FAXNUMB"/>
  17. <result property="mobilenumb" column="MOBILENUMB"/>
  18. <result property="email" column="EMAIL"/>
  19. <result property="bornPlac" column="BORN_PLAC"/>
  20. <result property="bornDate" column="BORN_DATE"/>
  21. <result property="nation" column="NATION"/>
  22. <result property="title" column="TITLE"/>
  23. <result property="school" column="SCHOOL"/>
  24. <result property="majob" column="MAJOB"/>
  25. <result property="highDegr" column="HIGH_DEGR"/>
  26. <result property="wdatetime" column="WDATETIME"/>
  27. <result property="status" column="STATUS"/>
  28. <result property="modifier" column="MODIFIER"/>
  29. <result property="fromDate" column="FROM_DATE"/>
  30. </resultMap>
  31. <sql id="table_columns">
  32. TO_DATE,
  33. NOTE,
  34. ADM_DUTY,
  35. NODE_CODE,
  36. GUID,
  37. PERS_NAME,
  38. PERS_CODE,
  39. ORG_GUID,
  40. PERS_TYPE,
  41. SEX,
  42. TELNUMB,
  43. FAXNUMB,
  44. MOBILENUMB,
  45. EMAIL,
  46. BORN_PLAC,
  47. BORN_DATE,
  48. NATION,
  49. TITLE,
  50. SCHOOL,
  51. MAJOB,
  52. HIGH_DEGR,
  53. WDATETIME,
  54. STATUS,
  55. MODIFIER,
  56. FROM_DATE
  57. </sql>
  58. <sql id="entity_properties">
  59. #{toDate},
  60. #{note},
  61. #{admDuty},
  62. #{nodeCode},
  63. #{guid},
  64. #{persName},
  65. #{persCode},
  66. #{orgGuid},
  67. #{persType},
  68. #{sex},
  69. #{telnumb},
  70. #{faxnumb},
  71. #{mobilenumb},
  72. #{email},
  73. #{bornPlac},
  74. #{bornDate},
  75. #{nation},
  76. #{title},
  77. #{school},
  78. #{majob},
  79. #{highDegr},
  80. #{wdatetime},
  81. #{status},
  82. #{modifier},
  83. #{fromDate}
  84. </sql>
  85. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  86. <sql id="page_where">
  87. <trim prefix="where" prefixOverrides="and | or ">
  88. <if test="note != null and note != ''">and NOTE = #{note}</if>
  89. <if test="admDuty != null and admDuty != ''">and ADM_DUTY = #{admDuty}</if>
  90. <if test="nodeCode != null and nodeCode != ''">and NODE_CODE = #{nodeCode}</if>
  91. <if test="guid != null and guid != ''">and ORG_GUID = #{guid}</if>
  92. <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
  93. <if test="persCode != null and persCode != ''">and PERS_CODE = #{persCode}</if>
  94. <if test="orgGuid != null and orgGuid != ''">and ORG_GUID = #{orgGuid}</if>
  95. <if test="persType != null and persType != ''">and PERS_TYPE = #{persType}</if>
  96. <if test="sex != null and sex != ''">and SEX = #{sex}</if>
  97. <if test="telnumb != null and telnumb != ''">and TELNUMB = #{telnumb}</if>
  98. <if test="faxnumb != null and faxnumb != ''">and FAXNUMB = #{faxnumb}</if>
  99. <if test="mobilenumb != null and mobilenumb != ''">and MOBILENUMB = #{mobilenumb}</if>
  100. <if test="email != null and email != ''">and EMAIL = #{email}</if>
  101. <if test="bornPlac != null and bornPlac != ''">and BORN_PLAC = #{bornPlac}</if>
  102. <if test="bornDate != null">and BORN_DATE = #{bornDate}</if>
  103. <if test="nation != null and nation != ''">and NATION = #{nation}</if>
  104. <if test="title != null and title != ''">and TITLE = #{title}</if>
  105. <if test="school != null and school != ''">and SCHOOL = #{school}</if>
  106. <if test="majob != null and majob != ''">and MAJOB = #{majob}</if>
  107. <if test="highDegr != null and highDegr != ''">and HIGH_DEGR = #{highDegr}</if>
  108. <if test="wdatetime != null">and WDATETIME = #{wdatetime}</if>
  109. <if test="status != null and status != ''">and STATUS = #{status}</if>
  110. <if test="modifier != null and modifier != ''">and MODIFIER = #{modifier}</if>
  111. <if test="fromDate != null">and FROM_DATE = #{fromDate}</if>
  112. </trim>
  113. </sql>
  114. <select id="get" resultMap="attPersBaseResultMap" parameterType="String">
  115. select
  116. <include refid="table_columns"/>
  117. from att_pers_base where GUID = #{id}
  118. </select>
  119. <select id="getPers" resultMap="attPersBaseResultMap" parameterType="String">
  120. select
  121. t1.TO_DATE,
  122. t1.NOTE,
  123. t1.ADM_DUTY,
  124. t1.NODE_CODE,
  125. t1.GUID,
  126. t1.PERS_NAME,
  127. t1.PERS_CODE,
  128. t2.ORG_NAME ORG_GUID,
  129. t1.PERS_TYPE,
  130. t1.SEX,
  131. t1.TELNUMB,
  132. t1.FAXNUMB,
  133. t1.MOBILENUMB,
  134. t1.EMAIL,
  135. t1.BORN_PLAC,
  136. t1.BORN_DATE,
  137. t1.NATION,
  138. t1.TITLE,
  139. t1.SCHOOL,
  140. t1.MAJOB,
  141. t1.HIGH_DEGR,
  142. t1.WDATETIME,
  143. t1.STATUS,
  144. t1.MODIFIER,
  145. t1.FROM_DATE
  146. from att_pers_base t1
  147. left join ATT_ORG_BASE t2 on t1.ORG_GUID=t2.GUID
  148. where t1.GUID = #{persId}
  149. </select>
  150. <select id="getBy" resultMap="attPersBaseResultMap">
  151. select
  152. <include refid="table_columns"/>
  153. from att_pers_base
  154. <include refid="page_where"/>
  155. </select>
  156. <select id="findAll" resultMap="attPersBaseResultMap">
  157. select
  158. <include refid="table_columns"/>
  159. from att_pers_base
  160. </select>
  161. <select id="findList" resultMap="attPersBaseResultMap">
  162. select * from BIS_INSP_ALL_RLATION_PERS WHERE ORG_ID = #{orgGuid}
  163. <if test="persName != null and persName != ''">and replace(PERS_NAME,' ','') LIKE '%${persName}%'</if>
  164. </select>
  165. <select id="selectCount" resultType="int">
  166. select count(GUID) from att_pers_base
  167. <include refid="page_where"/>
  168. </select>
  169. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttPersBase">
  170. insert into att_pers_base(
  171. <include refid="table_columns"/>
  172. )
  173. values (
  174. <include refid="entity_properties"/>
  175. )
  176. </insert>
  177. <delete id="delete" parameterType="java.lang.String">
  178. delete from att_pers_base where GUID = #{id}
  179. </delete>
  180. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttPersBase">
  181. delete from att_pers_base
  182. <include refid="page_where"/>
  183. </delete>
  184. <update id="deleteInFlag" parameterType="java.lang.String">
  185. update att_pers_base set flag_valid = 0 where GUID = #{id}
  186. </update>
  187. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttPersBase">
  188. update att_pers_base
  189. <trim prefix="set" suffixOverrides=",">
  190. <if test="note != null and note != ''">NOTE = #{note},</if>
  191. <if test="admDuty != null and admDuty != ''">ADM_DUTY = #{admDuty},</if>
  192. <if test="nodeCode != null and nodeCode != ''">NODE_CODE = #{nodeCode},</if>
  193. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  194. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  195. <if test="persCode != null and persCode != ''">PERS_CODE = #{persCode},</if>
  196. <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
  197. <if test="persType != null and persType != ''">PERS_TYPE = #{persType},</if>
  198. <if test="sex != null and sex != ''">SEX = #{sex},</if>
  199. <if test="telnumb != null and telnumb != ''">TELNUMB = #{telnumb},</if>
  200. <if test="faxnumb != null and faxnumb != ''">FAXNUMB = #{faxnumb},</if>
  201. <if test="mobilenumb != null and mobilenumb != ''">MOBILENUMB = #{mobilenumb},</if>
  202. <if test="email != null and email != ''">EMAIL = #{email},</if>
  203. <if test="bornPlac != null and bornPlac != ''">BORN_PLAC = #{bornPlac},</if>
  204. <if test="bornDate != null">BORN_DATE = #{bornDate},</if>
  205. <if test="nation != null and nation != ''">NATION = #{nation},</if>
  206. <if test="title != null and title != ''">TITLE = #{title},</if>
  207. <if test="school != null and school != ''">SCHOOL = #{school},</if>
  208. <if test="majob != null and majob != ''">MAJOB = #{majob},</if>
  209. <if test="highDegr != null and highDegr != ''">HIGH_DEGR = #{highDegr},</if>
  210. <if test="wdatetime != null">WDATETIME = #{wdatetime},</if>
  211. <if test="status != null and status != ''">STATUS = #{status},</if>
  212. <if test="modifier != null and modifier != ''">MODIFIER = #{modifier},</if>
  213. <if test="fromDate != null">FROM_DATE = #{fromDate},</if>
  214. </trim>
  215. <where>GUID = #{id}</where>
  216. </update>
  217. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttPersBase">
  218. update att_pers_base
  219. <trim prefix="set" suffixOverrides=",">
  220. <if test="note != null and note != ''">NOTE = #{note},</if>
  221. <if test="admDuty != null and admDuty != ''">ADM_DUTY = #{admDuty},</if>
  222. <if test="nodeCode != null and nodeCode != ''">NODE_CODE = #{nodeCode},</if>
  223. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  224. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  225. <if test="persCode != null and persCode != ''">PERS_CODE = #{persCode},</if>
  226. <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
  227. <if test="persType != null and persType != ''">PERS_TYPE = #{persType},</if>
  228. <if test="sex != null and sex != ''">SEX = #{sex},</if>
  229. <if test="telnumb != null and telnumb != ''">TELNUMB = #{telnumb},</if>
  230. <if test="faxnumb != null and faxnumb != ''">FAXNUMB = #{faxnumb},</if>
  231. <if test="mobilenumb != null and mobilenumb != ''">MOBILENUMB = #{mobilenumb},</if>
  232. <if test="email != null and email != ''">EMAIL = #{email},</if>
  233. <if test="bornPlac != null and bornPlac != ''">BORN_PLAC = #{bornPlac},</if>
  234. <if test="bornDate != null">BORN_DATE = #{bornDate},</if>
  235. <if test="nation != null and nation != ''">NATION = #{nation},</if>
  236. <if test="title != null and title != ''">TITLE = #{title},</if>
  237. <if test="school != null and school != ''">SCHOOL = #{school},</if>
  238. <if test="majob != null and majob != ''">MAJOB = #{majob},</if>
  239. <if test="highDegr != null and highDegr != ''">HIGH_DEGR = #{highDegr},</if>
  240. <if test="wdatetime != null">WDATETIME = #{wdatetime},</if>
  241. <if test="status != null and status != ''">STATUS = #{status},</if>
  242. <if test="modifier != null and modifier != ''">MODIFIER = #{modifier},</if>
  243. <if test="fromDate != null">FROM_DATE = #{fromDate},</if>
  244. </trim>
  245. <include refid="page_where"/>
  246. </update>
  247. <!-- 提取督察组下人员列表 -->
  248. <select id="findPerInGroup" resultType="cn.com.goldenwater.dcproj.dto.AttPersGroupDto" parameterType="string">
  249. select
  250. A.INSP_GROUP_ID,
  251. D.INSP_GROUP_NAME,
  252. DATE_FORMAT(C.TO_DATE,'%Y-%m-%d %H:%i:%s') TO_DATE,
  253. C.NOTE,
  254. C.ADM_DUTY,
  255. C.NODE_CODE,
  256. C.GUID,
  257. C.PERS_NAME,
  258. C.PERS_CODE,
  259. C.ORG_GUID,
  260. C.PERS_TYPE,
  261. C.SEX,
  262. C.TELNUMB,
  263. C.FAXNUMB,
  264. C.MOBILENUMB,
  265. C.EMAIL,
  266. C.BORN_PLAC,
  267. DATE_FORMAT(C.BORN_DATE,'%Y-%m-%d') BORN_DATE,
  268. C.NATION,
  269. C.TITLE,
  270. C.SCHOOL,
  271. C.MAJOB,
  272. C.HIGH_DEGR,
  273. DATE_FORMAT(C.WDATETIME,'%Y-%m-%d %H:%i:%s') WDATETIME,
  274. C.STATUS,
  275. C.MODIFIER,
  276. DATE_FORMAT(C.FROM_DATE,'%Y-%m-%d %H:%i:%s') FROM_DATE
  277. from REL_PERS_INSPGROUP A LEFT JOIN REL_PERS_INSPGROUP B ON A.INSP_GROUP_ID=B.INSP_GROUP_ID
  278. LEFT JOIN BIS_INSP_GROUP D ON A.INSP_GROUP_ID=D.INSP_GROUP_ID
  279. LEFT JOIN ATT_PERS_BASE C ON A.PERS_ID=C.GUID
  280. WHERE B.PERS_ID=#{id}
  281. </select>
  282. <select id="findPerDetailInGroup" resultType="cn.com.goldenwater.dcproj.dto.AttPersGroupDto" parameterType="string">
  283. select
  284. A.INSP_GROUP_ID,
  285. A.INSP_GROUP_NAME,
  286. DATE_FORMAT(C.TO_DATE,'%Y-%m-%d %H:%i:%s') TO_DATE,
  287. C.NOTE,
  288. C.ADM_DUTY,
  289. C.NODE_CODE,
  290. C.GUID,
  291. C.PERS_NAME,
  292. C.PERS_CODE,
  293. C.ORG_GUID,
  294. C.PERS_TYPE,
  295. C.SEX,
  296. C.TELNUMB,
  297. C.FAXNUMB,
  298. C.MOBILENUMB,
  299. C.EMAIL,
  300. C.BORN_PLAC,
  301. DATE_FORMAT(C.BORN_DATE,'%Y-%m-%d') BORN_DATE,
  302. C.NATION,
  303. C.TITLE,
  304. C.SCHOOL,
  305. C.MAJOB,
  306. C.HIGH_DEGR,
  307. DATE_FORMAT(C.WDATETIME,'%Y-%m-%d %H:%i:%s') WDATETIME,
  308. C.STATUS,
  309. C.MODIFIER,
  310. DATE_FORMAT(C.FROM_DATE,'%Y-%m-%d %H:%i:%s') FROM_DATE
  311. FROM
  312. ATT_PERS_BASE C
  313. LEFT JOIN REL_PERS_INSPGROUP B ON C.GUID=B.PERS_ID
  314. LEFT JOIN BIS_INSP_GROUP A ON B.INSP_GROUP_ID=A.INSP_GROUP_ID
  315. WHERE C.GUID=#{id}
  316. </select>
  317. <!--根据组id查询人员表 参数示例 jwW2Wihf5E9X3UC9t45fmSHyffUs2rzI-->
  318. <select id="getListByInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttPersBase">
  319. SELECT A.GUID,
  320. A.PERS_NAME,
  321. A.PWD,
  322. A.SEX,
  323. A.TELNUMB,
  324. A.FAXNUMB,
  325. A.MOBILENUMB,
  326. A.EMAIL,
  327. A.BORN_DATE,
  328. A.ORG_ID,
  329. A.ORG_NM org_name,
  330. A.ADM_DUTY,
  331. A.COLL_TIME,
  332. A.REMARK,
  333. A.DPNM,
  334. A.DPPOST,
  335. A.IDNM,
  336. A.PLST,
  337. A.SCHOOL,
  338. A.SPECIALTY,
  339. A.IMGURL,
  340. A.AGE,
  341. A.W_UNIT,
  342. A.IS_WORK,
  343. A.ID_NUMBER,
  344. A.BANK,
  345. A.BANK_NUM,
  346. A.MOHURD,B.PERTYPE,C.PNM,C.ID FROM BIS_INSP_ALL_RLATION_PERS A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.GUID = B.PERSID
  347. LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
  348. WHERE B.ID LIKE '${inspGroupId}%' ORDER BY B.ID
  349. </select>
  350. <select id="getByInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttPersBase">
  351. SELECT A.GUID,
  352. A.PERS_NAME,
  353. A.PWD,
  354. A.SEX,
  355. A.TELNUMB,
  356. A.FAXNUMB,
  357. A.MOBILENUMB,
  358. A.EMAIL,
  359. A.BORN_DATE,
  360. A.ORG_ID,
  361. A.ORG_NM org_name,
  362. A.ADM_DUTY,
  363. A.COLL_TIME,
  364. A.REMARK,
  365. A.DPNM,
  366. A.DPPOST,
  367. A.IDNM,
  368. A.PLST,
  369. A.SCHOOL,
  370. A.SPECIALTY,
  371. A.IMGURL,
  372. A.AGE,
  373. A.W_UNIT,
  374. A.IS_WORK,
  375. A.ID_NUMBER,
  376. A.BANK,
  377. A.BANK_NUM,
  378. A.MOHURD,A.CALLNUMBER,B.PERTYPE,C.PNM,C.ID FROM BIS_INSP_ALL_RLATION_PERS A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.GUID =
  379. B.PERSID
  380. LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
  381. WHERE 1 = 1
  382. <if test="persName != null and persName != ''">and A.PERS_NAME LIKE '%${persName}%'</if>
  383. <include refid="choseSql"/>
  384. <if test='isAll == "0"'>and B.ID = #{inspGroupId}</if>
  385. <if test='isAll == "1"'>and B.ID LIKE '${inspGroupId}%'</if>
  386. ORDER BY B.ID,A.GUID
  387. </select>
  388. <select id="getExpertListByInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttPersBase">
  389. SELECT A.GUID,
  390. A.PERS_NAME,
  391. A.PWD,
  392. A.SEX,
  393. A.TELNUMB,
  394. A.FAXNUMB,
  395. A.MOBILENUMB,
  396. A.EMAIL,
  397. A.BORN_DATE,
  398. A.ORG_ID,
  399. A.ORG_NM org_name,
  400. A.ADM_DUTY,
  401. A.COLL_TIME,
  402. A.REMARK,
  403. A.DPNM,
  404. A.DPPOST,
  405. A.IDNM,
  406. A.PLST,
  407. A.SCHOOL,
  408. A.SPECIALTY,
  409. A.IMGURL,
  410. A.AGE,
  411. A.W_UNIT,
  412. A.IS_WORK,
  413. A.ID_NUMBER,
  414. A.BANK,
  415. A.BANK_NUM,
  416. A.MOHURD,B.PERTYPE,C.PNM,C.ID FROM BIS_INSP_ALL_RLATION_PERS A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.GUID =
  417. B.PERSID
  418. LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
  419. WHERE 1 = 1
  420. <include refid="choseSql"/>
  421. and B.ID LIKE concat(#{inspGroupId},'%')
  422. and B.PERTYPE = '4'
  423. ORDER BY B.ID,A.GUID
  424. </select>
  425. <sql id="choseSql">
  426. <choose>
  427. <when test="province !=null and province !=''">
  428. and B.ad_code=#{province}
  429. </when>
  430. <otherwise>
  431. and B.ad_code is null
  432. </otherwise>
  433. </choose>
  434. </sql>
  435. <!--根据机构id,组id,name查询列表-->
  436. <select id="getListByGuidInspGroupIdName" resultType="cn.com.goldenwater.dcproj.model.AttPersBase">
  437. select GUID
  438. PERS_NAME,
  439. PWD,
  440. SEX,
  441. TELNUMB,
  442. FAXNUMB,
  443. MOBILENUMB,
  444. EMAIL,
  445. BORN_DATE,
  446. ORG_ID,
  447. ORG_NM org_name,
  448. ADM_DUTY,
  449. COLL_TIME,
  450. REMARK,
  451. DPNM,
  452. DPPOST,
  453. IDNM,
  454. PLST,
  455. SCHOOL,
  456. SPECIALTY,
  457. IMGURL from BIS_INSP_ALL_RLATION_PERS where guid in (select persid from BIS_INSP_ALL_RLATION where id like concat(#{inspGroupId},'%'))
  458. </select>
  459. <!--根据组id,机构id查询不在这个范围内的人员列表-->
  460. <select id="getListByGuidNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttPersBase">
  461. select guid,
  462. pers_name,
  463. pwd,
  464. sex,
  465. telnumb,
  466. faxnumb,
  467. mobilenumb,
  468. email,
  469. born_date,
  470. g.org_id,
  471. org_nm org_name,
  472. adm_duty,
  473. coll_time,
  474. remark,
  475. dpnm,
  476. dppost,
  477. idnm,
  478. plst,
  479. school,
  480. specialty,
  481. imgurl,
  482. age,
  483. w_unit,
  484. is_work,
  485. id_number,
  486. bank,
  487. bank_num,
  488. mohurd
  489. from
  490. BIS_INSP_ALL_RLATION_PERS s,
  491. (
  492. select *
  493. from bis_insp_pers_org g
  494. <where>
  495. <if test="orgId != null and orgId != ''">
  496. AND org_id like '${orgId}%'
  497. </if>
  498. </where>
  499. ) g
  500. where s.guid=g.pers_id
  501. <if test="orgName != null and orgName != ''">
  502. AND dpnm like CONCAT('%', CONCAT(#{orgName}, '%'))
  503. </if>
  504. and
  505. guid not in (select persid from BIS_INSP_ALL_RLATION where id=#{inspGroupId} and persid is not null)
  506. <if test="province != null and province != ''">
  507. AND S.PROVINCE like CONCAT(#{province}, '%')
  508. </if>
  509. <if test="name != null and name != ''">and PERS_NAME LIKE '%${name}%'</if>
  510. <if test="numb != null and numb != ''">and (IDNM LIKE '%${numb}%' OR MOBILENUMB LIKE '%${numb}%')</if>
  511. </select>
  512. </mapper>