<?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.hzs.sale.wares.mapper.BdWaresGradeMapper">

    <select id="queryWaresGradeAwards" resultType="com.hzs.common.domain.sale.wares.ext.WaresGradeAwards">
        select 1 range_type,pk_country,pk_wares,pk_range from BD_WARES_GRADE where del_flag= 0 and pk_wares in
        <foreach collection="waresIdList" item="item" open="(" close=")" separator=",">
            #{item}
        </foreach>
        union
        select 2 range_type,pk_country,pk_wares,pk_awards pk_range from BD_WARES_AWARDS where del_flag= 0 and pk_wares in
        <foreach collection="waresIdList" item="item" open="(" close=")" separator=",">
            #{item}
        </foreach>
        union
        select 3 range_type,pk_country,pk_wares,VALUE pk_range from BD_WARES_AUTHORIZE where del_flag= 0 and pk_wares in
        <foreach collection="waresIdList" item="item" open="(" close=")" separator=",">
            #{item}
        </foreach>
    </select>

</mapper>
