StringsqlPay=""+"select "+"sum(case when sPayTypeID = '1' then nPayAmount else 0 end) nCashPayAmount, "
+"sum(case when sPayTypeID = 'WxPay' then nPayAmount else 0 end) nWxPayAmount, "
+"sum(case when sPayTypeID = 'Coupon' then nPayAmount else 0 end) nCouponPayAmount, "
+"sum(nPayAmount) nTotalPayAmount "+"from tSalesOrderPay where sSalesOrderID = ?";
StringsqlPay="select sPayTypeID, sPayType, nPayAmnount, sOutTradeNO, sStatusID = case when nTag&2=2 then '1' else '0' end, sStatus = case when nTag&2=2 then '已付款' else '未付款' end "