Commit 1f2ce7b6 authored by yanzg's avatar yanzg

常规BUG的修改

parent 2d4ebee9
...@@ -110,6 +110,10 @@ public class DaoConst { ...@@ -110,6 +110,10 @@ public class DaoConst {
* 删除字段名称 * 删除字段名称
*/ */
public static final String REMOVE_FLAG = "remove"; public static final String REMOVE_FLAG = "remove";
/**
* 创建字段名称
*/
public static final String CREATE_FLAG = "create";
/** /**
* 更新字段名称 * 更新字段名称
*/ */
...@@ -159,6 +163,10 @@ public class DaoConst { ...@@ -159,6 +163,10 @@ public class DaoConst {
* 删除时记录操作状态的字段 * 删除时记录操作状态的字段
*/ */
public static final int FIELD_REMOVE_UPDATE = 5; public static final int FIELD_REMOVE_UPDATE = 5;
/**
* 删除时记录操作状态的字段
*/
public static final int FIELD_CREATE = 6;
/** /**
* SQL语句类型-普通语句 * SQL语句类型-普通语句
......
...@@ -265,6 +265,8 @@ public class TableStruct { ...@@ -265,6 +265,8 @@ public class TableStruct {
return DaoConst.FIELD_MD5; return DaoConst.FIELD_MD5;
} else if (vo.inputLName.startsWith(DaoConst.UPDATE_FLAG)) { } else if (vo.inputLName.startsWith(DaoConst.UPDATE_FLAG)) {
return DaoConst.FIELD_REMOVE_UPDATE; return DaoConst.FIELD_REMOVE_UPDATE;
} else if (vo.inputLName.startsWith(DaoConst.CREATE_FLAG)) {
return DaoConst.FIELD_CREATE;
} else { } else {
return DaoConst.FIELD_COMMON; return DaoConst.FIELD_COMMON;
} }
...@@ -338,8 +340,16 @@ public class TableStruct { ...@@ -338,8 +340,16 @@ public class TableStruct {
sql.addParaConst(this.getKey().inputName, sql.addParaConst(this.getKey().inputName,
DaoConst.FIELD_CODE, "a." + this.getKey().name + "=a." + this.getKey().name, DaoConst.FIELD_CODE, "a." + this.getKey().name + "=a." + this.getKey().name,
DaoConst.WHERE_CODE, " AND a." + this.getKey().name + "=?"); DaoConst.WHERE_CODE, " AND a." + this.getKey().name + "=?");
// 删除时更新字段
List<TableFieldVo> createFields = getFieldActionList(DaoConst.FIELD_CREATE);
Map<TableFieldVo, Boolean> mapCreate = new HashMap<>(createFields.size());
for (TableFieldVo field : createFields) {
mapCreate.put(field, true);
}
for (TableFieldVo field : this.getFields()) { for (TableFieldVo field : this.getFields()) {
if (field == removeField || field == versionField) { if (field == removeField || field == versionField || mapCreate.containsKey(field)) {
continue; continue;
} }
sql.addParaConst(field.inputName, DaoConst.FIELD_CODE, ",a." + field.name + "=?"); sql.addParaConst(field.inputName, DaoConst.FIELD_CODE, ",a." + field.name + "=?");
......
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