Commit 1f2ce7b6 authored by yanzg's avatar yanzg

常规BUG的修改

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