dev
This commit is contained in:
parent
01a8237bb0
commit
c0e343a34c
|
|
@ -84,15 +84,18 @@ public class SocialDiagnoseService extends BaseService {
|
|||
*/
|
||||
public List<SocialDiagnose> getDiagnosis(String keyword) {
|
||||
QueryWrapper<SocialDiagnose> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.select("*,CHAR_LENGTH(name) as name_length");
|
||||
if (keyword != null && !keyword.isEmpty()) {
|
||||
String key = keyword.trim().toUpperCase();
|
||||
|
||||
queryWrapper.and(wrapper -> wrapper.like("name", key)
|
||||
.or().like("code", key)
|
||||
.or().like("pinyin_full", key)
|
||||
.or().like("pinyin_first", key));
|
||||
}
|
||||
queryWrapper.orderByDesc("use_num","id");
|
||||
queryWrapper.orderByDesc("use_num");
|
||||
queryWrapper.orderByAsc("name_length");
|
||||
queryWrapper.orderByDesc("id");
|
||||
queryWrapper.last("limit 60");
|
||||
return socialDiagnoseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue