Joburgess 5 anni fa
parent
commit
a2f6983cc0

+ 2 - 3
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamSongDao.java

@@ -4,11 +4,9 @@ import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.entity.ExamSong;
 import com.keao.edu.user.enums.SongTypeEnum;
 import org.apache.ibatis.annotations.Param;
-import org.springframework.security.core.parameters.P;
 
 import java.util.List;
 import java.util.Map;
-import java.util.Map;
 
 public interface ExamSongDao extends BaseDAO<Integer, ExamSong> {
 
@@ -27,7 +25,8 @@ public interface ExamSongDao extends BaseDAO<Integer, ExamSong> {
      * @param subjectId:
      * @return java.util.List<com.keao.edu.user.entity.ExamSong>
      */
-    List<ExamSong> getWithSubject(@Param("subjectId") Integer subjectId);
+    List<ExamSong> getWithSubject(@Param("subjectId") Integer subjectId,
+                                  @Param("tenantId") String tenantId);
 
     /**
      * @describe 根据级别和类型获取曲库

+ 2 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamSongServiceImpl.java

@@ -7,6 +7,7 @@ import com.keao.edu.common.exception.BizException;
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.page.QueryInfo;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.user.dao.ExamRegistrationDao;
 import com.keao.edu.user.dao.ExamSongDao;
 import com.keao.edu.user.entity.ExamSong;
@@ -71,7 +72,7 @@ public class ExamSongServiceImpl extends BaseServiceImpl<Integer, ExamSong> impl
 	    if(Objects.isNull(subjectId)){
 	        throw new BizException("请选择专业");
         }
-        return examSongDao.getWithSubject(subjectId);
+        return examSongDao.getWithSubject(subjectId, TenantContextHolder.getTenantId());
     }
 
     @Override

+ 1 - 1
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamSongMapper.xml

@@ -116,7 +116,7 @@
 		SELECT * FROM exam_song WHERE FIND_IN_SET(id_,#{ids})
 	</select>
 	<select id="getWithSubject" resultMap="ExamSong">
-		SELECT * FROM exam_song WHERE FIND_IN_SET(#{subjectId}, subject_list_) AND del_flag_=0
+		SELECT * FROM exam_song WHERE FIND_IN_SET(#{subjectId}, subject_list_) AND del_flag_=0 AND tenant_id_ = #{tenantId}
 	</select>
 
     <select id="getWithLevelAndType" resultMap="ExamSong">