sql语句大概为: select distinct i.sku 物料编码, s.descr 物料名称, i.id LPN, i.qty 数量, i.qty - i.qtyallocated - i.qtypicked 可用量, i.qtyallocated 分配量, i.qtypicked 拣货量, case when i.status = 'OK' then '正常' else '冻结' end 库存状态, case when i.status = 'OK' then '合格' when i.status = 'HOLD' and ih.status is not null then to_char(ihc.description) else to_char(ihcloc.description) end 冻结状态, from lotxlocxid i where 1=1 ${if(len(库存状态)==0,"","and i.status =('"+库存状态+"')")} ${if(len(物料编码)==0,"","and i.sku =('"+物料编码+"')")} |