From 7808456a1e50af2dbd67488278eac85a558bd8f9 Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期日, 08 十月 2023 17:05:36 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai --- cloud-server-course/src/main/resources/mapper/TCoursePackagePaymentMapper.xml | 71 +++++++++++++++++++++++++++++++++++ 1 files changed, 71 insertions(+), 0 deletions(-) diff --git a/cloud-server-course/src/main/resources/mapper/TCoursePackagePaymentMapper.xml b/cloud-server-course/src/main/resources/mapper/TCoursePackagePaymentMapper.xml index cbbc616..149f878 100644 --- a/cloud-server-course/src/main/resources/mapper/TCoursePackagePaymentMapper.xml +++ b/cloud-server-course/src/main/resources/mapper/TCoursePackagePaymentMapper.xml @@ -134,6 +134,77 @@ </select> + <select id="getStudentTotal" resultType="map"> + + SELECT * from( + SELECT studentId, totalClassHours, name as courseName, laveClassHours,cashPayment as cashPayment,hasHours,appUserId,insertTime + FROM ( + SELECT studentId, totalClassHours, name, laveClassHours,cashPayment, (totalClassHours - laveClassHours) AS hasHours,py.appUserId,py.insertTime + FROM t_course_package_payment py + LEFT JOIN t_course_package cp ON py.coursePackageId = cp.id + UNION ALL + SELECT studentId, SUM(totalClassHours) AS totalClassHours,'总计' as name, SUM(laveClassHours) AS laveClassHours, SUM(cashPayment) AS cashPayment, + (SUM(totalClassHours) - SUM(laveClassHours)) AS hasHours,py.appUserId,py.insertTime + FROM t_course_package_payment py + LEFT JOIN t_course_package cp ON py.coursePackageId = cp.id + GROUP BY studentId + ORDER BY studentId, totalClassHours + ) subquery + ) a + <where> + <if test="null != start and '' != start and null != end and '' != end"> + a.insertTime between #{start} and #{end} + </if> + + </where> + + </select> + <select id="pacQueryDto" resultType="map"> + + SELECT + coursePackageId, + SUM( cashPayment ) AS cashPayment, + SUM( totalClassHours ) AS totalClassHours, + SUM( totalClassHours - laveClassHours ) AS hasHours, + ROUND( SUM(( totalClassHours - laveClassHours ) * ( cashPayment / totalClassHours )), 2 ) AS lavePay, + cp.`name` , + cp.province, + cp.city, + cp.storeId,cp.cityCode,cp.provinceCode,py.insertTime + FROM + t_course_package_payment py + LEFT JOIN t_course_package cp ON py.coursePackageId = cp.id + + + <where> + <if test="null != start and '' != start and null != end and '' != end"> + py.insertTime between #{start} and #{end} + </if> + <if test="null != cityCode and '' != cityCode"> + and cityCode =#{cityCode} + </if> + + <if test="null != provinceCode and '' != provinceCode"> + and provinceCode =#{provinceCode} + </if> + + <if test="null != name and '' != name"> + and name like CONCAT('%', #{name}, '%') + </if> + + + </where> + GROUP BY + coursePackageId + + + + + </select> + + <select id="listOne" resultType="com.dsh.course.entity.TCoursePackagePayment"> + select * from t_course_package_payment where appUserId in <foreach collection="ids" separator="," open="(" item="id" close=")">#{id}</foreach> + </select> <update id="updateBytime"> update t_course_package_payment -- Gitblit v1.7.1