|
@@ -292,7 +292,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
*/
|
|
|
@Modifying
|
|
|
@Transactional
|
|
|
- @Query(nativeQuery = true,value = "create view `DAY_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
|
|
|
+ @Query(nativeQuery = true,value = "create view `DAY_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
|
|
|
void createDayDiningStatementsTopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
|
|
|
/**
|
|
@@ -303,7 +303,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
*/
|
|
|
@Modifying
|
|
|
@Transactional
|
|
|
- @Query(nativeQuery = true,value = "create view `DAY_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
|
|
|
+ @Query(nativeQuery = true,value = "create view `DAY_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
|
|
|
void createDayDiningStatementsStopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
|
|
|
/**
|
|
@@ -314,7 +314,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
*/
|
|
|
@Modifying
|
|
|
@Transactional
|
|
|
- @Query(nativeQuery = true,value = "create view `WEEK_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
|
|
|
+ @Query(nativeQuery = true,value = "create view `WEEK_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
|
|
|
void createWeekDiningStatementsTopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
|
|
|
/**
|
|
@@ -325,7 +325,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
*/
|
|
|
@Modifying
|
|
|
@Transactional
|
|
|
- @Query(nativeQuery = true,value = "create view `WEEK_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
|
|
|
+ @Query(nativeQuery = true,value = "create view `WEEK_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
|
|
|
void createWeekDiningStatementsStopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
|
|
|
/**
|
|
@@ -336,7 +336,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
*/
|
|
|
@Modifying
|
|
|
@Transactional
|
|
|
- @Query(nativeQuery = true,value = "create view `MONTH_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
|
|
|
+ @Query(nativeQuery = true,value = "create view `MONTH_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
|
|
|
void createMonthDiningStatementsTopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
|
|
|
/**
|
|
@@ -347,7 +347,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
*/
|
|
|
@Modifying
|
|
|
@Transactional
|
|
|
- @Query(nativeQuery = true,value = "create view `MONTH_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
|
|
|
+ @Query(nativeQuery = true,value = "create view `MONTH_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
|
|
|
void createMonthDiningStatementsStopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
|
|
|
/**
|
|
@@ -358,7 +358,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
*/
|
|
|
@Modifying
|
|
|
@Transactional
|
|
|
- @Query(nativeQuery = true,value = "create view `YEAR_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
|
|
|
+ @Query(nativeQuery = true,value = "create view `YEAR_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
|
|
|
void createYearDiningStatementsTopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
|
|
|
/**
|
|
@@ -369,24 +369,24 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
*/
|
|
|
@Modifying
|
|
|
@Transactional
|
|
|
- @Query(nativeQuery = true,value = "create view `YEAR_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
|
|
|
+ @Query(nativeQuery = true,value = "create view `YEAR_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
|
|
|
void createYearDiningStatementsStopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
|
|
|
/**
|
|
|
* 查询前三日报
|
|
|
* @return
|
|
|
*/
|
|
|
- @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `DAY_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2 ",
|
|
|
- countQuery = "SELECT count(1) FROM `DAY_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2 ")
|
|
|
- List<Map<String,Object>> selectDayTopView(String startTime, String nowTime,Pageable pageable);
|
|
|
+ @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `DAY_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ",
|
|
|
+ countQuery = "SELECT count(1) FROM `DAY_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ")
|
|
|
+ Page<List<Map<String,Object>>> selectDayTopView(String startTime, String nowTime,Pageable pageable);
|
|
|
|
|
|
/**
|
|
|
* 查询后三日报
|
|
|
* @return
|
|
|
*/
|
|
|
- @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `DAY_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2",
|
|
|
- countQuery = "SELECT count(1) FROM `DAY_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2")
|
|
|
- List<Map<String,Object>> selectDayStopView(String startTime, String nowTime,Pageable pageable);
|
|
|
+ @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `DAY_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)",
|
|
|
+ countQuery = "SELECT count(1) FROM `DAY_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)")
|
|
|
+ Page<List<Map<String,Object>>> selectDayStopView(String startTime, String nowTime,Pageable pageable);
|
|
|
|
|
|
/**
|
|
|
* 查询前三周报
|
|
@@ -396,9 +396,9 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
* @param pageable
|
|
|
* @return
|
|
|
*/
|
|
|
- @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `WEEK_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2 ",
|
|
|
- countQuery = "SELECT count(1) FROM `WEEK_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2 ")
|
|
|
- List<Map<String,Object>> selectWeekTopView(String startTime, String nowTime, Pageable pageable);
|
|
|
+ @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `WEEK_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ",
|
|
|
+ countQuery = "SELECT count(1) FROM `WEEK_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ")
|
|
|
+ Page<List<Map<String,Object>>> selectWeekTopView(String startTime, String nowTime, Pageable pageable);
|
|
|
|
|
|
/**
|
|
|
* 查询后三周报
|
|
@@ -408,9 +408,9 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
* @param pageable
|
|
|
* @return
|
|
|
*/
|
|
|
- @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `WEEK_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2 ",
|
|
|
- countQuery = "SELECT count(1) FROM `WEEK_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2 ")
|
|
|
- List<Map<String,Object>> selectWeekStopView(String startTime, String nowTime, Pageable pageable);
|
|
|
+ @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `WEEK_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ",
|
|
|
+ countQuery = "SELECT count(1) FROM `WEEK_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ")
|
|
|
+ Page<List<Map<String,Object>>> selectWeekStopView(String startTime, String nowTime, Pageable pageable);
|
|
|
|
|
|
/**
|
|
|
* 查询前三 月报
|
|
@@ -420,9 +420,9 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
* @param pageable
|
|
|
* @return
|
|
|
*/
|
|
|
- @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `MONTH_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2",
|
|
|
- countQuery = "SELECT count(1) FROM `MONTH_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2 ")
|
|
|
- List<Map<String,Object>> selectMonthTopView(String startTime, String nowTime, Pageable pageable);
|
|
|
+ @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `MONTH_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)",
|
|
|
+ countQuery = "SELECT count(1) FROM `MONTH_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)")
|
|
|
+ Page<List<Map<String,Object>>> selectMonthTopView(String startTime, String nowTime, Pageable pageable);
|
|
|
|
|
|
/**
|
|
|
* 查询后三 月报
|
|
@@ -432,9 +432,9 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
* @param pageable
|
|
|
* @return
|
|
|
*/
|
|
|
- @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `MONTH_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2",
|
|
|
- countQuery = "SELECT pid,name,countPid,price,create_date FROM `MONTH_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2")
|
|
|
- List<Map<String,Object>> selectMonthStopView(String startTime, String nowTime, Pageable pageable);
|
|
|
+ @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `MONTH_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)",
|
|
|
+ countQuery = "SELECT pid,name,countPid,price,create_date FROM `MONTH_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)")
|
|
|
+ Page<List<Map<String,Object>>> selectMonthStopView(String startTime, String nowTime, Pageable pageable);
|
|
|
|
|
|
/**
|
|
|
* 查询前三 年报
|
|
@@ -444,9 +444,9 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
* @param pageable
|
|
|
* @return
|
|
|
*/
|
|
|
- @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `YEAR_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2",
|
|
|
- countQuery = "SELECT count(1) FROM `YEAR_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2 ")
|
|
|
- List<Map<String,Object>> selectYearTopView(String startTime, String nowTime, Pageable pageable);
|
|
|
+ @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `YEAR_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)",
|
|
|
+ countQuery = "SELECT count(1) FROM `YEAR_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ")
|
|
|
+ Page<List<Map<String,Object>>> selectYearTopView(String startTime, String nowTime, Pageable pageable);
|
|
|
|
|
|
/**
|
|
|
* 查询后三 年报
|
|
@@ -456,8 +456,8 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
* @param pageable
|
|
|
* @return
|
|
|
*/
|
|
|
- @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `YEAR_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2",
|
|
|
- countQuery = "SELECT count(1) FROM `YEAR_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2")
|
|
|
- List<Map<String,Object>> selectYearStopView(String startTime, String nowTime, Pageable pageable);
|
|
|
+ @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `YEAR_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)",
|
|
|
+ countQuery = "SELECT count(1) FROM `YEAR_DINING_STATEMENTS_STOP` where IF(?1 is null || ''= ?1,1=1,create_date between ?1 and ?2)")
|
|
|
+ Page<List<Map<String,Object>>> selectYearStopView(String startTime, String nowTime, Pageable pageable);
|
|
|
|
|
|
}
|