select t1.sonum,t1.billdate,t5.itemno,t5.itemname,t2.sa_orderitemsid,t2.price,t2.qty,t2.amount
from sa_order t1
inner join sa_orderitems t2 on t1.siteid=t2.siteid and t1.sa_orderid=t2.sa_orderid
inner join plm_item t5 on t2.siteid=t5.siteid and t2.itemid=t5.itemid
where t1.siteid = $siteid$ and t1.status='审核' and $where$