// String sqlAllCount = "select count(0) as 'allCount' from order_tickets where performance_id > 5721 and status != 2 and created_at like '2021-" + month + "%'"; //设置的预编译语句格式
StringsqlAllCount="select count(0) as 'allCount' from order_tickets where performance_id = "+month+" and status != 2 and status !=-1";//设置的预编译语句格式
pstmt=con.prepareStatement(sqlAllCount);
ResultSetallCount=pstmt.executeQuery();
intallCountResult=0;//共多少条
introwCount=0;//当前多少条
booleanisBreak=false;//是否终端循环
while(allCount.next()){
allCountResult=allCount.getInt("allCount");
}
do{
//订单
// String sql = "select * from order_tickets where performance_id > 5721 and status != 2 and created_at like '2021-" + month + "%' limit " + count * page + " ," + count; //设置的预编译语句格式
Stringsql="select * from order_tickets where performance_id = "+month+" and status != 2 limit "+count*page+" ,"+count;
pstmt=con.prepareStatement(sql);
ResultSetorderData=pstmt.executeQuery();
while(orderData.next()){
StringticketSql="select student,use_end,use_start,title,type from tickets where id = "+orderData.getInt("ticket_id");//设置的预编译语句格式
StringrefundSql="select refund_table_id,sum(refund_number) as 'refund_number',sum(refund_price) as 'refund_price' from order_refunds where refund_table = 'order_ticket_entities' and order_id = "+orderData.getInt("id")+" group by refund_table_id";//设置的预编译语句格式