NutzCN Logo
问答 sql 排序问题 排序无效
发布于 2933天前 作者 qq_fca05dd3 2568 次浏览 复制 上一个帖子 下一个帖子
标签:

这样写 为何排序无效

        sql.setPager(pager);
        sql.setCondition(Cnd.orderBy().desc("mm.FNUMBER"));
        sql.setCallback(Sqls.callback.entities());
        dao().execute(sql);
3 回复

sql的文本贴一下

@wendal SELECT * FROM (SELECT T.*, ROWNUM RN FROM (SELECT mm.ID AS orderNoId,mm.FNUMBER AS orderNo,mm.FSTATUS AS statusId,DECODE(mm.FSTATUS,0,'待分配技师',1,'全车检查',2,'车主确认',3,'维修',4,'整车质检',5,'待付款',6,'待提车',7,'已提车',8,'已评价',9,'项目变更',10,'废单') AS statusName,tu.NAME AS tecName,
pr.FNAME AS repairName,mr.FCONNECTER AS contacts,vm.FLICENSENO AS carNum,
(pl.FNAME || ' ' || pm.FNAME) AS carType,
TO_CHAR(mm.FYJJCDATE,'YYYY-MM-DD HH24:MI') AS estimatedDeliveryTime
FROM MM_WORKORDER mm
LEFT JOIN MM_MATEC ma ON ma.ID = mm.FTECHNICIAN
LEFT JOIN TUSER tu ON tu.ID = ma.FNAME
LEFT JOIN PUB_REPAIRCATEGORY pr ON pr.ID = mm.FREPAIR_METHOD
LEFT JOIN MM_REPAIRAPPOINTMENT mr ON mr.ID = mm.FGUYNUMBER
LEFT JOIN VM_CARDATE vm ON vm.ID = mm.FLICENSENO
LEFT JOIN PUB_Line pl ON pl.ID = mm.FLINE
LEFT JOIN PUB_Model pm ON pm.ID = mm.FMODEL
WHERE mm.FCREATER = 84 ) T WHERE ROWNUM <= 15) WHERE RN > 0

在需要插入排序条件的地方加入 $condition

添加回复
请先登陆
回到顶部