#####登录相关


#####类别相关

GET_ALL_TYPES = SELECT * FROM tb_OnLineExam_Type
GET_TYPE_BY_ID = SELECT * FROM tb_OnLineExam_Type WHERE ID = ?
GET_TYPE_BY_NAME_EXACTLY = SELECT * FROM tb_OnLineExam_Type WHERE Name = ?


#####科目相关

GET_ALL_COURSES = SELECT * FROM tb_OnLineExam_Course
GET_COURSE_BY_ID = SELECT * FROM tb_OnLineExam_Course WHERE ID = ?
GET_COURSE_BY_NAME_EXACTLY = SELECT * FROM tb_OnLineExam_Course WHERE Name = ?
GET_COURSES_BY_NAME = SELECT * FROM tb_OnLineExam_Course WHERE Name LIKE ?
GET_COURSES_BY_TYPE_ID = SELECT * FROM tb_OnLineExam_Course WHERE TypeID = ?
ADD_COURSE = INSERT INTO tb_OnLineExam_Course (Name, TypeID, Description) VALUES (?, ?, ?)
UPDATE_COURSE = UPDATE tb_OnLineExam_Course SET Name = ?, TypeID = ?, Description = ? WHERE ID = ?


#####场次相关

GET_ALL_EXAMS = SELECT * FROM tb_OnLineExam_Exam
GET_EXAM_BY_ID = SELECT * FROM tb_OnLineExam_Exam WHERE ID = ?
GET_EXAM_BY_NAME_EXACTLY = SELECT * FROM tb_OnLineExam_Exam WHERE Name = ?
GET_EXAMS_BY_NAME = SELECT * FROM tb_OnLineExam_Exam WHERE Name LIKE ?
GET_EXAMS_BY_COURSE_ID = SELECT * FROM tb_OnLineExam_Exam WHERE CourseID = ?
ADD_EXAM = INSERT INTO tb_OnLineExam_Exam (Name, CourseID, FillingNum, SingleNum, MultiNum, JudgeNum, FillingScore, SingleScore, MultiScore, JudgeScore, TimeOut, Status, DateTime, Organizer, Description) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
UPDATE_EXAM = UPDATE tb_OnLineExam_Exam SET Name = ?, CourseID = ?, FillingNum = ?, SingleNum = ?, MultiNum = ?, JudgeNum = ?, FillingScore = ?, SingleScore = ?, MultiScore = ?, JudgeScore = ?, TimeOut = ?, Status = ?, DateTime = ?, Organizer = ?, Description = ? WHERE ID = ?
DELETE_EXAM_BY_ID = DELETE FROM tb_OnLineExam_Exam WHERE ID = ?
DELETE_EXAM_BY_COURSE_ID = DELETE FROM tb_OnLineExam_Exam WHERE CourseID = ?
GET_COURSE_ID_BY_EXAM_ID = SELECT CourseID FROM tb_OnLineExam_Exam WHERE ID = ?


#####试题相关

###填空
GET_ALL_FILLING_PROBLEMS = SELECT * FROM tb_OnLineExam_FillingProblem
GET_FILLING_PROBLEM_BY_ID = SELECT * FROM tb_OnLineExam_FillingProblem WHERE ID = ?
GET_FILLING_PROBLEMS_BY_KEY_WORD = SELECT * FROM tb_OnLineExam_FillingProblem WHERE Question LIKE ? OR OptionA LIKE ? OR OptionB LIKE ? OR OptionC LIKE ? OR OptionD LIKE ? OR Answer LIKE ?
GET_FILLING_PROBLEMS_BY_COURSE_ID = SELECT * FROM tb_OnLineExam_FillingProblem WHERE CourseID = ?
ADD_FILLING_PROBLEM = INSERT INTO tb_OnLineExam_FillingProblem (CourseID, Question, OptionA, OptionB, OptionC, OptionD, Answer, TotalTimes, ErrorTimes, Description) VALUES (?, ?, ?, ?, ?, ?, ?, 0, 0, ?)
IS_EXISTENT_FILLING_PROBLEM = SELECT * FROM tb_OnLineExam_FillingProblem WHERE Question = ? AND OptionA = ? AND OptionB = ? AND OptionC = ? AND OptionD = ? AND Answer = ?
DELETE_FILLING_PROBLEM_BY_ID = DELETE FROM tb_OnLineExam_FillingProblem WHERE ID = ?
DELETE_FILLING_PROBLEMS_BY_COURSE_ID = DELETE FROM tb_OnLineExam_FillingProblem WHERE CourseID = ?

###单选
GET_ALL_SINGLE_PROBLEMS = SELECT * FROM tb_OnLineExam_SingleProblem
GET_SINGLE_PROBLEM_BY_ID = SELECT * FROM tb_OnLineExam_SingleProblem WHERE ID = ?
GET_SINGLE_PROBLEMS_BY_KEY_WORD = SELECT * FROM tb_OnLineExam_SingleProblem WHERE Question LIKE ? OR OptionA LIKE ? OR OptionB LIKE ? OR OptionC LIKE ? OR OptionD LIKE ? OR Answer LIKE ?
GET_SINGLE_PROBLEMS_BY_COURSE_ID = SELECT * FROM tb_OnLineExam_SingleProblem WHERE CourseID = ?
ADD_SINGLE_PROBLEM = INSERT INTO tb_OnLineExam_SingleProblem (CourseID, Question, OptionA, OptionB, OptionC, OptionD, Answer, TotalTimes, ErrorTimes, Description) VALUES (?, ?, ?, ?, ?, ?, ?, 0, 0, ?)
IS_EXISTENT_SINGLE_PROBLEM = SELECT * FROM tb_OnLineExam_SingleProblem WHERE Question = ? AND OptionA = ? AND OptionB = ? AND OptionC = ? AND OptionD = ? AND Answer = ?
DELETE_SINGLE_PROBLEM_BY_ID = DELETE FROM tb_OnLineExam_SingleProblem WHERE ID = ?
DELETE_SINGLE_PROBLEMS_BY_COURSE_ID = DELETE FROM tb_OnLineExam_SingleProblem WHERE CourseID = ?

###多选
GET_ALL_MULTI_PROBLEMS = SELECT * FROM tb_OnLineExam_MultiProblem
GET_MULTI_PROBLEM_BY_ID = SELECT * FROM tb_OnLineExam_MultiProblem WHERE ID = ?
GET_MULTI_PROBLEMS_BY_KEY_WORD = SELECT * FROM tb_OnLineExam_MultiProblem WHERE Question LIKE ? OR OptionA LIKE ? OR OptionB LIKE ? OR OptionC LIKE ? OR OptionD LIKE ? OR Answer LIKE ?
GET_MULTI_PROBLEMS_BY_COURSE_ID = SELECT * FROM tb_OnLineExam_MultiProblem WHERE CourseID = ?
ADD_MULTI_PROBLEM = INSERT INTO tb_OnLineExam_MultiProblem (CourseID, Question, OptionA, OptionB, OptionC, OptionD, Answer, TotalTimes, ErrorTimes, Description) VALUES (?, ?, ?, ?, ?, ?, ?, 0, 0, ?)
IS_EXISTENT_MULTI_PROBLEM = SELECT * FROM tb_OnLineExam_MultiProblem WHERE Question = ? AND OptionA = ? AND OptionB = ? AND OptionC = ? AND OptionD = ? AND Answer = ?
DELETE_MULTI_PROBLEM_BY_ID = DELETE FROM tb_OnLineExam_MultiProblem WHERE ID = ?
DELETE_MULTI_PROBLEMS_BY_COURSE_ID = DELETE FROM tb_OnLineExam_MultiProblem WHERE CourseID = ?

###判断
GET_ALL_JUDGE_PROBLEMS = SELECT * FROM tb_OnLineExam_JudgeProblem
GET_JUDGE_PROBLEM_BY_ID = SELECT * FROM tb_OnLineExam_JudgeProblem WHERE ID = ?
GET_JUDGE_PROBLEMS_BY_KEY_WORD = SELECT * FROM tb_OnLineExam_JudgeProblem WHERE Question LIKE ? OR Answer LIKE ?
GET_JUDGE_PROBLEMS_BY_COURSE_ID = SELECT * FROM tb_OnLineExam_JudgeProblem WHERE CourseID = ?
ADD_JUDGE_PROBLEM = INSERT INTO tb_OnLineExam_JudgeProblem (CourseID, Question, Answer, TotalTimes, ErrorTimes, Description) VALUES (?, ?, ?, 0, 0, ?)
IS_EXISTENT_JUDGE_PROBLEM = SELECT * FROM tb_OnLineExam_JudgeProblem WHERE Question = ? AND Answer = ?
DELETE_JUDGE_PROBLEM_BY_ID = DELETE FROM tb_OnLineExam_JudgeProblem WHERE ID = ?
DELETE_JUDGE_PROBLEMS_BY_COURSE_ID = DELETE FROM tb_OnLineExam_JudgeProblem WHERE CourseID = ?


#####练习相关



#####成绩相关
GET_ALL_SCORE = SELECT * FROM tb_OnLineExam_Score
DELETE_SCORE_BY_EXAM_ID = DELETE FROM tb_OnLineExam_Score WHERE ExamID = ?


#####其他


#####测试
GET_TEST = SELECT Id FROM tb_exam_fillingproblem TABLESAMPLE SYSTEM (2 PERCENT)

#####数据库表名
#tb_OnLineExam_Course
#tb_OnLineExam_Exam
#tb_OnLineExam_Score
#tb_OnLineExam_Type
#tb_OnLineExam_FillingProblem
#tb_OnLineExam_SingleProblem
#tb_OnLineExam_MultiProblem
#tb_OnLineExam_JudgeProblem