| | |
| | | ) shipping_status_counts ON sl.id = shipping_status_counts.sales_ledger_id |
| | | left join product_model pm on po.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join sales_ledger_product slp on po.sale_ledger_product_id = slp.id |
| | | left join sales_ledger_product slp on po.sale_ledger_product_id = slp.id and slp.type = 1 |
| | | left join product_process_route ppr on po.id = ppr.product_order_id |
| | | left join product_bom pb on pb.id = ppr.bom_id |
| | | <where> |
| | |
| | | WHERE create_time >= #{startDate} AND create_time <= #{endDate} |
| | | AND complete_quantity < quantity |
| | | </select> |
| | | |
| | | <update id="addCompleteQtyIfNotExceed"> |
| | | update product_order |
| | | set |
| | | complete_quantity = complete_quantity + #{delta}, |
| | | start_time = ifnull(start_time, now()), |
| | | end_time = case when (complete_quantity + #{delta}) = quantity then now() else end_time end |
| | | where id = #{id} |
| | | and (complete_quantity + #{delta}) <![CDATA[ <= ]]> quantity |
| | | </update> |
| | | </mapper> |