Commit ac95193f authored by yanzg's avatar yanzg

1.3版本修改,增加删除功能

parent 42e854ed
......@@ -174,6 +174,10 @@ public class DaoConst {
* 未删除条件
*/
public static final String CODE_WHERE_EQUALS_NOT_REMOVE = "AND a.%s=IFNULL(?,0)";
/**
* 未删除条件
*/
public static final String CODE_WHERE_REMOVE = "AND a.%s IN (0,2)";
/**
* 版本好字段
*/
......
......@@ -2,6 +2,7 @@ package com.yanzuoguang.dao.impl;
import com.yanzuoguang.dao.TableAnnotation;
import com.yanzuoguang.dao.cond.SqlCondDefault;
import com.yanzuoguang.dao.cond.SqlCondEquals;
import com.yanzuoguang.util.base.MethodField;
import com.yanzuoguang.util.base.ObjectHelper;
import com.yanzuoguang.util.exception.RuntimeCodeException;
......@@ -671,10 +672,14 @@ public class TableStruct {
private void addWhereRemove(SqlData sql) {
TableFieldVo remove = this.getRemove();
if (remove != null) {
sql.addParaConst(remove.inputName + OLD_FLAG,
sql.addPara(new SqlCondEquals(remove.inputName + OLD_FLAG, 0, 1, 2),
CODE_WHERE,
String.format(CODE_WHERE_EQUALS_NOT_REMOVE, this.getRemove().name)
);
sql.addPara(new SqlCondEquals(remove.inputName + OLD_FLAG, 3),
CODE_WHERE,
String.format(CODE_WHERE_REMOVE, this.getRemove().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