能不能对那个分类进行排序?
sql语句如下:
正确顺序:1,2,3,18,19,4,5,6,7
- select sum(case DrawingType when 1 then 1 else 0 end) as '图纸CAD',
- sum(case DrawingType when 0 then 1 else 0 end) as '图纸2020',
- sum(case DrawingType when 2 then 1 else 0 end) as '其他',
- COUNT(OrderNo) as '总量',
- (case OrderStatus
- when 1 then '待受理'
- when 2 then '待审图'
- when 3 then '待拆单'
- when 4 then '待报价审核'
- when 5 then '待经销商付款'
- when 6 then '待付款确认'
- when 7 then '待计划接单'
- when 18 then '待料单审核'
- when 19 then '待孔位审核' end) as '分类'
- from dbo.C_Order
- where 1=1
- ${if(len(ordertype)=0,""," and OrderType in ("+ordertype+")")}
- ${if(len(OrderStatus)=0,"and OrderStatus in (1,2,3,4,5,6,7,18,19)"," and OrderStatus in ("+OrderStatus+")")}
- group by OrderStatus
复制代码
|