Commit 95d1ceaa authored by yanzg's avatar yanzg

修改MQ请求尸体,防止出错

parent 8d689676
...@@ -20,6 +20,8 @@ public abstract class SqlCondBase<T extends SqlCondBase> implements SqlCond<T> { ...@@ -20,6 +20,8 @@ public abstract class SqlCondBase<T extends SqlCondBase> implements SqlCond<T> {
protected List<String> fields = new ArrayList<>(); protected List<String> fields = new ArrayList<>();
protected Runnable debugRunnable = null;
/** /**
* 构造函数 * 构造函数
* *
...@@ -82,6 +84,10 @@ public abstract class SqlCondBase<T extends SqlCondBase> implements SqlCond<T> { ...@@ -82,6 +84,10 @@ public abstract class SqlCondBase<T extends SqlCondBase> implements SqlCond<T> {
if (sqlDataField.getCond() != this) { if (sqlDataField.getCond() != this) {
throw new RuntimeException("不能处理非本条件的字段"); throw new RuntimeException("不能处理非本条件的字段");
} }
if (debugRunnable != null) {
// 用于断点调试的支持
debugRunnable.run();
}
int condType = getCondType(model, sqlDataField); int condType = getCondType(model, sqlDataField);
switch (condType) { switch (condType) {
case COND_TYPE_CONST_ONLY_PARA: { case COND_TYPE_CONST_ONLY_PARA: {
......
...@@ -19,7 +19,16 @@ public class SqlCondDefault extends SqlCondBase<SqlCondDefault> { ...@@ -19,7 +19,16 @@ public class SqlCondDefault extends SqlCondBase<SqlCondDefault> {
} }
public SqlCondDefault(List<String> fields) { public SqlCondDefault(List<String> fields) {
this(null, fields);
}
public SqlCondDefault(Runnable debugRunnable, String... field) {
this(debugRunnable, Arrays.asList(field));
}
public SqlCondDefault(Runnable debugRunnable, List<String> fields) {
super(fields); super(fields);
super.debugRunnable = debugRunnable;
} }
......
...@@ -37,7 +37,24 @@ public class SqlCondEquals extends SqlCondBase<SqlCondEquals> { ...@@ -37,7 +37,24 @@ public class SqlCondEquals extends SqlCondBase<SqlCondEquals> {
} }
public SqlCondEquals(List<String> fields, Object... vals) { public SqlCondEquals(List<String> fields, Object... vals) {
this(null, fields, vals);
}
public SqlCondEquals(Runnable debugRunnable, String field, Object... vals) {
this(debugRunnable, Arrays.asList(field), vals);
}
public SqlCondEquals(Runnable debugRunnable, String[] fields, Object... vals) {
this(debugRunnable, Arrays.asList(fields), vals);
}
public SqlCondEquals(Runnable debugRunnable, TableFieldString field, Object... vals) {
this(debugRunnable, field.getFields(), vals);
}
public SqlCondEquals(Runnable debugRunnable, List<String> fields, Object... vals) {
super(fields); super(fields);
super.debugRunnable = debugRunnable;
this.vals = vals; this.vals = vals;
// 判断值是否为整形 // 判断值是否为整形
if (vals != null) { if (vals != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment