select b.proj_id, a.proj_no, a.app_no, a.proj_name, f.name as knowledge_name, ifnull(h.unit_name, '省直属') as unit_name, c.id as expert_id, c.person_id, d.cert_id, d.person_name, e.unit_name as expert_unit_name, d.mobile, b.total_score, b.remark, b.audit_state, a.average_score
select b.proj_id, a.proj_no, a.app_no, a.proj_name, i.name as parent_name, f.name as knowledge_name, ifnull(h.unit_name, '省直属') as unit_name, c.id as expert_id, c.person_id, d.cert_id,
d.person_name, e.unit_name as expert_unit_name, d.mobile, case when b.expert_type = 1 then '技术专家' else '财务专家' end as expert_type_name, b.total_score as evaluation_score,
case when b.evaluation_type is null then '' when b.evaluation_type = 1 then 'A类(80分及以上)' when b.evaluation_type = 2 then 'B类(60分及以上)' else 'C类(60分以下)' end as evaluation_type_name,
case when b.support_state is null then '' when b.support_state = 0 then '是' else '否' end as support_state_name, b.remark,
case when b.audit_state is null or b.audit_state = 0 then '未评审' when b.audit_state = 1 then '评审中' else '已评审' end as audit_state_name, a.total_score, a.calculate_score
from com_project_assign b left join com_project a on a.id = b.proj_id
left join com_expert c on b.expert_id = c.id
left join com_person d on c.person_id = d.id
left join com_unit e on d.unit_id = e.id
left join system_parameter f on a.knowledge_id = f.id
left join system_parameter i on f.parent_id = i.id
left join com_unit g on a.app_unit_id = g.id
left join com_unit h on substring(g.tree_code, 1, 10) = h.tree_code and h.unit_type = 0
select a.id as group_id, a.group_name, a.display_order, b.proj_id, c.proj_no, c.proj_name, f.name as knowledge_name, i.name as parent_name, ifnull(h.unit_name, '省直属') as unit_name, d.person_name, e.unit_name as app_unit_name,