Commit f6884d99 authored by yanzg's avatar yanzg

常规BUG的修改

parent 473fbff7
...@@ -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 UPDATE_FLAG = "update";
/** /**
* MD5标记字段 * MD5标记字段
*/ */
...@@ -151,4 +155,8 @@ public class DaoConst { ...@@ -151,4 +155,8 @@ public class DaoConst {
* MD5标记字段,用于统计字段 * MD5标记字段,用于统计字段
*/ */
public static final int FIELD_MD5 = 4; public static final int FIELD_MD5 = 4;
/**
* 删除时记录操作状态的字段
*/
public static final int FIELD_REMOVE_UPDATE = 5;
} }
...@@ -216,8 +216,12 @@ public class TableStruct { ...@@ -216,8 +216,12 @@ public class TableStruct {
} else { } else {
// 将所有非主键列添加到普通列 // 将所有非主键列添加到普通列
commonActionList.add(vo); commonActionList.add(vo);
if (fieldAction == DaoConst.FIELD_REMOVE_UPDATE || stringAction == DaoConst.FIELD_REMOVE_UPDATE) {
List<TableFieldVo> actionList = this.getFieldActionList(DaoConst.FIELD_REMOVE_UPDATE);
actionList.add(vo);
}
// 处理其他特殊列 // 处理其他特殊列
if (fieldAction != DaoConst.FIELD_COMMON) { else if (fieldAction != DaoConst.FIELD_COMMON) {
// 假如特殊列已经存在,则将已经存在的特殊列删除,并且添加新的特殊列 // 假如特殊列已经存在,则将已经存在的特殊列删除,并且添加新的特殊列
List<TableFieldVo> actionList = this.getFieldActionList(fieldAction); List<TableFieldVo> actionList = this.getFieldActionList(fieldAction);
actionList.clear(); actionList.clear();
...@@ -249,6 +253,8 @@ public class TableStruct { ...@@ -249,6 +253,8 @@ public class TableStruct {
// 判断是否属于统计字段 // 判断是否属于统计字段
else if (DaoConst.MD5_KEY_FLAG.equals(vo.inputLName)) { else if (DaoConst.MD5_KEY_FLAG.equals(vo.inputLName)) {
return DaoConst.FIELD_MD5; return DaoConst.FIELD_MD5;
} else if (vo.inputLName.startsWith(DaoConst.UPDATE_FLAG)) {
return DaoConst.FIELD_REMOVE_UPDATE;
} else { } else {
return DaoConst.FIELD_COMMON; return DaoConst.FIELD_COMMON;
} }
...@@ -350,6 +356,9 @@ public class TableStruct { ...@@ -350,6 +356,9 @@ public class TableStruct {
String text = DaoConst.UPDATE_MODEL.replace(DaoConst.TABLE_CODE, this.name); String text = DaoConst.UPDATE_MODEL.replace(DaoConst.TABLE_CODE, this.name);
SqlData sql = new SqlData(DaoConst.REMOVE, text); SqlData sql = new SqlData(DaoConst.REMOVE, text);
sql.addCode(DaoConst.FIELD_CODE, removeField.name + "=1"); sql.addCode(DaoConst.FIELD_CODE, removeField.name + "=1");
for (TableFieldVo field : this.getFieldActionList(DaoConst.FIELD_REMOVE_UPDATE)) {
sql.addParaConst(field.inputName, DaoConst.FIELD_CODE, "," + field.name + "=?");
}
if (versionField != null) { if (versionField != null) {
sql.addCode(DaoConst.FIELD_CODE, "," + versionField.name + "=1+" + versionField.name); sql.addCode(DaoConst.FIELD_CODE, "," + versionField.name + "=1+" + versionField.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