年统计表修改
parent
9de26b3e80
commit
47a040eb35
|
|
@ -3430,21 +3430,47 @@ public class OrderStatService {
|
|||
// 预售
|
||||
List<Record> yhList = Db.find(
|
||||
"SELECT\n" +
|
||||
" t.supermarket_id id,\n" +
|
||||
" ifnull(count(*), 0) as order_num,\n" +
|
||||
" ifnull(sum(t.weight), 0) as weight,\n" +
|
||||
" ifnull(sum(t.total_price), 0) as total_price\n" +
|
||||
" s.id,\n" +
|
||||
" ifnull( t.order_num, 0 ) order_num,\n" +
|
||||
" ifnull( t.weight, 0 ) weight,\n" +
|
||||
" ifnull( t.total_price, 0 ) total_price \n" +
|
||||
"FROM\n" +
|
||||
" order_temp t\n" +
|
||||
"LEFT JOIN ordercluster c ON c.id = t.ordercluster_id\n" +
|
||||
"LEFT JOIN presell_order p ON p.id = c.presell_order_id\n" +
|
||||
"WHERE\n" +
|
||||
" t.sale_type = 1\n" +
|
||||
" AND t.state = 5\n" +
|
||||
" AND p.del = 0\n" +
|
||||
yhParams +
|
||||
"GROUP BY\n" +
|
||||
" t.supermarket_id", yhParamsList.toArray());
|
||||
" supermarket s\n" +
|
||||
" LEFT JOIN (\n" +
|
||||
" SELECT\n" +
|
||||
" t.supermarket_id,\n" +
|
||||
" ifnull( count(*), 0 ) AS order_num,\n" +
|
||||
" ifnull( sum( t.weight ), 0 ) AS weight,\n" +
|
||||
" ifnull( sum( t.total_price ), 0 ) AS total_price \n" +
|
||||
" FROM\n" +
|
||||
" order_temp t\n" +
|
||||
" LEFT JOIN ordercluster c ON c.id = t.ordercluster_id\n" +
|
||||
" LEFT JOIN presell_order p ON p.id = c.presell_order_id \n" +
|
||||
" WHERE\n" +
|
||||
" t.sale_type = 1 \n" +
|
||||
" AND t.state = 5 \n" +
|
||||
yhParams +
|
||||
" GROUP BY\n" +
|
||||
" t.supermarket_id \n" +
|
||||
" ) t ON s.id = t.supermarket_id",
|
||||
|
||||
// "SELECT\n" +
|
||||
// " t.supermarket_id id,\n" +
|
||||
// " ifnull(count(*), 0) as order_num,\n" +
|
||||
// " ifnull(sum(t.weight), 0) as weight,\n" +
|
||||
// " ifnull(sum(t.total_price), 0) as total_price\n" +
|
||||
// "FROM\n" +
|
||||
// " order_temp t\n" +
|
||||
// "LEFT JOIN ordercluster c ON c.id = t.ordercluster_id\n" +
|
||||
// "LEFT JOIN presell_order p ON p.id = c.presell_order_id\n" +
|
||||
// "WHERE\n" +
|
||||
// " t.sale_type = 1\n" +
|
||||
// " AND t.state = 5\n" +
|
||||
// " AND p.del = 0\n" +
|
||||
// yhParams +
|
||||
// "GROUP BY\n" +
|
||||
// " t.supermarket_id",
|
||||
yhParamsList.toArray());
|
||||
|
||||
List<Record> retChildren = new ArrayList<>();
|
||||
List<Record> retList = new ArrayList<>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue