Commit 04591073 by yangyang

删除图片提交

parent f31df323
......@@ -4,6 +4,7 @@ import com.exam.entity.PaperPhoto;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
......@@ -14,4 +15,7 @@ public interface PaperPhotoMapper {
@Delete("delete from paper_photo where paperId = #{paperId} and questionType = #{questionType} and questionId = #{questionId}")
int deletePaperPhoto(PaperPhoto paperPhoto);
@Delete("delete from paper_photo where questionid = #{questionid} and questionType = #{questionType} and paperid = (select paperid from exam_manage where type = #{subject})")
int deletePaperPhotoAll(@Param("questionid") String questionid, @Param("questionType") String questionType, @Param("subject") String subject);
}
......@@ -34,10 +34,13 @@ public class AnswerServiceImpl implements AnswerService {
public int deleteQuestion(String questionid, String tablename, String subject) {
int flag = answerMapper.deleteQuestion(questionid,tablename);
if(flag>0){
// 中间表删除
answerMapper.deletePaperManage(questionid,getQuestionType(tablename),subject);
// 照片库删除
paperPhotoMapper.deletePaperPhotoAll(questionid,getQuestionType(tablename),subject);
return 1;
}
return 0;
return flag;
}
@Override
......
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