Beispiel #1
0
 public int update(Judge judge) {
   String sql =
       "update exam_judge set content = ?, answer = ?, analysis = ?, remark = ? where id = ?";
   return jdbcTemplate.update(
       sql,
       new Object[] {
         judge.getContent(),
         judge.getAnswer(),
         judge.getAnalysis(),
         judge.getRemark(),
         judge.getId()
       });
 }
Beispiel #2
0
 @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 public int add(Judge judge) {
   String sql =
       "insert into exam_judge(id, exam_id, content, answer, analysis, description, remark) values (?,?,?,?,?,?,?)";
   String id = UUID.randomUUID().toString();
   int addRows =
       jdbcTemplate.update(
           sql,
           new Object[] {
             id,
             judge.getExam_id(),
             judge.getContent(),
             judge.getAnswer(),
             judge.getAnalysis(),
             judge.getDescription(),
             judge.getRemark()
           });
   return addRows;
 }