Update BookDaoImpl.java

feature/hy
threecat-up 3 years ago committed by GitHub
parent af4c646b98
commit a35eb467b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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());
}

Loading…
Cancel
Save