From 520f2f0e0a443965ba88d04e476c4f7b9047e2a9 Mon Sep 17 00:00:00 2001 From: dlaren Date: Thu, 7 Aug 2025 15:12:44 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=20?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E7=8E=AF=E5=A2=83=E6=A0=B9=E6=8D=AE=E8=AF=95?= =?UTF-8?q?=E5=8D=B7=E6=96=B9=E6=A1=88=E8=87=AA=E5=8A=A8=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/app/AppCheckController.java | 45 +++++- .../specialty/ExamSpecialtyController.java | 9 +- .../paper/EducationPaperSchemeMapper.java | 5 +- .../mysql/specialty/ExamSpecialtyMapper.java | 4 +- .../EducationPaperSchemeServiceImpl.java | 24 ++- .../paper/IEducationPaperSchemeService.java | 2 + .../specialty/ExamSpecialtyService.java | 8 + .../specialty/ExamSpecialtyServiceImpl.java | 31 ++-- .../exam/EducationPaperSchemeMapper.xml | 76 ++++++---- .../mapper/specialty/ExamSpecialtyMapper.xml | 137 +++++++++++------- 10 files changed, 225 insertions(+), 116 deletions(-) diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/app/AppCheckController.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/app/AppCheckController.java index 7da2dc49..2725eec4 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/app/AppCheckController.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/app/AppCheckController.java @@ -4,11 +4,19 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import jakarta.annotation.security.PermitAll; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import pc.exam.pp.framework.common.pojo.CommonResult; import pc.exam.pp.framework.tenant.core.aop.TenantIgnore; +import pc.exam.pp.module.exam.dal.dataobject.EducationPaperScheme; import pc.exam.pp.module.exam.dal.dataobject.app.AppCheckDO; +import pc.exam.pp.module.exam.dal.dataobject.specialty.ExamSpecialty; import pc.exam.pp.module.exam.service.app.AppCheckService; +import pc.exam.pp.module.exam.service.paper.IEducationPaperSchemeService; +import pc.exam.pp.module.exam.service.specialty.ExamSpecialtyService; + +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import static pc.exam.pp.framework.common.pojo.CommonResult.success; @@ -25,6 +33,10 @@ public class AppCheckController { @Resource AppCheckService appCheckService; + @Autowired + IEducationPaperSchemeService educationPaperSchemeService; + @Autowired + ExamSpecialtyService examSpecialtyService; @GetMapping("/getAppCheckList/{taskId}") @PermitAll @@ -42,11 +54,42 @@ public class AppCheckController { } @GetMapping("/delete/{id}") - @PermitAll @TenantIgnore @Operation(summary = "查看学生端需要检测的APP列表", description = "查看学生端需要检测的APP列表") public CommonResult delete(@PathVariable("id") String id){ // 使用传入的IP,进行ping,查看是否存在连接,并返回信号的强度 return success(appCheckService.deleteAppCheck(id)); } + + // 根据taskId查询下面有多少题型,然后查找对应的软件环境,在新增 + @GetMapping("/getAppCheckListByTaskId/{taskId}") + public CommonResult getAppCheckListByTaskId(@PathVariable("taskId") String taskId){ + List appCheckDOList = new ArrayList<>(); + // 根据试卷方案ID查询下面试卷的试题的组成部分 + List list = educationPaperSchemeService.getInfoDataByTaskId(taskId); + for (EducationPaperScheme educationPaperScheme : list) { + String spName = educationPaperScheme.getSpName(); + // 根据题型名称查询软件环境 + List examSpecialty = examSpecialtyService.selectExamSpecialtyBySpName(spName); + if (examSpecialty != null && !examSpecialty.isEmpty()) { + ExamSpecialty exams = examSpecialty.get(0); + if (exams.getRoles() != null && !exams.getRoles().isEmpty()) { + AppCheckDO appCheckDO = new AppCheckDO(); + appCheckDO.setTaskId(taskId); + appCheckDO.setAppName(exams.getRoles()); + // 判断是否在数组中存在 + boolean exists = appCheckDOList.contains(appCheckDO); + if (!exists) { + appCheckDOList.add(appCheckDO); + } + } + } + } + // 添加 + for (AppCheckDO appCheckDO : appCheckDOList) { + appCheckService.insertAppCheck(appCheckDO); + } + return success(true); + } + } diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/specialty/ExamSpecialtyController.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/specialty/ExamSpecialtyController.java index 84056a83..f3c4f22a 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/specialty/ExamSpecialtyController.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/specialty/ExamSpecialtyController.java @@ -29,7 +29,7 @@ import static pc.exam.pp.framework.common.pojo.CommonResult.success; */ @RestController @RequestMapping("/exam/specialty") -public class ExamSpecialtyController{ +public class ExamSpecialtyController { @Autowired private ExamSpecialtyService examSpecialtyService; @Autowired @@ -49,6 +49,7 @@ public class ExamSpecialtyController{ List list = examSpecialtyService.selectExamSpecialtyPart(); return success(BeanUtils.toBean(list, SpecialtyQueryVo.class)); } + /** * 获取全部数据详细信息 */ @@ -156,6 +157,7 @@ public class ExamSpecialtyController{ } return success(examSpecialtyService.deleteExamSpecialtyBySpIds(spIds)); } + @PostMapping("/setRole") public CommonResult setRole(@RequestBody SpecialRolesVo specialRolesVo) { System.out.println(specialRolesVo); @@ -164,10 +166,11 @@ public class ExamSpecialtyController{ examSpecialtyService.updateExamSpecialty(examSpecialty); return success("设置成功"); } + @GetMapping(value = "/getRole/{id}") public CommonResult getRole(@PathVariable("id") String id) { - String roles= examSpecialtyService.getRoleById(id); - if(roles!=null){ + String roles = examSpecialtyService.getRoleById(id); + if (roles != null) { return success(Integer.parseInt(roles)); } return success(""); diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperSchemeMapper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperSchemeMapper.java index dcc22723..0367ffb0 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperSchemeMapper.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/paper/EducationPaperSchemeMapper.java @@ -14,8 +14,7 @@ import java.util.List; * @date 2025-04-15 */ @Mapper -public interface EducationPaperSchemeMapper -{ +public interface EducationPaperSchemeMapper { /** * 查询试卷方案 * @@ -66,6 +65,7 @@ public interface EducationPaperSchemeMapper /** * 根据试卷任务id查询 试卷方案集合 + * * @param taskid * @return */ @@ -73,6 +73,7 @@ public interface EducationPaperSchemeMapper /** * 批量插入 试卷方案 + * * @param educationPaperSchemeList */ void insertEducationPaperSchemeList(List educationPaperSchemeList); diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/specialty/ExamSpecialtyMapper.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/specialty/ExamSpecialtyMapper.java index 7fe36bda..619fe71b 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/specialty/ExamSpecialtyMapper.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/dal/mysql/specialty/ExamSpecialtyMapper.java @@ -30,7 +30,9 @@ public interface ExamSpecialtyMapper extends BaseMapperX * @param spId 数据主键 * @return 数据信息 */ - public ExamSpecialty selectExamSpecialtyBySpId(Long spId); + ExamSpecialty selectExamSpecialtyBySpId(Long spId); + + List selectExamSpecialtyBySpName(String spName); /** * 查询数据parentId * diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperSchemeServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperSchemeServiceImpl.java index 54779f9f..2f5d7455 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperSchemeServiceImpl.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperSchemeServiceImpl.java @@ -17,8 +17,7 @@ import java.util.stream.Collectors; * @date 2025-04-15 */ @Service -public class EducationPaperSchemeServiceImpl implements IEducationPaperSchemeService -{ +public class EducationPaperSchemeServiceImpl implements IEducationPaperSchemeService { @Autowired private EducationPaperSchemeMapper educationPaperSchemeMapper; @@ -29,8 +28,7 @@ public class EducationPaperSchemeServiceImpl implements IEducationPaperSchemeSer * @return 试卷方案 */ @Override - public EducationPaperScheme selectEducationPaperSchemeBySchemeId(String schemeId) - { + public EducationPaperScheme selectEducationPaperSchemeBySchemeId(String schemeId) { return educationPaperSchemeMapper.selectEducationPaperSchemeBySchemeId(schemeId); } @@ -41,8 +39,7 @@ public class EducationPaperSchemeServiceImpl implements IEducationPaperSchemeSer * @return 试卷方案 */ @Override - public List selectEducationPaperSchemeList(EducationPaperScheme educationPaperScheme) - { + public List selectEducationPaperSchemeList(EducationPaperScheme educationPaperScheme) { return educationPaperSchemeMapper.selectEducationPaperSchemeList(educationPaperScheme); } @@ -56,7 +53,6 @@ public class EducationPaperSchemeServiceImpl implements IEducationPaperSchemeSer public int insertEducationPaperScheme(EducationPaperScheme educationPaperScheme) { - String uuid = IdUtils.simpleUUID(); educationPaperScheme.setSchemeId(uuid); @@ -85,8 +81,7 @@ public class EducationPaperSchemeServiceImpl implements IEducationPaperSchemeSer * @return 结果 */ @Override - public int updateEducationPaperScheme(EducationPaperScheme educationPaperScheme) - { + public int updateEducationPaperScheme(EducationPaperScheme educationPaperScheme) { // // 将 List 转换为逗号分隔的字符串 // List keyword = educationPaperScheme.getKeyword(); @@ -110,8 +105,7 @@ public class EducationPaperSchemeServiceImpl implements IEducationPaperSchemeSer * @return 结果 */ @Override - public int deleteEducationPaperSchemeBySchemeIds(String[] schemeIds) - { + public int deleteEducationPaperSchemeBySchemeIds(String[] schemeIds) { return educationPaperSchemeMapper.deleteEducationPaperSchemeBySchemeIds(schemeIds); } @@ -122,8 +116,7 @@ public class EducationPaperSchemeServiceImpl implements IEducationPaperSchemeSer * @return 结果 */ @Override - public int deleteEducationPaperSchemeBySchemeId(String schemeId) - { + public int deleteEducationPaperSchemeBySchemeId(String schemeId) { return educationPaperSchemeMapper.deleteEducationPaperSchemeBySchemeId(schemeId); } @@ -131,5 +124,10 @@ public class EducationPaperSchemeServiceImpl implements IEducationPaperSchemeSer public int selectEducationPaperSchemeCountsByTaskId(String taskId) { return educationPaperSchemeMapper.selectEducationPaperSchemeCountsByTaskId(taskId); } + + @Override + public List getInfoDataByTaskId(String taskId) { + return educationPaperSchemeMapper.selectEducationPaperTaskByTaskId(taskId); + } } diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperSchemeService.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperSchemeService.java index 0b3aaed7..cea0786a 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperSchemeService.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/IEducationPaperSchemeService.java @@ -63,5 +63,7 @@ public interface IEducationPaperSchemeService int selectEducationPaperSchemeCountsByTaskId(String taskId); + List getInfoDataByTaskId(String taskId); + } diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/specialty/ExamSpecialtyService.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/specialty/ExamSpecialtyService.java index 28056b2c..c24012be 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/specialty/ExamSpecialtyService.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/specialty/ExamSpecialtyService.java @@ -22,6 +22,14 @@ public interface ExamSpecialtyService */ public ExamSpecialty selectExamSpecialtyBySpId(Long spId); + /** + * 查询信息(名称) + * + * @param spName 名称 + * @return 所有信息 + */ + List selectExamSpecialtyBySpName(String spName); + /** * 查询全部信息列表 * diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/specialty/ExamSpecialtyServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/specialty/ExamSpecialtyServiceImpl.java index bac6a219..d52cda63 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/specialty/ExamSpecialtyServiceImpl.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/specialty/ExamSpecialtyServiceImpl.java @@ -30,10 +30,15 @@ public class ExamSpecialtyServiceImpl implements ExamSpecialtyService { * @return 数据信息 */ @Override - public ExamSpecialty selectExamSpecialtyBySpId(Long spId) - { + public ExamSpecialty selectExamSpecialtyBySpId(Long spId) { return examSpecialtyMapper.selectExamSpecialtyBySpId(spId); } + + @Override + public List selectExamSpecialtyBySpName(String spName) { + return examSpecialtyMapper.selectExamSpecialtyBySpName(spName); + } + /** * 查询数据信息列表 * @@ -41,8 +46,7 @@ public class ExamSpecialtyServiceImpl implements ExamSpecialtyService { * @return 数据信息 */ @Override - public List selectExamSpecialtyList(SpecialtListReqVo reqVo) - { + public List selectExamSpecialtyList(SpecialtListReqVo reqVo) { return examSpecialtyMapper.selectExamSpecialtyListVo(reqVo); } @@ -58,7 +62,7 @@ public class ExamSpecialtyServiceImpl implements ExamSpecialtyService { * @return 数据信息 */ @Override - public List selectSpIds(Long[] spIds){ + public List selectSpIds(Long[] spIds) { return examSpecialtyMapper.selectSpIds(spIds); } @@ -69,8 +73,7 @@ public class ExamSpecialtyServiceImpl implements ExamSpecialtyService { * @return 结果 */ @Override - public int insertExamSpecialty(ExamSpecialty examSpecialty) - { + public int insertExamSpecialty(ExamSpecialty examSpecialty) { // 插入部门 ExamSpecialty specialty = BeanUtils.toBean(examSpecialty, ExamSpecialty.class); return examSpecialtyMapper.insert(specialty); @@ -83,12 +86,11 @@ public class ExamSpecialtyServiceImpl implements ExamSpecialtyService { * @return 结果 */ @Override - public int updateExamSpecialty(ExamSpecialty examSpecialty) - { + public int updateExamSpecialty(ExamSpecialty examSpecialty) { // 对专业修改需判断是否已经互联 // 已互联的情况需要对知识点表也进行修改 - ExamSpecialty Specialty = examSpecialtyMapper.selectExamSpecialtyBySpId(examSpecialty.getSpId()); - if (Objects.equals(Specialty.getUnite(), "1")){ + ExamSpecialty Specialty = examSpecialtyMapper.selectExamSpecialtyBySpId(examSpecialty.getSpId()); + if (Objects.equals(Specialty.getUnite(), "1")) { // 实例化需要修改的专业 ExamKnowledgePoints knowledgePoint = new ExamKnowledgePoints(); knowledgePoint.setSpId(examSpecialty.getSpId()); @@ -105,10 +107,10 @@ public class ExamSpecialtyServiceImpl implements ExamSpecialtyService { * @return 结果 */ @Override - public int deleteExamSpecialtyBySpIds(Long[] spIds) - { + public int deleteExamSpecialtyBySpIds(Long[] spIds) { return examSpecialtyMapper.deleteExamSpecialtyBySpIds(spIds); } + /** * 删除数据信息 * @@ -116,8 +118,7 @@ public class ExamSpecialtyServiceImpl implements ExamSpecialtyService { * @return 结果 */ @Override - public int deleteExamSpecialtyBySpId(Long spId) - { + public int deleteExamSpecialtyBySpId(Long spId) { return examSpecialtyMapper.deleteExamSpecialtyBySpId(spId); } diff --git a/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/exam/EducationPaperSchemeMapper.xml b/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/exam/EducationPaperSchemeMapper.xml index 0e67069e..f7010081 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/exam/EducationPaperSchemeMapper.xml +++ b/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/exam/EducationPaperSchemeMapper.xml @@ -5,36 +5,48 @@ - - - - - - - - - - - + + + + + + + + + + + - select scheme_id, task_id,qu_title,sp_name, qu_level, keywords, point_names, qu_numbers, qu_scores, subtotal_score,sort from education_paper_scheme + select scheme_id, + task_id, + qu_title, + sp_name, + qu_level, + keywords, + point_names, + qu_numbers, + qu_scores, + subtotal_score, + sort + from education_paper_scheme - - and task_id = #{taskId} - and sp_name like concat('%', #{spName}, '%') - and qu_level = #{quLevel} - and keywords = #{keywords} - and point_names = #{pointNames} - and qu_numbers = #{quNumbers} - and qu_scores = #{quScores} - and subtotal_score = #{subtotalScore} + and task_id = #{taskId} + and sp_name like concat('%', #{spName}, '%') + and qu_level = #{quLevel} + and keywords = #{keywords} + and point_names = #{pointNames} + and qu_numbers = #{quNumbers} + and qu_scores = #{quScores} + and subtotal_score = #{subtotalScore} - order by sort asc + order by sort asc + @@ -78,10 +96,12 @@ - INSERT INTO education_paper_scheme (scheme_id, task_id, qu_title,sp_name, qu_level, keywords, point_names, qu_numbers, qu_scores, subtotal_score,sort) VALUES + INSERT INTO education_paper_scheme (scheme_id, task_id, qu_title,sp_name, qu_level, keywords, point_names, + qu_numbers, qu_scores, subtotal_score,sort) VALUES ( - #{item.schemeId}, #{item.taskId}, #{item.quTitle},#{item.spName}, #{item.quLevel}, #{item.keywords}, #{item.pointNames}, #{item.quNumbers}, #{item.quScores}, #{item.subtotalScore}, #{item.sort} + #{item.schemeId}, #{item.taskId}, #{item.quTitle},#{item.spName}, #{item.quLevel}, #{item.keywords}, + #{item.pointNames}, #{item.quNumbers}, #{item.quScores}, #{item.subtotalScore}, #{item.sort} ) @@ -95,7 +115,9 @@ - delete from education_paper_scheme where scheme_id = #{schemeId} + delete + from education_paper_scheme + where scheme_id = #{schemeId} diff --git a/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/specialty/ExamSpecialtyMapper.xml b/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/specialty/ExamSpecialtyMapper.xml index 0baea37d..44a00ad9 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/specialty/ExamSpecialtyMapper.xml +++ b/exam-module-exam/exam-module-exam-biz/src/main/resources/mapper/specialty/ExamSpecialtyMapper.xml @@ -1,49 +1,69 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - + + + + + + + + + - - - - - - - + + + + + + + - select sp_id, parent_id, ancestors, sp_name, order_num, status, creator, create_time, updater, update_time, unite, tree_num, roles,tenant_id from exam_specialty + select sp_id, + parent_id, + ancestors, + sp_name, + order_num, + status, + creator, + create_time, + updater, + update_time, + unite, + tree_num, + roles, + tenant_id + from exam_specialty - select sp_id as id, sp_name as name, parent_id, status, create_time,roles from exam_specialty - and sp_name like concat('%', #{name}, '%') - and status = #{status} + and sp_name like concat('%', #{name}, '%') + and status = #{status} and deleted = 0 - + select sp_id as id, sp_name as name, parent_id, status, create_time + from exam_specialty + where deleted = 0 + and status = 0 - + SELECT sp_id AS id, sp_name AS name, ancestors, parent_id, status, create_time from exam_specialty WHERE sp_id IN #{id} @@ -51,30 +71,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND deleted = 0 and status = 0 - select sp_id as id, sp_name as name, parent_id, status, create_time FROM exam_specialty - WHERE - ( - LENGTH(ancestors) - LENGTH(REPLACE(ancestors, ',', '')) - ) + 1 <= 2 and status = 0 and deleted = 0 + WHERE ( + LENGTH(ancestors) - LENGTH(REPLACE(ancestors, ',', '')) + ) + 1 <= 2 + and status = 0 + and deleted = 0 - + SELECT * + from exam_specialty + where sp_name = #{spName} + + + @@ -155,7 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" deleted = 1 - where sp_id = #{spId} + where sp_id = #{spId} @@ -163,7 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" deleted = 1 - where sp_id in + where sp_id in #{spId}