puzhibing
2024-02-05 640ff18d2d7f4be02ddb7f8f75e899f05545eb98
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
30
31
32
33
34
35
36
37
38
39
40
41
42
<?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,t2.coachId,
        t2.name as courseName,t2.coachId
        FROM
        t_cancelled_classes t1
        LEFT JOIN t_course_package t2 ON t1.coursePackageId = t2.id
 
        <where>
            <if test="query.courseName!=null and 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.coachIds != null and query.coachIds.size()>0">
                AND t2.coachId IN
                <foreach collection="query.coachIds" separator="," item="id" open="(" close=")">
                    #{id}
                </foreach>
            </if>
            <if test="collect != null and collect.size>0">
                AND t2.id IN
                <foreach collection="collect" separator="," item="id" open="(" close=")">
                    #{id}
                </foreach>
            </if>
        </where>
    </select>
    <select id="getRefund" resultType="com.dsh.course.entity.MoneyBack">
        select * from t_back_money where status = 1
    </select>
 
</mapper>