src/cn/itcast/goods/order/dao/OrderDao.java
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package cn.itcast.goods.order.dao;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.apache.commons.dbutils.handlers.MapListHandler;
import org.apache.commons.dbutils.handlers.ScalarHandler;
import cn.itcast.commons.CommonUtils;
import cn.itcast.goods.book.domain.Book;
import cn.itcast.goods.order.domain.Order;
import cn.itcast.goods.order.domain.OrderItem;
import cn.itcast.goods.pager.Expression;
import cn.itcast.goods.pager.PageBean;
import cn.itcast.goods.pager.PageConstants;
import cn.itcast.jdbc.TxQueryRunner;
public class OrderDao {
private QueryRunner qr = new TxQueryRunner();
/**
* 查询订单状态
* @param oid
* @return
* @throws SQLException
*/
public int findStatus(String oid) throws SQLException {
String sql = "select status from t_order where oid=?";
Number number = (Number)qr.query(sql, new ScalarHandler(), oid);
return number.intValue();
}
/**
* 修改订单状态
* @param oid
* @param status
* @throws SQLException
*/
public void updateStatus(String oid, int status) throws SQLException {
String sql = "update t_order set status=? where oid=?";
qr.update(sql, status, oid);
}
/**
* 加载订单
* @param oid
* @return
* @throws SQLException
*/
public Order load(String oid) throws SQLException {
String sql = "select * from t_order where oid=?";
Order order = qr.query(sql, new BeanHandler<Order>(Order.class), oid);
loadOrderItem(order);//为当前订单加载它的所有订单条目
return order;
}
后面还有 177 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
