diff --git a/src/main/java/com/glxp/mipsdl/service/hlfyyy/VA010Service.java b/src/main/java/com/glxp/mipsdl/service/hlfyyy/VA010Service.java index 6c4c270..d308613 100644 --- a/src/main/java/com/glxp/mipsdl/service/hlfyyy/VA010Service.java +++ b/src/main/java/com/glxp/mipsdl/service/hlfyyy/VA010Service.java @@ -27,11 +27,10 @@ public class VA010Service extends ServiceImpl { IPage iPage = va010Mapper.getList(page,udiwmsBasicSkPrescribeRequest); List list = iPage.getRecords(); List listNew = new ArrayList<>(); - list.sort( Comparator.comparing(VA010::getPrescribedate)); if(list!=null && list.size() >0){ String lastSql = ""; if(defXmlSqlType.equals("Mysql")){ - lastSql = "AND limit = 1"; + lastSql = " limit 1"; }else if(defXmlSqlType.equals("Oracle")){ lastSql = "AND rownum = 1"; @@ -43,6 +42,8 @@ public class VA010Service extends ServiceImpl { listNew.add(va010New); } } + listNew.sort( Comparator.comparing(VA010::getPrescribedate)); + iPage.setRecords(listNew); return iPage; diff --git a/src/main/resources/mybatis/mapper/master/hlfyyy/VA010Mapper.xml b/src/main/resources/mybatis/mapper/master/hlfyyy/VA010Mapper.xml index e6aae82..99db779 100644 --- a/src/main/resources/mybatis/mapper/master/hlfyyy/VA010Mapper.xml +++ b/src/main/resources/mybatis/mapper/master/hlfyyy/VA010Mapper.xml @@ -42,8 +42,8 @@ = #{req.startTime} - AND STR_TO_DATE(PRESCRIBEDATE, '%Y/%c/%e %H:%i:%s') < #{req.endTime} + STR_TO_DATE(PRESCRIBEDATE, '%e/%c/%Y %H:%i:%s') >= #{req.startTime} + AND STR_TO_DATE(PRESCRIBEDATE, '%e/%c/%Y %H:%i:%s') < #{req.endTime} ]]>