component/getMaterialLimit 查询所有物料(分页,模糊查询)
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @Api(tags = "散装件管理") |
| | | @Api(tags = "物料管理") |
| | | @RestController |
| | | @RequestMapping("component") |
| | | public class ComponentController { |
| | |
| | | public Response deleteComponent(@RequestParam int id){ |
| | | return service.deleteComponent(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询所有物料(分页,模糊查询)",notes = "2.0使用") |
| | | @GetMapping("getMaterialLimit") |
| | | public Response getMaterialLimit(@RequestParam(required = false) String subCode,@RequestParam(required = false) String subName, @RequestParam(required = false) String subModel,@RequestParam int pageCurr, @RequestParam int pageSize){ |
| | | return service.getMaterialLimit(subCode,subName,subModel,pageCurr,pageSize); |
| | | } |
| | | } |
| | |
| | | public void deleteBatch(List<Integer> componentIdList) { |
| | | mapper.deleteBatchIds(componentIdList); |
| | | } |
| | | |
| | | //查询所有物料(分页,模糊查询) |
| | | public Response getMaterialLimit(String subCode, String subName, String subModel, int pageCurr, int pageSize) { |
| | | PageHelper.startPage(pageCurr,pageSize); |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | if(subCode!=null&&!subCode.isEmpty()){ |
| | | wrapper.like("sub_code",subCode); |
| | | } |
| | | if(subName!=null&&!subName.isEmpty()){ |
| | | wrapper.like("sub_name",subName); |
| | | } |
| | | if(subModel!=null&&!subModel.isEmpty()){ |
| | | wrapper.like("sub_model",subModel); |
| | | } |
| | | List<Component> list=mapper.selectList(wrapper); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list.size()>0?true:false,pageInfo,"查询所有物料(分页,模糊查询)"); |
| | | } |
| | | } |