|
@ -71,13 +71,12 @@ |
|
|
SELECT |
|
|
SELECT |
|
|
`tbs_budget_log`.budget_id, |
|
|
`tbs_budget_log`.budget_id, |
|
|
`tbs_budget_log`.schedule_item_id, |
|
|
`tbs_budget_log`.schedule_item_id, |
|
|
`tbs_budget_log`.amount |
|
|
sum (`tbs_budget_log`.amount) amount |
|
|
FROM |
|
|
FROM |
|
|
`tbs_budget_log` |
|
|
`tbs_budget_log` |
|
|
LEFT JOIN |
|
|
LEFT JOIN |
|
|
`tbs_cost_apply` |
|
|
`tbs_cost_apply` |
|
|
ON `tbs_budget_log` .cost_apply_id = tbs_cost_apply.id |
|
|
ON `tbs_budget_log` .cost_apply_id = tbs_cost_apply.id |
|
|
AND `tbs_budget_log`.rollback_flag = '0' |
|
|
|
|
|
WHERE |
|
|
WHERE |
|
|
`tbs_budget_log`.budget_id in |
|
|
`tbs_budget_log`.budget_id in |
|
|
<foreach collection="budgetIds" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
<foreach collection="budgetIds" item ="selectId" index="i" open="(" close=")" separator=","> |
|
@ -88,8 +87,8 @@ |
|
|
#{selectId} |
|
|
#{selectId} |
|
|
</foreach> |
|
|
</foreach> |
|
|
AND `tbs_cost_apply`.id != #{applyId} |
|
|
AND `tbs_cost_apply`.id != #{applyId} |
|
|
AND `tbs_cost_apply`.charge_state in (1,2,3) |
|
|
AND opt_type IN (1,4,5,6,15) |
|
|
AND opt_type IN (1,4,5,6) |
|
|
group by `tbs_budget_log`.budget_id,`tbs_budget_log`.schedule_item_id |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|