|
@@ -25,7 +25,7 @@
|
|
|
<result column="group_status_" property="groupStatus"
|
|
|
typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="be_renew_group_id_" property="beRenewGroupId"/>
|
|
|
- <result column="educational_teacher_id_" property="educationalTeacherId" />
|
|
|
+ <result column="educational_teacher_id_" property="educationalTeacherId"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="PracticeCourseDto" type="com.ym.mec.biz.dal.dto.PracticeCourseDto" extends="PracticeGroup">
|
|
@@ -58,28 +58,28 @@
|
|
|
WHERE id_ = #{practiceGroupId}
|
|
|
</update>
|
|
|
|
|
|
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.PracticeGroup">
|
|
|
- UPDATE practice_group
|
|
|
- <set>
|
|
|
- <if test="subjectId!=null">
|
|
|
- subject_id_=#{subjectId},
|
|
|
- </if>
|
|
|
- <if test="memo!=null">
|
|
|
- memo_=#{memo},
|
|
|
- </if>
|
|
|
- <if test="name!=null">
|
|
|
- name_=#{name},
|
|
|
- </if>
|
|
|
- <if test="groupStatus!=null">
|
|
|
- group_status_=#{groupStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- </if>
|
|
|
- <if test="educationalTeacherId!=null">
|
|
|
- educational_teacher_id_=#{educationalTeacherId},
|
|
|
- </if>
|
|
|
- update_time_ = NOW()
|
|
|
- </set>
|
|
|
- WHERE id_ = #{id}
|
|
|
- </update>
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.PracticeGroup">
|
|
|
+ UPDATE practice_group
|
|
|
+ <set>
|
|
|
+ <if test="subjectId!=null">
|
|
|
+ subject_id_=#{subjectId},
|
|
|
+ </if>
|
|
|
+ <if test="memo!=null">
|
|
|
+ memo_=#{memo},
|
|
|
+ </if>
|
|
|
+ <if test="name!=null">
|
|
|
+ name_=#{name},
|
|
|
+ </if>
|
|
|
+ <if test="groupStatus!=null">
|
|
|
+ group_status_=#{groupStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ <if test="educationalTeacherId!=null">
|
|
|
+ educational_teacher_id_=#{educationalTeacherId},
|
|
|
+ </if>
|
|
|
+ update_time_ = NOW()
|
|
|
+ </set>
|
|
|
+ WHERE id_ = #{id}
|
|
|
+ </update>
|
|
|
|
|
|
<update id="batchUpdate">
|
|
|
<foreach collection="groups" item="group" separator=";">
|
|
@@ -116,8 +116,8 @@
|
|
|
</selectKey>
|
|
|
-->
|
|
|
INSERT INTO practice_group
|
|
|
- (id_,name_,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_)
|
|
|
- VALUES(#{id},#{name},#{subjectId},#{userId},#{studentId},#{singleClassMinutes},#{organId},#{coursesStartDate},#{coursesExpireDate},NOW(),NOW(),#{memo},#{buyMonths},#{drillTimesOnWeek},#{drillTimesJson},#{groupStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{beRenewGroupId})
|
|
|
+ (id_,name_,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},#{subjectId},#{userId},#{studentId},#{singleClassMinutes},#{organId},#{coursesStartDate},#{coursesExpireDate},NOW(),NOW(),#{memo},#{buyMonths},#{drillTimesOnWeek},#{drillTimesJson},#{groupStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{beRenewGroupId},#{educationalTeacherId})
|
|
|
</insert>
|
|
|
|
|
|
<select id="getUserFreePracticeGroup" resultMap="PracticeGroup">
|
|
@@ -272,7 +272,7 @@
|
|
|
|
|
|
<sql id="practiceGroupReviewsQueryCondition">
|
|
|
<where>
|
|
|
- pg.group_status_ != 'CANCEL' AND pg.group_status_ != 'LOCK'
|
|
|
+ pg.group_status_ != 'LOCK'
|
|
|
<if test="month != null">
|
|
|
AND DATE_FORMAT(cse.create_time_, '%Y-%m') = #{month}
|
|
|
</if>
|
|
@@ -339,7 +339,7 @@
|
|
|
pg.single_class_minutes_ total_minutes_
|
|
|
FROM practice_group pg
|
|
|
LEFT JOIN class_group cg on pg.id_ = cg.music_group_id_ AND cg.group_type_ = 'PRACTICE'
|
|
|
- WHERE cg.group_type_ = 'PRACTICE'
|
|
|
+ WHERE pg.group_status_ = 'NORMAL' AND cg.group_type_ = 'PRACTICE'
|
|
|
AND pg.buy_months_ >= 1
|
|
|
AND pg.courses_start_date_ <= #{nowDate,jdbcType=DATE}
|
|
|
AND pg.courses_expire_date_ >= #{afterDate,jdbcType=DATE}
|
|
@@ -348,11 +348,9 @@
|
|
|
AND DATE_FORMAT(pg.courses_expire_date_, '%d') = DATE_FORMAT(#{afterDate}, '%d')
|
|
|
</if>
|
|
|
<if test="afterDateIsLastDay == true">
|
|
|
- <![CDATA[ AND DATE_FORMAT(pg.courses_expire_date_, '%d') >= DATE_FORMAT(#{afterDate}, '%d') ]]>
|
|
|
+ <![CDATA[ AND DATE_FORMAT(pg.courses_expire_date_, '%d') >= DATE_FORMAT(#{afterDate}, '%d') ]]>
|
|
|
</if>
|
|
|
- AND cg.del_flag_ = 0
|
|
|
- AND pg.group_status_ != 'CANCEL'
|
|
|
- AND pg.group_status_ != 'LOCK'
|
|
|
+ AND cg.del_flag_ = 0
|
|
|
</select>
|
|
|
|
|
|
<select id="getReportCourseTimes" resultMap="com.ym.mec.biz.dal.dao.ClassGroupDao.ClassGroup">
|
|
@@ -366,8 +364,9 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="findByGroupId" resultMap="PracticeCourseDto">
|
|
|
- SELECT pg.*,s.name_ subject_name_ FROM practice_group pg
|
|
|
- LEFT JOIN subject s on pg.subject_id_ = s.id_
|
|
|
+ SELECT pg.*, s.name_ subject_name_
|
|
|
+ FROM practice_group pg
|
|
|
+ LEFT JOIN subject s on pg.subject_id_ = s.id_
|
|
|
WHERE pg.id_ = #{id}
|
|
|
</select>
|
|
|
</mapper>
|