Răsfoiți Sursa

门户查看延期计划2

qianxb 2 ani în urmă
părinte
comite
2848ab40c0

+ 17 - 1
blade-service/blade-control/src/main/java/org/springblade/control/mapper/ProjectCostBudgetMapper.xml

@@ -327,7 +327,23 @@
                (select cpp.name from c_project_process cpp WHERE cpp.id = pcb.project_process) as projectProcessValue,
                (select di.dict_name from c_dict_info di where di.type = 2 and di.id = pcb.plan_task_type) as planTaskTypeValue
         from c_project_cost_budget pcb
-        WHERE pcb.cost_type = #{type} and pcb.is_deleted = 0
+        WHERE pcb.cost_type = #{costType} and pcb.is_deleted = 0 and pcb.project_id = #{projectId} and pcb.plan_end_time < NOW() and pcb.status in (2,3)
+        UNION ALL
+        select pcb.*,
+               case pcb.status
+                   when 1 then '未开始'
+                   when 2 then '进行中'
+                   when 3 then '暂停'
+                   when 4 then '已完成'
+                   end  as statusValue,
+               (select cpi.name from c_control_project_info cpi WHERE cpi.id = pcb.project_id) as projectName,
+               (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0) as budgetTypeValue,
+               (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.task_detail and di.parent_id =
+                                                                                                                  (select di.id from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0)) as taskDetailValue,
+               (select cpp.name from c_project_process cpp WHERE cpp.id = pcb.project_process) as projectProcessValue,
+               (select di.dict_name from c_dict_info di where di.type = 2 and di.id = pcb.plan_task_type) as planTaskTypeValue
+        from c_project_cost_budget pcb
+        WHERE pcb.cost_type = #{costType} and pcb.is_deleted = 0 and pcb.project_id = #{projectId} and pcb.plan_end_time < pcb.practical_finish_time and pcb.status = 4
     </select>