教育训练处考试制证系统后端
heheng
2025-05-19 c0895bccd7e54f867bbdf0f32d2fd04e97d0c223
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<?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.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="payType" column="pay_type"/>
        <result property="orderNo" column="order_no"/>
        <result property="orderId" column="order_id"/>
        <result property="fileData" column="file_data"/>
        <result property="payTime" column="pay_time"/>
        <result property="govPayStatus" column="gov_pay_status"/>
        <result property="train" column="train"/>
    </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,
               pay_type,
               order_no,
               order_id,
               file_data,
               pay_time,
               gov_pay_status,
               train
        from non_coal_pay_student
    </sql>
 
    <select id="selectNonCoalPayStudentList" parameterType="NonCoalPayStudent" resultMap="NonCoalPayStudentResult">
        <include refid="selectNonCoalPayStudentVo"/>
        <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}
    </select>
 
    <insert id="insertNonCoalPayStudent" parameterType="NonCoalPayStudent">
        insert into non_coal_pay_student
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="nonCoalPayId != null">
                non_coal_pay_id,
            </if>
            <if test="name != null and name != ''">
                name,
            </if>
            <if test="idCard != null and idCard != ''">
                id_card,
            </if>
            <if test="phone != null and phone != ''">
                phone,
            </if>
            <if test="sex != null">
                sex,
            </if>
            <if test="govPayStatus!=null">
                gov_pay_status,
            </if>
            <if test="payCode != null">
                pay_code,
            </if>
            <if test="payType != null">
                pay_type,
            </if>
            <if test="orderNo != null and orderNo != '' ">
                order_no,
            </if>
            <if test="train != null and train != '' ">
                train,
            </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 prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id},
            </if>
            <if test="nonCoalPayId != null">
                #{nonCoalPayId},
            </if>
            <if test="name != null and name != ''">
                #{name},
            </if>
            <if test="idCard != null and idCard != ''">
                #{idCard},
            </if>
            <if test="phone != null and phone != ''">
                #{phone},
            </if>
            <if test="sex != null">
                #{sex},
            </if>
            <if test="govPayStatus!=null">
                #{govPayStatus},
            </if>
            <if test="payCode != null">
                #{payCode},
            </if>
            <if test="payType != null">
                #{payType},
            </if>
            <if test="orderNo != null and orderNo != '' ">
                #{orderNo},
            </if>
            <if test="train != null and train != '' ">
                #{train},
            </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>
    </insert>
 
    <update id="updateNonCoalPayStudentType">
        update non_coal_pay_student
        set pay_type  = 2,
            update_by = #{updateBy}
        where non_coal_pay_id = #{id}
          and pay_status = 0
          and order_no is null
    </update>
 
 
    <select id="getsch" resultMap="NonCoalPayStudentResult">
        select *
        from non_coal_pay_student
        where order_no is not null
          and pay_status = 0
          and pay_type = 1
          and update_time between '2025-02-28 00:00:00' and '2025-03-04 14:29:59'
    </select>
    <update id="updateNonCoalPayStudent" parameterType="NonCoalPayStudent">
        update non_coal_pay_student
        <trim prefix="SET" suffixOverrides=",">
            <if test="nonCoalPayId != null">
                non_coal_pay_id = #{nonCoalPayId},
            </if>
            <if test="name != null and name != ''">
                name = #{name},
            </if>
            <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="orderNo != null and orderNo != ''">
                order_no = #{orderNo},
            </if>
            <if test="orderNo != null and orderNo != ''">
                order_no = #{orderNo},
            </if>
            <if test="train != null and train != ''">
                train = #{train},
            </if>
            <if test="govPayStatus!=null">
                gov_pay_status=#{govPayStatus},
            </if>
            <if test="fileData != null and fileData != ''">
                file_data = #{fileData},
            </if>
            <if test="payTime != null">
                pay_time = #{payTime},
            </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>
            <if test="updateTime != null">
                update_time = #{updateTime},
            </if>
            <if test="createBy != null">
                create_by = #{createBy},
            </if>
            <if test="createTime != null">
                create_time = #{createTime},
            </if>
            <if test="delFlag != null">
                del_flag = #{delFlag},
            </if>
        </trim>
        where id = #{id}
    </update>
 
    <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
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>