浏览代码

add 对内评价接口

周箭河 5 年之前
父节点
当前提交
b8f689df9a

+ 41 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleReviewDao.java

@@ -0,0 +1,41 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.dto.CourseReviewDto;
+import com.ym.mec.biz.dal.entity.CourseScheduleReview;
+import com.ym.mec.common.dal.BaseDAO;
+
+import java.util.List;
+import java.util.Map;
+
+public interface CourseScheduleReviewDao extends BaseDAO<Integer, CourseScheduleReview> {
+
+    /**
+     * 网管课评价列表
+     *
+     * @param params
+     * @return
+     */
+    List<CourseReviewDto> getPracticeGroupReviewList(Map<String, Object> params);
+
+    /**
+     * 网管课评价总条数
+     *
+     * @param params
+     * @return
+     */
+    Integer countPracticeGroupReviews(Map<String, Object> params);
+
+    /**
+     * 教务网管课评论列表
+     *
+     * @return
+     */
+    List<CourseScheduleReview> getPracticeGroupReview4EduList(Map<String, Object> params);
+
+    /**
+     * 教务网管课评论条数
+     *
+     * @return
+     */
+    Integer countPracticeGroupReviews4Edu(Map<String, Object> params);
+}

+ 294 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleReview.java

@@ -0,0 +1,294 @@
+package com.ym.mec.biz.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import java.util.Date;
+
+public class CourseScheduleReview {
+    /**
+    * 评价id
+    */
+    private Integer id;
+
+    /**
+    * 课程id
+    */
+    @ApiModelProperty(value = "课程编号",required = false)
+    private Integer courseScheduleId;
+
+    /**
+    * 班级id
+    */
+    private Integer classGroupId;
+
+    /**
+    * 老师id
+    */
+    private Integer teacherId;
+
+    /**
+    * 教务老师id
+    */
+    private Integer educationalTeacherId;
+
+    /**
+    * 学生id
+    */
+    private Integer studentId;
+
+    /**
+    * 教材内容
+    */
+    private String teachingMaterial;
+
+    /**
+    * 曲目
+    */
+    private String song;
+
+    /**
+    * 评价备注
+    */
+    private String memo;
+
+    /**
+    * 发音
+    */
+    private Integer pronunciation;
+
+    /**
+    * 节奏
+    */
+    private Integer tempo;
+
+    /**
+    * 乐理
+    */
+    private Integer musicTheory;
+
+    /**
+    * 是否双向沟通 0-否 1-是
+    */
+    private Integer hasLiaison;
+
+    /**
+    * 是否交作业 0-否 1-是
+    */
+    private Integer handHomework;
+
+    /**
+    * 课程评价
+    */
+    private String courseReview;
+
+    /**
+     * 学生评价
+     */
+    private Integer studentReview;
+
+    /**
+    * 评价时间
+    */
+    private Date createTime;
+
+    /**
+    * 修改时间
+    */
+    private Date updateTime;
+
+    /**
+     * 作业
+     */
+    private String homeWork;
+
+    @ApiModelProperty(value = "上课日期",required = false)
+    private Date classDate;
+
+    @ApiModelProperty(value = "课程名称",required = false)
+    private String courseName;
+
+    @ApiModelProperty(value = "老师名字",required = false)
+    private String teacherName;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getCourseScheduleId() {
+        return courseScheduleId;
+    }
+
+    public void setCourseScheduleId(Integer courseScheduleId) {
+        this.courseScheduleId = courseScheduleId;
+    }
+
+    public Integer getClassGroupId() {
+        return classGroupId;
+    }
+
+    public void setClassGroupId(Integer classGroupId) {
+        this.classGroupId = classGroupId;
+    }
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public Integer getEducationalTeacherId() {
+        return educationalTeacherId;
+    }
+
+    public void setEducationalTeacherId(Integer educationalTeacherId) {
+        this.educationalTeacherId = educationalTeacherId;
+    }
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public String getTeachingMaterial() {
+        return teachingMaterial;
+    }
+
+    public void setTeachingMaterial(String teachingMaterial) {
+        this.teachingMaterial = teachingMaterial;
+    }
+
+    public String getSong() {
+        return song;
+    }
+
+    public void setSong(String song) {
+        this.song = song;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+
+    public Integer getPronunciation() {
+        return pronunciation;
+    }
+
+    public void setPronunciation(Integer pronunciation) {
+        this.pronunciation = pronunciation;
+    }
+
+    public Integer getTempo() {
+        return tempo;
+    }
+
+    public void setTempo(Integer tempo) {
+        this.tempo = tempo;
+    }
+
+    public Integer getMusicTheory() {
+        return musicTheory;
+    }
+
+    public void setMusicTheory(Integer musicTheory) {
+        this.musicTheory = musicTheory;
+    }
+
+    public Integer getHasLiaison() {
+        return hasLiaison;
+    }
+
+    public void setHasLiaison(Integer hasLiaison) {
+        this.hasLiaison = hasLiaison;
+    }
+
+    public Integer getHandHomework() {
+        return handHomework;
+    }
+
+    public void setHandHomework(Integer handHomework) {
+        this.handHomework = handHomework;
+    }
+
+    public String getCourseReview() {
+        return courseReview;
+    }
+
+    public void setCourseReview(String courseReview) {
+        this.courseReview = courseReview;
+    }
+
+    public Integer getStudentReview() {
+        return studentReview;
+    }
+
+    public void setStudentReview(Integer studentReview) {
+        this.studentReview = studentReview;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
+    public Date getClassDate() {
+        return classDate;
+    }
+
+    public void setClassDate(Date classDate) {
+        this.classDate = classDate;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public String getHomeWork() {
+        return homeWork;
+    }
+
+    public void setHomeWork(String homeWork) {
+        this.homeWork = homeWork;
+    }
+}

+ 239 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleReviewMapper.xml

@@ -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>