lisy
2023-07-06 d061aa842106480f3a8991d83dc3b978441330ab
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?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.CoursePackageStudentMapper">
 
 
    <select id="queryStuDeduClassHourNums" resultType="com.dsh.course.entity.CoursePackageStudent">
        SELECT *
        FROM t_course_package_student
        UNION ALL
        SELECT *
        FROM t_course_package_student1
        UNION ALL
        SELECT *
        FROM t_course_package_student2
        UNION ALL
        SELECT *
        FROM t_course_package_student3
        UNION ALL
        SELECT *
        FROM t_course_package_student4
        UNION ALL
        SELECT *
        FROM t_course_package_student5
        WHERE signInOrNot = 1
        <if test="courseId != null">
            and coursePackageId = #{courseId}
        </if>
        <if test="stuId != null ">
            and studentId = #{stuId}
        </if>
        <if test="appUserId != null">
            and appUserId = #{appUserId}
        </if>
    </select>
    <select id="queryAppUserOfStuAttendClass" resultType="com.dsh.course.entity.CoursePackageStudent">
        SELECT *
        FROM t_course_package_student
        UNION ALL
        SELECT *
        FROM t_course_package_student1
        UNION ALL
        SELECT *
        FROM t_course_package_student2
        UNION ALL
        SELECT *
        FROM t_course_package_student3
        UNION ALL
        SELECT *
        FROM t_course_package_student4
        UNION ALL
        SELECT *
        FROM t_course_package_student5
        WHERE signInOrNot = 1 and reservationStatus = 1
        <if test=" appUserId != null">
            and appUserId = #{appUserId}
        </if>
        <if test="coursePackageIds.size >0">
            and coursePackageId in
        <foreach collection="coursePackageIds" close=")" index="index" open="(" separator="," item="item">
            #{item}
        </foreach>
        </if>
    </select>
</mapper>