44323
2023-09-25 89c36365eda5cdd23de2338f1c28a5b250ea7b34
cloud-server-course/src/main/resources/mapper/CancelledClassesMapper.xml
@@ -7,22 +7,31 @@
        t1.*,
        t2.name,
        CONCAT(t2.province, t2.city) AS provinceAndCity,
        t2.storeId,
        CONCAT(t3.classDate, t3.endDate) AS startAndEnd
        t2.storeId,t2.coachId,
        t2.name as courseName,t2.coachId,t3.studentId
        FROM
        t_cancelled_classes t1
        LEFT JOIN
        t_course_package t2 ON t1.coursePackageId = t2.id
        LEFT JOIN (SELECT id,classDate,endDate FROM t_course_package_scheduling
        ) t3
        ON t1.coursePackageSchedulingId = t3.id
        LEFT JOIN t_course_package t2 ON t1.coursePackageId = t2.id
        inner join t_course_package_payment t3 on t1.coursePackagePaymentId = t3.id
        <where>
            <if test="query.courseName!=null and query.courseName!= ''">
                and t5.name = #{query.courseName}
                and t2.name = #{query.courseName}
            </if>
            <if test="sTime !=null and sTime!= '' and eTime !=null and eTime!= ''">
                and t1.insertTime between #{sTime} and #{eTime}
            </if>
            <if test="query.studentIds != null and query.studentIds.size()>0">
                AND t3.studentId IN
                <foreach collection="query.studentIds" separator="," item="id" open="(" close=")">
                    #{id}
                </foreach>
            </if>
            <if test="query.coachIds != null and query.coachIds.size()>0">
                AND t2.coachId IN
                <foreach collection="query.coachIds" separator="," item="id" open="(" close=")">
                    #{id}
                </foreach>
            </if>
        </where>
    </select>