|
@@ -12,38 +12,38 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
*/
|
|
|
@Transactional
|
|
|
@Modifying
|
|
|
- @Query(value = "DROP VIEW if \\exists `zgmonth`",nativeQuery = true)
|
|
|
+ @Query(value = "DROP VIEW IF EXISTS `zgmonth`",nativeQuery = true)
|
|
|
void dropByZgMonth();
|
|
|
@Transactional
|
|
|
@Modifying
|
|
|
- @Query(value = "DROP VIEW if \\exists `zdmonth`",nativeQuery = true)
|
|
|
+ @Query(value = "DROP VIEW IF EXISTS `zdmonth`",nativeQuery = true)
|
|
|
void dropByZdMonth();
|
|
|
|
|
|
@Transactional
|
|
|
@Modifying
|
|
|
- @Query(value = "DROP VIEW if \\exists zgyear",nativeQuery = true)
|
|
|
+ @Query(value = "DROP VIEW IF EXISTS zgyear",nativeQuery = true)
|
|
|
void dropByZgYear();
|
|
|
@Transactional
|
|
|
@Modifying
|
|
|
- @Query(value = "DROP VIEW if \\exists zdyear",nativeQuery = true)
|
|
|
+ @Query(value = "DROP VIEW if IF EXISTS zdyear",nativeQuery = true)
|
|
|
void dropByZdYear();
|
|
|
|
|
|
@Transactional
|
|
|
@Modifying
|
|
|
- @Query(value = "DROP VIEW if \\exists `zgday`",nativeQuery = true)
|
|
|
+ @Query(value = "DROP VIEW if IF EXISTS `zgday`",nativeQuery = true)
|
|
|
void dropByZgDay();
|
|
|
@Transactional
|
|
|
@Modifying
|
|
|
- @Query(value = "DROP VIEW if \\exists `zdday`",nativeQuery = true)
|
|
|
+ @Query(value = "DROP VIEW IF EXISTS `zdday`",nativeQuery = true)
|
|
|
void dropByZdDay();
|
|
|
|
|
|
@Transactional
|
|
|
@Modifying
|
|
|
- @Query(value = "DROP VIEW if \\exists `zgweek`",nativeQuery = true)
|
|
|
+ @Query(value = "DROP VIEW IF EXISTS `zgweek`",nativeQuery = true)
|
|
|
void dropByZgWeek();
|
|
|
@Transactional
|
|
|
@Modifying
|
|
|
- @Query(value = "DROP VIEW if \\exists `zdweek`",nativeQuery = true)
|
|
|
+ @Query(value = "DROP VIEW IF EXISTS `zdweek`",nativeQuery = true)
|
|
|
void dropByZdWeek();
|
|
|
|
|
|
/**
|
|
@@ -129,15 +129,16 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
"SELECT @id \\:= @id+1 as id,zg_name,zg_num,time,null as money,null as zd_name,0 as zd_num,null as week_time from zgmonth a " +
|
|
|
"WHERE 3> (SELECT COUNT(*) from (SELECT @id \\:=0) r,zgmonth b WHERE a.time = b.time and a.zg_num < b.zg_num))a ",
|
|
|
countQuery="select count(*) from(" +
|
|
|
- "SELECT @id := @id+1 as id,zg_name,zg_num,time from (SELECT @id :=0) r,zgmonth a " +
|
|
|
+ "SELECT @id \\:= @id+1 as id,zg_name,zg_num,time from (SELECT @id \\:=0) r,zgmonth a " +
|
|
|
"WHERE 3> (SELECT COUNT(*) from zgmonth b WHERE a.time = b.time and a.zg_num < b.zg_num)" +
|
|
|
")a ",nativeQuery = true)
|
|
|
Page<DmHaveDinner> selectByZgMonth(Pageable pageable);
|
|
|
+
|
|
|
@Query(value = "SELECT id,zg_name,zg_num,CONCAT( time, '-01 00:00:00' ) time,CAST(money AS DECIMAL(15,2)) money,zd_name,zd_num,week_time FROM("+
|
|
|
"SELECT @id \\:= @id+1 as id,null as zg_name,0 as zg_num,time,money,zd_name,zd_num,null as week_time from zdmonth a " +
|
|
|
"WHERE 1> (SELECT COUNT(*) from (SELECT @id \\:=0) r,zdmonth b WHERE a.time = b.time and a.zd_num > b.zd_num))a ",
|
|
|
countQuery="select count(*) from(" +
|
|
|
- "SELECT @id := @id+1 as id,zd_name,zd_num,time from (SELECT @id :=0) r,zdmonth a " +
|
|
|
+ "SELECT @id \\:= @id+1 as id,zd_name,zd_num,time from (SELECT @id \\:=0) r,zdmonth a " +
|
|
|
"WHERE 1> (SELECT COUNT(*) from zdmonth b WHERE a.time = b.time and a.zd_num > b.zd_num)" +
|
|
|
")a ",nativeQuery = true)
|
|
|
Page<DmHaveDinner> selectByZdMonth(Pageable pageable);
|
|
@@ -146,7 +147,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
"SELECT @id \\:= @id+1 as id,zg_name,zg_num,time,null as money,null as zd_name,0 as zd_num,null as week_time from zgyear a " +
|
|
|
"WHERE 3> (SELECT COUNT(*) from (SELECT @id \\:=0) r,zgyear b WHERE a.time = b.time and a.zg_num < b.zg_num))a ",
|
|
|
countQuery="select count(*) from(" +
|
|
|
- "SELECT @id := @id+1 as id,zg_name,zg_num,time from (SELECT @id :=0) r,zgyear a " +
|
|
|
+ "SELECT @id \\:= @id+1 as id,zg_name,zg_num,time from (SELECT @id \\:=0) r,zgyear a " +
|
|
|
"WHERE 3> (SELECT COUNT(*) from zgyear b WHERE a.time = b.time and a.zg_num < b.zg_num)" +
|
|
|
")a ",nativeQuery = true)
|
|
|
Page<DmHaveDinner> selectByZgYear(Pageable pageable);
|
|
@@ -154,7 +155,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
"SELECT @id \\:= @id+1 as id,zd_name,zd_num,time,money,null as zg_name,0 as zg_num,null as week_time from zdyear a " +
|
|
|
"WHERE 1> (SELECT COUNT(*) from (SELECT @id \\:=0) r,zdyear b WHERE a.time = b.time and a.zd_num > b.zd_num))a ",
|
|
|
countQuery="select count(*) from(" +
|
|
|
- "SELECT @id := @id+1 as id,zd_name,zd_num,time from (SELECT @id :=0) r,zdyear a " +
|
|
|
+ "SELECT @id \\:= @id+1 as id,zd_name,zd_num,time from (SELECT @id \\:=0) r,zdyear a " +
|
|
|
"WHERE 1> (SELECT COUNT(*) from zdyear b WHERE a.time = b.time and a.zd_num > b.zd_num)" +
|
|
|
")a ",nativeQuery = true)
|
|
|
Page<DmHaveDinner> selectByZdYear(Pageable pageable);
|
|
@@ -180,7 +181,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
"SELECT @id \\:= @id+1 as id,zg_name,zg_num,null as time,null as money,null as zd_name,0 as zd_num,week_time from zgweek a " +
|
|
|
"WHERE 3> (SELECT COUNT(*) from (SELECT @id \\:=0) r,zgweek b WHERE a.week_time = b.week_time and a.zg_num < b.zg_num))a ",
|
|
|
countQuery="select count(*) from(" +
|
|
|
- "SELECT @id := @id+1 as id,zg_name,zg_num,time from (SELECT @id :=0) r,zgweek a " +
|
|
|
+ "SELECT @id \\:= @id+1 as id,zg_name,zg_num,time from (SELECT @id \\:=0) r,zgweek a " +
|
|
|
"WHERE 3> (SELECT COUNT(*) from zgweek b WHERE a.time = b.time and a.zg_num < b.zg_num)" +
|
|
|
")a ",nativeQuery = true)
|
|
|
Page<DmHaveDinner> selectByZgWeek(Pageable pageable);
|
|
@@ -188,7 +189,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
|
|
|
"SELECT @id \\:= @id+1 as id,zd_name,zd_num,null as time,money,null as zg_name,0 as zg_num,week_time from zdweek a " +
|
|
|
"WHERE 1> (SELECT COUNT(*) from (SELECT @id \\:=0) r,zdweek b WHERE a.week_time = b.week_time and a.zd_num > b.zd_num))a ",
|
|
|
countQuery="select count(*) from(" +
|
|
|
- "SELECT @id := @id+1 as id,zd_name,zd_num,time from (SELECT @id :=0) r,zdweek a " +
|
|
|
+ "SELECT @id \\:= @id+1 as id,zd_name,zd_num,time from (SELECT @id \\:=0) r,zdweek a " +
|
|
|
"WHERE 1> (SELECT COUNT(*) from zdweek b WHERE a.time = b.time and a.zd_num > b.zd_num)" +
|
|
|
")a ",nativeQuery = true)
|
|
|
Page<DmHaveDinner> selectByZdWeek(Pageable pageable);
|