教育训练处考试制证系统后端
“djh”
2025-02-25 70dcf4e610a0ec5fd6ca2c3daf9edf4957b30529
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
<?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.institutionalaccess.mapper.ThStudentMapper">
 
    <insert id="insertBatch">
        INSERT INTO th_student (idcard, name, sex, phone, auth_photo,train_org_name, institution_id, institution_name,
        industry,occupation,post,del_flag,create_time,update_time,create_by,update_by) VALUES
        <foreach collection="list" separator="," item="item">
            (#{item.idcard},#{item.name},#{item.sex},#{item.phone},#{item.authPhoto},#{item.trainOrgName},#{item.institutionId},#{item.institutionName},
             #{item.industry},#{item.occupation},#{item.post},#{item.delFlag},#{item.createTime},
             #{item.updateTime},#{item.createBy},#{item.updateBy})
        </foreach>
    </insert>
 
 
 
    <update id="updateBatch" parameterType="java.util.List" >
        <foreach collection="list" item="item" index="index" separator=";">
            UPDATE th_student
            <set>
                <if test="item.name != null and item.name != ''" >
                    name = #{item.name},
                </if>
                <if test="item.idcard != null and item.idcard != ''" >
                    idcard = #{item.idcard},
                </if>
                <if test="item.sex != null" >
                    sex = #{item.sex},
                </if>
                <if test="item.phone != null and item.phone != ''" >
                    phone = #{item.phone},
                </if>
                <if test="item.authPhoto != null and item.authPhoto != ''" >
                    auth_photo = #{item.authPhoto},
                </if>
                <if test="item.trainOrgName != null and item.trainOrgName != ''" >
                    train_org_name = #{item.trainOrgName},
                </if>
                <if test="item.institutionId != null" >
                    institution_id = #{item.institutionId},
                </if>
                <if test="item.institutionName != null and item.institutionName != ''" >
                    institution_name = #{item.institutionName},
                </if>
                <if test="item.industry != null and item.industry != ''" >
                    industry = #{item.industry},
                </if>
                <if test="item.occupation != null and item.occupation != ''" >
                    occupation = #{item.occupation},
                </if>
                <if test="item.post != null and item.post != ''" >
                    post = #{item.post},
                </if>
 
                <if test="item.updateBy != null and item.updateBy != ''" >
                    update_by = #{item.updateBy},
                </if>
                <if test="item.updateTime != null" >
                    update_time = #{item.updateTime}
                </if>
            </set>
            where id = #{item.id}
        </foreach>
    </update>
 
    <select id="getByIdCards" resultType="com.gkhy.exam.institutionalaccess.entity.ThStudent" >
        select idcard, name, sex, phone, auth_photo,train_org_name, institution_id, institution_name,
        industry,occupation,post from th_student where del_flag = 0 and idcard in
        <foreach collection="idcards" item="idcard" index ="index" open="(" close=")" separator=",">
            #{idcard}
        </foreach>
    </select>
    <select id="getNameByIdcards" resultType="com.gkhy.exam.institutionalaccess.entity.ThStudent" >
        select idcard, name from th_student where del_flag = 0 and idcard in
        <foreach collection="idcards" item="idcard" index ="index" open="(" close=")" separator=",">
            #{idcard}
        </foreach>
    </select>
 
</mapper>