| | |
| | | SUM(t2.unit_amount * (t2.goods_count - COALESCE(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 |
| | | left join t_erp_supplier_outbound_goods t3 on t2.id = t3.warehousing_id |
| | | from t_erp_goods t1 |
| | | left join t_erp_supplier_warehousing t2 on t1.id = t2.goods_id |
| | | left join ( |
| | | select warehousing_id, sum(outbound_count) as outbound_count |
| | | from t_erp_supplier_outbound_goods |
| | | group by warehousing_id |
| | | ) 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 != ''"> |
| | | and t1.goods_name like concat('%',#{query.goodsName},'%') |
| | |
| | | <if test="user.roleType !=null and user.roleType ==4"> and t2.supplier_id =#{supplierClinicId} |
| | | </if> |
| | | <if test="query.name != null and query.name != ''"> |
| | | and t4.goods_name like concat('%',#{query.goodsName},'%') |
| | | and t4.goods_name like concat('%',#{query.name},'%') |
| | | </if> |
| | | <if test="query.quasiNumber != null and query.quasiNumber != ''"> |
| | | and t4.quasi_number like concat('%',#{query.quasiNumber},'%') |