【新增】根据不同的用户类型,查询不同的专业数据

This commit is contained in:
任维炳
2025-04-24 14:42:04 +08:00
parent 9179cfe989
commit 0b2829f40d
5 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package pc.exam.pp.module.exam.controller.admin.specialty.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 专业列表 Request VO")
@Data
public class SpecialtListByUserReqVo {
@Schema(description = "用户类型", example = "xxxx")
private String userType;
}

View File

@@ -1,11 +1,13 @@
package pc.exam.pp.module.exam.dal.mysql.specialty;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import pc.exam.pp.framework.mybatis.core.mapper.BaseMapperX;
import pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtListReqVo;
import pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo;
import pc.exam.pp.module.exam.dal.dataobject.specialty.ExamSpecialty;
import java.util.List;
import java.util.Set;
/**
* 客户端Mapper接口
@@ -40,6 +42,20 @@ public interface ExamSpecialtyMapper extends BaseMapperX<ExamSpecialty>
*/
public List<SpecialtyQueryVo> selectExamSpecialtyListVo(SpecialtListReqVo reqVo);
/**
* 查询所有数据信息
*
* @return 数据集合
*/
public List<SpecialtyQueryVo> selectExamSpecialtyAll();
/**
* 通过ID查询数据数据信息
*
* @return 数据集合
*/
public List<SpecialtyQueryVo> selectExamSpecialtyByids(@Param("ids") Set<Long> ids);
/**
* 查询部分数据信息
*

View File

@@ -28,6 +28,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectExamSpecialtyAll" resultType="pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo">
select sp_id as id, sp_name as name, parent_id, status, create_time from exam_specialty where deleted = 0 and status = 0
</select>
<select id="selectExamSpecialtyByids" resultType="pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo">
SELECT sp_id AS id, sp_name AS name, parent_id, status, create_time from exam_specialty
WHERE sp_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
AND deleted = 0 and status = 0
</select>
<select id="selectExamSpecialtyPart" resultType="pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo">
select sp_id as id, sp_name as name, parent_id, status, create_time
FROM exam_specialty

View File

@@ -6,7 +6,10 @@ import pc.exam.pp.framework.common.enums.CommonStatusEnum;
import pc.exam.pp.framework.common.pojo.CommonResult;
import pc.exam.pp.framework.common.pojo.PageParam;
import pc.exam.pp.framework.common.pojo.PageResult;
import pc.exam.pp.framework.common.util.object.BeanUtils;
import pc.exam.pp.framework.excel.core.util.ExcelUtils;
import pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtListByUserReqVo;
import pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo;
import pc.exam.pp.module.exam.dal.dataobject.classs.ClassDO;
import pc.exam.pp.module.exam.service.classs.ClassService;
import pc.exam.pp.module.system.controller.admin.user.vo.user.*;
@@ -232,4 +235,13 @@ public class UserController {
return success(userService.importUserList(list, updateSupport));
}
@GetMapping("/getSpeciatListByUser")
@Operation(summary = "获取专业信息,判断用户类型")
public CommonResult<List<SpecialtyQueryVo>> getListByUser() {
List<SpecialtyQueryVo> list = userService.getListByUser();
return success(BeanUtils.toBean(list, SpecialtyQueryVo.class));
}
}

View File

@@ -3,6 +3,8 @@ package pc.exam.pp.module.system.service.user;
import cn.hutool.core.collection.CollUtil;
import pc.exam.pp.framework.common.pojo.PageResult;
import pc.exam.pp.framework.common.util.collection.CollectionUtils;
import pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtListByUserReqVo;
import pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo;
import pc.exam.pp.module.system.controller.admin.auth.vo.AuthRegisterReqVO;
import pc.exam.pp.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
import pc.exam.pp.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO;
@@ -256,5 +258,11 @@ public interface AdminUserService {
* @return 是否匹配
*/
boolean isPasswordMatch(String rawPassword, String encodedPassword);
/**
* 获取专业信息,判断用户类型
*
* @return 全部信息集合
*/
List<SpecialtyQueryVo> getListByUser();
}