<?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.BdWaresLabelMapper">

    <select id="selectByList" resultType="com.hzs.common.domain.system.ext.BdLabelExt">
        select bl.LABEL label,bl.LABEL_TYPE labelType,bl.PK_ID pkId,bl.LABEL_IMAGE labelImage,wl.PK_WARES pkWares from BD_WARES_LABEL wl
        left join BD_LABEL bl on bl.PK_ID = wl.PK_LABLE
        where 1 = 1 and wl.DEL_FLAG=0
        <if test="pkWares != null">
            and wl.PK_WARES = #{pkWares}
        </if>
        <if test="labelType != null">
            and bl.LABEL_TYPE = #{labelType}
        </if>
        <if test="pkIdList != null and pkIdList.size > 0">
            and wl.PK_WARES in
            <foreach collection="pkIdList" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
    </select>

</mapper>
