puzhibing
2023-08-14 1882d607549762a84b1a5326f7262eba01363b85
cloud-server-course/src/main/resources/mapper/TCoursePackagePaymentMapper.xml
@@ -42,4 +42,65 @@
        and `code` = #{code}
    </if>
    </select>
    <select id="queryRegistrationRecord" resultType="map">
        select
        CAST(id AS CHAR(20)) as id,
        appUserId,
        studentId,
        DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as insertTime,
        totalClassHours,
        absencesNumber,
        `status`
        from t_course_package_payment where payStatus = 2 and state = 1
        <if test="null != coursePackageId">
            and coursePackageId = #{coursePackageId}
        </if>
        <if test="null != userIds">
            and appUserId in
            <foreach collection="userIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        <if test="null != studentIds">
            and studentId in
            <foreach collection="studentIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        order by insertTime desc
    </select>
    <select id="queryWalkInStudentList" resultType="map">
        select
        CAST(id AS CHAR(20)) as id,
        appUserId,
        studentId
        from t_course_package_payment where payStatus = 2 and state = 1
        <if test="null != coursePackageId">
            and coursePackageId = #{coursePackageId}
        </if>
        <if test="null != coursePackagePaymentId">
            and id not in
            <foreach collection="coursePackagePaymentId" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        <if test="null != userIds">
            and appUserId in
            <foreach collection="userIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        <if test="null != studentIds">
            and studentId in
            <foreach collection="studentIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        order by insertTime desc
    </select>
</mapper>