SELECT b.Goods_no as 货号, c.ColorID as 颜色编号, c.Long as 内长, SUM ( isnull( c.S1, 0 )) AS 仓库调入S1, SUM ( isnull( c.S2, 0 )) AS 仓库调入S2, SUM ( isnull( c.S3, 0 )) AS 仓库调入S3, SUM ( isnull( c.S4, 0 )) AS 仓库调入S4, SUM ( isnull( c.S5, 0 )) AS 仓库调入S5, SUM ( isnull( c.S6, 0 )) AS 仓库调入S6, SUM ( isnull( c.S7, 0 )) AS 仓库调入S7, SUM ( isnull( c.S8, 0 )) AS 仓库调入S8, SUM ( 0+isnull ( c.S1, 0 ) + isnull( c.S2, 0 ) + isnull( c.S3, 0 ) + isnull( c.S4, 0 ) + isnull( c.S5, 0 ) + isnull( c.S6, 0 ) + isnull( c.S7, 0 ) + isnull( c.S8, 0 )) as 仓库调入总数
FROM PuReceipt a
INNER JOIN PuReceiptGoods b ON b.PureceiptID= a.PureceiptID
INNER JOIN PuReceiptDetail c ON b.PureceiptGoodsID= c.PureceiptGoodsID
INNER JOIN Warehouse d ON d.Warehouse_No= a.Warehouse_No
WHERE 1=1
${if(len(Goods_no) == 0,"","and b.Goods_no in ('" + Goods_no + "')" )}
${if(len(warehouse_na) == 0,"","and a.warehouse_no in ('" + warehouse_na + "')")}
${if(len(warehouse_na) == 0,"","and a.fmwarehouse_no NOT in ('" + warehouse_na + "')")
AND a.Type= 2 AND a.Posted= 1 GROUP BY b.Goods_No, c.ColorID, c.Long 关于warehouse_na这个控件,选择单个参数的情况下 数据可以正常显示,
但是如果选择多个参数的情况下,则不显示任何内容。但是在数据库里单独用语句查询的时候,是可以正常显示出来的。 |