| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | |
| | | @Autowired(required = false) |
| | | private ComponentMapper mapper; |
| | | //查询所有的散装件信息加设置了替换关系的子件信息 |
| | | public Response getAllComponent(int pageCurr,int pageSize) { |
| | | public Response getAllComponent(String category,String subCode,String subName,String subModel,int pageCurr,int pageSize) { |
| | | PageHelper.startPage(pageCurr,pageSize); |
| | | /*QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.orderByAsc("id"); |
| | | List<Component> list=mapper.selectList(wrapper);*/ |
| | | List<Component> list=mapper.getAllComponent(); |
| | | List<Component> list=mapper.getAllComponent(category,subCode,subName,subModel); |
| | | 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); |
| | | 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,"返回子件没有添加过联系的散装件"); |
| | | } |
| | | //删除散装件(将散装件标识为不可用) |
| | |
| | | int bl=mapper.update(null,wrapper); |
| | | return new Response().setII(1,bl>0?true:false,bl,"将散装件标识为不可用"); |
| | | } |
| | | |
| | | public List<Component> getList() { |
| | | return mapper.selectList(null); |
| | | } |
| | | |
| | | public void insertBatch(List<Component> componentList) { |
| | | mapper.insertBatchSomeColumn(componentList); |
| | | } |
| | | |
| | | /**mybatis-plus逻辑删除*/ |
| | | public void deleteBatch(List<Integer> componentIdList) { |
| | | mapper.deleteBatchIds(componentIdList); |
| | | } |
| | | } |