| | |
| | | COALESCE(sum(t2.purchase_count), 0) - COALESCE(sum(t3.outbound_count), 0) as allNum, |
| | | SUM(t2.unit_amount * (t2.purchase_count - COALESCE(t3.outbound_count, 0))) as allTotalPrice, |
| | | |
| | | COALESCE(sum(t3.outbound_count), 0) as outNum |
| | | COALESCE(sum(t3.outbound_count), 0) as outNum,t4.create_time as createTime1 |
| | | from t_erp_goods t1 left join t_erp_clinic_warehousing_batch t2 on t1.id = t2.goods_id |
| | | left join t_erp_clinic_warehousing t4 on t2.warehousing_id = t4.id |
| | | left join t_erp_clinic_outbound_goods t3 on t2.id = t3.warehousing_id |
| | | where t1.disabled = 0 and t2.id is not null |
| | | <if test="query.goodsName != null and query.goodsName != ''"> |
| | |
| | | <if test="query.type != null and query.type ==1"> |
| | | and o.warning_inventory > (o.allNum-o.outNum) |
| | | </if> |
| | | order by o.create_time desc |
| | | order by o.createTime1 desc |
| | | </select> |
| | | |
| | | <select id="warehousePageList" resultType="com.ruoyi.system.vo.TErpClinicWarehousePageListVO"> |