list根据字段转map
//(key1, key2) -> key1 表示重复key的话 用旧的key
List<Field> list = new ArrayList<>();
Map<String,Field> map= Arrays.stream(list).collect(Collectors.toMap(Field::getName, Function.identity(),(key1, key2) -> key1));
list根据分隔符转string
StringUtils.join(intList,"|")
获取mybatis执行的sql
@Component
public class DoPageUtil {
@Autowired
private SqlSessionFactory sqlSessionFactory;
public String getRunsql(String mapperLocation, Object parameterObject) {
return sqlSessionFactory.getConfiguration().getMappedStatement(mapperLocation).getBoundSql(parameterObject).getSql();
}
}