<?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.product.mapper.BdSpecsTypeMapper">

    <resultMap id="SelectResultMap" type="com.hzs.sale.product.vo.SpecsTypeVo">
        <id column="PK_ID" property="pkId" />
        <result column="TYPE_NAME" property="typeName" />
        <result column="PK_CLASSIFY" property="pkClassify" />
        <result column="SORT" property="sort" />
        <result column="classifyName" property="classifyName" />
    </resultMap>

    <select id="selectSpecsTypeList" resultMap="SelectResultMap">
        select st.* ,bc.NAME classifyName from BD_SPECS_TYPE st
        left join BD_CLASSIFY bc on bc.PK_ID = st.PK_CLASSIFY
        where st.DEL_FLAG = '0'
        <if test="typeName != null and typeName !='' ">
            AND st.TYPE_NAME like #{typeName}||'%'
        </if>
        <if test="pkClassify != null and pkClassify !='' ">
            AND st.PK_CLASSIFY = #{pkClassify}
        </if>
        <if test="pkCountry != null">
            and st.PK_COUNTRY = #{pkCountry}
        </if>
       order by st.sort
    </select>

</mapper>
