解决员工查询报错

This commit is contained in:
1378012178@qq.com 2026-05-08 09:45:28 +08:00
parent 000cedfaf3
commit 1dec0a793f
1 changed files with 86 additions and 78 deletions

View File

@ -8,84 +8,92 @@
</select>
<select id="listPage" resultType="com.nu.modules.employeesapply.entity.EmployeesApply">
SELECT sup.* FROM (
SELECT
IFNULL(b.id, a.id) AS id,
a.id as employee_id,
a.name,
a.sex,
a.date_of_birth,
a.tel,
a.national,
a.id_card,
a.married_or_not,
CONCAT(a.height, '') as height,
CONCAT(a.weight, '') as weight,
a.health_status,
a.political_appearance,
a.house_address,
a.emergency_contact,
a.emergency_tel,
a.emergency_relationship,
a.hukou_nature,
a.current_address,
a.id_card_positive,
a.id_card_negative,
a.health_certificate_positive,
a.bank_positive,
a.qualification,
a.no_crime_certificate,
a.head_path,
a.create_time,
b.status,
b.modify_status,
b.apply_type,
b.audit_content,
b.iz_history,
b.open_id
FROM nu_biz_employees_info a
LEFT JOIN nu_biz_employees_apply b ON a.id = b.employee_id AND b.iz_history = 'N'
WHERE a.del_flag = '0' AND a.iz_freeze = 'N'
UNION ALL
SELECT
b.id AS id,
b.employee_id,
b.name,
b.sex,
b.date_of_birth,
b.tel,
b.national,
b.id_card,
b.married_or_not,
CONCAT(b.height, '') as height,
CONCAT(b.weight, '') as weight,
b.health_status,
b.political_appearance,
b.house_address,
b.emergency_contact,
b.emergency_tel,
b.emergency_relationship,
b.hukou_nature,
b.current_address,
b.id_card_positive,
b.id_card_negative,
b.health_certificate_positive,
b.bank_positive,
b.qualification,
b.no_crime_certificate,
b.create_time,
b.status,
b.modify_status,
b.apply_type,
b.audit_content,
b.iz_history,
b.open_id,
b.head_path
FROM nu_biz_employees_apply b
WHERE b.employee_id NOT IN (SELECT id FROM nu_biz_employees_info)
AND b.apply_type = '1'
AND b.iz_history = 'N'
) sup
SELECT
sup.*
FROM
(
SELECT
IFNULL( b.id, a.id ) AS id,
a.id AS employee_id,
a.NAME,
a.sex,
a.date_of_birth,
a.tel,
a.national,
a.id_card,
a.married_or_not,
CONCAT( a.height, '' ) AS height,
CONCAT( a.weight, '' ) AS weight,
a.health_status,
a.political_appearance,
a.house_address,
a.emergency_contact,
a.emergency_tel,
a.emergency_relationship,
a.hukou_nature,
a.current_address,
a.id_card_positive,
a.id_card_negative,
a.health_certificate_positive,
a.bank_positive,
a.qualification,
a.no_crime_certificate,
a.head_path,
a.create_time,
b.STATUS,
b.modify_status,
b.apply_type,
b.audit_content,
b.iz_history,
b.open_id
FROM
nu_biz_employees_info a
LEFT JOIN nu_biz_employees_apply b ON a.id = b.employee_id
AND b.iz_history = 'N'
WHERE
a.del_flag = '0'
AND a.iz_freeze = 'N' UNION ALL
SELECT
b.id AS id,
b.employee_id,
b.NAME,
b.sex,
b.date_of_birth,
b.tel,
b.national,
b.id_card,
b.married_or_not,
CONCAT( b.height, '' ) AS height,
CONCAT( b.weight, '' ) AS weight,
b.health_status,
b.political_appearance,
b.house_address,
b.emergency_contact,
b.emergency_tel,
b.emergency_relationship,
b.hukou_nature,
b.current_address,
b.id_card_positive,
b.id_card_negative,
b.health_certificate_positive,
b.bank_positive,
b.qualification,
b.no_crime_certificate,
b.head_path,
b.create_time,
b.STATUS,
b.modify_status,
b.apply_type,
b.audit_content,
b.iz_history,
b.open_id
FROM
nu_biz_employees_apply b
WHERE
b.employee_id NOT IN ( SELECT id FROM nu_biz_employees_info )
AND b.apply_type = '1'
AND b.iz_history = 'N'
) sup
${ew.customSqlSegment}
</select>