From 2af8a3cab2feb318926d7f685dd91918d9daca6b Mon Sep 17 00:00:00 2001 From: ragdoll Date: Tue, 16 Jun 2020 03:47:56 +0900 Subject: [PATCH] =?UTF-8?q?[BE/#33]=20Feat=20:=20issueDao=EC=97=90=20?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EB=B8=94=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20=EC=BF=BC=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - issueDao.addAttachedLabelId() - issueDao.deleteAttachedLabelId() --- .../issuetracker/ragdoll/dao/IssueDao_Ragdoll.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BE/src/main/java/com/codesquad/issuetracker/ragdoll/dao/IssueDao_Ragdoll.java b/BE/src/main/java/com/codesquad/issuetracker/ragdoll/dao/IssueDao_Ragdoll.java index f1d05b9..f417064 100644 --- a/BE/src/main/java/com/codesquad/issuetracker/ragdoll/dao/IssueDao_Ragdoll.java +++ b/BE/src/main/java/com/codesquad/issuetracker/ragdoll/dao/IssueDao_Ragdoll.java @@ -127,4 +127,14 @@ public void deleteAssigneeId(Long issueId, Long deletedAssigneeId) { String sql = "DELETE FROM assignee WHERE issue_id = ? AND user_id = ?"; jdbcTemplate.update(sql, new Object[]{issueId, deletedAssigneeId}); } + + public void addAttachedLabelId(Long issueId, Integer labelId) { + String sql = "INSERT issue_has_label (label_id, issue_id) VALUES (?, ?)"; + jdbcTemplate.update(sql, new Object[]{labelId, issueId}); + } + + public void deleteAttachedLabelId(Long issueId, Integer labelId) { + String sql = "DELETE FROM issue_has_label WHERE issue_id = ? AND label_id = ?"; + jdbcTemplate.update(sql, new Object[]{issueId, labelId}); + } }