| | |
| | | <select id="validityPeriodWarning" resultType="com.ruoyi.system.vo.ValidityPeriodWarningVo"> |
| | | select * from (select t2.warehouse_id,t2.warehouse_no warehousingNo, t4.goods_name, t4.quasi_number, |
| | | t1.batch_number, t1.id as batchId,t1.expiry_date, t4.id as goodsId,t5.type_name,t6.unit_name packingUnitName, |
| | | case |
| | | when t3.id is null then t1.warehousing_number |
| | | else t1.warehousing_number -t3.outbound_count |
| | | end as num,t3.id as ogid |
| | | t1.warehousing_number -t3.outbound_count as num |
| | | from t_erp_supplier_warehousing_batch t1 |
| | | left join t_erp_supplier_warehousing t2 on t1.warehousing_id = t2.id |
| | | LEFT JOIN t_erp_supplier_outbound_goods t3 on t3.warehousing_batch_id = t1.id |
| | | left join ( |
| | | select warehousing_batch_id, COALESCE(sum(outbound_count), 0) as outbound_count |
| | | from t_erp_supplier_outbound_goods |
| | | group by warehousing_batch_id |
| | | ) t3 on t3.warehousing_batch_id = t1.id |
| | | LEFT JOIN t_erp_goods t4 on t2.goods_id = t4.id |
| | | left join t_erp_goods_type t5 on t4.type_id = t5.id |
| | | left join t_erp_goods_unit t6 on t4.packing_unit_id = t6.id |
| | |
| | | and t4.type_id = #{query.typeId} |
| | | </if> |
| | | group by t1.id |
| | | ) as o where (o.num > 0 or o.ogid is null) |
| | | ) as o where (o.num > 0 ) |
| | | order by o.expiry_date |
| | | |
| | | </select> |
| | | <select id="pageInventoryList" resultType="com.ruoyi.system.vo.PageInventoryListVo"> |
| | | select t1.id,t1.create_time,t2.user_name createBy,t3.warehouse_name |
| | | select t1.id,t1.create_time,t1.create_by,t3.warehouse_name |
| | | from t_erp_supplier_inventory t1 left join sys_user t2 on t1.create_id = t2.user_id |
| | | left join t_crm_warehouse t3 on t1.warehouse_id =t3.id |
| | | where t1.disabled = 0 |
| | |
| | | and t1.warehouse_id = #{query.warehouseId} |
| | | </if> |
| | | <if test="query.createBy != null and query.createBy != ''"> |
| | | and t2.user_name like concat('%',#{query.createBy},'%') |
| | | and t1.create_by like concat('%',#{query.createBy},'%') |
| | | </if> |
| | | <if test="sTime != null and eTime !=null "> |
| | | and t1.create_time between #{sTime} and #{eTime} |