Class OrderDAO
java.lang.Object
app.dao.OrderDAO
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbindDateRange(PreparedStatement stmt, LocalDate startDate, LocalDate endDate) private intbindFilters(PreparedStatement stmt, OrderFilters filters) private StringbuildWhereClause(OrderFilters filters) intcountOrders(OrderFilters filters) private List<SalesTrendRow> getDailySales(Connection conn, LocalDate startDate, LocalDate endDate) private List<EmployeeSales> getEmployeeSales(Connection conn, LocalDate startDate, LocalDate endDate) getOrders(OrderFilters filters, int limit, int offset) private List<PaymentMethodSales> getPaymentMethodSales(Connection conn, LocalDate startDate, LocalDate endDate) private List<SalesReportRow> getSalesByItem(Connection conn, LocalDate startDate, LocalDate endDate) getSalesReport(LocalDate startDate, LocalDate endDate) private intnextId(Connection conn, String sql) intsaveOrder(int employeeId, String customerName, String paymentType, BigDecimal totalCost, BigDecimal salesTax, List<OrderItem> items) private voidvalidatePage(int limit, int offset)
-
Field Details
-
MAX_PAGE_SIZE
private static final int MAX_PAGE_SIZE- See Also:
-
-
Constructor Details
-
OrderDAO
public OrderDAO()
-
-
Method Details
-
getOrders
- Throws:
SQLException
-
countOrders
- Throws:
SQLException
-
getSalesReport
- Throws:
SQLException
-
getSalesByItem
private List<SalesReportRow> getSalesByItem(Connection conn, LocalDate startDate, LocalDate endDate) throws SQLException - Throws:
SQLException
-
getDailySales
private List<SalesTrendRow> getDailySales(Connection conn, LocalDate startDate, LocalDate endDate) throws SQLException - Throws:
SQLException
-
getPaymentMethodSales
private List<PaymentMethodSales> getPaymentMethodSales(Connection conn, LocalDate startDate, LocalDate endDate) throws SQLException - Throws:
SQLException
-
getEmployeeSales
private List<EmployeeSales> getEmployeeSales(Connection conn, LocalDate startDate, LocalDate endDate) throws SQLException - Throws:
SQLException
-
bindDateRange
private void bindDateRange(PreparedStatement stmt, LocalDate startDate, LocalDate endDate) throws SQLException - Throws:
SQLException
-
buildWhereClause
-
bindFilters
- Throws:
SQLException
-
validatePage
private void validatePage(int limit, int offset) -
saveOrder
public int saveOrder(int employeeId, String customerName, String paymentType, BigDecimal totalCost, BigDecimal salesTax, List<OrderItem> items) -
nextId
- Throws:
SQLException
-