From d30f51ef23798fea6e83859684267cbb133fed9c Mon Sep 17 00:00:00 2001
From: heheng <heheng@123456>
Date: 星期一, 20 一月 2025 10:17:31 +0800
Subject: [PATCH] 特种作业非煤缴费版本

---
 exam-system/src/main/resources/mapper/pay/NonCoalPayStudentMapper.xml |   94 +++++++++++++++++++++++++++++++----------------
 1 files changed, 62 insertions(+), 32 deletions(-)

diff --git a/exam-system/src/main/resources/mapper/pay/NonCoalPayStudentMapper.xml b/exam-system/src/main/resources/mapper/pay/NonCoalPayStudentMapper.xml
index 6bccdb1..b609a23 100644
--- a/exam-system/src/main/resources/mapper/pay/NonCoalPayStudentMapper.xml
+++ b/exam-system/src/main/resources/mapper/pay/NonCoalPayStudentMapper.xml
@@ -1,42 +1,60 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.gkhy.exam.pay.mapper.NonCoalPayStudentMapper">
-    
+
     <resultMap type="NonCoalPayStudent" id="NonCoalPayStudentResult">
-        <result property="id"    column="id"    />
-        <result property="nonCoalPayId"    column="non_coal_pay_id"    />
-        <result property="name"    column="name"    />
-        <result property="idCard"    column="id_card"    />
-        <result property="phone"    column="phone"    />
-        <result property="sex"    column="sex"    />
-        <result property="payCode"    column="pay_code"    />
-        <result property="payStatus"    column="pay_status"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="delFlag"    column="del_flag"    />
+        <result property="id" column="id"/>
+        <result property="nonCoalPayId" column="non_coal_pay_id"/>
+        <result property="name" column="name"/>
+        <result property="idCard" column="id_card"/>
+        <result property="phone" column="phone"/>
+        <result property="sex" column="sex"/>
+        <result property="payCode" column="pay_code"/>
+        <result property="payStatus" column="pay_status"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="payType" column="pay_type"/>
     </resultMap>
 
     <sql id="selectNonCoalPayStudentVo">
-        select id, non_coal_pay_id, name, id_card, phone, sex, pay_code, pay_status, update_by, update_time, create_by, create_time, del_flag from non_coal_pay_student
+        select id,
+               non_coal_pay_id,
+               name,
+               id_card,
+               phone,
+               sex,
+               pay_code,
+               pay_status,
+               update_by,
+               update_time,
+               create_by,
+               create_time,
+               del_flag,
+               pay_type
+        from non_coal_pay_student
     </sql>
 
     <select id="selectNonCoalPayStudentList" parameterType="NonCoalPayStudent" resultMap="NonCoalPayStudentResult">
         <include refid="selectNonCoalPayStudentVo"/>
-        <where>  
-            <if test="nonCoalPayId != null "> and non_coal_pay_id = #{nonCoalPayId}</if>
-            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
-            <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
-            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
-            <if test="sex != null "> and sex = #{sex}</if>
-            <if test="payCode != null  and payCode != ''"> and pay_code = #{payCode}</if>
-            <if test="payStatus != null "> and pay_status = #{payStatus}</if>
+        <where>
+            and del_flag = 0
+            <if test="nonCoalPayId != null ">and non_coal_pay_id = #{nonCoalPayId}</if>
+            <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
+            <if test="idCard != null  and idCard != ''">and id_card = #{idCard}</if>
+            <if test="phone != null  and phone != ''">and phone = #{phone}</if>
+            <if test="sex != null ">and sex = #{sex}</if>
+            <if test="payCode != null  and payCode != ''">and pay_code = #{payCode}</if>
+            <if test="payStatus != null ">and pay_status = #{payStatus}</if>
+            <if test="payType != null ">and pay_type = #{payType}</if>
         </where>
+        order by create_time desc
     </select>
-    
+
     <select id="selectNonCoalPayStudentById" parameterType="Long" resultMap="NonCoalPayStudentResult">
         <include refid="selectNonCoalPayStudentVo"/>
         where id = #{id}
@@ -52,13 +70,14 @@
             <if test="phone != null and phone != ''">phone,</if>
             <if test="sex != null">sex,</if>
             <if test="payCode != null">pay_code,</if>
+            <if test="payType != null">pay_type,</if>
             <if test="payStatus != null">pay_status,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="delFlag != null">del_flag,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
             <if test="nonCoalPayId != null">#{nonCoalPayId},</if>
@@ -67,15 +86,22 @@
             <if test="phone != null and phone != ''">#{phone},</if>
             <if test="sex != null">#{sex},</if>
             <if test="payCode != null">#{payCode},</if>
+            <if test="payType != null">#{payType},</if>
             <if test="payStatus != null">#{payStatus},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="delFlag != null">#{delFlag},</if>
-         </trim>
+        </trim>
     </insert>
 
+    <update id="updateNonCoalPayStudentType">
+        update non_coal_pay_student
+        set pay_type  = 2,
+            update_by = #{updateBy}
+        where non_coal_pay_id = #{id}
+    </update>
     <update id="updateNonCoalPayStudent" parameterType="NonCoalPayStudent">
         update non_coal_pay_student
         <trim prefix="SET" suffixOverrides=",">
@@ -84,6 +110,7 @@
             <if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
             <if test="phone != null and phone != ''">phone = #{phone},</if>
             <if test="sex != null">sex = #{sex},</if>
+            <if test="payType != null">pay_type = #{payType},</if>
             <if test="payCode != null">pay_code = #{payCode},</if>
             <if test="payStatus != null">pay_status = #{payStatus},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
@@ -95,12 +122,15 @@
         where id = #{id}
     </update>
 
-    <delete id="deleteNonCoalPayStudentById" parameterType="Long">
-        delete from non_coal_pay_student where id = #{id}
-    </delete>
+    <update id="deleteNonCoalPayStudentById">
+        update non_coal_pay_student
+        set del_flag  = 2,
+            update_by = #{updateBy}
+        where id = #{id}
+    </update>
 
     <delete id="deleteNonCoalPayStudentByIds" parameterType="String">
-        delete from non_coal_pay_student where id in 
+        delete from non_coal_pay_student where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

--
Gitblit v1.9.2