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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hzs.common.domain.sale.wares.BdWaresSpecs">
        <id column="PK_ID" property="pkId" />
        <result column="PK_WARES_DETAIL" property="pkWaresDetail" />
        <result column="PK_SPECS_TYPE" property="pkSpecsType" />
        <result column="PK_SPECS" property="pkSpecs" />
        <result column="SPECS_NAME" property="specsName" />

    </resultMap>


    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        PK_ID, PK_WARES_DETAIL, PK_SPECS_TYPE, PK_SPECS
    </sql>

    <select id="selectByPkId" resultMap="BaseResultMap">
        select ws.*,bs.SPECS_NAME from  BD_WARES_SPECS ws
        left join BD_SPECS bs on bs.PK_ID = ws.PK_SPECS
        where 1 = 1
        and ws.PK_ID = #{pkWaresSpecs}
    </select>

</mapper>
