main
parent
1072c916aa
commit
a80ebf79ed
|
|
@ -67,6 +67,8 @@ public interface AppUserMapper
|
||||||
AppUser selectAppUserByPhone(@Param("phoneNumber") String phoneNumber);
|
AppUser selectAppUserByPhone(@Param("phoneNumber") String phoneNumber);
|
||||||
List<AppUserDataVo> selectList(AppUser appUser);
|
List<AppUserDataVo> selectList(AppUser appUser);
|
||||||
|
|
||||||
|
List<AppUserDataVo> selectListByName(AppUser appUser);
|
||||||
|
|
||||||
List<Long> listByOrderTime();
|
List<Long> listByOrderTime();
|
||||||
void updateAppUserById();
|
void updateAppUserById();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,15 @@ public class AppUserServiceImpl implements IAppUserService {
|
||||||
entity.setSchool(appUser.getSchool());
|
entity.setSchool(appUser.getSchool());
|
||||||
entity.setSearch(appUser.getSearch());
|
entity.setSearch(appUser.getSearch());
|
||||||
// 学校
|
// 学校
|
||||||
List<AppUserDataVo> schoolList = appUserMapper.selectList(entity);
|
List<AppUserDataVo> schoolList = new ArrayList<>();
|
||||||
|
if (StringUtils.isBlank(appUser.getSearch())) {
|
||||||
|
schoolList = appUserMapper.selectList(entity);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(appUser.getSearch())) {
|
||||||
|
AppUser user = new AppUser();
|
||||||
|
user.setSearch(appUser.getSearch());
|
||||||
|
schoolList = appUserMapper.selectListByName(user);
|
||||||
|
}
|
||||||
Collections.shuffle(schoolList);
|
Collections.shuffle(schoolList);
|
||||||
if (schoolList.size() > limit) {
|
if (schoolList.size() > limit) {
|
||||||
schoolList = schoolList.subList(0, limit);
|
schoolList = schoolList.subList(0, limit);
|
||||||
|
|
|
||||||
|
|
@ -236,6 +236,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
group by a.id
|
group by a.id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectListByName" parameterType="AppUser" resultType="com.ruoyi.app.domain.vo.AppUserDataVo">
|
||||||
|
select
|
||||||
|
<include refid="appUserColumns"/>,
|
||||||
|
s.name as "schoolName",
|
||||||
|
count(f.user_id) as "fansNum",
|
||||||
|
a.id as "userId"
|
||||||
|
from app_user a
|
||||||
|
left join app_school s on s.id = a.school
|
||||||
|
left join app_user_fans f on f.user_id = a.id
|
||||||
|
<where>
|
||||||
|
a.username like concat('%', #{search}, '%')
|
||||||
|
or a.nickname like concat('%', #{search}, '%')
|
||||||
|
</where>
|
||||||
|
group by a.id
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="listByOrderTime" resultType="java.lang.Long">
|
<select id="listByOrderTime" resultType="java.lang.Long">
|
||||||
select
|
select
|
||||||
a.id
|
a.id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue