<?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.ylx.massage.mapper.TBankMapper">

    <resultMap type="com.ylx.massage.domain.TBank" id="TBankMap">
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="bankName" column="bank_name" jdbcType="VARCHAR"/>
        <result property="bankLogo" column="bank_logo" jdbcType="VARCHAR"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
        <result property="isDelete" column="is_delete" jdbcType="INTEGER"/>
    </resultMap>

    <!-- 批量插入 -->
    <insert id="insertBatch" keyProperty="" useGeneratedKeys="true">
        insert into ry-vue.t_bank(idbank_namebank_logocreate_timeupdate_timeis_delete)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.id}#{entity.bankName}#{entity.bankLogo}#{entity.createTime}#{entity.updateTime}#{entity.isDelete})
        </foreach>
    </insert>
    <!-- 批量插入或按主键更新 -->
    <insert id="insertOrUpdateBatch" keyProperty="" useGeneratedKeys="true">
        insert into ry-vue.t_bank(idbank_namebank_logocreate_timeupdate_timeis_delete)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.id}#{entity.bankName}#{entity.bankLogo}#{entity.createTime}#{entity.updateTime}#{entity.isDelete})
        </foreach>
        on duplicate key update
        id = values(id) bank_name = values(bank_name) bank_logo = values(bank_logo) create_time = values(create_time)
        update_time = values(update_time) is_delete = values(is_delete)
    </insert>

</mapper>

