|
@@ -1,10 +1,8 @@
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
<mapper namespace="com.ym.mec.biz.dal.mapper.LessonCoursewareMapper">
|
|
|
-
|
|
|
- <select id="selectPage" resultType="com.ym.mec.biz.dal.wrapper.LessonCoursewareWrapper$LessonCoursewareDto">
|
|
|
- select lc.id_ id, lc.subject_id_ subjectId, lc.lesson_course_id_ lessonCoursewareId, lc.enable_ enable from lesson_courseware lc
|
|
|
- left join lesson_courseware_user_mapper lcum ON lcum.lesson_courseware_id_ = lc.id_
|
|
|
+
|
|
|
+ <sql id="selectPageSql">
|
|
|
<where>
|
|
|
<if test="param.studentId != null">
|
|
|
AND (lc.student_range_type_ == 'ALL' OR (lcum.user_id_ = #{param.studentId} AND lcum.user_type_ = 'STUDENT'))
|
|
@@ -12,6 +10,12 @@
|
|
|
<if test="param.teacherId != null">
|
|
|
AND (lc.teacher_range_type_ == 'ALL' OR (lcum.user_id_ = #{param.teacherId} AND lcum.user_type_ = 'TEACHER'))
|
|
|
</if>
|
|
|
+ <if test="param.lessonCoursewareIds != null">
|
|
|
+ and lc.lesson_course_id_ IN
|
|
|
+ <foreach collection="param.lessonCoursewareIds" item="lessonCoursewareId" open="(" close=")" separator=",">
|
|
|
+ #{lessonCoursewareId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<if test="param.subjectId != null">
|
|
|
and lc.id_subject_id_ = #{param.subjectId}
|
|
|
</if>
|
|
@@ -25,6 +29,18 @@
|
|
|
and lc.id_enable_ = #{param.enable}
|
|
|
</if>
|
|
|
</where>
|
|
|
+ </sql>
|
|
|
+ <select id="selectPage" resultType="com.ym.mec.biz.dal.wrapper.LessonCoursewareWrapper$LessonCoursewareDto">
|
|
|
+ select lc.id_ id, lc.subject_id_ subjectId, lc.lesson_course_id_ lessonCoursewareId, lc.enable_ enable from lesson_courseware lc
|
|
|
+ left join lesson_courseware_user_mapper lcum ON lcum.lesson_courseware_id_ = lc.id_
|
|
|
+ <include refid="selectPageSql"/>
|
|
|
+ GROUP BY lc.id_
|
|
|
+ order by lc.create_time_ desc
|
|
|
+ </select>
|
|
|
+ <select id="selectList" resultType="com.ym.mec.biz.dal.wrapper.LessonCoursewareWrapper$LessonCoursewareDto">
|
|
|
+ select lc.id_ id, lc.subject_id_ subjectId, lc.lesson_course_id_ lessonCoursewareId, lc.enable_ enable from lesson_courseware lc
|
|
|
+ left join lesson_courseware_user_mapper lcum ON lcum.lesson_courseware_id_ = lc.id_
|
|
|
+ <include refid="selectPageSql"/>
|
|
|
GROUP BY lc.id_
|
|
|
order by lc.create_time_ desc
|
|
|
</select>
|