CourseScheduleStudentMapper.xml 1002 B

1234567891011121314151617181920212223
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.yonge.cooleshow.biz.dal.dao.CourseScheduleStudentDao">
  4. <insert id="insertBatch">
  5. INSERT INTO course_schedule_student (course_id_, student_id_) VALUES
  6. <foreach collection ="list" item="item" separator =",">
  7. (#{item.courseId}, #{item.studentId})
  8. </foreach >
  9. </insert>
  10. <select id="selectUser" resultType="com.yonge.cooleshow.biz.dal.vo.CourseScheduleStudentVo">
  11. SELECT
  12. c.id_ AS courseId,
  13. c.teacher_id_ AS teacherId,
  14. s.student_id_ AS studentId,
  15. c.end_time_ AS endTime,
  16. c.single_course_time_ AS singleCourseTime
  17. FROM course_schedule c
  18. LEFT JOIN course_schedule_student s ON c.id_ = s.course_id_
  19. WHERE c.lock_ = 0
  20. AND c.status_ IN ('ING','NOT_START')
  21. AND NOW() &gt;= c.end_time_
  22. </select>
  23. </mapper>