<?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.fjhx.mapper.bom.BomMapper">

    <select id="getPage" resultType="com.fjhx.params.bom.BomEx">
        select b.id,
               b.edition,
               b.update_user,
               b.update_time,
               b.product_id,
               p.name productName,
               p.code productCode,
               p.type productType,
               c.name classifyName
        from bom b
                 inner join product p on b.product_id = p.id
                 left join classify c on p.classify_id = c.id
            ${ew.customSqlSegment}
    </select>

    <select id="getBomRelationProductClassify" resultType="java.util.Map">
        select distinct c.id   classifyId,
                        c.name classifyName
        from bom b
                 inner join product p on b.product_id = p.id
                 inner join classify c on p.classify_id = c.id
    </select>

</mapper>
