dev
wuwenxiong 2022-01-04 03:52:10 +08:00
parent 6e08312df8
commit c456fef6fb
1 changed files with 9 additions and 5 deletions

View File

@ -2946,12 +2946,15 @@ public class OrderStatService {
List<Object> shParamsList = new ArrayList<>();
shParamsList.add(OrderStateEnum.RECEIVED.getStateid());
List<Object> yhParamsList = new ArrayList<>();
yhParamsList.add(OrderStateEnum.RECEIVED.getStateid());
String shParams = "";
String yhParams = "";
if (!StrKit.isBlank(tm)) {
shParams += " and t.create_time like ? \n";
yhParams += " and t.create_time like '" + tm + "%'\n";
yhParams += " and t.create_time like ? \n";
shParamsList.add(tm + "%");
yhParamsList.add(tm + "%");
}
// 实售
List<Record> shList = Db.find(
@ -2961,8 +2964,9 @@ public class OrderStatService {
" select t.id, t.product_id, count(*) as orderCount, sum(t.total_price) as totalPrice, sum(t.weight) as weight\n" +
" from (\n" +
" select t.supermarket_id as id, t.paid, t.total_price, t.weight, t.product_id\n" +
" from order_temp t\n" +
" where t.state = ? \n" +
" from order_temp t \n" +
" where t.sale_type = 0 \n" +
" and t.state = ? \n" +
shParams +
" ) t\n" +
" group by t.id, t.product_id\n" +
@ -2978,10 +2982,10 @@ public class OrderStatService {
" `order_temp` t\n" +
"WHERE\n" +
" t.sale_type = 1\n" +
" and t.state = 5\n" +
" and t.state = ?\n" +
yhParams +
" GROUP BY\n" +
" t.supermarket_id");
" t.supermarket_id", yhParamsList.toArray());
List<Record> retChildren = new ArrayList<>();
List<Record> retList = new ArrayList<>();