Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordListSqlGenerator.java =================================================================== diff -u -r27470 -r27699 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordListSqlGenerator.java (.../RecyclingRecordListSqlGenerator.java) (revision 27470) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordListSqlGenerator.java (.../RecyclingRecordListSqlGenerator.java) (revision 27699) @@ -151,15 +151,16 @@ String orderSqlOfUrgent = ""; if(enableUrgentFunction){ joinSqlOfUrgent = " left join UrgentLevel ul on p.urgentLevel_id=ul.id "; - orderSqlOfUrgent = " ul.grade desc,"; } String recyclingAmountNeedConfirmOrder = ""; if(CssdUtils.getSystemSetConfigByNameBool("confirmRecyclingAmount",true)){ recyclingAmountNeedConfirmOrder = "case r.recycleAmountNeedConfirm when '" + Constants.STR_YES + "' then 0 else 1 end,"; } if (dbConnection.isSqlServer()) { - + if(enableUrgentFunction){ + orderSqlOfUrgent = " ul.grade desc,"; + } String tempSql = "(SELECT TOP " + end + " r.*,p.type,p.remark,p.submitTime,p.recyclingStatus "+ extraQuery +" FROM " + RecyclingRecord.class.getSimpleName() + " r left join " + InvoicePlan.class.getSimpleName() @@ -181,6 +182,9 @@ + tempSql2 + " order by A.recyclingTime desc "; } else if (dbConnection.isOracle()) { + if(enableUrgentFunction){ + orderSqlOfUrgent = " nvl(ul.grade,0) desc,"; + } sql = "SELECT * FROM (SELECT A.*, ROWNUM RN FROM (SELECT r.*,p.type,p.remark,p.submitTime,p.recyclingStatus "+ extraQuery +" FROM " + RecyclingRecord.class.getSimpleName() + " r left join " + InvoicePlan.class.getSimpleName() + " p on r.recyclingApplication_id = p.id " + joinSqlOfUrgent + "where r.orgUnitCoding = '"