|
|
@@ -6,6 +6,7 @@ import com.usoftchina.bi.server.model.bo.Screen;
|
|
|
import com.usoftchina.bi.server.model.bo.ScreenStr;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.time.DayOfWeek;
|
|
|
@@ -41,23 +42,20 @@ public class ScreenUtil {
|
|
|
String columnType = screen.getColumnType();
|
|
|
String symbol = screen.getSymbol();
|
|
|
String value = screen.getValue();
|
|
|
+ String type = screen.getType();//钻取过滤条件的类型 可能和x轴的类型不同
|
|
|
+ String nowType = StringUtils.hasText(type)?type:xColumnType;//钻取的类型优先 没有则使用x轴的类型
|
|
|
|
|
|
- if (columnType != "time" && !("time".equals(columnType))) {
|
|
|
+ if( "isNull".equals(symbol) ){//字段值为null
|
|
|
+ ret = ret + " and " + columnName + " is null ";
|
|
|
+ }else if( "isNotNull".equals(symbol) ){//字段值不为null
|
|
|
+ ret = ret + " and " + columnName + " is not null ";
|
|
|
+ }else if (columnType != "time" && !("time".equals(columnType))) {
|
|
|
String symbVal = getSymbAndVal(symbol, value, columnType);
|
|
|
- if (xColumn.equals(columnName)) {
|
|
|
- withColumnRet = ret + " and " + columnName + " " + symbVal;
|
|
|
- } else {
|
|
|
- ret = ret + " and " + columnName + " " + symbVal;
|
|
|
- }
|
|
|
- }
|
|
|
- if (columnType == "time" || "time".equals(columnType)) {
|
|
|
+ ret = ret + " and " + columnName + " " + symbVal;
|
|
|
+ }else if (columnType == "time" || "time".equals(columnType)) {
|
|
|
String symbVal = getTimeSymbAndVal(symbol, value);
|
|
|
- String column = getTimeColumn(columnName, xColumnType);
|
|
|
- if (xColumn.equals(columnName)) {
|
|
|
- withColumnRet = ret + " and " + column + " " + symbVal;
|
|
|
- } else {
|
|
|
- ret = ret + " and " + column + " " + symbVal;
|
|
|
- }
|
|
|
+ String column = getTimeColumn(columnName, nowType);
|
|
|
+ ret = ret + " and " + column + " " + symbVal;
|
|
|
}
|
|
|
}
|
|
|
screenStr.setRet(ret);
|