StringsqlAllCount="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 > 5721 and status != 2 and created_at like '2021-"+month+"%'";//设置的预编译语句格式
// String sqlAllCount = "select count(0) as 'allCount' from order_tickets where performance_id = "+month + " and status != 2 and status !=-1"; //设置的预编译语句格式
// String sqlAllCount = "select count(0) as 'allCount' from order_tickets where performance_id = "+month + " and status != 2 and status !=-1"; //设置的预编译语句格式
System.out.println(" SQL COUNT = "+sqlAllCount);
System.out.println(" SQL COUNT = "+sqlAllCount);
pstmt=con.prepareStatement(sqlAllCount);
pstmt=con.prepareStatement(sqlAllCount);
ResultSetallCount=pstmt.executeQuery();
ResultSetallCount=pstmt.executeQuery();
intallCountResult=0;//共多少条
intallCountResult=0;//共多少条
...
@@ -478,7 +478,7 @@ public class DataImpl {
...
@@ -478,7 +478,7 @@ public class DataImpl {
//订单
//订单
Stringsql="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 > 5721 and status != 2 and created_at like '2021-"+month+"%' limit "+count*page+" ,"+count;//设置的预编译语句格式
// String sql = "select * from order_tickets where performance_id = "+month +" and status != 2 limit " + count * page + " ," + count;
// String sql = "select * from order_tickets where performance_id = "+month +" and status != 2 limit " + count * page + " ," + count;
System.out.println(" SQL DATA = "+sql);
System.out.println(" SQL DATA = "+sql);
pstmt=con.prepareStatement(sql);
pstmt=con.prepareStatement(sql);
ResultSetorderData=pstmt.executeQuery();
ResultSetorderData=pstmt.executeQuery();
while(orderData.next()){
while(orderData.next()){
...
@@ -506,14 +506,14 @@ public class DataImpl {
...
@@ -506,14 +506,14 @@ public class DataImpl {
}
}
//退款
//退款
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";//设置的预编译语句格式
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";//设置的预编译语句格式
Stringsql="select rs.id,rs.title,rs.img_poster,rs.created_at,rs.updated_at,count(p.id) as 'count' from road_shows as rs left join performances as p on p.road_show_id = rs.id where p.id > 5721 group by rs.id,rs.title having count>0";