原数据库内容
需要把逗号拼接的字符串内容进行去重
变成如下
直接贴代码
select distinct substring_index(substring_index(a.software_str ,',',b.help_topic_id+1),',',-1) as name
from
user a
join
mysql.help_topic b
on b.help_topic_id < (length(a.software_str) - length(replace(a.software_str,',',''))+1)
后因涉及到分页问题,需要list转page
可直接参考此Po
list转page
代码参考如下
int start = (int)pageable.getOffset();
int end = (start + pageable.getPageSize()) > list.size() ? list.size() : ( start + pageable.getPageSize());
Page<String> klassPage =new PageImpl<String>(list.subList(start, end), pageable, list.size());