예제 #1
0
 public void insertIntoSupplementAnswer(SupplementAnswer supplementAnswer) {
   Date now = new Date();
   commonDao.insert(
       "INSERT INTO SUPPLEMENT_ANSWER (INSERT_DATETIME, UPDATE_DATETIME, ANSWER_ID, FANS_NAME, ANSWER, TITLE) VALUES (?, ?, ?, ?, ?, ?)",
       now,
       now,
       supplementAnswer.getAnswerId(),
       supplementAnswer.getFansName(),
       supplementAnswer.getAnswer(),
       supplementAnswer.getTitle());
 }
예제 #2
0
 public void denialSupplement(int id) {
   commonDao.update("UPDATE SUPPLEMENT_ANSWER SET IS_ACTIVE = 0 WHERE ID = ?", id);
 }
예제 #3
0
 public void approveSupplement(int id) {
   commonDao.update("UPDATE SUPPLEMENT_ANSWER SET IS_APPROVED = 1 WHERE ID = ?", id);
 }
예제 #4
0
 public SupplementAnswer getSupplementAnswer(int suppleId) {
   return commonDao.getFirst(
       SupplementAnswer.class, "SELECT * FROM SUPPLEMENT_ANSWER WHERE ID = ?", suppleId);
 }
예제 #5
0
 public List<SupplementAnswer> getUnapprovedAnswerList() {
   return commonDao.query(
       SupplementAnswer.class,
       "SELECT A.*, B.TITLE AS PARENT_ANSWER_TITLE FROM SUPPLEMENT_ANSWER A LEFT JOIN ANSWER B ON A.ANSWER_ID = B.ID WHERE A.IS_ACTIVE = 1 AND A.IS_APPROVED = 0 ORDER BY UPDATE_DATETIME DESC");
 }
예제 #6
0
 public List<SupplementAnswer> getSuppleAnswerList(int answerId) {
   return commonDao.query(
       SupplementAnswer.class,
       "SELECT * FROM SUPPLEMENT_ANSWER WHERE ANSWER_ID = ? AND IS_ACTIVE = 1 AND IS_APPROVED = 1 ORDER BY UPDATE_DATETIME",
       answerId);
 }