--修正出入库单累计对账数
update Stock_InOuts set
dz_quantity=isnull(t.quantity,0),
dz_num=isnull(t.num,0)
from(
    select ios_id,sum(d.quantity) as quantity,sum(d.num) as num
    from ARAP_CheckAccounts d 
    left join ARAP_CheckAccount t on t.ca_id=d.ca_id
    where isnull(ios_id,0)!=0
    and isnull(t.verify_user,'')<>''
    group by ios_id 
)t where Stock_InOuts.ios_id=t.ios_id
--and Stock_InOuts.io_id='出入库单主表id'