Commit d3d0501b authored by yanzg's avatar yanzg

压缩视频

parent c203eb85
......@@ -144,6 +144,10 @@ public class DaoConst {
* 等于条件
*/
public static final String CODE_WHERE_EQUALS = "AND %s%s=%s";
/**
* In条件参数
*/
public static final String CODE_WHERE_IN = "AND %s%s IN (%s)";
/**
* 等于条件参数
*/
......
......@@ -551,9 +551,15 @@ public class TableStruct {
}
// 添加普通的Where条件
for (TableFieldVo field : fields) {
sql.add(field.inputName,
String.format(DaoConst.CODE_WHERE_EQUALS, tag, field.name, DaoConst.CODE_PARA)
);
// 添加等于条件
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);
......@@ -597,8 +603,6 @@ public class TableStruct {
* @return 生成的SQL语句
*/
private SqlData releaseSql(int sqlType, String name, String model, String valueModel, List<TableFieldVo> valueFields, List<TableFieldVo> whereFields) {
// 参数字段
List<String> paraFields = new ArrayList<String>();
// 生成修改的SQL语句
SqlData sql = new SqlData(name, model.replace(DaoConst.CODE_TABLE, this.name));
sql.setSqlType(sqlType);
......@@ -610,14 +614,13 @@ public class TableStruct {
}
for (TableFieldVo field : whereFields) {
sql.addParaConst(field.inputName, DaoConst.CODE_WHERE, 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.addParaConst(field.inputName + DaoConst.CODE_WHERE_IN_END_ES,
DaoConst.CODE_WHERE, String.format(DaoConst.CODE_WHERE_IN_PARA, field.name));
sql.add(field.inputName + DaoConst.CODE_WHERE_IN_END_ES, String.format(DaoConst.CODE_WHERE_IN_PARA, field.name));
} else {
sql.addParaConst(field.inputName + DaoConst.CODE_WHERE_IN_END,
DaoConst.CODE_WHERE, String.format(DaoConst.CODE_WHERE_IN_PARA, field.name));
sql.add(field.inputName + DaoConst.CODE_WHERE_IN_END, String.format(DaoConst.CODE_WHERE_IN_PARA, 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