2 #10

Merged
pc4gok3i8 merged 1 commits from branch_LYH into main 1 year ago

@ -6,59 +6,132 @@ import com.hua.dao.DAO;
import com.hua.dao.LevelExamDAO;
import com.hua.entity.LevelExam;
/**
* `LevelExamDAOImpl`访DAO
* `DAO``LevelExamDAO`SQL
*/
public class LevelExamDAOImpl extends DAO<LevelExam> implements LevelExamDAO {
/**
*
* SQL`levelExam` `SELECT * FROM levelExam;`
* `DAO``getForList``List<LevelExam>`
* `LevelExam`
*
* @return
*/
@Override
public List<LevelExam> getAll() {
String sql = "SELECT * FROM levelExam;";
return getForList(sql);
}
/**
* ID
* SQL使`courseId``levelExam`
* `DAO``get``LevelExam`
* `null`
*
* @param courseId
* @return `null`
*/
@Override
public LevelExam get(String courseId) {
String sql = "select *from levelExam where courseId = ?";
String sql = "select *from levelExam where courseId =?";
return get(sql, courseId);
}
/**
*
* SQL`?`
* `DAO``update``update`
* `levelExam`SQL
* `levelExam`
*
* @param levelExam `LevelExam`
*/
@Override
public void insert(LevelExam levelExam) {
String sql = "insert into levelExam values(?,?,?,?,?,?)";
update(sql , levelExam.getYearTerm(), levelExam.getCourseId(), levelExam.getCourseName(),
update(sql, levelExam.getYearTerm(), levelExam.getCourseId(), levelExam.getCourseName(),
levelExam.getApplyTime(), levelExam.getExamTime(),levelExam.getExamCost());
}
/**
*
* SQL`courseId`
* `DAO``update``levelExam``courseId`SQL
*
*
* @param levelExam `LevelExam`
*/
@Override
public void update(LevelExam levelExam) {
String sql = "update levelExam set YearTerm = ?,CourseName = ?, ApplyTime = ?, " +
"ExamTime = ?, ExamCost = ? where courseId = ?";
update(sql, levelExam.getYearTerm(), levelExam.getCourseName(), levelExam.getApplyTime(),
String sql = "update levelExam set YearTerm =?,CourseName =?, ApplyTime =?, " +
"ExamTime =?, ExamCost =? where courseId =?";
update(sql, levelExam.getYearTerm(), levelExam.getCourseName(), levelExam.getApplyTime(),
levelExam.getExamTime(),levelExam.getExamCost(), levelExam.getCourseId() );
}
/**
* ID
* SQL`courseId``levelExam`
* `DAO``update`SQL`executeUpdate`
* 使
*
* @param courseId
*/
@Override
public void delete(String courseId) {
String sql = "delete from levelExam where courseId = ?";
String sql = "delete from levelExam where courseId =?";
update(sql, courseId);
}
/**
*
* 0SQL
*
*
* @param courseId
* @return 0
*/
@Override
public long getCountWithName(String courseId) {
return 0;
}
/**
*
* SQL`yearTerm``levelExam`
* `DAO``getForList``List<LevelExam>`
*
*
* @param yearTerm
* @return `LevelExam`
*/
@Override
public List<LevelExam> getAllWithYearTerm(String yearTerm) {
String sql = "SELECT * FROM levelExam where yearTerm = ?;";
String sql = "SELECT * FROM levelExam where yearTerm =?";
return getForList(sql, yearTerm);
}
/**
* ID
* SQL`courseId``yearTerm``levelExam`
* `DAO``get``LevelExam`
* ID`null`
*
* @param courseId
* @param yearTerm
* @return `null`
*/
@Override
public LevelExam get(String courseId, String yearTerm) {
String sql = "select *from levelExam where courseId = ? and yearTerm = ?";
String sql = "select *from levelExam where courseId =? and yearTerm =?";
return get(sql, courseId, yearTerm);
}
}
}

@ -6,57 +6,129 @@ import com.hua.dao.DAO;
import com.hua.dao.LevelExamListDAO;
import com.hua.entity.LevelExamList;
/**
* `LevelExamListDAOImpl`访DAO
* `DAO``LevelExamListDAO`SQL
*/
public class LevelExamListDAOImpl extends DAO<LevelExamList> implements LevelExamListDAO {
/**
*
* SQL`levelExamlist` `SELECT * FROM levelExamlist;`
* `DAO``getForList``List<LevelExamList>`
* `LevelExamList`
*
* @return
*/
@Override
public List<LevelExamList> getAll() {
String sql = "SELECT * FROM levelExamlist;";
return getForList(sql);
}
/**
* ID
* SQL使`studentId``levelExamlist`
* `DAO``get``LevelExamList`
* `null`
*
* @param studentId
* @return `null`
*/
@Override
public LevelExamList get(String studentId) {
String sql = "select *from levelExamlist where studentId = ?";
String sql = "select *from levelExamlist where studentId =?";
return get(sql, studentId);
}
/**
*
* SQL`?`
* `DAO``update``update`
* `levelExamList``studentId``CourseId`SQL
* `levelExamlist`
*
* @param levelExamList `LevelExamList``studentId``CourseId`
*/
@Override
public void insert(LevelExamList levelExamList) {
String sql = "insert into levelExamlist values(?,?)";
update(sql , levelExamList.getStudentId(),levelExamList.getCourseId());
update(sql, levelExamList.getStudentId(),levelExamList.getCourseId());
}
/**
*
* SQL`CourseId``studentId`
* `DAO``update``levelExamList``CourseId``studentId`SQL
*
*
* @param levelExamList `LevelExamList`
*/
@Override
public void update(LevelExamList levelExamList) {
String sql = "update levelExamlist set CourseId = ? where studentId = ?";
String sql = "update levelExamlist set CourseId =? where studentId =?";
update(sql, levelExamList.getCourseId(), levelExamList.getStudentId() );
}
/**
* ID
* SQL`studentId``levelExamlist`
* `DAO``update`SQL`executeUpdate`
* 使
*
* @param studentId
*/
@Override
public void delete(String studentId) {
String sql = "delete from levelExamlist where studentId = ?";
String sql = "delete from levelExamlist where studentId =?";
update(sql, studentId);
}
/**
*
* 0SQL
*
*
* @param studentId
* @return 0
*/
@Override
public long getCountWithName(String studentId) {
// TODO Auto-generated method stub
return 0;
}
/**
* `LevelExamList`IDID
* SQL`studentId``courseId``levelExamlist`
* `DAO``get``LevelExamList`
* IDID`null`
*
* @param levelExamList `LevelExamList``studentId``CourseId`
* @return `null`
*/
@Override
public LevelExamList get(LevelExamList levelExamList) {
String sql = "select *from levelExamlist where studentId = ? and courseId = ?";
String sql = "select *from levelExamlist where studentId =? and courseId =?";
return get(sql, levelExamList.getStudentId(), levelExamList.getCourseId());
}
/**
* ID
* SQL`studentId``levelExamlist`
* `DAO``getForList``List<LevelExamList>`
* ID
*
* @param studentId
* @return ID`LevelExamList`
*/
@Override
public List<LevelExamList> getAll(String studentId) {
String sql = "SELECT * FROM levelExamlist where studentId = ?;";
String sql = "SELECT * FROM levelExamlist where studentId =?";
return getForList(sql, studentId);
}
}
}

@ -6,57 +6,107 @@ import com.hua.dao.DAO;
import com.hua.dao.LevelExaminationDAO;
import com.hua.entity.LevelExamination;
/**
* `LevelExaminationDAOImpl`访DAO `cetGrade`
* `DAO` `LevelExaminationDAO` SQL
* `TODO`
*/
public class LevelExaminationDAOImpl extends DAO<LevelExamination> implements
LevelExaminationDAO {
/**
* ID
* `yearTerm` `null` SQL
* `yearTerm` `null` SQL `like` `%` `cetGrade` `yearTerm` ID
* `yearTerm` `null`ID SQL `cetGrade`
* `DAO` `getForList` `List<LevelExamination>`
* `LevelExamination`
*
* @param studentId
* @param yearTerm `null`
* @return ID `LevelExamination`
*/
@Override
public List<LevelExamination> getAllWithYearTerm(String studentId, String yearTerm) {
String sql;
if(yearTerm != null){
sql = "SELECT * FROM cetGrade where yearTerm like '%" + yearTerm +"%' and studentId = ?;";
return getForList(sql,studentId);
}else{
sql = "SELECT * FROM cetGrade where studentId = ?;";
return getForList(sql,studentId);
if (yearTerm!= null) {
sql = "SELECT * FROM cetGrade where yearTerm like '%" + yearTerm + "%' and studentId =?";
return getForList(sql, studentId);
} else {
sql = "SELECT * FROM cetGrade where studentId =?";
return getForList(sql, studentId);
}
}
/**
* ID
* ID SQL `cetGrade`
* `DAO` `getForList` `List<LevelExamination>`
*
*
* @param studentId
* @return `LevelExamination`
*/
@Override
public List<LevelExamination> getAllLevelWithStudentId(String studentId) {
String sql = "SELECT * FROM cetGrade where studentId = ? ;";
String sql = "SELECT * FROM cetGrade where studentId =?";
return getForList(sql, studentId);
}
/**
*
* `TODO`
* SQL `DAO` `LevelExamination` `cetGrade`
*
* @param levalExamination `LevelExamination`
*/
@Override
public void insert(LevelExamination levalExamination) {
// TODO Auto-generated method stub
}
/**
*
* `TODO`
* SQL
* `DAO` `LevelExamination` SQL
*
* @param levalExamination `LevelExamination`
*/
@Override
public void update(LevelExamination levalExamination) {
// TODO Auto-generated method stub
}
/**
*
* ID`TODO`
* SQL ID `Long`
* `cetGrade` `DAO` 使
*
* @param studentId `Long`
*/
@Override
public void delete(Long studentId) {
// TODO Auto-generated method stub
}
/**
*
* ID`TODO`
* SQL ID `Integer`
*
* @param studentId `Long`
* @return `null` `Integer`
*/
@Override
public Integer getCountWithStudentId(Long studentId) {
// TODO Auto-generated method stub
return null;
}
}
}

@ -6,61 +6,134 @@ import com.hua.dao.DAO;
import com.hua.dao.OptionalCourseDAO;
import com.hua.entity.OptionalCourse;
/**
* `OptionalCourseDAOImpl`访DAO
* `DAO``OptionalCourseDAO`SQL
*/
public class OptionalCourseDAOImpl extends DAO<OptionalCourse> implements OptionalCourseDAO {
/**
*
* SQL`optionalCourse` `SELECT * FROM optionalCourse;`
* `DAO``getForList``List<OptionalCourse>`
* `OptionalCourse`
*
* @return
*/
@Override
public List<OptionalCourse> getAll() {
String sql = "SELECT * FROM optionalCourse;";
return getForList(sql);
}
/**
* ID
* SQL使`courseId``optionalCourse`
* `DAO``get``OptionalCourse`
* `null`
*
* @param courseId
* @return `null`
*/
@Override
public OptionalCourse get(String courseId) {
String sql = "select *from optionalCourse where courseId = ?";
String sql = "select *from optionalCourse where courseId =?";
return get(sql, courseId);
}
/**
*
* SQL`?`
* `DAO``update``update`
* `optionalCourse`SQL
* `optionalCourse`
*
* @param optionalCourse `OptionalCourse`
*/
@Override
public void insert(OptionalCourse optionalCourse) {
String sql = "insert into optionalCourse values(?,?,?,?,?,?,?,?)";
update(sql , optionalCourse.getYearTerm(), optionalCourse.getCourseId(), optionalCourse.getCourseName(),
optionalCourse.getCredit(), optionalCourse.getCourseType(),optionalCourse.getTeacher(),
update(sql, optionalCourse.getYearTerm(), optionalCourse.getCourseId(), optionalCourse.getCourseName(),
optionalCourse.getCredit(), optionalCourse.getCourseType(),optionalCourse.getTeacher(),
optionalCourse.getClassWay(), optionalCourse.getClassTime());
}
/**
*
* SQL`courseId`
* `DAO``update``optionalCourse``courseId`SQL
*
*
* @param optionalCourse `OptionalCourse`
*/
@Override
public void update(OptionalCourse optionalCourse) {
String sql = "update optionalCourse set YearTerm = ?,CourseName = ?, Credit = ?, " +
"CourseType = ?, Teacher = ?, ClassWay = ?, ClassTime = ? where courseId = ?";
update(sql, optionalCourse.getYearTerm(), optionalCourse.getCourseName(),
optionalCourse.getCredit(), optionalCourse.getCourseType(),optionalCourse.getTeacher(),
String sql = "update optionalCourse set YearTerm =?,CourseName =?, Credit =?, " +
"CourseType =?, Teacher =?, ClassWay =?, ClassTime =? where courseId =?";
update(sql, optionalCourse.getYearTerm(), optionalCourse.getCourseName(),
optionalCourse.getCredit(), optionalCourse.getCourseType(),optionalCourse.getTeacher(),
optionalCourse.getClassWay(), optionalCourse.getClassTime(), optionalCourse.getCourseId());
}
/**
* ID
* SQL`courseId``optionalCourse`
* `DAO``update`SQL`executeUpdate`
* 使
*
* @param courseId
*/
@Override
public void delete(String courseId) {
String sql = "delete from optionalCourse where courseId = ?";
String sql = "delete from optionalCourse where courseId =?";
update(sql, courseId);
}
/**
*
* 0SQL
*
*
* @param courseId
* @return 0
*/
@Override
public long getCountWithName(String courseId) {
return 0;
}
/**
*
* SQL`yearTerm``optionalCourse`
* `DAO``getForList``List<OptionalCourse>`
*
*
* @param yearTerm
* @return `OptionalCourse`
*/
@Override
public List<OptionalCourse> getAllWithYearTerm(String yearTerm) {
String sql = "SELECT * FROM optionalCourse where yearTerm = ?;";
String sql = "SELECT * FROM optionalCourse where yearTerm =?";
return getForList(sql, yearTerm);
}
/**
* ID
* SQL`courseId``yearTerm``optionalCourse`
* `DAO``get``OptionalCourse`
* ID`null`
*
* @param courseId
* @param yearTerm
* @return `null`
*/
@Override
public OptionalCourse get(String courseId, String yearTerm) {
String sql = "select *from optionalCourse where courseId = ? and yearTerm = ?";
String sql = "select *from optionalCourse where courseId =? and yearTerm =?";
return get(sql, courseId, yearTerm);
}
}
}

@ -6,38 +6,84 @@ import com.hua.dao.DAO;
import com.hua.dao.PostponeExamApplyDAO;
import com.hua.entity.PostponeExamApply;
/**
* `PostponeExamApplyDAOImpl`访DAO
* `DAO``PostponeExamApplyDAO`SQL
*/
public class PostponeExamApplyDAOImpl extends DAO<PostponeExamApply> implements PostponeExamApplyDAO {
/**
*
* SQL`postponeexamapply` `SELECT * FROM postponeexamapply;`
* `DAO``getForList``List<PostponeExamApply>`
* `PostponeExamApply`
*
* @return
*/
@Override
public List<PostponeExamApply> getAll() {
String sql = "SELECT * FROM postponeexamapply;";
return getForList(sql);
}
/**
* ID
* SQL使`studentId``postponeexamapply`
* `DAO``get``PostponeExamApply`
* `null`
*
* @param studentId
* @return `null`
*/
@Override
public PostponeExamApply get(String studentId) {
String sql = "select *from postponeexamapply where studentId = ?";
String sql = "select *from postponeexamapply where studentId =?";
return get(sql, studentId);
}
/**
*
* SQL`?`
* `DAO``update``update`
* `postponeExamApply``getYearTerm()``getStudentId()``getCourseName()``getApplyReason()`SQL
* `postponeexamapply`
*
* @param postponeExamApply `PostponeExamApply`
*/
@Override
public void insert(PostponeExamApply postponeExamApply) {
String sql = "insert into postponeexamapply values(?,?,?,?)";
update(sql , postponeExamApply.getYearTerm(),postponeExamApply.getStudentId(),
update(sql, postponeExamApply.getYearTerm(),postponeExamApply.getStudentId(),
postponeExamApply.getCourseName(), postponeExamApply.getApplyReason());
}
/**
*
*
* SQL
* `DAO``update`SQL
*
* @param postponeExamApply `PostponeExamApply`
*/
@Override
public void update(PostponeExamApply postponeExamApply) {
}
/**
* ID
* SQL`studentId``postponeexamapply`
* `DAO``update`SQL`executeUpdate`
* 使
*
* @param studentId
*/
@Override
public void delete(String studentId) {
String sql = "delete from postponeexamapply where studentId = ?";
String sql = "delete from postponeexamapply where studentId =?";
update(sql, studentId);
}
}
}

@ -7,34 +7,71 @@ import com.hua.dao.StudentBasicInforDAO;
import com.hua.entity.CriterStudent;
import com.hua.entity.StudentBasicInformation;
/**
* `StudentBasicInforDAOImpl`访DAO
* `DAO``StudentBasicInforDAO`SQL
*/
public class StudentBasicInforDAOImpl extends DAO<StudentBasicInformation> implements StudentBasicInforDAO {
/**
* `getAll`
* SQL`SELECT * FROM studentBasicInformation;``studentBasicInformation`
* `DAO``getForList``List<StudentBasicInformation>`
* `StudentBasicInformation`
*
* @return
*/
@Override
public List<StudentBasicInformation> getAll() {
String sql = "SELECT * FROM studentBasicInformation;";
return getForList(sql);
}
/**
* `get`ID
* SQL`select *from studentBasicInformation where studentId =?``studentId``studentBasicInformation`
* `DAO``get``get``StudentBasicInformation``null`
*
* @param studentId `Long`
* @return `null`
*/
@Override
public StudentBasicInformation get(Long studentId) {
String sql = "select *from studentBasicInformation where studentId = ?";
String sql = "select *from studentBasicInformation where studentId =?";
return get(sql, studentId);
}
/**
* `insert`
* SQL`insert into studentBasicInformation values(?,?,?,?,?,?,?,?,?,?)``studentBasicInformation``?`
* `DAO``update``update`访SQL
* `studentBasicInfor`SQL`studentBasicInformation`
*
* @param studentBasicInfor `StudentBasicInformation`ID
*/
@Override
public void insert(StudentBasicInformation studentBasicInfor) {
String sql = "insert into studentBasicInformation " +
"values(?,?,?,?,?,?,?,?,?,?)";
update(sql , studentBasicInfor.getStudentId(), studentBasicInfor.getStudentName(), studentBasicInfor.getGender(),
update(sql, studentBasicInfor.getStudentId(), studentBasicInfor.getStudentName(), studentBasicInfor.getGender(),
studentBasicInfor.getGrade(),studentBasicInfor.getClassName(),studentBasicInfor.getAcademy(),
studentBasicInfor.getProfession(),studentBasicInfor.getCampus(),studentBasicInfor.getPhone(),
studentBasicInfor.getHomeAddress());
}
/**
* `update`
* SQL`update studentbasicinformation set studentName =?,gender =?, grade =?, className =?, " +
* "academy =?, profession =?, campus =?, phone =?, homeAddress =? where studentId =?`
* `studentId`ID`studentId`SQL
* `DAO``update`使
*
* @param studentBasicInfor `StudentBasicInformation`ID
*/
@Override
public void update(StudentBasicInformation studentBasicInfor) {
String sql = "update studentbasicinformation set studentName = ?,gender = ?, grade = ?, className = ? ," +
"academy = ?, profession = ?, campus = ?, phone = ?, homeAddress = ? where studentId = ?";
String sql = "update studentbasicinformation set studentName =?,gender =?, grade =?, className =?, " +
"academy =?, profession =?, campus =?, phone =?, homeAddress =? where studentId =?";
update(sql, studentBasicInfor.getStudentName(), studentBasicInfor.getGender(),
studentBasicInfor.getGrade(),studentBasicInfor.getClassName(),studentBasicInfor.getAcademy(),
studentBasicInfor.getProfession(),studentBasicInfor.getCampus(),studentBasicInfor.getPhone(),
@ -42,26 +79,51 @@ public class StudentBasicInforDAOImpl extends DAO<StudentBasicInformation> imple
}
/**
* `delete`ID
* SQL`delete from studentBasicInformation where studentId =?``studentId``Long``studentBasicInformation`
* `DAO``update`SQL`executeUpdate`使
*
* @param studentId `Long`
*/
@Override
public void delete(Long studentId) {
String sql = "delete from studentBasicInformation where studentId = ?";
String sql = "delete from studentBasicInformation where studentId =?";
update(sql, studentId);
}
/**
* `getCountWithStudentId`IDID
* SQL`select count(studentId) from studentBasicInformation where studentId =?``studentId`
* `DAO``getForValue``Integer`
*
* @param studentId `Long`
* @return `studentId``Integer`
*/
@Override
public Integer getCountWithStudentId(Long studentId) {
String sql = "select count(studentId) from studentBasicInformation where studentId = ?";
String sql = "select count(studentId) from studentBasicInformation where studentId =?";
return getForValue(sql,studentId);
}
/**
* `getForListWithCriterStudent``CriterStudent`
* SQL`select * from studentBasicInformation where academy like? and Profession like? and ClassName like? " +
* "and StudentName like? and StudentId like?``like``CriterStudent``academy``Profession``ClassName``StudentName`ID`StudentId`
* `studentBasicInformation`
* `DAO``getForList``List<StudentBasicInformation>`
*
* @param student `CriterStudent`
* @return `StudentBasicInformation`
*/
@Override
public List<StudentBasicInformation> getForListWithCriterStudent(CriterStudent student) {
String sql = "select * from studentBasicInformation " +
"where academy like ? and Profession like ? and ClassName like ? " +
"and StudentName like ? and StudentId like ?";
"where academy like? and Profession like? and ClassName like? " +
"and StudentName like? and StudentId like?";
return getForList(sql, student.getAcademy(), student.getProfession(), student.getClassName(),
student.getStudentName(),student.getStudentId());
}
}
}
Loading…
Cancel
Save