liujie
2023-09-25 d41358fce9a436d81b9341d06fc1d8f3ddff92ff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsh.course.mapper.CancelledClassesMapper">
 
    <select id="listAll" resultType="com.dsh.course.model.CancelClassesVO">
        SELECT
        t1.*,
        t2.name,
        CONCAT(t2.province, t2.city) AS provinceAndCity,
        t2.storeId,
        CONCAT(t3.classDate, t3.endDate) AS startAndEnd
        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
        <where>
            <if test="query.courseName!=null and query.courseName!= ''">
                and t5.name = #{query.courseName}
            </if>
            <if test="sTime !=null and sTime!= '' and eTime !=null and eTime!= ''">
                and t1.insertTime between #{sTime} and #{eTime}
            </if>
        </where>
    </select>
 
</mapper>