UserMapper.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.diagbot.mapper.UserMapper">
  5. <!-- 通用查询映射结果 -->
  6. <resultMap id="BaseResultMap" type="com.diagbot.entity.User">
  7. <id column="id" property="id"/>
  8. <result column="is_deleted" property="isDeleted"/>
  9. <result column="gmt_create" property="gmtCreate"/>
  10. <result column="gmt_modified" property="gmtModified"/>
  11. <result column="creator" property="creator"/>
  12. <result column="modifier" property="modifier"/>
  13. <result column="password" property="password"/>
  14. <result column="username" property="username"/>
  15. <result column="dept" property="dept"/>
  16. <result column="position" property="position"/>
  17. <result column="linkman" property="linkman"/>
  18. <result column="email" property="email"/>
  19. <result column="type" property="type"/>
  20. </resultMap>
  21. <resultMap id="UserOrgDTO" type="com.diagbot.dto.UserOrgDTO">
  22. <id column="user_id" property="userId"/>
  23. <result column="username" property="username"/>
  24. <result column="linkman" property="linkman"/>
  25. <result column="email" property="email"/>
  26. <result column="org_id" property="orgId"/>
  27. <result column="org_name" property="orgName"/>
  28. <result column="is_reject" property="isReject"/>
  29. <result column="au_status" property="auStatus"/>
  30. <result column="sub_num" property="subNum"/>
  31. </resultMap>
  32. <select id="findByName" resultMap="BaseResultMap" parameterType="java.lang.String">
  33. select * from sys_user
  34. where username = #{username} and is_deleted = 'N'
  35. </select>
  36. <select id="selectUserListPage" resultMap="BaseResultMap">
  37. select u.*
  38. from sys_user u
  39. LEFT JOIN sys_user_role ur on u.id= ur.user_id
  40. LEFT JOIN sys_role r on ur.role_id=r.id
  41. where u.is_deleted = 'N'
  42. <if test="user.id != null">
  43. and u.id = #{user.id}
  44. </if>
  45. </select>
  46. <select id="indexPage" resultMap="BaseResultMap">
  47. select u.* from sys_user u where u.is_deleted = 'N'
  48. <if test="user.id != null">
  49. and u.id = #{user.id}
  50. </if>
  51. <if test="user.username != null and user.username != '' ">
  52. and u.username like concat('%',#{user.username},'%')
  53. </if>
  54. </select>
  55. <select id="getByIds" resultMap="BaseResultMap">
  56. select u.* from sys_user u where u.is_deleted = 'N'
  57. and u.id in
  58. <foreach collection="list" item="ids" open="(" close=")" separator=",">
  59. #{ids}
  60. </foreach>
  61. </select>
  62. <select id="getUserOrgDTOByIds" resultMap="UserOrgDTO">
  63. select u.id user_id ,u.username username, u.email email, u.linkman linkman , org.id org_id,
  64. org.name org_name, ua.is_reject is_reject, ua.status au_status,org.sub_num
  65. from sys_user u, sys_user_organization uo, sys_organization org , sys_user_authentication ua
  66. where u.is_deleted = 'N' and uo.is_deleted = 'N' and org.is_deleted = 'N'
  67. and u.id = uo.user_id and uo.organization_id = org.id and u.id = ua.user_id
  68. and u.id in
  69. <foreach collection="list" item="ids" open="(" close=")" separator=",">
  70. #{ids}
  71. </foreach>
  72. </select>
  73. <select id="getUserByOrgName" resultMap="BaseResultMap">
  74. select a.* from sys_user a, sys_organization org, sys_user_organization uo
  75. where a.is_deleted = 'N' and org.is_deleted = 'N' and uo.is_deleted = 'N'
  76. and a.id = uo.user_id and uo.organization_id = org.id and org.`name` like concat('%' ,#{orgName}, '%')
  77. </select>
  78. <!-- <select id="selectUserInfoListPage" resultMap="BaseResultMap">
  79. select u.*
  80. LEFT JOIN sys_user_role ur on u.id= ur.user_id
  81. LEFT JOIN
  82. sys_role r on ur.role_id=r.id
  83. where u.is_deleted = 'N' and type = "0"
  84. ORDER BY gmt_create DESC
  85. </select> -->
  86. <!-- <select id="selectUserInfoPage" parameterType="com.diagbot.dto.UserInfoDTO" resultType="com.diagbot.dto.UserInfoDTO">
  87. SELECT
  88. u.id AS userId,
  89. u.gmt_create as userGmtCreate,
  90. u.username as userName,
  91. u.linkman as linKman,
  92. u.email as email,
  93. org.id AS orgId,
  94. org.gmt_create as orgGmtCreate,
  95. org.name as orgName
  96. FROM sys_user u
  97. LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
  98. LEFT JOIN sys_organization org ON uorg.organization_id = org.id
  99. WHERE u.is_deleted = 'N' AND u.TYPE = 0 ORDER BY u.gmt_create DESC
  100. </select> -->
  101. <select id="selectUserInfoListPage" resultType="com.diagbot.dto.UserInfoDTO">
  102. SELECT
  103. u.id AS userId,
  104. u.gmt_create AS userGmtCreate,
  105. u.username AS userName,
  106. u.linkman AS linKman,
  107. u.email AS email,
  108. org.id AS orgId,
  109. org.gmt_create AS orgGmtCreate,
  110. org.name AS orgName,
  111. org.type as orgType,
  112. org.principal AS orgPrincipal,
  113. org.address as orgAddress,
  114. org.parent_id as orgParent_id,
  115. org.sub_num as orgSub_num,
  116. aut.position as autPosition,
  117. aut.is_reject as autIsReject,
  118. aut.status as autStatus
  119. FROM sys_user u
  120. LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
  121. LEFT JOIN sys_organization org ON uorg.organization_id = org.id
  122. LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
  123. WHERE u.is_deleted = 'N' AND u.TYPE = 0
  124. <if test="userInfo.orgName != null">
  125. AND org.name LIKE CONCAT('%', #{userInfo.orgName}, '%')
  126. </if>
  127. <if test="userInfo.autStatus != null">
  128. AND aut.status = #{userInfo.autStatus}
  129. </if>
  130. ORDER BY u.gmt_create DESC
  131. </select>
  132. <update id="updateUserInfoAll" parameterType="java.util.Map">
  133. UPDATE sys_user u ,sys_user_organization a ,
  134. sys_organization b ,sys_user_authentication c
  135. SET u.remark = "0"
  136. <if test="userMap.email != null">
  137. <if test="userMap.gmtModified !=null">
  138. ,u.gmt_modified=#{userMap.gmtModified}
  139. </if>
  140. <if test="userMap.modifier != null">
  141. ,u.modifier=#{userMap.modifier}
  142. </if>
  143. ,u.email=#{userMap.email}
  144. </if>
  145. <if test="userMap.principal != null || userMap.address != null || userMap.type != null">
  146. <if test="userMap.gmtModified !=null">
  147. ,b.gmt_modified=#{userMap.gmtModified}
  148. </if>
  149. <if test="userMap.modifier != null">
  150. ,b.modifier=#{userMap.modifier}
  151. </if>
  152. <if test="userMap.principal != null">
  153. ,b.principal=#{userMap.principal}
  154. </if>
  155. <if test="userMap.address != null">
  156. ,b.address=#{userMap.address}
  157. </if>
  158. <if test="userMap.type != null">
  159. ,b.type=#{userMap.type}
  160. </if>
  161. </if>
  162. <!-- <if test="position != null || isReject != null || rejectType !=null || rejectComment !=null || status != null"> -->
  163. <if test="userMap.position != null">
  164. <if test="userMap.gmtModified !=null">
  165. ,c.gmt_modified=#{userMap.gmtModified}
  166. </if>
  167. <if test="userMap.modifier != null">
  168. ,c.modifier=#{userMap.modifier}
  169. </if>
  170. ,c.position=#{userMap.position}
  171. </if>
  172. <!-- <if test="isReject != null">
  173. ,c.is_reject=#{isReject}
  174. </if>
  175. <if test="rejectType !=null">
  176. ,c.reject_type=#{rejectType}
  177. </if>
  178. <if test="rejectComment !=null">
  179. ,c.reject_comment=#{rejectComment}
  180. </if>
  181. <if test="status != null">
  182. ,c.status = #{status}
  183. </if> -->
  184. <!-- </if> -->
  185. WHERE
  186. u.is_deleted = "N"
  187. AND u.id = #{userMap.userId}
  188. AND c.user_id= #{userMap.userId}
  189. AND a.user_id = #{userMap.userId}
  190. AND a.organization_id =b.id
  191. </update>
  192. <update id="updateDeleted" parameterType="java.util.Map">
  193. UPDATE sys_user u ,sys_user_organization a ,
  194. sys_organization b,sys_user_authentication c, sys_user_role r
  195. SET u.is_deleted = "Y",a.is_deleted= "Y",b.is_deleted= "Y",c.is_deleted="Y", r.is_deleted="Y"
  196. <if test="map.gmtModified !=null">
  197. ,u.gmt_modified=#{map.gmtModified}
  198. ,a.gmt_modified=#{map.gmtModified}
  199. ,b.gmt_modified=#{map.gmtModified}
  200. ,c.gmt_modified=#{map.gmtModified}
  201. ,r.gmt_modified=#{map.gmtModified}
  202. </if>
  203. <if test="map.modifier != null">
  204. ,u.modifier=#{map.modifier}
  205. ,a.modifier=#{map.modifier}
  206. ,b.modifier=#{map.modifier}
  207. ,c.modifier=#{map.modifier}
  208. ,r.modifier=#{map.modifier}
  209. </if>
  210. WHERE u.id = #{map.userId}
  211. AND c.user_id= #{map.userId}
  212. AND a.user_id = #{map.userId}
  213. AND a.organization_id =b.id
  214. AND r.user_id= #{map.userId}
  215. </update>
  216. <update id="auditUserInfoAll" parameterType="java.util.Map">
  217. UPDATE sys_user_authentication
  218. <trim prefix="set" suffixOverrides=",">
  219. <if test="auditMap.gmtModified !=null">gmt_modified=#{auditMap.gmtModified},</if>
  220. <if test="auditMap.modifier != null">modifier=#{auditMap.modifier},</if>
  221. <if test="auditMap.isReject != null">is_reject = #{auditMap.isReject} ,</if>
  222. <if test="auditMap.certificationDate != null">certification_date = #{auditMap.certificationDate},</if>
  223. <if test="auditMap.rejectType != null">reject_type =#{auditMap.rejectType},</if>
  224. <if test="auditMap.rejectComment != null">reject_comment= #{auditMap.rejectComment},
  225. </if>
  226. <if test="auditMap.status != null">STATUS= #{auditMap.status}</if>
  227. </trim>
  228. WHERE
  229. user_id = #{auditMap.userId}
  230. AND is_deleted = "N"
  231. </update>
  232. <select id="dependentuserInfoByTime" parameterType="java.util.Map"
  233. resultType="com.diagbot.dto.UserInfoDTO">
  234. SELECT
  235. u.id AS userId,
  236. u.gmt_create AS userGmtCreate,
  237. u.gmt_modified AS userGmtModified,
  238. u.username AS userName,
  239. u.linkman AS linKman,
  240. u.email AS email,
  241. org.id AS orgId,
  242. org.gmt_create AS orgGmtCreate,
  243. org.name AS orgName,
  244. org.type as orgType,
  245. org.principal AS orgPrincipal,
  246. org.address as orgAddress,
  247. org.parent_id as orgParent_id,
  248. org.sub_num as orgSub_num,
  249. aut.position as autPosition,
  250. aut.is_reject as autIsReject,
  251. aut.status as autStatus
  252. FROM sys_user u
  253. LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
  254. LEFT JOIN sys_organization org ON uorg.organization_id = org.id
  255. LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
  256. WHERE
  257. u.is_deleted = 'N'
  258. AND u.TYPE = "0"
  259. <if test="userExport.orgName != null">
  260. AND org.name LIKE CONCAT('%', #{userExport.orgName}, '%')
  261. </if>
  262. <if test="userExport.userName != null">
  263. AND u.username LIKE CONCAT('%', #{userExport.userName}, '%')
  264. </if>
  265. <if test="userExport.autStatus != null">
  266. AND aut.status = #{userExport.autStatus}
  267. </if>
  268. <if test="userExport.startTime != null and userExport.endTime != null">
  269. AND u.gmt_create BETWEEN #{userExport.startTime} and #{userExport.endTime}
  270. </if>
  271. ORDER BY u.gmt_create DESC
  272. </select>
  273. <select id="queryUserInformation" resultType="com.diagbot.dto.UserAllDTO">
  274. SELECT
  275. u.id AS userId,
  276. u.gmt_create AS userGmtCreate,
  277. u.username AS userName,
  278. u.linkman AS linKman,
  279. u.email AS email,
  280. org.id AS orgId,
  281. org.name AS orgName,
  282. aut.status AS autStatus
  283. FROM sys_user u
  284. LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
  285. LEFT JOIN sys_organization org ON uorg.organization_id = org.id
  286. LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
  287. WHERE u.is_deleted = 'N' AND u.TYPE = 0
  288. <if test="userInformation.userName != null">
  289. AND u.username LIKE CONCAT('%', #{userInformation.userName}, '%')
  290. </if>
  291. <if test="userInformation.autStatus != null">
  292. AND aut.status = #{userInformation.autStatus}
  293. </if>
  294. <if test="userInformation.startTime != null and userInformation.endTime != null">
  295. AND u.gmt_create BETWEEN #{userInformation.startTime} and #{userInformation.endTime}
  296. </if>
  297. ORDER BY u.gmt_create DESC
  298. </select>
  299. <!-- <select id="queryMechanismInformation(jiude)" resultType="com.diagbot.dto.OrganizationDTO">
  300. SELECT
  301. u.id AS userId,
  302. u.linkman AS linKman,
  303. org.id AS orgId,
  304. org.gmt_create AS orgGmtCreate,
  305. org.name AS orgName,
  306. org.type AS orgType,
  307. org.principal AS orgPrincipal,
  308. org.address AS orgAddress,
  309. org.parent_id AS orgParent_id,
  310. org.sub_num AS orgSub_num
  311. FROM sys_user u
  312. LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
  313. LEFT JOIN sys_organization org ON uorg.organization_id = org.id
  314. LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
  315. WHERE u.is_deleted = 'N' AND u.TYPE = 0
  316. <if test="mechanism.orgName != null">
  317. AND org.name LIKE CONCAT('%', #{mechanism.orgName}, '%')
  318. </if>
  319. <if test="mechanism.autStatus != null">
  320. AND aut.status = #{mechanism.autStatus}
  321. </if>
  322. <if test="mechanism.startTime != null and mechanism.endTime != null">
  323. AND u.gmt_create BETWEEN #{mechanism.startTime} and #{mechanism.endTime}
  324. </if>
  325. ORDER BY u.gmt_create DESC
  326. </select> -->
  327. <select id="queryMechanismInformation" resultType="com.diagbot.dto.OrganizationDTO">
  328. SELECT
  329. u.id AS userId,
  330. org.id AS orgId,
  331. org.gmt_create AS orgGmtCreate,
  332. org.name AS orgName,
  333. org.principal AS orgPrincipal,
  334. org.type AS orgType,
  335. org.address AS orgAddress,
  336. u.linkman AS linkman,
  337. aut.status AS autStatus,
  338. org.parent_id AS orgParent_id,
  339. org.sub_num AS orgSub_num
  340. FROM
  341. sys_organization org
  342. LEFT JOIN sys_user_organization uorg ON org.id = uorg.organization_id
  343. LEFT JOIN sys_user u ON uorg.user_id = u.id
  344. LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
  345. WHERE org.is_deleted = 'N'
  346. <if test="mechanism.orgName != null">
  347. AND org.name LIKE CONCAT('%', #{mechanism.orgName}, '%')
  348. </if>
  349. <if test="mechanism.autStatus != null">
  350. AND aut.status = #{mechanism.autStatus}
  351. </if>
  352. <if test="mechanism.startTime != null and mechanism.endTime != null">
  353. AND org.gmt_create BETWEEN #{mechanism.startTime} and #{mechanism.endTime}
  354. </if>
  355. ORDER BY org.gmt_create DESC
  356. </select>
  357. <select id="queryVerifiedUserOrganizationProduct" resultType="com.diagbot.dto.UserOrgizationProductDTO">
  358. SELECT
  359. u.id AS userId,
  360. u.gmt_create AS userGmtCreate,
  361. u.username AS userName,
  362. u.linkman AS linKman,
  363. u.email AS email,
  364. org.id AS orgId,
  365. org.gmt_create AS orgGmtCreate,
  366. org.name AS orgName,
  367. org.type AS orgType,
  368. org.principal AS orgPrincipal,
  369. org.address AS orgAddress,
  370. org.parent_id AS orgParent_id,
  371. org.sub_num AS orgSub_num,
  372. aut.certification_date AS certificationDate,
  373. aut.position AS autPosition,
  374. aut.status AS autStatus
  375. FROM sys_user u
  376. LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
  377. LEFT JOIN sys_organization org ON uorg.organization_id = org.id
  378. LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
  379. WHERE u.is_deleted = 'N' AND u.TYPE = 0
  380. <if test="userOrg.orgName != null">
  381. AND org.name LIKE CONCAT('%', #{userOrg.orgName}, '%')
  382. </if>
  383. <if test="userOrg.userName != null">
  384. AND u.username LIKE CONCAT('%', #{userOrg.userName}, '%')
  385. </if>
  386. <if test="userOrg.startTime != null and userOrg.endTime != null">
  387. AND u.gmt_create BETWEEN #{userOrg.startTime} and #{userOrg.endTime}
  388. </if>
  389. AND aut.status = 1
  390. ORDER BY u.gmt_create DESC
  391. </select>
  392. <select id="queryAuthentication" resultType="com.diagbot.dto.AuthenticationDTO">
  393. SELECT
  394. u.id AS userId,
  395. u.gmt_create AS userGmtCreate,
  396. u.username AS userName,
  397. u.linkman AS linKman,
  398. u.email AS email,
  399. org.id AS orgId,
  400. org.gmt_create AS orgGmtCreate,
  401. org.name AS orgName,
  402. org.type AS orgType,
  403. org.principal AS orgPrincipal,
  404. org.address AS orgAddress,
  405. org.parent_id AS orgParent_id,
  406. org.sub_num AS orgSub_num,
  407. aut.position AS autPosition,
  408. aut.status AS autStatus
  409. FROM sys_user u
  410. LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
  411. LEFT JOIN sys_organization org ON uorg.organization_id = org.id
  412. LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
  413. WHERE u.is_deleted = 'N' AND u.TYPE = 0
  414. <if test="authen.orgName != null">
  415. AND org.name LIKE CONCAT('%', #{authen.orgName}, '%')
  416. </if>
  417. <if test="authen.userName != null">
  418. AND u.username LIKE CONCAT('%', #{authen.userName}, '%')
  419. </if>
  420. <if test="authen.startTime != null and authen.endTime != null">
  421. AND u.gmt_create BETWEEN #{authen.startTime} and #{authen.endTime}
  422. </if>
  423. AND aut.status = 2
  424. ORDER BY u.gmt_create DESC
  425. </select>
  426. <update id="updateUserInfo" parameterType="java.util.Map">
  427. UPDATE
  428. sys_user a
  429. JOIN sys_user_authentication b ON a.id = b.user_id
  430. <trim prefix="set" suffixOverrides=",">
  431. <if test="amendUserInfo.linKman != null">
  432. a.linkman = #{amendUserInfo.linKman},
  433. </if>
  434. <if test="amendUserInfo.email != null">
  435. a.email = #{amendUserInfo.email},
  436. </if>
  437. <if test="amendUserInfo.autPosition != null">
  438. b.position = #{amendUserInfo.autPosition},
  439. </if>
  440. <if test="amendUserInfo.gmtModified != null">
  441. a.gmt_modified =#{amendUserInfo.gmtModified},
  442. </if>
  443. <if test="amendUserInfo.gmtModified != null">
  444. b.gmt_modified = #{amendUserInfo.gmtModified},
  445. </if>
  446. <if test="amendUserInfo.modifier != null">
  447. a.modifier = #{amendUserInfo.modifier},
  448. </if>
  449. <if test="amendUserInfo.modifier != null">
  450. b.modifier = #{amendUserInfo.modifier}
  451. </if>
  452. </trim>
  453. WHERE
  454. a.is_deleted = "N"
  455. AND b.is_deleted = "N"
  456. AND a.id = #{amendUserInfo.userId}
  457. </update>
  458. <update id="updateOrganizations" parameterType="java.util.Map">
  459. UPDATE sys_organization a
  460. <trim prefix="set" suffixOverrides=",">
  461. <if test="amendOrg.address != null">
  462. a.address = #{amendOrg.address},
  463. </if>
  464. <if test="amendOrg.type != null">
  465. a.type = #{amendOrg.type},
  466. </if>
  467. <if test="amendOrg.subMum != null">
  468. a.sub_num = #{amendOrg.subMum},
  469. </if>
  470. <if test="amendOrg.gmtModified != null">
  471. a.gmt_modified =#{amendOrg.gmtModified},
  472. </if>
  473. <if test="amendOrg.modifier != null">
  474. a.modifier =#{amendOrg.modifier}
  475. </if>
  476. </trim>
  477. WHERE
  478. a.is_deleted = "N"
  479. AND a.id = #{amendOrg.orgId}
  480. </update>
  481. <select id="exportOrganizations" parameterType="java.util.Map"
  482. resultType="com.diagbot.dto.UserInfoDTO">
  483. SELECT
  484. u.id AS userId,
  485. u.gmt_create AS userGmtCreate,
  486. u.gmt_modified AS userGmtModified,
  487. u.username AS userName,
  488. u.linkman AS linKman,
  489. u.email AS email,
  490. org.id AS orgId,
  491. org.gmt_create AS orgGmtCreate,
  492. org.name AS orgName,
  493. org.type AS orgType,
  494. org.principal AS orgPrincipal,
  495. org.address AS orgAddress,
  496. org.parent_id AS orgParent_id,
  497. org.sub_num AS orgSub_num,
  498. aut.position AS autPosition,
  499. aut.is_reject AS autIsReject,
  500. aut.status AS autStatus
  501. FROM
  502. sys_organization org
  503. LEFT JOIN sys_user_organization uorg ON org.id = uorg.organization_id
  504. LEFT JOIN sys_user u ON uorg.user_id = u.id
  505. LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
  506. WHERE org.is_deleted = 'N'
  507. <if test="exportOrg.orgName != null">
  508. AND org.name LIKE CONCAT('%', #{exportOrg.orgName}, '%')
  509. </if>
  510. <if test="exportOrg.startTime != null and exportOrg.endTime != null">
  511. AND org.gmt_create BETWEEN #{exportOrg.startTime} and #{exportOrg.endTime}
  512. </if>
  513. ORDER BY org.gmt_create DESC
  514. </select>
  515. </mapper>