<?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="cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouImageGetMapper">

    <insert id="replaceBatch">
        replace into ctop_kuaishou_image_get(
        id,
        account_id,
        url,
        width,
        height,
        size,
        format,
        material_type,
        signature,
        image_token,
        create_time,
        update_time
        )
        values
        <foreach collection="images" item="image" separator=",">
            (
            #{image.id},
            #{image.accountId},
            #{image.url},
            #{image.width},
            #{image.height},
            #{image.size},
            #{image.format},
            #{image.materialType},
            #{image.signature},
            #{image.imageToken},
            #{image.createTime},
            #{image.updateTime}
            )
        </foreach>
    </insert>

    <select id="getUrlByCode" resultType="java.lang.String">
        select url from ctop_material_image_info
        where  code = #{signature}
        limit 1

    </select>

</mapper>
