|
@@ -0,0 +1,239 @@
|
|
|
+<?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.dao.CourseScheduleReviewDao">
|
|
|
+ <resultMap id="CourseScheduleReview" type="com.ym.mec.biz.dal.entity.CourseScheduleReview">
|
|
|
+ <id column="id_" jdbcType="INTEGER" property="id"/>
|
|
|
+ <result column="course_schedule_id_" jdbcType="INTEGER" property="courseScheduleId"/>
|
|
|
+ <result column="class_group_id_" jdbcType="INTEGER" property="classGroupId"/>
|
|
|
+ <result column="teacher_id_" jdbcType="INTEGER" property="teacherId"/>
|
|
|
+ <result column="educational_teacher_id_" jdbcType="INTEGER" property="educationalTeacherId"/>
|
|
|
+ <result column="student_id_" jdbcType="INTEGER" property="studentId"/>
|
|
|
+ <result column="teaching_material_" jdbcType="VARCHAR" property="teachingMaterial"/>
|
|
|
+ <result column="song_" jdbcType="VARCHAR" property="song"/>
|
|
|
+ <result column="memo_" jdbcType="VARCHAR" property="memo"/>
|
|
|
+ <result column="pronunciation_" jdbcType="INTEGER" property="pronunciation"/>
|
|
|
+ <result column="tempo_" jdbcType="INTEGER" property="tempo"/>
|
|
|
+ <result column="music_theory_" jdbcType="INTEGER" property="musicTheory"/>
|
|
|
+ <result column="has_liaison_" jdbcType="TINYINT" property="hasLiaison"/>
|
|
|
+ <result column="hand_homework_" jdbcType="TINYINT" property="handHomework"/>
|
|
|
+ <result column="course_review_" jdbcType="VARCHAR" property="courseReview"/>
|
|
|
+ <result column="student_review_" jdbcType="TINYINT" property="studentReview"/>
|
|
|
+ <result column="create_time_" jdbcType="DATE" property="createTime"/>
|
|
|
+ <result column="update_time_" jdbcType="DATE" property="updateTime"/>
|
|
|
+ <result column="coursre_name_" jdbcType="VARCHAR" property="courseName"/>
|
|
|
+ <result column="teacher_name_" jdbcType="VARCHAR" property="teacherName"/>
|
|
|
+ <result column="class_date_" jdbcType="DATE" property="classDate"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="get" parameterType="java.lang.Integer" resultMap="CourseScheduleReview">
|
|
|
+ select * from course_schedule_review
|
|
|
+ where id_ = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <delete id="delete" parameterType="java.lang.Integer">
|
|
|
+ delete
|
|
|
+ from course_schedule_review
|
|
|
+ where id_ = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleReview"
|
|
|
+ useGeneratedKeys="true">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into course_schedule_review (course_schedule_id_, class_group_id_, teacher_id_,
|
|
|
+ educational_teacher_id_, student_id_, teaching_material_,
|
|
|
+ song_, memo_, pronunciation_,
|
|
|
+ tempo_, music_theory_, has_liaison_,
|
|
|
+ hand_homework_, course_review_, create_time_,
|
|
|
+ update_time_)
|
|
|
+ values (#{courseScheduleId,jdbcType=INTEGER}, #{classGroupId,jdbcType=INTEGER}, #{teacherId,jdbcType=INTEGER},
|
|
|
+ #{educationalTeacherId,jdbcType=INTEGER}, #{studentId,jdbcType=INTEGER}, #{teachingMaterial,jdbcType=VARCHAR},
|
|
|
+ #{song,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, #{pronunciation,jdbcType=INTEGER},
|
|
|
+ #{tempo,jdbcType=INTEGER}, #{musicTheory,jdbcType=INTEGER}, #{hasLiaison,jdbcType=TINYINT},
|
|
|
+ #{handHomework,jdbcType=TINYINT}, #{courseReview,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleReview">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ update course_schedule_review
|
|
|
+ <set>
|
|
|
+ <if test="courseScheduleId != null">
|
|
|
+ course_schedule_id_ = #{courseScheduleId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="classGroupId != null">
|
|
|
+ class_group_id_ = #{classGroupId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="teacherId != null">
|
|
|
+ teacher_id_ = #{teacherId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="educationalTeacherId != null">
|
|
|
+ educational_teacher_id_ = #{educationalTeacherId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="studentId != null">
|
|
|
+ student_id_ = #{studentId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="teachingMaterial != null">
|
|
|
+ teaching_material_ = #{teachingMaterial,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="song != null">
|
|
|
+ song_ = #{song,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="memo != null">
|
|
|
+ memo_ = #{memo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="pronunciation != null">
|
|
|
+ pronunciation_ = #{pronunciation,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="tempo != null">
|
|
|
+ tempo_ = #{tempo,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="musicTheory != null">
|
|
|
+ music_theory_ = #{musicTheory,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="hasLiaison != null">
|
|
|
+ has_liaison_ = #{hasLiaison,jdbcType=TINYINT},
|
|
|
+ </if>
|
|
|
+ <if test="handHomework != null">
|
|
|
+ hand_homework_ = #{handHomework,jdbcType=TINYINT},
|
|
|
+ </if>
|
|
|
+ <if test="courseReview != null">
|
|
|
+ course_review_ = #{courseReview,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="studentReview != null">
|
|
|
+ student_review_ = #{studentReview,jdbcType=TINYINT},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time_ = #{createTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time_ = #{updateTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id_ = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <resultMap id="CourseReviewDto" type="com.ym.mec.biz.dal.dto.CourseReviewDto">
|
|
|
+ <id column="id_" jdbcType="INTEGER" property="id"/>
|
|
|
+ <result column="subject_id_" jdbcType="INTEGER" property="subjectId"/>
|
|
|
+ <result column="organ_id_" jdbcType="INTEGER" property="organId"/>
|
|
|
+ <result column="class_date_" jdbcType="DATE" property="classDate"/>
|
|
|
+ <result column="coursre_name_" jdbcType="VARCHAR" property="courseName"/>
|
|
|
+ <result column="teacher_name_" jdbcType="VARCHAR" property="teacherName"/>
|
|
|
+ <result column="edu_teacher_name_" jdbcType="VARCHAR" property="eduTeacherName"/>
|
|
|
+ <result column="buy_months_" property="BuyMonths"/>
|
|
|
+ <result column="review_id_" property="reviewId"/>
|
|
|
+ <result column="student_review_" property="studentReview"/>
|
|
|
+ <result column="hand_homework_" property="handHomework"/>
|
|
|
+ <result column="course_review_" property="courseReview"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="practiceGroupReviewsQueryCondition">
|
|
|
+ <where>
|
|
|
+ AND pg.id_ > 0 AND cs.group_type_='PRACTICE' AND cs.status_='OVER' AND (cs.del_flag_ = 0 OR cs.del_flag_ IS NULL)
|
|
|
+ <if test="organId != null">
|
|
|
+ AND FIND_IN_SET(pg.organ_id_,#{organId})
|
|
|
+ </if>
|
|
|
+ <if test="subjectId != null">
|
|
|
+ AND pg.subject_id_=#{subjectId}
|
|
|
+ </if>
|
|
|
+ <if test="teacherId != null">
|
|
|
+ AND cs.actual_teacher_id_=#{teacherId}
|
|
|
+ </if>
|
|
|
+ <if test="eduTeacherId != null">
|
|
|
+ AND pg.educational_teacher_id_=#{eduTeacherId}
|
|
|
+ </if>
|
|
|
+ <if test='isFree !=null and isFree=="0"'>
|
|
|
+ AND pg.buy_months_ > 0
|
|
|
+ </if>
|
|
|
+ <if test='isFree !=null and isFree=="1"'>
|
|
|
+ AND pg.buy_months_ IS NULL
|
|
|
+ </if>
|
|
|
+ <if test="studentReview !=null">
|
|
|
+ AND pg.student_review_ =#{studentReview}
|
|
|
+ </if>
|
|
|
+ <if test='hasReview !=null and hasReview=="1"'>
|
|
|
+ AND csr.id_ > 0
|
|
|
+ </if>
|
|
|
+ <if test='hasReview !=null and hasReview=="0"'>
|
|
|
+ AND csr.id_ IS NULL
|
|
|
+ </if>
|
|
|
+ <if test='hasHandHomework !=null and hasHandHomework=="1"'>
|
|
|
+ AND csr.hand_homework_ = 1
|
|
|
+ </if>
|
|
|
+ <if test='hasHandHomework !=null and hasHandHomework=="0"'>
|
|
|
+ AND csr.hand_homework_ IS NULL
|
|
|
+ </if>
|
|
|
+ <if test="courseReview != null">
|
|
|
+ AND csr.course_review_=#{courseReview}
|
|
|
+ </if>
|
|
|
+ <if test="startTime !=null">
|
|
|
+ <![CDATA[AND cs.class_date_ >= #{startTime} ]]>
|
|
|
+ </if>
|
|
|
+ <if test="endTime !=null">
|
|
|
+ <![CDATA[AND cs.class_date_ <= #{endTime} ]]>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="getPracticeGroupReviewList" resultMap="CourseReviewDto">
|
|
|
+ SELECT cs.id_,cs.class_date_, pg.subject_id_,pg.organ_id_,pg.name_ coursre_name_,su.real_name_ teacher_name_,edsu.real_name_
|
|
|
+ edu_teacher_name_,pg.buy_months_,csr.id_ review_id_, csr.student_review_,csr.hand_homework_,csr.course_review_
|
|
|
+ FROM course_schedule cs
|
|
|
+ LEFT JOIN practice_group pg ON cs.music_group_id_ = pg.id_
|
|
|
+ LEFT JOIN sys_user su ON cs.actual_teacher_id_ = su.id_
|
|
|
+ LEFT JOIN sys_user edsu ON pg.educational_teacher_id_ = edsu.id_
|
|
|
+ LEFT JOIN course_schedule_review csr on cs.id_ = csr.course_schedule_id_
|
|
|
+ <include refid="practiceGroupReviewsQueryCondition"/>
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="countPracticeGroupReviews" resultType="java.lang.Integer">
|
|
|
+ SELECT count(*) FROM course_schedule cs
|
|
|
+ LEFT JOIN practice_group pg ON cs.music_group_id_ = pg.id_
|
|
|
+ LEFT JOIN course_schedule_review csr on cs.id_ = csr.course_schedule_id_
|
|
|
+ <include refid="practiceGroupReviewsQueryCondition"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <sql id="practiceGroupReviews4EduQueryCondition">
|
|
|
+ <where>
|
|
|
+ <if test="eduTeacherId != null">
|
|
|
+ AND pg.educational_teacher_id_=#{eduTeacherId}
|
|
|
+ </if>
|
|
|
+ <if test='hasReview !=null and hasReview=="1"'>
|
|
|
+ AND csr.course_review_ IS NOT NULL
|
|
|
+ </if>
|
|
|
+ <if test='hasReview !=null and hasReview=="0"'>
|
|
|
+ AND csr.course_review_ IS NULL
|
|
|
+ </if>
|
|
|
+ <if test='hasHandHomework !=null and hasHandHomework=="1"'>
|
|
|
+ AND csr.hand_homework_ = 1
|
|
|
+ </if>
|
|
|
+ <if test='hasHandHomework !=null and hasHandHomework=="0"'>
|
|
|
+ AND csr.hand_homework_ IS NULL
|
|
|
+ </if>
|
|
|
+ <if test="startTime !=null">
|
|
|
+ <![CDATA[AND cs.class_date_ >= #{startTime} ]]>
|
|
|
+ </if>
|
|
|
+ <if test="endTime !=null">
|
|
|
+ <![CDATA[AND cs.class_date_ <= #{endTime} ]]>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="getPracticeGroupReview4EduList" resultMap="CourseScheduleReview">
|
|
|
+ SELECT csr.id_,cs.class_date_, pg.name_ coursre_name_,su.real_name_ teacher_name_,csr.hand_homework_
|
|
|
+ FROM course_schedule_review csr
|
|
|
+ LEFT JOIN course_schedule cs on cs.id_ = csr.course_schedule_id_
|
|
|
+ LEFT JOIN practice_group pg ON cs.music_group_id_ = pg.id_
|
|
|
+ LEFT JOIN sys_user su ON cs.actual_teacher_id_ = su.id_
|
|
|
+ <include refid="practiceGroupReviews4EduQueryCondition"/>
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="countPracticeGroupReviews4Edu" resultType="java.lang.Integer">
|
|
|
+ SELECT count(*) FROM course_schedule_review csr
|
|
|
+ LEFT JOIN course_schedule cs on cs.id_ = csr.course_schedule_id_
|
|
|
+ LEFT JOIN practice_group pg ON cs.music_group_id_ = pg.id_
|
|
|
+ <include refid="practiceGroupReviews4EduQueryCondition"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+</mapper>
|