From 02fa12e93281fea472323201e5eb6ab55466a63d Mon Sep 17 00:00:00 2001
From: heheng <heheng@123456>
Date: 星期四, 23 一月 2025 08:35:48 +0800
Subject: [PATCH] 特种作业非煤缴费版本导入优化

---
 exam-system/src/main/resources/mapper/pay/NonCoalPayMapper.xml |   40 +++++++++++++++++++++++++++++-----------
 1 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/exam-system/src/main/resources/mapper/pay/NonCoalPayMapper.xml b/exam-system/src/main/resources/mapper/pay/NonCoalPayMapper.xml
index 1452f5f..b273dae 100644
--- a/exam-system/src/main/resources/mapper/pay/NonCoalPayMapper.xml
+++ b/exam-system/src/main/resources/mapper/pay/NonCoalPayMapper.xml
@@ -52,12 +52,18 @@
         <result property="categoryAmount" column="category_amount"/>
     </resultMap>
 
-    <resultMap id="getNonCoalPayResultH5" type="com.gkhy.exam.pay.dto.rep.NonCoalPayDetailH5RepDto">
+    <resultMap id="getNonCoalPayResultH5" type="com.gkhy.exam.pay.dto.rep.NonCoalPayDetailH5RepDto"
+               extends="getNonCoalPayResult">
         <result property="nonCoalStudentId" column="non_coal_student_id"/>
         <result property="phone" column="phone"/>
         <result property="idCard" column="id_card"/>
         <result property="studentName" column="student_name"/>
-
+        <result property="payStatus" column="pay_status"/>
+        <!--        <result property="govPayStatus" column="gov_pay_status"/>-->
+        <result property="fileData" column="file_data"/>
+        <result property="nonCoalPayType" column="non_coal_pay_type"/>
+        <result property="orderId" column="order_id"/>
+        <result property="createTime" column="create_time"/>
     </resultMap>
 
 
@@ -117,7 +123,12 @@
         <if test="payCompanyName != null  and payCompanyName != ''">and a.pay_company_name like concat('%',
             #{payCompanyName}, '%')
         </if>
-
+        <if test="params.startTime != null and params.startTime != ''"><!-- 开始时间检索 -->
+            AND a.create_time &gt;= #{params.startTime}
+        </if>
+        <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+            AND a.create_time &lt;= #{params.endTime}
+        </if>
         <if test="payCompanyCard != null  and payCompanyCard != ''">and a.pay_company_card = #{payCompanyCard}</if>
         order by a.create_time desc
     </select>
@@ -156,22 +167,28 @@
         select a.id,
                a.batch_name,
                a.dept_id,
-               d2.name as district_name,
+               d2.name    as district_name,
                d.dept_name,
                a.district_code,
                a.pay_type,
                a.amount,
                a.year,
                a.quarter,
-               b.id    as non_category_id,
+               b.id       as non_category_id,
                b.category_id,
                c.subject_name,
                c.category_type,
                b.category_amount,
-               t.id    as non_coal_student_id,
+               t.id       as non_coal_student_id,
                t.phone,
                t.id_card,
-               t.name  as student_name
+               t.name     as student_name,
+               t.pay_status,
+--                t.gov_pay_status,
+               t.file_data,
+               t.pay_type as non_coal_pay_type,
+               t.order_id,
+               t.create_time
         from non_coal_pay a
                  inner join non_coal_pay_student t on t.non_coal_pay_id = a.id and t.del_flag = 0
                  inner join non_coal_pay_category b on a.id = b.non_coal_pay_id and b.del_flag = 0
@@ -179,9 +196,10 @@
                  left join sys_dept d on a.dept_id = d.dept_id
                  left join sys_district d2 on a.district_code = d2.code
         where a.del_flag = 0
-          and t.pay_status = 0
           and t.phone = #{phone}
-          and t.id_card = #{idCard} limit 1
+          and t.id_card = #{idCard}
+        order by t.pay_status asc, t.create_time desc
+
     </select>
 
 
@@ -245,10 +263,10 @@
         where id = #{id}
     </update>
 
-    <update id="deleteNonCoalPayById" parameterType="Long">
+    <update id="deleteNonCoalPayById">
         update non_coal_pay
         set del_flag  = 2,
-            update_by = #{updateBy} non_coal_pay
+            update_by = #{updateBy}
         where id = #{id}
     </update>
 

--
Gitblit v1.9.2