lisy
2023-06-30 add48c8930d02d58046e89e78b0530c2d5fce32d
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
<?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.TCoursePackagePaymentMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.dsh.course.entity.TCoursePackagePayment">
        <id column="id" property="id" />
        <result column="appUserId" property="appUserId" />
        <result column="studentId" property="studentId" />
        <result column="coursePackageId" property="coursePackageId" />
        <result column="payType" property="payType" />
        <result column="classHours" property="classHours" />
        <result column="cashPayment" property="cashPayment" />
        <result column="playPaiCoin" property="playPaiCoin" />
        <result column="totalClassHours" property="totalClassHours" />
        <result column="laveClassHours" property="laveClassHours" />
        <result column="absencesNumber" property="absencesNumber" />
        <result column="payUserType" property="payUserType" />
        <result column="payStatus" property="payStatus" />
        <result column="orderNumber" property="orderNumber" />
        <result column="payUserId" property="payUserId" />
        <result column="status" property="status" />
        <result column="withdrawalTime" property="withdrawalTime" />
        <result column="certificate" property="certificate" />
        <result column="state" property="state" />
        <result column="insertTime" property="insertTime" />
    </resultMap>
    <select id="queryAllCoursePackage" resultType="com.dsh.course.entity.TCoursePackagePayment">
        SELECT *
        FROM t_course_package_payment
        UNION ALL
        SELECT *
        FROM t_course_package_payment1
        UNION ALL
        SELECT *
        FROM t_course_package_payment2
        UNION ALL
        SELECT *
        FROM t_course_package_payment3
        UNION ALL
        SELECT *
        FROM t_course_package_payment4
        UNION ALL
        SELECT *
        FROM t_course_package_payment5
        WHERE 1=1
        <if test=" stuId != null">
            and studentId  = #{stuId}
        </if>
        <if test="appUserId != null">
            and appUserId = #{appUserId}
        </if>
        <if test="startTime != null and endTime != null">
            and (insertTime between #{startTime} and #{endTime})
        </if>
        <if test="coursePackId != null ">
            and coursePackageId = #{coursePackId}
        </if>
    </select>
 
</mapper>