|
|
@@ -29,6 +29,10 @@
|
|
|
<result column="be_renew_group_id_" property="beRenewGroupId"/>
|
|
|
<result column="educational_teacher_id_" property="educationalTeacherId"/>
|
|
|
<result column="course_schedule_json_" property="courseScheduleJson"/>
|
|
|
+ <result column="payment_expire_date_" property="paymentExpireDate"/>
|
|
|
+ <result column="registration_start_time_" property="registrationStartTime"/>
|
|
|
+ <result column="course_num_" property="allCourseNum"/>
|
|
|
+ <result column="total_price_" property="totalPrice"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="PracticeCourseDto" type="com.ym.mec.biz.dal.dto.PracticeCourseDto" extends="PracticeGroup">
|
|
|
@@ -67,6 +71,18 @@
|
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.PracticeGroup">
|
|
|
UPDATE practice_group
|
|
|
<set>
|
|
|
+ <if test="totalPrice != null">
|
|
|
+ total_price_ = #{totalPrice},
|
|
|
+ </if>
|
|
|
+ <if test="paymentExpireDate != null">
|
|
|
+ payment_expire_date_ = #{paymentExpireDate},
|
|
|
+ </if>
|
|
|
+ <if test="registrationStartTime != null">
|
|
|
+ registration_start_time_ = #{registrationStartTime},
|
|
|
+ </if>
|
|
|
+ <if test="allCourseNum != null">
|
|
|
+ course_num_ = #{allCourseNum},
|
|
|
+ </if>
|
|
|
<if test="courseScheduleJson != null">
|
|
|
course_schedule_json_ = #{courseScheduleJson},
|
|
|
</if>
|
|
|
@@ -140,14 +156,16 @@
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.PracticeGroup" useGeneratedKeys="true" keyColumn="id"
|
|
|
keyProperty="id">
|
|
|
- <!--
|
|
|
- <selectKey resultClass="int" keyProperty="id" >
|
|
|
- SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
- </selectKey>
|
|
|
- -->
|
|
|
INSERT INTO practice_group
|
|
|
- (id_,name_,type_,subject_id_,user_id_,student_id_,single_class_minutes_,organ_id_,courses_start_date_,courses_expire_date_,create_time_,update_time_,memo_,buy_months_,drill_times_on_week_,drill_times_json_,group_status_,be_renew_group_id_,educational_teacher_id_)
|
|
|
- VALUES(#{id},#{name},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{subjectId},#{userId},#{studentId},#{singleClassMinutes},#{organId},#{coursesStartDate},#{coursesExpireDate},NOW(),NOW(),#{memo},#{buyMonths},#{drillTimesOnWeek},#{drillTimesJson},#{groupStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{beRenewGroupId},#{educationalTeacherId})
|
|
|
+ (id_,name_,type_,subject_id_,user_id_,student_id_,single_class_minutes_,
|
|
|
+ organ_id_,courses_start_date_,courses_expire_date_,create_time_,update_time_,
|
|
|
+ memo_,buy_months_,drill_times_on_week_,drill_times_json_,group_status_,
|
|
|
+ be_renew_group_id_,educational_teacher_id_,payment_expire_date_,registration_start_time_,course_num_,total_price_)
|
|
|
+ VALUES(#{id},#{name},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{subjectId},#{userId},#{studentId},#{singleClassMinutes},#{organId},#{coursesStartDate},
|
|
|
+ #{coursesExpireDate},NOW(),NOW(),#{memo},#{buyMonths},#{drillTimesOnWeek},#{drillTimesJson},
|
|
|
+ #{groupStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{beRenewGroupId},
|
|
|
+ #{educationalTeacherId},#{paymentExpireDate},#{registrationStartTime},#{allCourseNum},#{totalPrice})
|
|
|
</insert>
|
|
|
|
|
|
<select id="getUserFreePracticeGroup" resultMap="PracticeGroup">
|
|
|
@@ -775,4 +793,24 @@
|
|
|
FROM practice_group
|
|
|
WHERE student_id_ = #{userId} AND courses_start_date_ = #{courseStartDate} AND courses_expire_date_ = #{courseEndDate}
|
|
|
</select>
|
|
|
+ <select id="findPracticeGroups" resultMap="com.ym.mec.biz.dal.dao.VipGroupDao.studentVipGroup">
|
|
|
+ SELECT pg.id_,pg.name_,pg.single_class_minutes_,pg.payment_expire_date_,pg.courses_expire_date_,
|
|
|
+ pg.courses_start_date_,pg.course_num_ online_classes_num_,pg.total_price_,cg.expect_student_num_,
|
|
|
+ cg.student_num_,su.real_name_ teacher_name_,su.avatar_,pg.create_time_
|
|
|
+ FROM practice_group pg
|
|
|
+ LEFT JOIN class_group cg ON pg.id_ = cg.music_group_id_ AND cg.group_type_ = 'PRACTICE'
|
|
|
+ LEFT JOIN teacher t ON pg.user_id_ = t.id_
|
|
|
+ LEFT JOIN sys_user su ON pg.user_id_ = su.id_
|
|
|
+ WHERE pg.audit_status_ = 'PASS' AND pg.group_status_ = 'APPLYING' AND pg.courses_expire_date_ >= DATE_FORMAT(NOW(),'%Y%m%d')
|
|
|
+ AND pg.registration_start_time_ <= NOW()
|
|
|
+ AND pg.courses_start_date_ > NOW()
|
|
|
+ AND (select count(1) as num from student_payment_order where pg.id_ = music_group_id_ AND user_id_ = #{userId}
|
|
|
+ AND status_='SUCCESS') = 0 AND pg.student_id_ = #{userId}
|
|
|
+ <if test="subjectId != null">
|
|
|
+ AND pg.subject_id_ = #{subjectId}
|
|
|
+ </if>
|
|
|
+ <if test="search != null">
|
|
|
+ AND pg.name_ LIKE concat('%',#{search},'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|