数据报表 排序规则
This commit is contained in:
parent
0a8973a24c
commit
e7c447066c
|
|
@ -44,7 +44,7 @@ public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, In
|
|||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderSalesCountByDayVo(" +
|
||||
"info.productName," +
|
||||
"info.productSkuName," +
|
||||
"SUM( CASE WHEN info.status = 'closed' THEN info.num ELSE 0 END )," +
|
||||
"SUM( CASE WHEN info.status = 'closed' THEN info.num ELSE 0 END ) as salesNum," +
|
||||
"SUM( CASE WHEN info.status = 'refund' THEN info.num ELSE 0 END )," +
|
||||
"SUM( info.num )) " +
|
||||
"FROM TbOrderDetail info " +
|
||||
|
|
@ -52,13 +52,13 @@ public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, In
|
|||
"AND info.createTime > :startTime AND info.createTime < :endTime " +
|
||||
"AND ((info.status = 'closed') OR ( info.status ='refund')) " +
|
||||
"GROUP BY info.productId,info.productSkuId " +
|
||||
"ORDER BY info.productId DESC")
|
||||
"ORDER BY salesNum DESC")
|
||||
Page<TbOrderSalesCountByDayVo> queryTbOrderSalesCountByDay(@Param("shopId") Integer shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, Pageable pageable);
|
||||
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderSalesCountByDayVo(" +
|
||||
"info.productName," +
|
||||
"info.productSkuName," +
|
||||
"SUM( CASE WHEN info.status = 'closed' THEN info.num ELSE 0 END )," +
|
||||
"SUM( CASE WHEN info.status = 'closed' THEN info.num ELSE 0 END ) as salesNum," +
|
||||
"SUM( CASE WHEN info.status = 'refund' THEN info.num ELSE 0 END )," +
|
||||
"SUM( info.num )) " +
|
||||
"FROM TbOrderDetail info " +
|
||||
|
|
@ -66,7 +66,7 @@ public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, In
|
|||
"AND info.createTime > :startTime AND info.createTime < :endTime " +
|
||||
"AND ((info.status = 'closed') OR ( info.status ='refund')) " +
|
||||
"GROUP BY info.productId,info.productSkuId " +
|
||||
"ORDER BY info.productId DESC")
|
||||
"ORDER BY salesNum DESC")
|
||||
List<TbOrderSalesCountByDayVo> queryTbOrderSalesCountByDay(@Param("shopId") Integer shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderPayCountVo(" +
|
||||
|
|
|
|||
Loading…
Reference in New Issue