Commit 78e69e5f authored by 李博今's avatar 李博今

新增删除班级的条件判断

parent 02756908
...@@ -224,6 +224,9 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -224,6 +224,9 @@ public class BLessonServiceImpl implements BLessonService {
if(bSlRepository.selectslNumByLesson(id)>0) { if(bSlRepository.selectslNumByLesson(id)>0) {
throw new ServiceException(ResultServiceEnums.LESSON_HAS_SL); throw new ServiceException(ResultServiceEnums.LESSON_HAS_SL);
} }
if(bSlRepository.isUse(id) > 0){
throw new ServiceException(ResultServiceEnums.LESSON_HAS_SL);
}
BLesson bLesson = new BLesson(); BLesson bLesson = new BLesson();
bLesson.setBusinessId(id); bLesson.setBusinessId(id);
bLesson.setDeleted(); bLesson.setDeleted();
......
...@@ -265,5 +265,7 @@ public interface BSlRepository extends BaseMapper<BSl> { ...@@ -265,5 +265,7 @@ public interface BSlRepository extends BaseMapper<BSl> {
int updateTeacher(@Param("businessId") String businessId, @Param("teacherCode") String teacherCode); int updateTeacher(@Param("businessId") String businessId, @Param("teacherCode") String teacherCode);
//List<BStudent> querySlStudentByPagination(String slId); //List<BStudent> querySlStudentByPagination(String slId);
@Select("SELECT count(*) from b_schedule_dto where lesson_code = (select lesson_code from b_lesson where business_id = #{lessonId}) and del_flag = 0")
int isUse(String lessonId);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment