Skip to content

Commit

Permalink
refactor: 삭제되지 않은 결과 조회를 위해 isNull 조건 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 committed Jun 22, 2024
1 parent be09bd6 commit dfb30e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ArticleDao(
.join(ArticleIfo.ARTICLE_IFO)
.on(ArticleMst.ARTICLE_MST.ID.eq(ArticleIfo.ARTICLE_IFO.ARTICLE_MST_ID))
.where(ArticleMst.ARTICLE_MST.ID.eq(articleId))
.and(ArticleMst.ARTICLE_MST.DELETED_AT.isNull)
.fetchOneInto(SelectArticleRecord::class.java)
?: throw IllegalArgumentException("cannot find article record by articleId: $articleId")
}
Expand Down Expand Up @@ -57,6 +58,7 @@ class ArticleDao(
.on(mappingWorkbookArticle.WORKBOOK_ID.eq(workbookId))
.and(mappingWorkbookArticle.ARTICLE_ID.eq(articleMst.ID))
.where(articleMst.ID.eq(articleId))
.and(articleMst.DELETED_AT.isNull)
.fetchOneInto(SelectWorkBookArticleRecord::class.java)
?: throw IllegalArgumentException("cannot find $workbookId article record by articleId: $articleId")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class MemberDao(
.from(Member.MEMBER)
.where(Member.MEMBER.ID.eq(writerId))
.and(Member.MEMBER.TYPE_CD.eq(1)) // todo fix after considering the type_cd
.and(Member.MEMBER.DELETED_AT.isNull)
.fetchOneInto(WriterRecord::class.java)
?: throw IllegalArgumentException("cannot find writer record by writerId: $writerId")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class ProblemDao(
return dslContext.select()
.from(Problem.PROBLEM)
.where(Problem.PROBLEM.ARTICLE_ID.eq(articleId))
.and(Problem.PROBLEM.DELETED_AT.isNull)
.fetch()
.map { it[Problem.PROBLEM.ID] }
.let { ProblemIdsRecord(it) }
Expand Down

0 comments on commit dfb30e8

Please sign in to comment.