Commit 0bc772ac authored by yanzg's avatar yanzg

压缩视频

parent d3d0501b
...@@ -536,9 +536,7 @@ public class TableStruct { ...@@ -536,9 +536,7 @@ public class TableStruct {
* @return 生成的语句 * @return 生成的语句
*/ */
private void addWhereField(SqlData sql, String tag, boolean isRemove) { private void addWhereField(SqlData sql, String tag, boolean isRemove) {
sql.add(this.getKey().inputName, addWhereFieldCommon(sql, this.getKey(), tag);
String.format(DaoConst.CODE_WHERE_EQUALS, tag, this.getKey().name, DaoConst.CODE_PARA)
);
// Where条件包含的字段 // Where条件包含的字段
List<TableFieldVo> fields; List<TableFieldVo> fields;
...@@ -549,22 +547,27 @@ public class TableStruct { ...@@ -549,22 +547,27 @@ public class TableStruct {
// 非删除时需要更新的字段 // 非删除时需要更新的字段
fields = this.getFieldActionList(DaoConst.FIELD_COMMON, DaoConst.FIELD_REMOVE_UPDATE); fields = this.getFieldActionList(DaoConst.FIELD_COMMON, DaoConst.FIELD_REMOVE_UPDATE);
} }
// 添加普通的Where条件 // 添加普通的Where条件
for (TableFieldVo field : fields) { for (TableFieldVo field : fields) {
// 添加等于条件 addWhereFieldCommon(sql, field, tag);
sql.add(field.inputName, String.format(DaoConst.CODE_WHERE_EQUALS, tag, field.name, DaoConst.CODE_PARA));
// 添加in条件
String sqlIn = String.format(DaoConst.CODE_WHERE_IN, tag, field.name, DaoConst.CODE_PARA);
if (field.inputLName.endsWith(DaoConst.CODE_WHERE_IN_END)) {
sql.add(field.inputName + DaoConst.CODE_WHERE_IN_END_ES, sqlIn);
} else {
sql.add(field.inputName + DaoConst.CODE_WHERE_IN_END, sqlIn);
}
} }
// 查询时,不能查询到非删除的字段 // 查询时,不能查询到非删除的字段
addWhereRemove(sql); addWhereRemove(sql);
} }
private void addWhereFieldCommon(SqlData sql, TableFieldVo field, String tag) {
// 添加等于条件
sql.add(field.inputName, String.format(DaoConst.CODE_WHERE_EQUALS, tag, field.name, DaoConst.CODE_PARA));
// 添加in条件
String sqlIn = String.format(DaoConst.CODE_WHERE_IN, tag, field.name, DaoConst.CODE_PARA);
if (field.inputLName.endsWith(DaoConst.CODE_WHERE_IN_END)) {
sql.add(field.inputName + DaoConst.CODE_WHERE_IN_END_ES, sqlIn);
} else {
sql.add(field.inputName + DaoConst.CODE_WHERE_IN_END, sqlIn);
}
}
/** /**
* 添加删除WHERE条件字段 * 添加删除WHERE条件字段
* *
...@@ -615,13 +618,6 @@ public class TableStruct { ...@@ -615,13 +618,6 @@ public class TableStruct {
for (TableFieldVo field : whereFields) { for (TableFieldVo field : whereFields) {
sql.addConst(field.inputName, String.format(DaoConst.CODE_WHERE_EQUALS_PARA, field.name)); sql.addConst(field.inputName, String.format(DaoConst.CODE_WHERE_EQUALS_PARA, field.name));
// 添加in条件
if (field.inputLName.endsWith(DaoConst.CODE_WHERE_IN_END)) {
sql.add(field.inputName + DaoConst.CODE_WHERE_IN_END_ES, String.format(DaoConst.CODE_WHERE_IN_PARA, field.name));
} else {
sql.add(field.inputName + DaoConst.CODE_WHERE_IN_END, String.format(DaoConst.CODE_WHERE_IN_PARA, field.name));
}
} }
return sql; return sql;
......
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