Commit 69de31a3 authored by yanzg's avatar yanzg

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

parent 33563ba6
......@@ -6,22 +6,37 @@ import io.swagger.annotations.ApiModelProperty;
/**
* 查询参数
*
* @author 颜佐光
* @author 颜佐光
*/
@ApiModel(description = "查询参数")
public class QueryPara {
/**
* 查询删除
*/
public static QueryPara LOAD_REMOVE = new QueryPara(false, true);
/**
* 所有条件生效
*/
public static QueryPara FULL_COND = new QueryPara(true);
public static QueryPara FULL_COND = new QueryPara(true, false);
/**
* 所有条件生效
*/
@ApiModelProperty(notes = "所有条件生效,而不仅仅在主键存在时,通过主键加载")
private boolean fullCond;
public QueryPara(boolean fullCond) {
/**
* 查询删除标记的结果
*/
@ApiModelProperty(notes = "在数据通过删除标记删除时,可以通过该参数查询出来")
private boolean loadRemove;
public QueryPara(boolean fullCond, boolean loadRemove) {
this.fullCond = fullCond;
this.loadRemove = loadRemove;
}
public boolean isFullCond() {
......@@ -31,4 +46,12 @@ public class QueryPara {
public void setFullCond(boolean fullCond) {
this.fullCond = fullCond;
}
public boolean isLoadRemove() {
return loadRemove;
}
public void setLoadRemove(boolean loadRemove) {
this.loadRemove = loadRemove;
}
}
......@@ -213,7 +213,18 @@ public abstract class BaseDaoSql {
* @param copy 是否复制
*/
protected SqlData getSqlQueryPara(SqlData sqlData, QueryPara queryPara, boolean copy) {
return sqlData;
SqlData copyTo = sqlData;
if (queryPara != null && queryPara.isLoadRemove()) {
TableFieldVo remove = this.table.getTable().getRemove();
SqlDataField field = copyTo.getField(remove.inputName);
if (field != null) {
if (copy) {
copyTo = sqlData.copy();
}
copyTo.removeField(remove.inputName);
}
}
return copyTo;
}
/**
......
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