| | |
| | | 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; |
| | |
| | | String retStr = "-1"; |
| | | switch (key) { |
| | | case "EQUAL": //等于 |
| | | retStr = " is null OR = '' "; |
| | | retStr = " is null"; |
| | | break; |
| | | case "UNEQUAL": //不等于 |
| | | retStr = " is not null "; |
| | |
| | | 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()); |
| | | } |
| | |
| | | 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; |
| | | } |
| | | |
| | | // 拼接条件有问题,不操作 |