|
|
@@ -31,10 +31,17 @@ public interface StoreClockInMapper extends BaseMapper<StoreClockIn> {
|
|
|
" where uorder.store_id = store.id and uorder.status = '1' and uorder.delete_flag = 0 " +
|
|
|
") perCapitaPrice, " +
|
|
|
"( " +
|
|
|
- " select ifnull(round(avg(score), 1), 0) " +
|
|
|
- " from store_evaluation eval " +
|
|
|
- " where eval.store_id = store.id and eval.delete_flag = 0 " +
|
|
|
- ") score " +
|
|
|
+ " select ifnull(round(avg(cr_avg.score), 1), 0) " +
|
|
|
+ " from common_rating cr_avg " +
|
|
|
+ " where cr_avg.business_type = 1 and cr_avg.business_id = store.id and cr_avg.delete_flag = 0 " +
|
|
|
+ " and (cr_avg.audit_status is null or cr_avg.audit_status <> 2) " +
|
|
|
+ ") score, " +
|
|
|
+ "( " +
|
|
|
+ " select ifnull(count(1), 0) " +
|
|
|
+ " from common_rating cr_cnt " +
|
|
|
+ " where cr_cnt.business_type = 1 and cr_cnt.business_id = store.id and cr_cnt.delete_flag = 0 " +
|
|
|
+ " and (cr_cnt.audit_status is null or cr_cnt.audit_status <> 2) " +
|
|
|
+ ") rating_count " +
|
|
|
"from store_clock_in clock " +
|
|
|
"join life_user user on user.id = clock.user_id " +
|
|
|
"join store_info store on store.id = clock.store_id " +
|