|
@@ -7,16 +7,22 @@
|
|
|
|
|
|
<delete id="removeOldBudget">
|
|
|
delete from c_project_cost_budget
|
|
|
- where project_id = #{projectId} and approve = 0 and parent_id is null
|
|
|
+ where project_id = #{projectId} and approve = 0 and parent_id = 0
|
|
|
</delete>
|
|
|
<delete id="removeChildrenPlan">
|
|
|
delete from c_project_cost_budget
|
|
|
- where project_id = #{projectId} and parent_id is not null
|
|
|
+ where project_id = #{projectId} and parent_id > 0
|
|
|
</delete>
|
|
|
|
|
|
<select id="budgetList" resultType="org.springblade.control.vo.ProjectCostBudgetVO">
|
|
|
select
|
|
|
- pcb.*
|
|
|
+ pcb.*,
|
|
|
+ (select di.dict_name from c_dict_info di where di.code = 'cost_type' and di.dict_value = pcb.cost_type) as costTypeValue,
|
|
|
+ (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 = 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 di.dict_name from c_dict_info di where di.type = 3 and di.code = pcb.post_type) as postTypeValue
|
|
|
from c_project_cost_budget pcb
|
|
|
where pcb.project_id = #{budget.projectId}
|
|
|
<if test="budget.costType != null and budget.costType != ''">
|
|
@@ -108,6 +114,10 @@
|
|
|
where pcb.task_user = #{user} and pcb.is_deleted = 0
|
|
|
and DATE_FORMAT(pcb.plan_start_time,'%Y') = #{year} or DATE_FORMAT(pcb.plan_end_time,'%Y') = #{year}
|
|
|
</select>
|
|
|
+ <select id="getPostMoney" resultType="java.lang.Integer">
|
|
|
+ select dict_value
|
|
|
+ from c_dict_info where `type` = 3 and code = #{type}
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
</mapper>
|