Browse Source

后端排序代码模板排序规则校验修改

wenjinbiao 9 months ago
parent
commit
3d3c9599bf

+ 1 - 1
snowy-plugin/snowy-plugin-gen/src/main/resources/backend/ServiceImpl.java.btl

@@ -61,7 +61,7 @@ public class ${className}ServiceImpl extends ServiceImpl<${className}Mapper, ${c
         <% } %>
         if(ObjectUtil.isAllNotEmpty(${classNameFirstLower}PageParam.getSortField(), ${classNameFirstLower}PageParam.getSortOrder())) {
             CommonSortOrderEnum.validate(${classNameFirstLower}PageParam.getSortOrder());
-            queryWrapper.orderBy(true, ${classNameFirstLower}PageParam.getSortOrder().equals(CommonSortOrderEnum.ASC.getValue()),
+            queryWrapper.orderBy(true, ${classNameFirstLower}PageParam.getSortOrder().equalsIgnoreCase(CommonSortOrderEnum.ASC.getValue()),
                     StrUtil.toUnderlineCase(${classNameFirstLower}PageParam.getSortField()));
         } else {
             <% if(hasSortCodeField) { %>