select case when `type`= 1 then '商机' when `type`= 0 then '项目' end AS type,dept_id, project_name,MIN(work_day) AS firstTime,MAX(work_day) AS lastTime,SUM(work_time)/8 AS totalTime,(SUM(work_time))/8*10 AS cost
select case when `type`= 1 then '商机' when `type`= 0 then '项目' end AS type,dept_id, project_id,MIN(work_day) AS firstTime,MAX(work_day) AS lastTime,SUM(work_time)/8 AS totalTime,(SUM(work_time))/8*10 AS cost