xieb
2024-01-29 d5aef2e06c79541ed003af44e621df7c57fcf2e7
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/resDataCheck/feign/RulesClient.java
@@ -12,6 +12,7 @@
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@@ -49,7 +50,7 @@
      String retStr = "-1";
      switch (key) {
         case "EQUAL": //等于
            retStr = " is null OR = '' ";
            retStr = " is null";
            break;
         case "UNEQUAL": //不等于
            retStr = " is not null ";
@@ -246,7 +247,9 @@
         if (rc.getProp().equals("NULLVAL")) { // 空值
            sqlStr += getConditionSqlStrByNullVal(rc.getCondition());
         } else if (rc.getProp().equals("TARGET")) { // 指标
            sqlStr += getConditionSqlStrByTarget(rc.getCondition(), getPropSqlStr(rc.getTarget()), rc.getValue());
            sqlStr += ObjectUtil.isNotEmpty(rc.getFixValue())?
               getConditionSqlStrByTarget(rc.getCondition(), getPropSqlStr(rc.getTarget()), rc.getValue())+"-"+rc.getFixValue() :
               getConditionSqlStrByTarget(rc.getCondition(), getPropSqlStr(rc.getTarget()), rc.getValue());
         } else {
            sqlStr += getConditionSqlStrByVal(rc.getCondition(), rc.getValue());
         }
@@ -270,7 +273,10 @@
      varStr = "concat(" + varStr +") AS val";
      if (StringUtil.isNotBlank(rules.getIsGate())) {
         sqlStr += " and a.\"is_gate\" = " + rules.getIsGate();
         String gateStr = rules.getIsGate().equals("1") ?"'有闸水库'":"'无闸水库'";
         sqlStr += " and a.\"is_gate\" = " + gateStr;
      }
      // 拼接条件有问题,不操作