@Test
public void test02() {
QueryWrapper<Result> queryWrapper = new QueryWrapper<>();
queryWrapper.select(Result.ID);
String param = "' and (select * from (select sleep(5)) a) ='";
String format = String.format(" %s REGEXP CONCAT('(',REPLACE('%s',',','|'),')') ",
Result.HIT_MIND_LABEL, param);
System.out.println(format);
queryWrapper.apply(format);
List<Result> list = resultService.list(queryWrapper);
System.out.println(JSON.toJSONString(list));
}
@Test
public void test03() {
System.out.println(JSON.toJSONString(resultService.list().stream().map(Result::getHitMindLabel).toArray()));
QueryWrapper<Result> queryWrapper = new QueryWrapper<>();
queryWrapper.select(Result.ID);
String param = "333,444";
queryWrapper.apply(Result.LABLE+ " REGEXP CONCAT('(',REPLACE({0},',','|'),')') ", param);
List<Result> list = resultMapper.selectList(queryWrapper);
System.out.println(JSON.toJSONString(list));
}
|