SysUserMapper.xml 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~
  4. ~ Copyright (c) 2018-2025, hnqz All rights reserved.
  5. ~
  6. ~ Redistribution and use in source and binary forms, with or without
  7. ~ modification, are permitted provided that the following conditions are met:
  8. ~
  9. ~ Redistributions of source code must retain the above copyright notice,
  10. ~ this list of conditions and the following disclaimer.
  11. ~ Redistributions in binary form must reproduce the above copyright
  12. ~ notice, this list of conditions and the following disclaimer in the
  13. ~ documentation and/or other materials provided with the distribution.
  14. ~ Neither the name of the pig4cloud.com developer nor the names of its
  15. ~ contributors may be used to endorse or promote products derived from
  16. ~ this software without specific prior written permission.
  17. ~ Author: hnqz
  18. ~
  19. -->
  20. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  21. <mapper namespace="com.qunzhixinxi.hnqz.daemon.quartz.mapper.SysUserMapper">
  22. <select id="listUserCertFailure" resultType="java.util.TreeMap">
  23. SELECT sys_user.user_id AS `ID`,
  24. sys_user.realname AS `姓名`,
  25. sys_user.username AS `账号`,
  26. sys_dept.name AS `所属企业`,
  27. (CASE sys_user_sub.gig_type
  28. WHEN 0 THEN '人力家'
  29. WHEN 1 THEN '税邦云'
  30. WHEN 2 THEN '阿拉丁'
  31. WHEN 3 THEN '3 '
  32. END) AS `结算平台`,
  33. (CASE sys_user_sub.subject_location
  34. WHEN 'REN_LI_JIA' THEN '人力家'
  35. WHEN 'LUO_SHU_YUN' THEN '税邦云'
  36. WHEN 'FEI_YI' THEN '阿拉丁'
  37. WHEN 'JIN_YUAN' THEN '金园数科'
  38. WHEN 'XIN_TAI_ZI' THEN '薪泰梓'
  39. END) AS '税源地',
  40. IF(
  41. sys_user_sub.gig_type = 1 AND sys_user_sub.cert_status = 15, ' 认证成功 ',
  42. IF(sys_user_sub.gig_type = 0 AND sys_user_sub.cert_status = 1, ' 认证成功 ',
  43. IF(sys_user_sub.gig_type = 2 AND sys_user_sub.cert_status = 1, ' 认证成功 ',
  44. ' 未完成 '
  45. ))) AS `认证表述`,
  46. sys_user_sub.cert_status AS `认证状态`,
  47. (CASE sys_user_sub.callback_status
  48. WHEN 0 THEN '有结果'
  49. WHEN 1 THEN '进行中'
  50. WHEN 2 THEN '未发起' END) AS `发起状态`,
  51. sys_user_sub.cert_remark AS `上次回信信息`,
  52. IF(CHAR_LENGTH(sys_user_sub.agreement_url) > 0, '有', '无') AS `手签`,
  53. IF(etoken.num = 1, ' 有 ', ' 无 ') AS `E证通认证`,
  54. sys_user_sub.update_time AS `用户认证时间`
  55. FROM sys_user_sub
  56. LEFT JOIN sys_user ON sys_user_sub.user_id = sys_user.user_id
  57. LEFT JOIN sys_dept ON sys_user.dept_id = sys_dept.dept_id
  58. LEFT JOIN (SELECT user_id,
  59. sub_type,
  60. settle_amount,
  61. MAX(notify_time) AS lastest_time
  62. FROM wm_score_package_settle_note
  63. WHERE settle_note_status = 1
  64. GROUP BY user_id, sub_type
  65. ) AS tmp1 ON tmp1.user_id = sys_user_sub.user_id AND tmp1.sub_type = sys_user_sub.gig_type
  66. LEFT JOIN (SELECT user_id, COUNT(1) AS num
  67. FROM sys_user_ext_record
  68. WHERE del_flag = 0
  69. GROUP BY user_id) AS etoken
  70. ON etoken.user_id = sys_user.user_id
  71. WHERE sys_user.del_flag = 0
  72. AND sys_user.lock_flag = 0
  73. AND (
  74. (sys_user_sub.gig_type = 1 AND sys_user_sub.cert_status NOT IN (10, 15))
  75. OR (sys_user_sub.gig_type = 0 AND sys_user_sub.cert_status NOT IN (0, 1))
  76. OR (sys_user_sub.gig_type = 2 AND sys_user_sub.cert_status NOT IN (1))
  77. )
  78. AND sys_dept.dept_id NOT IN (1611890563)
  79. AND sys_user_sub.update_time > '2022-08-01 00:00:00'
  80. ORDER BY sys_user_sub.create_time
  81. DESC
  82. </select>
  83. </mapper>