<?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.fibo.ddp.common.dao.authx.dictionary.DictionaryMapper">

    <resultMap type="com.fibo.ddp.common.model.authx.dictionary.Dictionary" id="DictionaryMap">
        <result property="id" column="id" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
        <result property="dictKey" column="dict_key" jdbcType="VARCHAR"/>
        <result property="dictValue" column="dict_value" jdbcType="VARCHAR"/>
    </resultMap>



    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
        insert into t_dictionary(dict_key, dict_value)
        values
        <foreach collection="entities" item="entity" separator=",">
            ( #{entity.dictKey}, #{entity.dictValue})
        </foreach>
        on duplicate key update
          dict_key = values(dict_key) , dict_value = values(dict_value)
    </insert>



</mapper>

