From 7e7f901b2172281dc294dfbc67e6ad00625f09f4 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 04 三月 2024 10:11:21 +0800
Subject: [PATCH] 合并代码

---
 cloud-server-course/src/main/resources/mapper/CoursePackageStudentMapper.xml |  102 ++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 77 insertions(+), 25 deletions(-)

diff --git a/cloud-server-course/src/main/resources/mapper/CoursePackageStudentMapper.xml b/cloud-server-course/src/main/resources/mapper/CoursePackageStudentMapper.xml
index f9e2d0d..48d9f6e 100644
--- a/cloud-server-course/src/main/resources/mapper/CoursePackageStudentMapper.xml
+++ b/cloud-server-course/src/main/resources/mapper/CoursePackageStudentMapper.xml
@@ -1,35 +1,87 @@
 <?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.CoursePackageStudentMapper">
+    <update id="updateSignInOrNotById">
+        update t_course_package_student set signInOrNot = 2 where id =#{id}
+    </update>
 
 
-    <select id="queryStuDeduClassHourNums" resultType="com.dsh.course.entity.CoursePackageStudent">
-        SELECT *
-        FROM t_course_package_student
-        UNION ALL
-        SELECT *
-        FROM t_course_package_student1
-        UNION ALL
-        SELECT *
-        FROM t_course_package_student2
-        UNION ALL
-        SELECT *
-        FROM t_course_package_student3
-        UNION ALL
-        SELECT *
-        FROM t_course_package_student4
-        UNION ALL
-        SELECT *
-        FROM t_course_package_student5
-        WHERE signInOrNot = 1
-        <if test="courseId != null">
-            and coursePackageId = #{courseId}
+    <select id="queryCoursePackageStudentList" resultType="map">
+        select
+        CAST(id AS CHAR(20)) as id,
+        appUserId,
+        studentId,
+        signInOrNot,
+        reservationStatus
+        from t_course_package_student where 1=1
+        <if test="ids != null and ids.size() > 0">
+            and coursePackageSchedulingId in
+            <foreach collection="ids" close=")" item="id" open="(" separator=",">
+                #{id}
+            </foreach>
         </if>
-        <if test="stuId != null ">
-            and studentId = #{stuId}
+
+        and reservationStatus != 3
+        <if test="null != userId">
+            and appUserId in
+            <foreach collection="appUserId" item="item" index="index" separator="," open="(" close=")">
+                #{item}
+            </foreach>
         </if>
-        <if test="appUserId != null">
-            and appUserId = #{appUserId}
+        <if test="null != studentId">
+            and studentId in
+            <foreach collection="studentId" item="item" index="index" separator="," open="(" close=")">
+                #{item}
+            </foreach>
         </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_order_student  py
+
+           where  py.studentId = #{tStudentId}
+
+    </select>
+
+    <select id="getClassList" resultType="com.dsh.course.entity.dto.ClassListDto">
+
+        SELECT
+        *,
+        pg.NAME AS className,
+        pg.`type` AS classType
+        FROM
+        t_course_package_order_student py
+        LEFT JOIN t_course_package pg ON py.coursePackageId = pg.id
+
+        <where>
+              py.status = 1
+            <if test="null != tStudentId">
+                and py.studentId = #{tStudentId}
+            </if>
+            and pg.type!=3
+        </where>
+    </select>
+    <select id="getMaxDate" resultType="java.util.Date">
+        SELECT
+            MAX(useTime)
+        FROM t_course_package_payment py
+        where py.studentId = #{tStudentId}
+    </select>
+    <select id="getHoliList" resultType="com.dsh.course.entity.dto.ClassListDto">
+        select
+            od.id,od.insertTime as insertTime, cp.name as className,cp.type as classType
+        from t_course_package_order od
+                 left join t_course_package cp on od.coursePackageId = cp.id
+
+        WHERE            od.payStatus = 2  and cp.type = 2
+
+
+
     </select>
 </mapper>

--
Gitblit v1.7.1