| | |
| | | COALESCE(sum(t2.goods_count), 0) - COALESCE(sum(t3.outbound_count), 0) as allNum, |
| | | COALESCE(sum(t2.total_price), 0) * ( COALESCE(sum(t2.goods_count), 0) - COALESCE(sum(t3.outbound_count), 0)) as allTotalPrice, |
| | | COALESCE(sum(t3.outbound_count), 0) as outNum |
| | | from t_erp_goods t1 left join t_erp_supplier_warehousing t2 on t1.id = t2.goods_id |
| | | from t_erp_supplier_warehousing t2 left join t_erp_goods t1 on t1.id = t2.goods_id |
| | | left join t_erp_supplier_outbound_goods t3 on t2.id = t3.warehousing_id |
| | | where t1.disabled = 0 |
| | | <if test="query.goodsName != null and query.goodsName != ''"> |
| | |
| | | <if test="user.roleType != null and user.roleType == 5 "> |
| | | and t1.goods_source =2 and t1.supplier_clinic_id =#{query.supplierClinicId} |
| | | </if> |
| | | GROUP BY t2.id |
| | | ) o where 1=1 |
| | | <if test="query.type != null and query.type ==1"> |
| | | and o.warning_inventory > (o.allNum-o.outNum) |