|
@@ -1,5 +1,5 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.yonge.cooleshow.biz.dal.dao.VideoLessonGroupDao">
|
|
|
<resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup">
|
|
@@ -86,8 +86,8 @@
|
|
|
LEFT JOIN video_lesson_purchase_record p ON g.id_ = p.video_lesson_group_id_
|
|
|
LEFT JOIN sys_user s ON g.teacher_id_ = s.id_
|
|
|
<where>
|
|
|
- <if test="param.studentId !=null">
|
|
|
- AND p.student_id_ = #{param.studentId}
|
|
|
+ <if test="param.userId !=null">
|
|
|
+ AND p.student_id_ = #{param.userId}
|
|
|
</if>
|
|
|
<if test="null != param.search and '' != param.search">
|
|
|
AND (
|
|
@@ -114,4 +114,65 @@
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
+ <select id="selectTeacherPage" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonTeacherVo">
|
|
|
+ SELECT
|
|
|
+ g.id_ AS groupId,
|
|
|
+ g.lesson_name_ AS lessonName,
|
|
|
+ g.lesson_subject_ AS lessonSubject,
|
|
|
+ g.lesson_count_ AS lessonCount,
|
|
|
+ g.lesson_price_ AS lessonPrice,
|
|
|
+ g.audit_status_ AS auditStatus,
|
|
|
+ (SELECT COUNT(1) FROM video_lesson_purchase_record r WHERE r.video_lesson_group_id_=g.id_) AS countStudent,
|
|
|
+ g.create_time_ AS createTime,
|
|
|
+ g.lesson_desc_ AS lessonDesc
|
|
|
+ FROM video_lesson_group g
|
|
|
+ <where>
|
|
|
+ <if test="param.userId !=null">
|
|
|
+ AND g.teacher_id_ = #{param.userId}
|
|
|
+ </if>
|
|
|
+ <if test="null != param.search and '' != param.search">
|
|
|
+ AND (
|
|
|
+ g.id_ LIKE CONCAT('%', #{param.search}, '%') OR
|
|
|
+ g.lesson_name_ LIKE CONCAT('%', #{param.search}, '%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="null != param.lessonSubject and '' != param.lessonSubject">
|
|
|
+ AND g.lesson_subject_ = #{param.lessonSubject}
|
|
|
+ </if>
|
|
|
+ <if test="param.auditStatus !=null">
|
|
|
+ AND g.audit_status_ = #{param.auditStatus}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="selectPurchaseStudent" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonPurchaseVo">
|
|
|
+ SELECT
|
|
|
+ p.student_id_ AS studentId,
|
|
|
+ u.username_ AS username,
|
|
|
+ p.pay_money_ AS payMoney,
|
|
|
+ p.order_no_ AS orderNo,
|
|
|
+ p.purchase_time_ AS purchaseTime
|
|
|
+ FROM video_lesson_purchase_record p
|
|
|
+ LEFT JOIN sys_user u ON p.student_id_ = u.id_
|
|
|
+ <where>
|
|
|
+ <if test="param.videoLessonGroupId !=null">
|
|
|
+ AND p.video_lesson_group_id_ = #{param.videoLessonGroupId}
|
|
|
+ </if>
|
|
|
+ <if test="null != param.search and '' != param.search">
|
|
|
+ AND (
|
|
|
+ u.id_ LIKE CONCAT('%', #{param.search}, '%') OR
|
|
|
+ u.username_ LIKE CONCAT('%', #{param.search}, '%') OR
|
|
|
+ u.phone_ LIKE CONCAT('%', #{param.search}, '%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="null != param.orderNo and '' != param.orderNo">
|
|
|
+ AND p.order_no_ = #{param.orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="param.startTime !=null">
|
|
|
+ <![CDATA[AND p.purchase_time_ >= #{param.startTime} ]]>
|
|
|
+ </if>
|
|
|
+ <if test="param.endTime !=null">
|
|
|
+ <![CDATA[AND p.purchase_time_ <= #{param.endTime} ]]>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|