@Query("select new cn.srblog.springbootcurd.vo.StudentTypeInfoVo(count(s.id),m.name) " + "FROM MusicType m left JOIN Student s on s.musicTypeId = m.id group by m.id ") List<StudentTypeInfoVo> getTypeInfo(); }
@Query(nativeQuery = true,value = "SELECT " + " c.id as id," + "DAYOFWEEK(c.start_time) as week," + "m.name as musicType," + "t.name as teacherName," + "c.start_time as startTime," + "c.end_time as endTime " + " FROM t_courseplan c,t_musictype m , t_teacher t " + " WHERE DATE(c.start_time) < DATE_ADD(CURDATE(), INTERVAL 7 DAY ) AND CURDATE() <= DATE(c.start_time) " + " and t.id=c.tea_id and c.music_type_id = m.id order by c.start_time ") List<CoursePlanVos> getWeekList();
@Query(value = "select count(s.id) as count,m.name as name " + " FROM t_musictype m left JOIN t_student s on s.music_type_id = m.id group by m.id ",nativeQuery = true) List<Object[]> listType1();