Browse Source

update 优化 代码生成 增加buildQueryWrapper默认排序规则

疯狂的狮子Li 4 months ago
parent
commit
2bb787886d

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

@@ -95,6 +95,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service {
             ${ClassName}::get$AttrName ,params.get("begin$AttrName"), params.get("end$AttrName"));
 #end
 #end
+#if($column.isPk==1)
+        lqw.orderByAsc(${ClassName}::get$AttrName);
+#end
 #end
         return lqw;
     }