<?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.malk.diwei.mapper.ProcessMaterialMapper">

    <select id="selectProcessMaterialByGoodsProperty" resultType="java.util.Map">
        SELECT
            pm.ProcessMaterialID,
            pm.ProcessID,
            gp.GoodsPartsName,
            g.GoodsID,
            g.GoodsCode,
            g.GoodsName,
            g.GoodsSpecs,
            c.ColorName,
            pm.ProcessMaterialColorVCode,
            pm.ProcessMaterialDes,
            u.UnitName,
            pm.ProcessMaterialQty,
            pm.ProcessMaterialPickQty
        from
            ProcessMaterial pm
        left join
            Goods g
        on
            pm.GoodsID = g.GoodsID
        left join
            GoodsParts gp
        on
            pm.ProcessMaterialGoodsPartsID = gp.GoodsPartsID
        left join
            Color c
        on
            pm.ColorID = c.ColorID
        left join
            Unit u
        on
            pm.UnitID = u.UnitID
        where
            pm.ProcessID = #{processId}
        and
            g.GoodsProperty = #{goodsProperty}
    </select>
</mapper>
