|
|
@@ -41,14 +41,14 @@ public interface LifeUserExpertOrderMapper extends BaseMapper<LifeUserExpertOrde
|
|
|
|
|
|
@Select("select SUM(lueo.account_money) AS accountMoney, " +
|
|
|
"SUM(COALESCE(lueo.order_money, 0)) - SUM(COALESCE(lueo.account_money, 0)) AS pendingPerformanceIncome, " +
|
|
|
- "SUM(CASE WHEN lueo.STATUS = 2 THEN 1 ELSE 0 END) AS completedOrdersNumber, " +
|
|
|
- "SUM(CASE WHEN lueo.STATUS = 1 THEN 1 ELSE 0 END) AS incompleteOrdersNumber " +
|
|
|
+ "SUM(CASE WHEN lueo.STATUS = 5 THEN 1 ELSE 0 END) AS completedOrdersNumber, " +
|
|
|
+ "SUM(CASE WHEN (lueo.STATUS = 3 or lueo.STATUS = 4) THEN 1 ELSE 0 END) AS incompleteOrdersNumber " +
|
|
|
"FROM life_user_expert_order lueo " +
|
|
|
" WHERE expert_id = #{expertId}")
|
|
|
List<LifeUserExpertOrderVo> getExpertOrderDetails(@Param("expertId") Long expertId);
|
|
|
|
|
|
|
|
|
- @Select("select orders.id, orders.order_no, store.store_name, orders.order_money, package.name,orders.account_money,orders.end_funds_button, if (orders.status = '1', '待完成', '已完成') statusName, " +
|
|
|
+ @Select("select orders.*, orders.order_no, store.store_name, orders.order_money, package.name,orders.account_money,orders.end_funds_button, if (orders.status = '1', '待完成', '已完成') statusName, " +
|
|
|
" orders.order_time, orders.complete_time " +
|
|
|
"from life_user_expert_order orders " +
|
|
|
"left join store_info store on store.id = orders.store_id " +
|
|
|
@@ -61,7 +61,7 @@ public interface LifeUserExpertOrderMapper extends BaseMapper<LifeUserExpertOrde
|
|
|
"earliest_works AS (SELECT order_id, MIN(created_time) AS earliest_created_time FROM life_user_expert_works GROUP BY order_id), " +
|
|
|
"purchase AS (SELECT order_id, SUM(CASE WHEN STATUS = 1 THEN 1 ELSE 0 END) completedOrdersNumber, SUM(purchase_amount) amount FROM life_user_expert_purchase WHERE delete_flag = 0 GROUP BY order_id), " +
|
|
|
"record AS (SELECT order_id, COUNT(order_id) storeVisitViewCount FROM life_browse_record WHERE delete_flag = 0 GROUP BY order_id) " +
|
|
|
- "SELECT orders.id, orders.order_no, store.store_name, orders.order_money, orders.first_funds_button,orders.end_funds_button,package.name,ew.earliest_created_time, orders.account_money, IF(orders.STATUS = '1', '待完成', '已完成') AS statusName, " +
|
|
|
+ "SELECT orders.id, orders.order_no, store.store_name, orders.order_money, orders.end_funds_button,package.name,ew.earliest_created_time, orders.account_money, IF(orders.STATUS = '1', '待完成', '已完成') AS statusName, " +
|
|
|
"orders.order_time, orders.first_payment_time, orders.final_payment_time, orders.complete_time, orders.order_play_count, orders.order_gmv, " +
|
|
|
"IFNULL(works.playCount, 0) AS actualPlayCount, IFNULL(purchase.amount, 0) AS actualGmv, IFNULL(purchase.completedOrdersNumber, 0) AS completedOrdersNumber, " +
|
|
|
"IFNULL(purchase.amount, 0) AS transactionAmount, IFNULL(record.storeVisitViewCount, 0) AS storeVisitViewCount, ew.earliest_created_time AS firstWorkTime " +
|
|
|
@@ -76,6 +76,29 @@ public interface LifeUserExpertOrderMapper extends BaseMapper<LifeUserExpertOrde
|
|
|
LifeUserExpertOrderVo fetchExpertOrderInfo(@Param("expertId") Long expertId, @Param("orderId") String orderId);
|
|
|
|
|
|
|
|
|
+
|
|
|
+ @Select("WITH works AS (SELECT order_id, SUM(play_count) playCount ,sum(real_order_gmv) actualGmv FROM life_user_expert_works WHERE delete_flag = 0 GROUP BY order_id), " +
|
|
|
+ "earliest_works AS (SELECT order_id, MIN(created_time) AS earliest_created_time FROM life_user_expert_works GROUP BY order_id), " +
|
|
|
+ "purchase AS (SELECT order_id, SUM(CASE WHEN STATUS = 1 THEN 1 ELSE 0 END) completedOrdersNumber ,SUM(purchase_amount) amount FROM life_user_expert_purchase WHERE delete_flag = 0 GROUP BY order_id), " +
|
|
|
+ "record AS (SELECT order_id, COUNT(order_id) storeVisitViewCount FROM life_browse_record WHERE delete_flag = 0 GROUP BY order_id) " +
|
|
|
+ "SELECT orders.id, orders.order_no, store.store_name, orders.order_money, orders.end_funds_button,package.name,ew.created_time, orders.account_money, orders.status AS statusName, " +
|
|
|
+ "orders.order_time, orders.first_payment_time, orders.final_payment_time, orders.complete_time, orders.order_play_count, orders.order_gmv, IFNULL(dy.reality_count, 0) AS actualPlayCount, " +
|
|
|
+ "IFNULL(works.actualGmv, 0) AS actualGmv, IFNULL(purchase.completedOrdersNumber, 0) AS completedOrdersNumber, " +
|
|
|
+ "IFNULL(purchase.amount, 0) AS transactionAmount, IFNULL(record.storeVisitViewCount, 0) AS storeVisitViewCount, ew.created_time AS earliestCreatedTime " +
|
|
|
+ "FROM life_user_expert_order orders " +
|
|
|
+ "left join life_promotion_package package on package.id = orders.package_id " +
|
|
|
+ "LEFT JOIN store_info store ON store.id = orders.store_id " +
|
|
|
+ "LEFT JOIN works ON works.order_id = orders.id " +
|
|
|
+ "LEFT JOIN purchase ON purchase.order_id = orders.id " +
|
|
|
+ "LEFT JOIN record ON record.order_id = orders.id " +
|
|
|
+ "LEFT JOIN life_user_expert_works ew ON ew.order_id = orders.id " +
|
|
|
+ "LEFT JOIN life_user_dynamics dy ON dy.expert_id = orders.id " +
|
|
|
+ "WHERE orders.expert_id = #{expertId} AND orders.id = #{orderId}")
|
|
|
+ LifeUserExpertOrderVo getExpertOrderInfo(@Param("expertId") Long expertId, @Param("orderId") String orderId);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Select("SELECT works.expert_id, works.order_id, works.works_url, works.play_count, works.created_time, orders.order_money " +
|
|
|
"FROM life_user_expert_works works " +
|
|
|
"LEFT JOIN life_user_expert_order orders ON works.order_id = orders.id " +
|
|
|
@@ -125,4 +148,12 @@ public interface LifeUserExpertOrderMapper extends BaseMapper<LifeUserExpertOrde
|
|
|
"left join life_promotion_package package on package.id = ccc.package_id " +
|
|
|
" ${ew.customSqlSegment}")
|
|
|
List<LifeUserExpertOrderVo> getFinalPaymentList(@Param(Constants.WRAPPER) QueryWrapper<LifeUserExpertVo> wrapper);
|
|
|
+
|
|
|
+
|
|
|
+ @Select("SELECT orders.status " +
|
|
|
+ "FROM life_promotion_package package " +
|
|
|
+ "left join life_user_expert_order orders on orders.package_id = package.id " +
|
|
|
+ "where package.id = #{id} and orders.delete_flag =0 and package.delete_flag=0 "
|
|
|
+ )
|
|
|
+ List<LifeUserExpertOrderVo> getStatus(@Param("id") Integer id);
|
|
|
}
|