SELECT
(a.uuid) AS user_uuid,
a.user_name,
a.user_id,
c.online_state,
e.level_name,
e.uuid AS euuid
FROM
sys_user a,
sys_user_role b,
biz_document_user_info c,
biz_document_level_info e
WHERE
a.uuid = b.user_uuid
AND a.sys_status = 1
AND b.sys_status = 1
AND c.sys_status = 1
AND e.sys_status = 1
AND a.uuid = c.user_id
AND c.online_state = 1
AND e.uuid = c.document_level_id
AND a.uuid <> 'u1029'
AND b.role_uuid = 'qhyf1011'
AND a.uuid IN (
SELECT
x.user_id
FROM
(
SELECT
a.user_id,
GROUP_CONCAT(DISTINCT b.task_id) AS task_id
FROM
biz_document_user_task_info a,
biz_document_user_task_detail b
WHERE
a.uuid = b.document_task_id
AND a.start_date <= DATE_FORMAT(NOW(), '%Y-%m-%d')
AND a.end_date >= DATE_FORMAT(NOW(), '%Y-%m-%d')
AND a.sys_status = 1
AND b.sys_status = 1
GROUP BY
a.user_id
) x
WHERE
x.task_id LIKE '%DT1007%'
AND x.task_id LIKE '%DT1013%'