44323
2023-09-23 753145b81710f934c28b29a1feb376ce79d4a965
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
<?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.CoursePackagePaymentConfigMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.dsh.course.entity.CoursePackagePaymentConfig">
        <id column="id" property="id" />
        <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" />
    </resultMap>
    <update id="changeState">
            update t_course_package_payment2 set
            payStatus = 2,payUserName = #{payUserName},payType = 7,payUserId=#{payUserId}
            <where>
                <if test="ids != null and ids.size()>0">
                    AND t_course_package_payment2.id IN
                    <foreach collection="ids" separator="," item="id" open="(" close=")">
                        #{id}
                    </foreach>
                </if>
            </where>
    </update>
 
    <select id="listAll" resultType="com.dsh.course.model.CoursePackagePaymentVO">
        select t1.id,t1.studentId,t1.payUserType,t1.payStatus,t1.payType,t1.originalPrice,t1.userCouponId,t1.payUserId,t1.giftClassHours,t1.studentId,t1.appUserId,t1.cashPayment,t1.playPaiCoin,
        t1.payUserName as buyTypeName,
               CONCAT(t2.province,t2.city) as provinceAndCity,t2.coursePackageTypeId,t2.storeId,t2.name as coursePackage,
               t3.name as coursePackageType
        from t_course_package_payment2 t1
        left join t_course_package t2 on t1.coursePackageId = t2.id
        left join t_course_package_type t3 on t2.coursePackageTypeId = t3.id
        <where>
            <if test="query.province!=null and query.province!= ''">
                and t2.province = #{query.province}
            </if>
            <if test="query.city!=null and query.city!= ''">
                and t2.city = #{query.city}
            </if>
            <if test="query.coursePackageTypeId!=null and query.coursePackageTypeId!= ''">
                and t3.id = #{query.coursePackageTypeId}
            </if>
            <if test="query.coursePackageTypeName!=null and query.coursePackageTypeName!= ''">
                and t2.name like concat('%',#{query.coursePackageTypeName},'%')
            </if>
            <if test="query.payStatus!=null and query.payStatus!= ''">
                and t1.payStatus = #{query.payStatus}
            </if>
            <if test="query.payStatus!=null and query.payStatus!= ''">
                and t1.payStatus = #{query.payStatus}
            </if>
        </where>
    </select>
 
</mapper>