PianoRoomTimeDao.xml 1.3 KB

1234567891011121314151617181920212223242526272829
  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.PianoRoomTimeDao">
  4. <select id="selectRemainTime" resultType="com.yonge.cooleshow.biz.dal.vo.PianoRoomTimeVo"
  5. parameterType="java.lang.Long">
  6. SELECT *,
  7. (SELECT COUNT(1) FROM user_binding_teacher WHERE teacher_id_=#{teacherId}) AS studentCount
  8. FROM piano_room_time
  9. WHERE teacher_id_=#{teacherId}
  10. </select>
  11. <select id="countStudent" resultType="java.lang.Integer">
  12. SELECT COUNT(1) FROM user_binding_teacher WHERE teacher_id_=#{teacherId}
  13. </select>
  14. <update id="updateEndTime">
  15. <foreach collection="list" item="item" index="index" separator=";">
  16. UPDATE user_binding_teacher
  17. SET last_end_class_ = #{item.endTime}
  18. WHERE teacher_id_ = #{item.teacherId}
  19. AND student_id_ = #{item.studentId}
  20. </foreach>
  21. </update>
  22. <update id="updateBatch">
  23. <foreach collection="list" item="item" index="index" separator=";">
  24. UPDATE piano_room_time
  25. SET frozen_time_ = #{item.frozenTime}
  26. WHERE teacher_id_ = #{item.teacherId}
  27. </foreach>
  28. </update>
  29. </mapper>