Browse Source

班级组织:科目删除接口

zhaoy 7 years ago
parent
commit
8ff6fb80c4

+ 5 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/controller/ClassController.java

@@ -36,4 +36,9 @@ public class ClassController {
         return Result.success();
     }
 
+    @PostMapping("/deleteDetail/{id}")
+    public Result deleteDetail(@PathVariable("id") Long id) {
+        classService.deleteDetail(id);
+        return Result.success();
+    }
 }

+ 2 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/ClassService.java

@@ -9,4 +9,6 @@ public interface ClassService {
     DocBaseDTO saveFormData(ClassForm form);
 
     void delete(Long id);
+
+    void deleteDetail(Long id);
 }

+ 12 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/ClassServiceImpl.java

@@ -7,7 +7,11 @@ import com.usoftchina.smartschool.school.dto.DocBaseDTO;
 import com.usoftchina.smartschool.school.exception.BizExceptionCode;
 import com.usoftchina.smartschool.school.mapper.SysClazzMapper;
 import com.usoftchina.smartschool.school.mapper.SysStudentMapper;
-import com.usoftchina.smartschool.school.po.*;
+import com.usoftchina.smartschool.school.mapper.SysTeacherMapper;
+import com.usoftchina.smartschool.school.po.ClassForm;
+import com.usoftchina.smartschool.school.po.SysClazz;
+import com.usoftchina.smartschool.school.po.SysStudent;
+import com.usoftchina.smartschool.school.po.SysTeacherClazz;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -26,6 +30,8 @@ public class ClassServiceImpl implements ClassService{
     private SysClazzMapper sysClazzMapper;
     @Autowired
     private SysStudentMapper sysStudentMapper;
+    @Autowired
+    private SysTeacherMapper sysTeacherMapper;
 
     @Override
     public ClassForm getFormdata(Long id) {
@@ -125,4 +131,9 @@ public class ClassServiceImpl implements ClassService{
         sysClazzMapper.deleteByPrimaryKey(id);
         sysStudentMapper.deleteTeacher(id);
     }
+
+    @Override
+    public void deleteDetail(Long id) {
+        sysTeacherMapper.deleteDetail(id);
+    }
 }

+ 2 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysTeacherMapper.java

@@ -42,4 +42,6 @@ public interface SysTeacherMapper {
     int checkTeacher(@Param("teacher_id") Long teacher_id);
 
     Integer checkTeacherSubjects(@Param("clazz_id") Long clazz_id);
+
+    void deleteDetail(@Param("teacher_clazz_id") Long teacher_clazz_id);
 }

+ 4 - 0
applications/school/school-server/src/main/resources/mapper/SysTeacherMapper.xml

@@ -402,4 +402,8 @@ where sys_teacher_clazz.teacher_id=#{id}
   <select id="checkTeacherSubjects" parameterType="long" resultType="Integer">
     select count(*) from sys_teacher_clazz where  clazz_id= #{clazz_id}
   </select>
+
+  <delete id="deleteDetail">
+    DELETE FROM sys_teacher_clazz where teacher_clazz_id = #{teacher_clazz_id}
+  </delete>
 </mapper>