TestDao.java
2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.example.dahua.dao;
import com.example.dahua.bean.QuestionBean;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
@Mapper
public interface TestDao {
@Insert("insert into TK_QuestionStem values(#{QuestionStem},#{State},#{Intime})")
int addQuestionStem(@Param("QuestionStem")String QuestionStem,@Param("State")String State,@Param("Intime")String Intime);
@Insert("insert into TK_Question(Question,Qtype,Answer,CorrectAnswer,Analysis,State,Intime,ExamineFlag,ExamineUserId,CreateUserId,SubjectId,SchoolId,DifficulteId,KnowledgeId,ChapterId,GradeId,SourceId,OrderId,SId," +
"StemId,AutomaticCorrection,PkgId,PkgType) " +
"values(#{Question},#{Qtype},#{Answer},#{CorrectAnswer},#{Analysis},#{State},#{Intime},#{ExamineFlag},#{ExamineUserId}" +
",#{CreateUserId},#{SubjectId},#{SchoolId},#{DifficulteId},#{KnowledgeId},#{ChapterId},#{GradeId},#{SourceId},#{OrderId},#{SId}" +
",#{StemId},#{AutomaticCorrection},#{PkgId},#{PkgType})")
int addQuestion(@Param("Question")String Question,@Param("Qtype")String Qtype,@Param("Answer")String Answer,@Param("CorrectAnswer")String CorrectAnswer
,@Param("Analysis")String Analysis,@Param("State")String State,@Param("Intime")String Intime,@Param("ExamineFlag")String ExamineFlag,@Param("ExamineUserId")String ExamineUserId
,@Param("CreateUserId")String CreateUserId,@Param("SubjectId")String SubjectId,@Param("SchoolId")String SchoolId,@Param("DifficulteId")String DifficulteId,@Param("KnowledgeId")String KnowledgeId
,@Param("ChapterId")String ChapterId,@Param("GradeId")String GradeId,@Param("SourceId")String SourceId,@Param("OrderId")String OrderId,@Param("SId")String SId
,@Param("StemId")String StemId,@Param("AutomaticCorrection")String AutomaticCorrection,@Param("PkgId")String PkgId,@Param("PkgType")String PkgType);
@Select("select Top(1) ID from TK_QuestionStem order by Intime desc ")
int getStemId();
@Select("select * from TK_Question where SchoolId = 59 and ID > 16488 and ID < 17000 order by ID desc")
List<QuestionBean> getQuestions();
@Select("select * from TK_Question where Question like #{Question}")
List<QuestionBean> getQuestionsWithQuestion(@Param("Question")String Question);
@Update("update TK_Question set Question = #{Question} where ID = #{id}")
void updateQuestion(@Param("Question") String Question,@Param("id")String id);
}