瀏覽代碼

代码生成增加时间排序

jun hu 1 年之前
父節點
當前提交
5cec2ed2a0
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm

+ 4 - 0
ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm

@@ -168,6 +168,10 @@ public class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${C
                 ${ClassName}::get$AttrName ,params.get("begin$AttrName"), params.get("end$AttrName"));
         #end
     #end
+    #if($column.javaField == 'createTime')
+        #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
+        lqw.orderByDesc(${ClassName}::get$AttrName);
+    #end
 #end
         return lqw;
     }