mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
<?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.panzhihua.service_community.dao.ComActSocialOrgHatchAuditScheduleDAO">
 
    <resultMap type="com.panzhihua.service_community.entity.ComActSocialOrgHatchAuditSchedule"
               id="ComActSocialOrgHatchAuditScheduleMap">
        <result property="id" column="id" jdbcType="INTEGER"/>
        <result property="auditId" column="audit_id" jdbcType="INTEGER"/>
        <result property="stage" column="stage" jdbcType="VARCHAR"/>
        <result property="detail" column="detail" jdbcType="VARCHAR"/>
        <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
    </resultMap>
 
    <!-- 批量插入 -->
    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
        insert into smart_life.com_act_social_org_hatch_audit_schedule(audit_id, stage, detail, created_at)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.auditId}, #{entity.stage}, #{entity.detail}, #{entity.createdAt})
        </foreach>
    </insert>
    <!-- 批量插入或按主键更新 -->
    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
        insert into smart_life.com_act_social_org_hatch_audit_schedule(audit_id, stage, detail, created_at)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.auditId}, #{entity.stage}, #{entity.detail}, #{entity.createdAt})
        </foreach>
        on duplicate key update
        audit_id = values(audit_id) , stage = values(stage) , detail = values(detail) , created_at = values(created_at)
    </insert>
 
</mapper>