p.id as id, p.name as name, p.display_name as displayName, ifnull(date_format(p.create_time, '%Y-%m-%d %H:%i:%S'), '-') as
createTime, p.owner_id as ownerId, p.project_desc as projectDesc, p.is_enable_scheduler as isEnableScheduler, p.is_enable_select as
isEnableSelect, case when t.permission_id is not null then '1' else '0' end as isHaveIntegration,
case when s.permission_id is not null then '1' else '0' end as isHaveDataService,
case when r.role_id ='1' then '1' ELSE '0' end as roleId,
case when p.data_status = '1' then '正常'
when p.data_status = '2' then '禁用' else '删除' end as dataStatus
from dmp_project p join dmp_project_member pm on pm.member_id = #{ownerId} and pm.data_status = '1'
left join (select dp.id as permission_id, pp.project_id as project_id from dmp_project_permission pp, dmp_permission dp where
pp.data_status = '1' and dp.data_status = '1' and pp.permission_id = dp.id and dp.name = '数据集成' and dp.data_status = '1' ) t
on p.id = t.project_id
LEFT JOIN (select dp2.id as permission_id, pp2.project_id as project_id from dmp_project_permission pp2, dmp_permission dp2 where
pp2.data_status = '1' and dp2.data_status = '1' and pp2.permission_id = dp2.id and dp2.name = '数据服务' and dp2.data_status = '1' ) s ON p.id = s.project_id
LEFT JOIN (SELECT role_id,project_id FROM dmp_project_member_role where role_id=1 and member_id = #{ownerId} and data_status='1') r ON r.project_id = p.id
where p.data_status != '0' and p.id = pm.project_id
<iftest="name != null">
and (upper(p.name) like CONCAT('%',upper(#{name}),'%') or upper(p.display_name) like CONCAT('%',upper(#{name}),'%'))