统计修改

dev
wany 2025-03-11 16:41:40 +08:00
parent f77b4d3b05
commit e61a2c3adb
1 changed files with 9 additions and 8 deletions

View File

@ -542,10 +542,10 @@ public class OrderStatService {
// saleParams += " and t.sale_type = 0 \n";
}
if (type != null){
saleParams += " and s.type = ? \n";
params.add(type);
}
// if (type != null){
// saleParams += " and s.type = ? \n";
// params.add(type);
// }
params.addAll(params);
//2025-03-06更改解决砂站商品删除后月统计数据查询不到问题
@ -563,11 +563,11 @@ public class OrderStatService {
String sql = "select m.* from (" + selectSql + "left join (\n" + commonSql + " ) a on a.id = t.supermarket_id and a.product_id = t.product_id\n" +
" left join supermarket s on s.id = t.supermarket_id\n" +
" left join product p on p.id = t.product_id\n" +
" left join product p on p.id = t.product_id where s.type = 0 \n" +
"union\n" +
selectSql + "right join (\n" + commonSql + " ) a on a.id = t.supermarket_id and a.product_id = t.product_id\n" +
" left join supermarket s on s.id = a.id\n" +
" left join product p on p.id = a.product_id ) m order by m.id,m.product_id";
" left join product p on p.id = a.product_id where s.type = 0) m order by m.id,m.product_id";
/**
String sql = "select s.id, s.name, s.name2, p.id product_id, p.`name` product_name, ifnull(a.orderCount, 0) as orderCount, ifnull(a.totalPrice, 0) as totalPrice, ifnull(a.weight, 0) as weight\n" +
@ -4020,8 +4020,9 @@ public class OrderStatService {
"FROM\n" +
" supermarket t\n"
+ "WHERE\n" +
" id <= 6\n" +
"OR id = 11 or id = 12 "
// " id <= 6\n" +
// "OR id = 11 or id = 12 "
"t.type = 0 "
);
List<Object> shParamsList = new ArrayList<>();