@Mapper
public interface ArticleRepository {
@Insert("INSERT into article SET regDate = NOW(), updateDate = NOW(), title = #{title}, `body` = #{body}")
public Article writeArticle(String title, String body);
@Select("SELECT * FROM article WHERE id = #{id}")
public Article getArticle(int id);
@Select("SELECT * FROM article")
public List<Article> getArticles();
@Delete("DELETE FROM article WHERE id = #{id}")
public void delete(int id);
@Update ("UPDATE article SET title = #{title}, `body` = #{body}, updateDate = NOW() WHERE id = #{id}")
public void modify(int id, String title, String body);
}