zss
2023-08-31 fa40e09b66af9d17b6d2dda1a3d4687ad72bf668
standard-server/src/main/resources/mapper/MaterialMapper.xml
@@ -36,7 +36,8 @@
               sp.id   spid, #五级型号id
               sp.name spname #五级型号名
        from (select type, id, name,father from mom_ocean.material where state = 1) m
                 left join (select id, name, material_id from mom_ocean.standard where state = 1) s on m.id = s.material_id
                 left join (select id, name, material_id from mom_ocean.standard where state = 1) s
                           on m.id = s.material_id
                 left join (select id, name, standard_id from mom_ocean.specifications where state = 1) sp
                           on sp.standard_id = s.id
    </select>
@@ -60,4 +61,15 @@
          and m.name = #{name}
          and code = #{code}
    </select>
    <!--根据标准id查询物料-->
    <select id="selFath" resultType="com.yuanchu.mom.pojo.Material">
        select *
        from mom_ocean.material
        where state = 1
          and id = (select material_id
                    from mom_ocean.standard
                    where standard.state = 1
                      and standard.id = #{id})
    </select>
</mapper>