SELECT t.Goods_No,t.Customer_na,t.Goods_name,t.year,t.brand,t.sex,t.season,t.color,t.Size_class,t.size,t.Customer_id,t.WholeSalePrice,t.UnitPrice,sum(t.quantity) quantity FROM (select c.Customer_na,dig.Goods_No,g.Goods_name,g.year,g.brand,g.sex,g.season,dc.color,g.Size_class,ds.size,c.Customer_id,g.WholeSalePrice,g.UnitPrice, Case when ds.FieldName='S1' then ded.S1 when ds.FieldName='S2' then ded.S2 when ds.FieldName='S3' then ded.S3 when ds.FieldName='S4' then ded.S4 when ds.FieldName='S5' then ded.S5 when ds.FieldName='S6' then ded.S6 when ds.FieldName='S7' then ded.S7 else 0 end as quantity from DELIVERY di left join DELIVERYGoods dig on di.deliveryid=dig.deliveryid left join Goods g on dig.Goods_No=g.Goods_no left join DELIVERYDetail ded on dig.DELIVERYgoodsid=ded.DELIVERYgoodsid left join Customer c on di.Customer_Id=c.Customer_id left join DictSize ds on g.Size_class=ds.Size_Class left join DictColor dc on ded.ColorId=dc.ColorID where g.brand ='${品牌}' and g.year = '${年份}'and g.season = '${季节}' ) t GROUP BY t.year,t.Customer_na,t.goods_name,t.Goods_No,t.brand,t.sex,t.season,t.color,t.Size_class ,t.size,t.Customer_id,t.WholeSalePrice,t.UnitPrice HAVING sum(t.quantity)<>0 想把参数变为多选可以用,现在这个参数只能单选 |