lxw
2022-08-03 3712fe77699c9aa61c8c92c550c52968ade88a86
查询所有产品中没有与指定散装件关联的子件
2个文件已添加
4个文件已修改
28 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/ProductBomController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/ProductBomMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/ProductBomService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ComponentMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ComponentProductMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ProductBomMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/ProductBomController.java
@@ -67,5 +67,10 @@
    public void downloadBom(HttpServletRequest req, HttpServletResponse resp,@RequestParam String parentModel){
         service.downloadBom(req,resp,parentModel);
    }
    @ApiOperation(tags = "散装件管理",value = "查询所有产品中没有与指定散装件关联的子件")
    @GetMapping("getAllSubWithOutComponent")
    public Response getAllSubWithOutComponent(@RequestParam int componentId){
        return  service.getAllSubWithOutComponent(componentId);
    }
}
src/main/java/com/whyc/mapper/ProductBomMapper.java
@@ -11,4 +11,6 @@
    void updateUrl(List<ProductBomApproving> fileBomApprovingList);
    //查询所有产品中没有与指定散装件关联的子件
    List<ProductBom> getAllSubWithOutComponent(int componentId);
}
src/main/java/com/whyc/service/ProductBomService.java
@@ -354,4 +354,9 @@
            e.printStackTrace();
        }
    }
    //查询所有产品中没有与指定散装件关联的子件
    public Response getAllSubWithOutComponent(int componentId) {
        List<ProductBom> list=mapper.getAllSubWithOutComponent(componentId);
        return new Response().setII(1,list.size()>0?true:false,list,"返回数据");
    }
}
src/main/resources/mapper/ComponentMapper.xml
New file
@@ -0,0 +1,6 @@
<?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.whyc.mapper.ComponentMapper">
</mapper>
src/main/resources/mapper/ComponentProductMapper.xml
New file
@@ -0,0 +1,6 @@
<?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.whyc.mapper.ComponentProductMapper">
</mapper>
src/main/resources/mapper/ProductBomMapper.xml
@@ -53,4 +53,8 @@
        </where>
    </select>
    <select id="getAllSubWithOutComponent" resultType="com.whyc.pojo.ProductBom">
        select * from  db_doc.tb_product_bom  b where (select count(1) as num from  db_doc.tb_component_product  c
         where b.parent_model= c.parent_model  and b.sub_name= c.sub_name and c.component_id=#{componentId} ) = 0
    </select>
</mapper>