浏览代码

优化if 标签后还有数据的情况

wuxw 6 年之前
父节点
当前提交
570c3e3902
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      java110-service/src/main/java/com/java110/service/smo/impl/QueryServiceSMOImpl.java

+ 1 - 1
java110-service/src/main/java/com/java110/service/smo/impl/QueryServiceSMOImpl.java

@@ -344,7 +344,7 @@ public class QueryServiceSMOImpl extends LoggerEngine implements IQueryServiceSM
         String[] oSqls = oldSql.split("</if>");
         String[] oSqls = oldSql.split("</if>");
         for (String oSql : oSqls) {
         for (String oSql : oSqls) {
             logger.debug("处理if 节点,当前处理的oSql=" + oSql + "总的oSqls = " + oSqls);
             logger.debug("处理if 节点,当前处理的oSql=" + oSql + "总的oSqls = " + oSqls);
-            if(StringUtil.isNullOrNone(oSql)){
+            if(StringUtil.isNullOrNone(oSql) || !oSql.contains("<if")){
                 continue;
                 continue;
             }
             }
             if (!oSql.startsWith("<if")) {
             if (!oSql.startsWith("<if")) {