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

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

    <select id="queryListByProductBasCode" resultType="com.hzs.ground.product.vo.BdProductBasSpecsVo">
        select pbs.*, st.TYPE_NAME specsTypeName
        from bd_product_bas_specs pbs
                 left join bd_specs_type st on st.PK_ID = pbs.PK_SPECS_TYPE
        where pbs.PK_PRODUCT_BAS = #{pkProductBas}
          and pbs.del_flag = 0
          and st.del_flag = 0
    </select>

    <select id="findByPkSpecsType" resultType="com.hzs.ground.product.vo.SpecsVo">
        select bs.PK_ID pkSpecs, bs.SPECS_NAME name
        from BD_SPECS bs
        where bs.PK_SPECS_TYPE = #{pkSpecsType}
          and bs.DEL_FLAG = 0
    </select>

</mapper>
