<?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.liquidnet.service.goblin.mapper.GoblinNftExCodeTaskRelationMapper">

    <resultMap id="BaseResult" type="com.liquidnet.service.goblin.entity.GoblinNftExCodeTaskRelation">
        <result column="task_id" property="taskId" jdbcType="VARCHAR"/>
        <result column="sku_id" property="skuId" jdbcType="VARCHAR"/>
        <result column="stock" property="stock" jdbcType="VARCHAR"/>
        <result column="created_at" property="createdAt" jdbcType="TIMESTAMP"/>
        <result column="updated_at" property="updatedAt" jdbcType="TIMESTAMP"/>
    </resultMap>

    
    <select id="selectByTaskIds" resultMap="BaseResult">
        select  task_id,sku_id,stock,created_at,updated_at from goblin_nft_ex_code_task_relation where task_id in 
        <foreach collection="taskIds.split(',')" item="taskId" open="(" separator="," close=")">
            #{taskId}
        </foreach>
    </select>
    
    <insert id="inserts">
        insert into goblin_nft_ex_code_task_relation (task_id,sku_id,stock,created_at)
        values
        <foreach collection="goblinNftExCodeTaskRelations" item="goblinNftExCodeTaskRelation" separator=",">
            (
            #{goblinNftExCodeTaskRelation.taskId},
            #{goblinNftExCodeTaskRelation.skuId},
            #{goblinNftExCodeTaskRelation.stock},
            #{goblinNftExCodeTaskRelation.createdAt}
            )
        </foreach>
    </insert>

    
    
</mapper>
