liujie
2023-09-20 d09828cdec78a160f4530a8ab245216ed8671c27
cloud-server-course/src/main/resources/mapper/CoursePackageStudentMapper.xml
@@ -26,4 +26,40 @@
        </if>
        order by insertTime desc
    </select>
    <select id="listAll" resultType="com.dsh.course.entity.StudentClassInfo">
        SELECT
            SUM( py.totalClassHours ) AS totalHours,
            SUM( py.laveClassHours ) AS restHours,
            SUM( py.giftClassHours ) as giftHours
        FROM
            t_course_package_payment  py
           where  py.studentId = #{tStudentId}
    </select>
    <select id="getClassList" resultType="com.dsh.course.entity.dto.ClassListDto">
        SELECT
            *,
            pg.NAME AS className,
            ty.`name` AS classType
        FROM
            t_course_package_payment py
                LEFT JOIN t_course_package pg ON py.coursePackageId = pg.id
                LEFT JOIN t_course_package_type ty ON pg.type = ty.id
        <where>
            <if test="null != tStudentId">
                py.studentId = #{tStudentId}
            </if>
        </where>
    </select>
    <select id="getMaxDate" resultType="java.util.Date">
        SELECT
            MAX(useTime)
        FROM t_course_package_payment py
        where py.studentId = #{tStudentId}
    </select>
</mapper>