| | |
| | | public Response getAllComponent(@RequestParam int pageCurr, @RequestParam int pageSize){ |
| | | return service.getAllComponent(pageCurr,pageSize); |
| | | } |
| | | |
| | | @ApiOperation(tags = "产品管理",value = "查询所有的散装件信息不分页") |
| | | @GetMapping("getComponentWithoutSub") |
| | | public Response getComponentWithoutSub(@RequestParam String parentModel, @RequestParam String subName){ |
| | | return service.getComponentWithoutSub(parentModel,subName); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.whyc.pojo.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ComponentMapper extends CustomMapper<Component>{ |
| | | //查询所有的散装件信息不分页 |
| | | List<Component> getComponentWithoutSub(String parentModel, String subName); |
| | | } |
| | |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | 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); |
| | | return new Response().setII(1,list.size()>0?true:false,list,"返回子件没有添加过联系的散装件"); |
| | | } |
| | | } |
| | |
| | | <mapper namespace="com.whyc.mapper.ComponentMapper"> |
| | | |
| | | |
| | | <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 |
| | | </select> |
| | | </mapper> |