From a35eb467b10d47abf2b08d8804ad70187b68f804 Mon Sep 17 00:00:00 2001 From: threecat-up <60840921+threecat-up@users.noreply.github.com> Date: Fri, 3 Jun 2022 15:15:00 +0800 Subject: [PATCH] Update BookDaoImpl.java --- src/com/yj/dao/impl/BookDaoImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/yj/dao/impl/BookDaoImpl.java b/src/com/yj/dao/impl/BookDaoImpl.java index dfda3aa..14b4fee 100644 --- a/src/com/yj/dao/impl/BookDaoImpl.java +++ b/src/com/yj/dao/impl/BookDaoImpl.java @@ -14,7 +14,7 @@ public class BookDaoImpl extends BaseDao implements BookDao { @Override public int addBook(Book book) { - String sql = "insert into t_book(`name`,`author`,`classification`,`price`,`sales`,`stock`,`img_path`) values(?,?,?,?,?,?,?)"; + String sql = "insert into t_book(`name`,`author`,`classification`,`price`,`sales`,`stock`,`imgpath`) values(?,?,?,?,?,?,?)"; return update(sql,book.getName(),book.getAuthor(),book.getClassification(),book.getPrice(),book.getSales(),book.getStock(),book.getImgPath()); } @@ -26,7 +26,7 @@ public class BookDaoImpl extends BaseDao implements BookDao { @Override public int updateBook(Book book) { - String sql = "update t_book set `name`=?,`author`=?,`classification`=?,`price`=?,`sales`=?,`stock`=?,`img_path`=? where id=?"; + String sql = "update t_book set `name`=?,`author`=?,`classification`=?,`price`=?,`sales`=?,`stock`=?,`imgpath`=? where id=?"; return update(sql,book.getName(),book.getAuthor(),book.getClassification(),book.getPrice(),book.getSales(),book.getStock(),book.getImgPath(),book.getId()); }