|
@@ -1922,64 +1922,15 @@
|
|
|
|
|
|
<sql id="endFindCourseSchedulesCondition">
|
|
|
<where>
|
|
|
- <if test="search != null">
|
|
|
- AND (cs.name_ LIKE CONCAT('%',#{search},'%') OR cs.id_ = #{search}
|
|
|
- <if test="groups != null and organIdList==null">
|
|
|
- OR cs.music_group_id_ IN
|
|
|
- <foreach collection="groups" item="group" open="(" close=")" separator=",">
|
|
|
- #{group.id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="courseIds != null and organIdList==null">
|
|
|
- OR cs.id_ IN
|
|
|
- <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
|
|
|
- #{courseId}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- )
|
|
|
- </if>
|
|
|
- <if test="groups != null and organIdList!=null">
|
|
|
- AND cs.music_group_id_ IN
|
|
|
- <foreach collection="groups" item="group" open="(" close=")" separator=",">
|
|
|
- #{group.id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="courseIds != null and organIdList!=null">
|
|
|
+ <if test="courseScheduleIds != null">
|
|
|
AND cs.id_ IN
|
|
|
- <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
|
|
|
+ <foreach collection="courseScheduleIds" item="courseId" open="(" close=")" separator=",">
|
|
|
#{courseId}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="teacherIdList != null">
|
|
|
AND FIND_IN_SET(cs.actual_teacher_id_,#{teacherIdList})
|
|
|
</if>
|
|
|
- <if test="groupType != null">
|
|
|
- AND cs.group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
- </if>
|
|
|
- <if test="groupId != null">
|
|
|
- AND cs.music_group_id_=#{groupId}
|
|
|
- </if>
|
|
|
- <if test="classGroupId != null">
|
|
|
- AND cs.class_group_id_=#{classGroupId}
|
|
|
- </if>
|
|
|
- <if test="startTime!=null and endTime==null">
|
|
|
- AND cs.class_date_ > DATE_FORMAT(#{startTime},"%Y-%m-%d")
|
|
|
- </if>
|
|
|
- <if test="startTime==null and endTime!=null">
|
|
|
- AND cs.class_date_ < DATE_FORMAT(#{endTime},"%Y-%m-%d")
|
|
|
- </if>
|
|
|
- <if test="startTime!=null and endTime!=null">
|
|
|
- AND cs.class_date_ BETWEEN DATE_FORMAT(#{startTime},"%Y-%m-%d") AND DATE_FORMAT(#{endTime},"%Y-%m-%d")
|
|
|
- </if>
|
|
|
- <if test="courseStatus!=null">
|
|
|
- AND cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
- </if>
|
|
|
- <if test="courseType!=null">
|
|
|
- AND cs.type_ = #{courseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
- </if>
|
|
|
- <if test="schoolId!=null">
|
|
|
- AND cs.schoole_id_ = #{schoolId}
|
|
|
- </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
|
|
@@ -2075,4 +2026,54 @@
|
|
|
WHERE group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
AND music_group_id_=#{groupId}
|
|
|
</select>
|
|
|
+ <select id="queryMusicCourseScheduleIds" resultType="java.lang.Integer">
|
|
|
+ SELECT cs.id_ FROM course_schedule cs
|
|
|
+ LEFT JOIN music_group mg ON cs.music_group_id_ = mg.id_
|
|
|
+ LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
|
|
|
+ WHERE cs.group_type_ = 'MUSIC' AND mg.status_ = 'PROGRESS' AND cs.del_flag_ = 0 AND cg.del_flag_ = 0
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ AND (mg.id_ = #{search} OR mg.name_ LIKE CONCAT('%',#{search},'%')
|
|
|
+ OR cs.id_ = #{search} OR cs.name_ LIKE CONCAT('%',#{search},'%')
|
|
|
+ OR cg.id_ = #{search} OR cg.name_ LIKE CONCAT('%',#{search},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="organIdList != null and organIdList != ''">
|
|
|
+ AND FIND_IN_SET(mg.organ_id_,#{organIdList})
|
|
|
+ </if>
|
|
|
+ <include refid="queryVipCourseScheduleIds"/>
|
|
|
+ </select>
|
|
|
+ <sql id="queryVipCourseScheduleIds">
|
|
|
+ <if test="startTime!=null and endTime==null">
|
|
|
+ AND cs.class_date_ > DATE_FORMAT(#{startTime},"%Y-%m-%d")
|
|
|
+ </if>
|
|
|
+ <if test="startTime==null and endTime!=null">
|
|
|
+ AND cs.class_date_ < DATE_FORMAT(#{endTime},"%Y-%m-%d")
|
|
|
+ </if>
|
|
|
+ <if test="startTime!=null and endTime!=null">
|
|
|
+ AND cs.class_date_ BETWEEN DATE_FORMAT(#{startTime},"%Y-%m-%d") AND DATE_FORMAT(#{endTime},"%Y-%m-%d")
|
|
|
+ </if>
|
|
|
+ <if test="courseStatus!=null">
|
|
|
+ AND cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ </if>
|
|
|
+ <if test="courseType!=null">
|
|
|
+ AND cs.type_ = #{courseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ </if>
|
|
|
+ <if test="schoolId!=null">
|
|
|
+ AND cs.schoole_id_ = #{schoolId}
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+ <select id="queryVipCourseScheduleIds" resultType="java.lang.Integer">
|
|
|
+ SELECT cs.id_ FROM course_schedule cs
|
|
|
+ LEFT JOIN vip_group vg ON cs.music_group_id_ = vg.id_
|
|
|
+ LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
|
|
|
+ WHERE cs.group_type_ = 'VIP' AND vg.status_ = '2' AND cs.del_flag_ = 0 AND cg.del_flag_ = 0
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ AND (vg.id_ = #{search} OR vg.name_ LIKE CONCAT('%',#{search},'%')
|
|
|
+ OR cs.id_ = #{search} OR cs.name_ LIKE CONCAT('%',#{search},'%')
|
|
|
+ OR cg.id_ = #{search} OR cg.name_ LIKE CONCAT('%',#{search},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="organIdList != null and organIdList != ''">
|
|
|
+ AND FIND_IN_SET(vg.organ_id_,#{organIdList})
|
|
|
+ </if>
|
|
|
+ <include refid="queryVipCourseScheduleIds"/>
|
|
|
+ </select>
|
|
|
</mapper>
|