|
@@ -213,25 +213,251 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
String judgeView(@Param("viewName") String viewName);
|
|
|
|
|
|
/**
|
|
|
- * 删除视图
|
|
|
+ * 删除前三名日报表视图
|
|
|
* @param viewName
|
|
|
*/
|
|
|
@Modifying
|
|
|
@Transactional
|
|
|
- @Query(nativeQuery = true,value = "drop view `DAY_DINING_STATEMENTS`")
|
|
|
- void dropDayView(@Param("viewName") String viewName);
|
|
|
+ @Query(nativeQuery = true,value = "drop view `DAY_DINING_STATEMENTS_TOP`")
|
|
|
+ void dropDayTopView(@Param("viewName") String viewName);
|
|
|
|
|
|
/**
|
|
|
- * 创建视图
|
|
|
+ * 删除后三日名报表视图
|
|
|
+ * @param viewName
|
|
|
+ */
|
|
|
+ @Modifying
|
|
|
+ @Transactional
|
|
|
+ @Query(nativeQuery = true,value = "drop view `DAY_DINING_STATEMENTS_STOP`")
|
|
|
+ void dropDayStopView(@Param("viewName") String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除前三名周报表视图
|
|
|
+ * @param viewName
|
|
|
+ */
|
|
|
+ @Modifying
|
|
|
+ @Transactional
|
|
|
+ @Query(nativeQuery = true,value = "drop view `WEEK_DINING_STATEMENTS_TOP`")
|
|
|
+ void dropWeekTopView(String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除前三名周报表视图
|
|
|
+ * @param viewName
|
|
|
+ */
|
|
|
+ @Modifying
|
|
|
+ @Transactional
|
|
|
+ @Query(nativeQuery = true,value = "drop view `WEEK_DINING_STATEMENTS_STOP`")
|
|
|
+ void dropWeekStopView(String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除前三名月报表视图
|
|
|
+ * @param viewName
|
|
|
+ */
|
|
|
+ @Modifying
|
|
|
+ @Transactional
|
|
|
+ @Query(nativeQuery = true,value = "drop view `MONTH_DINING_STATEMENTS_TOP`")
|
|
|
+ void dropMonthTopView(String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除后三名月报表视图
|
|
|
+ * @param viewName
|
|
|
+ */
|
|
|
+ @Modifying
|
|
|
+ @Transactional
|
|
|
+ @Query(nativeQuery = true,value = "drop view `MONTH_DINING_STATEMENTS_STOP`")
|
|
|
+ void dropMonthStopView(String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除前三名年报表视图
|
|
|
+ * @param viewName
|
|
|
+ */
|
|
|
+ @Modifying
|
|
|
+ @Transactional
|
|
|
+ @Query(nativeQuery = true,value = "drop view `YEAR_DINING_STATEMENTS_TOP`")
|
|
|
+ void dropYearTopView(String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除前三名年报表视图
|
|
|
+ * @param viewName
|
|
|
+ */
|
|
|
+ @Modifying
|
|
|
+ @Transactional
|
|
|
+ @Query(nativeQuery = true,value = "drop view `YEAR_DINING_STATEMENTS_STOP`")
|
|
|
+ void dropYearStopView(String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建前三日报表视图
|
|
|
+ * @param startTime //开始时间
|
|
|
+ * @param nowTime //当前时间
|
|
|
+ * @param viewName //视图名称
|
|
|
+ */
|
|
|
+ @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 ")
|
|
|
+ void createDayDiningStatementsTopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建后三日视图
|
|
|
+ * @param startTime //开始时间
|
|
|
+ * @param nowTime //当前时间
|
|
|
+ * @param viewName //视图名称
|
|
|
+ */
|
|
|
+ @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 ")
|
|
|
+ void createDayDiningStatementsStopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建创建前三周报视图
|
|
|
+ * @param startTime //开始时间
|
|
|
+ * @param nowTime //当前时间
|
|
|
+ * @param viewName //视图名称
|
|
|
+ */
|
|
|
+ @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 ")
|
|
|
+ void createWeekDiningStatementsTopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建后三周报视图
|
|
|
+ * @param startTime //开始时间
|
|
|
+ * @param nowTime //当前时间
|
|
|
+ * @param viewName //视图名称
|
|
|
+ */
|
|
|
+ @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 ")
|
|
|
+ void createWeekDiningStatementsStopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建前三月报视图
|
|
|
+ * @param startTime //开始时间
|
|
|
+ * @param nowTime //当前时间
|
|
|
+ * @param viewName //视图名称
|
|
|
+ */
|
|
|
+ @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 ")
|
|
|
+ void createMonthDiningStatementsTopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建后三月报视图
|
|
|
+ * @param startTime //开始时间
|
|
|
+ * @param nowTime //当前时间
|
|
|
+ * @param viewName //视图名称
|
|
|
+ */
|
|
|
+ @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 ")
|
|
|
+ void createMonthDiningStatementsStopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建前三 年报表视图
|
|
|
+ * @param startTime //开始时间
|
|
|
+ * @param nowTime //当前时间
|
|
|
+ * @param viewName //视图名称
|
|
|
+ */
|
|
|
+ @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 ")
|
|
|
+ void createYearDiningStatementsTopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建后三 年报视图
|
|
|
* @param startTime //开始时间
|
|
|
* @param nowTime //当前时间
|
|
|
* @param viewName //视图名称
|
|
|
*/
|
|
|
@Modifying
|
|
|
@Transactional
|
|
|
- @Query(nativeQuery = true,value = "create view DAY_DINING_STATEMENTS 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 rec.create_date BETWEEN ?1 AND ?2 GROUP BY item.pid ")
|
|
|
- void createDayView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
|
|
|
+ @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 ")
|
|
|
+ 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);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询后三日报
|
|
|
+ * @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);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询前三周报
|
|
|
+ * @param startTime
|
|
|
+ * @param nowTime
|
|
|
+ * @param weeksInWeekYear
|
|
|
+ * @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);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询后三周报
|
|
|
+ * @param startTime
|
|
|
+ * @param nowTime
|
|
|
+ * @param weeksInWeekYear
|
|
|
+ * @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);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询前三 月报
|
|
|
+ * @param startTime
|
|
|
+ * @param nowTime
|
|
|
+ * @param monthsInYear
|
|
|
+ * @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);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询后三 月报
|
|
|
+ * @param startTime
|
|
|
+ * @param nowTime
|
|
|
+ * @param monthsInYear
|
|
|
+ * @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);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询前三 年报
|
|
|
+ * @param startTime
|
|
|
+ * @param nowTime
|
|
|
+ * @param year
|
|
|
+ * @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);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询后三 年报
|
|
|
+ * @param startTime
|
|
|
+ * @param nowTime
|
|
|
+ * @param year
|
|
|
+ * @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 * FROM `DAY_DINING_STATEMENTS`")
|
|
|
- List<Map<String,Object>> selectDayView();
|
|
|
}
|