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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hzs.common.domain.sale.product.BdProductSpecs">
        <result column="DEL_FLAG" property="delFlag"/>
        <result column="PK_COUNTRY" property="pkCountry"/>
        <result column="PK_CREATOR" property="pkCreator"/>
        <result column="CREATION_TIME" property="creationTime"/>
        <result column="PK_MODIFIED" property="pkModified"/>
        <result column="MODIFIED_TIME" property="modifiedTime"/>
        <result column="PK_ID" property="pkId"/>
        <result column="PK_PRODUCT" property="pkProduct"/>
        <result column="PK_SPECS_TYPE" property="pkSpecsType"/>
    </resultMap>

    <select id="selectByList" resultType="com.hzs.sale.product.vo.ProductSpecsVo">
        select ps.*, st.TYPE_NAME typeName
        from BD_PRODUCT_SPECS ps
                 left join BD_SPECS_TYPE st on st.PK_ID = ps.PK_SPECS_TYPE
        WHERE ps.PK_PRODUCT = #{pkProduct}
          and ps.del_flag = 0
          and st.del_flag = 0
        order by ps.pk_specs_type
    </select>

</mapper>
