pa.proc_inst_id,pa.assignee,pa.assignee_name,pa.main_title,pa.flow_branch_id,pa.task_name,pa.agree,pa.flow_last_time,pa.comment_msg,pa.proc_def_id,pa.flow_state from xm_project res
select res.*,s.* from xm_project res
left join xm_project_state s on s.project_id=res.id
left join xm_project_process_approva pa on res.id=pa.project_id and res.biz_proc_inst_id=pa.proc_inst_id
<iftest=" linkProductId !=null and linkProductId!=''">
inner join xm_product_project_link ppl on res.id=ppl.project_id and ppl.product_id=#{linkProductId}
</if>
<where>
<includerefid="whereForMap"/>
<includerefid="where"/>
</where>
<iftest=" linkProductId !=null and linkProductId!=''">