产品管理和散装件管理中与散装件有联系的都要加上版本
| | |
| | | public Response getAllComponent(@RequestParam int pageCurr, @RequestParam int pageSize){ |
| | | return service.getAllComponent(pageCurr,pageSize); |
| | | } |
| | | @ApiOperation(tags = "产品管理",value = "查询所有的散装件信息不分页(不包含被关联的散装件,status=1可用)") |
| | | @ApiOperation(tags = "产品管理",value = "查询所有的散装件信息不分页(不包含被最新版本关联的散装件,status=1可用)") |
| | | @GetMapping("getComponentWithoutSub") |
| | | public Response getComponentWithoutSub(@RequestParam String parentModel, @RequestParam String subName){ |
| | | return service.getComponentWithoutSub(parentModel,subName); |
| | | public Response getComponentWithoutSub(@RequestParam String parentModel, @RequestParam String subName, @RequestParam int version){ |
| | | return service.getComponentWithoutSub(parentModel,subName,version); |
| | | } |
| | | @ApiOperation(value = "删除散装件(将散装件标识为不可用)") |
| | | @GetMapping("deleteComponent") |
| | |
| | | return service.getAllBom(); |
| | | } |
| | | |
| | | @ApiOperation(tags = "产品管理",value = "根据母料型号查询子件信息及有关联的散装件信息") |
| | | @ApiOperation(tags = "产品管理",value = "根据母料型号查询子件信息及有最新版本关联的散装件信息") |
| | | @GetMapping("getSubByComponentProduct") |
| | | public Response getSubByComponentProduct(@RequestParam String parentModel){ |
| | | return service.getSubByComponentProduct(parentModel); |
| | |
| | | |
| | | public interface ComponentMapper extends CustomMapper<Component>{ |
| | | //查询所有的散装件信息不分页 |
| | | List<Component> getComponentWithoutSub(String parentModel, String subName); |
| | | List<Component> getComponentWithoutSub(String parentModel, String subName,int version); |
| | | //查询所有的散装件信息加设置了替换关系的子件信息 |
| | | List<Component> getAllComponent(); |
| | | } |
| | |
| | | return new Response().setII(1,list.size()>0?true:false,pageInfo,"返回所有的散装件"); |
| | | } |
| | | //查询所有的散装件信息不分页 |
| | | public Response getComponentWithoutSub(String parentModel, String subName) { |
| | | List<Component> list=mapper.getComponentWithoutSub(parentModel,subName); |
| | | public Response getComponentWithoutSub(String parentModel, String subName,int version) { |
| | | List<Component> list=mapper.getComponentWithoutSub(parentModel,subName,version); |
| | | return new Response().setII(1,list.size()>0?true:false,list,"返回子件没有添加过联系的散装件"); |
| | | } |
| | | //删除散装件(将散装件标识为不可用) |
| | |
| | | List<ProductBom> list=mapper.getAllSubWithOutComponent(componentId); |
| | | return new Response().setII(1,list.size()>0?true:false,list,"返回数据"); |
| | | } |
| | | //根据母料型号查询子件信息及有关联的散装件信息 |
| | | //根据母料型号查询子件信息及有最新版本关联的散装件信息 |
| | | public Response getSubByComponentProduct(String parentModel) { |
| | | List<ProductBom> list=mapper.getSubByComponentProduct(parentModel); |
| | | return new Response().setII(1,list.size()>0?true:false,list,"返回数据"); |
| | |
| | | |
| | | <select id="getComponentWithoutSub" resultType="com.whyc.pojo.Component"> |
| | | select * from db_doc.tb_component b |
| | | where (select count(1) as num from db_doc.tb_component_product c where b.id= c.component_id and c.sub_name=#{subName} and parent_model=#{parentModel} ) = 0 |
| | | where (select count(1) as num from db_doc.tb_component_product_history c |
| | | where b.id= c.component_id and c.sub_name=#{subName} and parent_model=#{parentModel} |
| | | and c.e_version=#{version} |
| | | ) = 0 |
| | | and b.status=1; |
| | | </select> |
| | | |
| | |
| | | order by id asc |
| | | </select> |
| | | <select id="selectProductBom" resultType="com.whyc.pojo.ProductBom"> |
| | | select DISTINCT tb_product_bom.* FROM db_doc.tb_product_bom,db_doc.tb_component_product |
| | | where tb_product_bom.sub_name=tb_component_product.sub_name |
| | | and tb_product_bom.parent_model=tb_component_product.parent_model and tb_component_product.component_id=#{id} |
| | | select DISTINCT tb_product_bom.* FROM db_doc.tb_product_bom,db_doc.tb_component_product_history |
| | | where tb_product_bom.version=tb_component_product_history.e_version and tb_product_bom.sub_name=tb_component_product_history.sub_name |
| | | and tb_product_bom.parent_model=tb_component_product_history.parent_model and tb_component_product_history.component_id=#{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | </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 * from db_doc.tb_product_bom b |
| | | where (select count(1) as num from db_doc.tb_component_product_history c |
| | | where b.parent_model= c.parent_model and b.sub_name= c.sub_name and b.version=c.e_version |
| | | and c.component_id=#{componentId} |
| | | ) = 0 |
| | | </select> |
| | | |
| | | <resultMap id="componentList" type="productBom"> |
| | |
| | | <result property="version" column="version"></result> |
| | | <result property="dwgUrl" column="dwg_url"></result> |
| | | <result property="parentVersion" column="parent_version"></result> |
| | | <collection property="components" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Component" column="{subName=sub_name,parentModel=parent_model}" select="selectComponent"> |
| | | <collection property="components" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Component" column="{subName=sub_name,parentModel=parent_model,eVersion=version}" select="selectComponent"> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="selectComponent" resultType="com.whyc.pojo.Component"> |
| | | select DISTINCT tb_component.* FROM db_doc.tb_component,db_doc.tb_component_product where tb_component.id=tb_component_product.component_id |
| | | and tb_component_product.sub_name=#{subName} and tb_component_product.parent_model=#{parentModel} |
| | | select DISTINCT tb_component.* FROM db_doc.tb_component,db_doc.tb_component_product_history where tb_component.id=tb_component_product_history.component_id |
| | | and tb_component_product_history.sub_name=#{subName} and tb_component_product_history.parent_model=#{parentModel |
| | | and tb_component_product_history.e_version=#{eVersion} |
| | | </select> |
| | | </mapper> |