SELECT 
    wb.tablename,         -- 表单表名
    wf.workflowname,      -- 流程名称
    wf.id AS workflowid,  -- 流程ID（取最新版本）
    a.*                   -- 字段信息
FROM workflow_billfield a
JOIN workflow_bill wb 
    ON a.billid = wb.id
left JOIN workflow_base wf
    ON wf.formid = wb.id
WHERE a.fielddbtype = '57504' -- 树形的id
  AND wf.id = (
      SELECT MAX(id)
      FROM workflow_base wf2
      WHERE wf2.workflowname = wf.workflowname
  );