Merge remote-tracking branch 'origin/main'

main
王宇航 2024-08-13 09:44:51 +08:00
commit d291747dde
4 changed files with 30 additions and 1 deletions

View File

@ -67,6 +67,8 @@ public interface AppUserMapper
AppUser selectAppUserByPhone(@Param("phoneNumber") String phoneNumber);
List<AppUserDataVo> selectList(AppUser appUser);
List<AppUserDataVo> selectListByName(AppUser appUser);
List<Long> listByOrderTime();
void updateAppUserById();

View File

@ -172,6 +172,9 @@ public class AppRegisterServiceImpl implements IAppRegisterService {
appUser.setProvinceId(appRegister.getProvinceId() != null ? appRegister.getProvinceId() : null);
appUser.setCityId(appRegister.getCityId() != null ? appRegister.getCityId() : null);
appUser.setTownId(appRegister.getTownId() != null ? appRegister.getTownId() : null);
appUser.setJx("[]");
appUser.setHy("[]");
appUser.setJy("[]");
appUserMapper.insertAppUser(appUser);
if (org.apache.commons.lang3.StringUtils.isNotBlank(appRegister.getInvitationCode())) {
AppCode appCode = appCodeMapper.selectAppCodeByCode(appRegister.getInvitationCode());

View File

@ -279,7 +279,15 @@ public class AppUserServiceImpl implements IAppUserService {
entity.setSchool(appUser.getSchool());
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);
if (schoolList.size() > limit) {
schoolList = schoolList.subList(0, limit);

View File

@ -236,6 +236,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by a.id
</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
a.id