| | |
| | | |
| | | |
| | | </insert> |
| | | <update id="updateQuantity"> |
| | | update sd.order_process_detail as a |
| | | inner join |
| | | (select |
| | | rwd.completed_quantity, |
| | | rwd.breakage_quantity, |
| | | rw.process_id, |
| | | rwd.order_number, |
| | | rwd.technology_number |
| | | from pp.reporting_work_detail as rwd |
| | | left join pp.reporting_work as rw |
| | | on rwd.reporting_work_id = rw.reporting_work_id |
| | | where rwd.reporting_work_id =#{reportingWorkId} ) as b |
| | | on a.process_id = b.process_id |
| | | and a.order_number = b.order_number |
| | | and a.technology_number = b.technology_number |
| | | |
| | | <if test="type == 'delete'"> |
| | | set a.reporting_work_num_count |
| | | = a.reporting_work_num_count-b.completed_quantity, |
| | | |
| | | a.reporting_work_num |
| | | = a.reporting_work_num-b.completed_quantity, |
| | | |
| | | a.broken_num |
| | | = a.broken_num-b.breakage_quantity |
| | | </if> |
| | | |
| | | <if test="type == 'add'"> |
| | | set a.reporting_work_num_count |
| | | = a.reporting_work_num_count+b.completed_quantity, |
| | | |
| | | a.reporting_work_num |
| | | = a.reporting_work_num+b.completed_quantity, |
| | | |
| | | a.broken_num |
| | | = a.broken_num+b.breakage_quantity |
| | | </if> |
| | | |
| | | where a.process = #{process} |
| | | |
| | | </update> |
| | | |
| | | </mapper> |