fix:add param for ConfigInfoMapperByMySql#findAllConfigInfoBaseFetchRows (#11883)

* fix:add param for ConfigInfoMapperByMySql#findAllConfigInfoBaseFetchRows

* fix:code style modify

* fix:code style modify

* fix:code style modify

---------

Co-authored-by: zhangyang <1445621702@qq.com>
This commit is contained in:
tangmingyao 2024-04-02 11:36:29 +08:00 committed by GitHub
parent 19a857b701
commit facf4c8270
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -85,8 +85,8 @@ public class ConfigInfoMapperByMySql extends AbstractMapper implements ConfigInf
@Override
public MapperResult findAllConfigInfoBaseFetchRows(MapperContext context) {
String sql = "SELECT t.id,data_id,group_id,content,md5"
+ " FROM ( SELECT id FROM config_info ORDER BY id LIMIT ?,? ) "
+ " g, config_info t WHERE g.id = t.id ";
+ " FROM ( SELECT id FROM config_info ORDER BY id LIMIT " + context.getStartRow() + ","
+ context.getPageSize() + " )" + " g, config_info t WHERE g.id = t.id ";
return new MapperResult(sql, Collections.emptyList());
}

View File

@ -143,8 +143,8 @@ public class ConfigInfoMapperByMySqlTest {
public void testFindAllConfigInfoBaseFetchRows() {
MapperResult mapperResult = configInfoMapperByMySql.findAllConfigInfoBaseFetchRows(context);
Assert.assertEquals(mapperResult.getSql(),
"SELECT t.id,data_id,group_id,content,md5 FROM ( SELECT id FROM config_info ORDER BY id LIMIT ?,?"
+ " ) g, config_info t WHERE g.id = t.id ");
"SELECT t.id,data_id,group_id,content,md5 FROM ( SELECT id FROM config_info ORDER BY id LIMIT " + context.getStartRow() + ","
+ context.getPageSize() + " ) g, config_info t WHERE g.id = t.id ");
Assert.assertArrayEquals(mapperResult.getParamList().toArray(), emptyObjs);
}