parent
e76bf59263
commit
3ab7b73ec9
@ -0,0 +1,38 @@
|
||||
package com.hzu.bookingsystem.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Data
|
||||
public class LabRecordDTO {
|
||||
// 学年
|
||||
private String year;
|
||||
|
||||
// 学期
|
||||
private Integer semester;
|
||||
|
||||
// 几周
|
||||
private Integer week;
|
||||
|
||||
// 周几
|
||||
private Integer day;
|
||||
|
||||
// 第几节课
|
||||
private Integer time;
|
||||
|
||||
private Integer status;
|
||||
|
||||
//UC
|
||||
private String course_name;
|
||||
private Integer population;
|
||||
private String classes;
|
||||
|
||||
//LAB
|
||||
private String lab_name;
|
||||
|
||||
private String position;
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.hzu.bookingsystem.repository;
|
||||
|
||||
import com.hzu.bookingsystem.dto.LabRecordDTO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface LabRecordDTOMapper {
|
||||
@Select("SELECT " +
|
||||
" tb_lab_time.`year`, " +
|
||||
" tb_lab_time.semester, " +
|
||||
"COUNT(tb_lab_time.`week`) AS `week`,"+
|
||||
" tb_lab_time.`day`, " +
|
||||
" tb_lab_time.time, " +
|
||||
" tb_lab_record.`status`, " +
|
||||
" tb_user_course.`name` AS course_name, " +
|
||||
" tb_user_course.population, " +
|
||||
" tb_user_course.classes, " +
|
||||
" tb_lab.`name` AS lab_name, " +
|
||||
" tb_lab.position " +
|
||||
"FROM " +
|
||||
" tb_lab_time " +
|
||||
" INNER JOIN " +
|
||||
" tb_lab_record " +
|
||||
" ON " +
|
||||
" tb_lab_time.lt_id = tb_lab_record.lt_id " +
|
||||
" INNER JOIN " +
|
||||
" tb_lab " +
|
||||
" ON " +
|
||||
" tb_lab_time.lab_id = tb_lab.lab_id, " +
|
||||
" tb_user_course " +
|
||||
"WHERE " +
|
||||
" tb_lab_time.lt_id = tb_lab_record.lt_id AND " +
|
||||
" tb_lab_record.uc_id = tb_user_course.uc_id AND " +
|
||||
" tb_lab_time.lab_id = tb_lab.lab_id AND " +
|
||||
" tb_user_course.u_id = #{uId} " +
|
||||
"GROUP BY " +
|
||||
" tb_lab_time.`year`, " +
|
||||
" tb_lab_time.semester, " +
|
||||
" tb_lab_time.`day`, " +
|
||||
" tb_lab_time.time, " +
|
||||
" tb_lab_record.`status`")
|
||||
List<LabRecordDTO> getRecordListByUId(Integer uId);
|
||||
}
|
Loading…
Reference in new issue