HistoryConfigInfoMapperBySqlServer 第47行语法错误,导致历史配置查看不了
tanzb2013 opened this issue · 1 comments
tanzb2013 commented
缺少一个OFFSET
chanhang commented
補充
`
public class HistoryConfigInfoMapperByPostgresql extends HistoryConfigInfoMapperByMySql {
@Override
public MapperResult removeConfigHistory(MapperContext context) {
String sql = "WITH temp_table as (SELECT id FROM his_config_info WHERE gmt_modified < ? LIMIT ? ) "
+ "DELETE FROM his_config_info WHERE id in (SELECT id FROM temp_table) ";
return new MapperResult(sql, CollectionUtils.list(context.getWhereParameter(FieldConstant.START_TIME),
context.getWhereParameter(FieldConstant.LIMIT_SIZE)));
}
@Override
public MapperResult pageFindConfigHistoryFetchRows(MapperContext context) {
String sql =
"SELECT nid,data_id,group_id,tenant_id,app_name,src_ip,src_user,op_type,gmt_create,gmt_modified FROM his_config_info "
+ "WHERE data_id = ? AND group_id = ? AND tenant_id = ? ORDER BY nid DESC LIMIT "
+ context.getPageSize() + " OFFSET " + context.getStartRow();
return new MapperResult(sql, CollectionUtils.list(context.getWhereParameter(FieldConstant.DATA_ID),
context.getWhereParameter(FieldConstant.GROUP_ID), context.getWhereParameter(FieldConstant.TENANT_ID)));
}
@Override
public String getDataSource() {
return DatabaseTypeConstant.POSTGRESQL;
}
}
`