|
|
@ -114,6 +114,7 @@ |
|
|
|
group by tbs_budget_log.schedule_item_budget_id |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="getCostCheckingList" resultType="com.qs.serve.modules.tbs.entity.dto.TbsBudgetLogWithAmount"> |
|
|
|
select |
|
|
|
tbs_budget_log.budget_id as id, |
|
|
@ -137,5 +138,72 @@ |
|
|
|
group by tbs_budget_log.schedule_item_budget_id |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getBudgetLogCheckingList" resultType="com.qs.serve.modules.tbs.entity.dto.TbsBudgetCheckingWithAmount"> |
|
|
|
select |
|
|
|
'costApply' as type, |
|
|
|
tbs_cost_apply.id as tar_id, |
|
|
|
tbs_cost_apply.code as tar_code, |
|
|
|
tbs_cost_apply.charge_theme as tar_title, |
|
|
|
sum(tbs_budget_log.amount) as total_amount, |
|
|
|
tbs_cost_apply.supplier_code, |
|
|
|
tbs_cost_apply.supplier_name, |
|
|
|
tbs_cost_apply.user_code, |
|
|
|
tbs_cost_apply.user_name |
|
|
|
from tbs_budget_log |
|
|
|
left join tbs_cost_apply on tbs_budget_log.cost_apply_id = tbs_cost_apply.id |
|
|
|
where |
|
|
|
tbs_budget_log.cost_apply_id is not null |
|
|
|
and tbs_cost_apply.charge_state = 1 |
|
|
|
and tbs_budget_log.del_flag = 0 |
|
|
|
and tbs_cost_apply.del_flag = 0 |
|
|
|
and opt_type in |
|
|
|
<foreach collection="costNumbers" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
|
#{selectId} |
|
|
|
</foreach> |
|
|
|
AND tbs_budget_log.budget_id in |
|
|
|
<foreach collection="selectIds" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
|
#{selectId} |
|
|
|
</foreach> |
|
|
|
AND tbs_budget_log.schedule_item_budget_id in |
|
|
|
<foreach collection="scheduleItemBudgetIds" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
|
#{selectId} |
|
|
|
</foreach> |
|
|
|
group by tbs_budget_log.cost_apply_id |
|
|
|
|
|
|
|
union |
|
|
|
|
|
|
|
select |
|
|
|
'policy' as type, |
|
|
|
tzc_policy.id as tar_id, |
|
|
|
tzc_policy.policy_code as tar_code, |
|
|
|
tzc_policy.title as tar_title, |
|
|
|
sum(tbs_budget_log.amount) as total_amount, |
|
|
|
tzc_policy.supplier_code, |
|
|
|
tzc_policy.supplier_name, |
|
|
|
tzc_policy.user_code, |
|
|
|
tzc_policy.user_name |
|
|
|
from tbs_budget_log |
|
|
|
left join tzc_policy on tbs_budget_log.policy_id = tzc_policy.id |
|
|
|
where |
|
|
|
tbs_budget_log.policy_id is not null |
|
|
|
and tzc_policy.policy_status = 1 |
|
|
|
and tbs_budget_log.del_flag = 0 |
|
|
|
and tzc_policy.del_flag = 0 |
|
|
|
and opt_type in |
|
|
|
<foreach collection="policyNumbers" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
|
#{selectId} |
|
|
|
</foreach> |
|
|
|
AND tbs_budget_log.budget_id in |
|
|
|
<foreach collection="selectIds" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
|
#{selectId} |
|
|
|
</foreach> |
|
|
|
AND tbs_budget_log.schedule_item_budget_id in |
|
|
|
<foreach collection="scheduleItemBudgetIds" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
|
#{selectId} |
|
|
|
</foreach> |
|
|
|
group by tbs_budget_log.policy_id |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |
|
|
|
|
|
|
|