<?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.ai.da.mapper.primary.PanToneMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ai.da.mapper.primary.entity.PanTone">
        <id column="pantone_index" property="pantoneIndex" />
        <result column="name" property="name" />
        <result column="tcx" property="tcx" />
        <result column="r" property="r" />
        <result column="g" property="g" />
        <result column="b" property="b" />
        <result column="h" property="h" />
        <result column="s" property="s" />
        <result column="v" property="v" />
    </resultMap>

    <select id="getRgbByHsvBatch" resultType="com.ai.da.mapper.primary.entity.PanTone">
        select * from pantone
        <where>
            <if test="rgbByHsvBatch != null and rgbByHsvBatch.size() > 0">
                <foreach collection="idList" index="index" item="item" open="("  separator="or" close=")">
                    r = #{item.r} and g =  #{item.g} and b =  #{item.b}
                </foreach>
            </if>
        </where>
    </select>
</mapper>
