|
@@ -1,15 +1,20 @@
|
|
|
package com.hssx.cloudmodel.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import com.hssx.cloudmodel.entity.Company;
|
|
|
import com.hssx.cloudmodel.entity.Factory;
|
|
|
import com.hssx.cloudmodel.mapper.FactoryMapper;
|
|
|
import com.hssx.cloudmodel.service.FactoryService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.hssx.cloudmodel.util.HttpRespMsg;
|
|
|
+import com.hssx.cloudmodel.util.PageUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* 服务实现类
|
|
@@ -42,4 +47,18 @@ public class FactoryServiceImpl extends ServiceImpl<FactoryMapper, Factory> impl
|
|
|
}
|
|
|
return msg;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg pageList(PageUtil page, String keyName) {
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ QueryWrapper<Factory> qw = new QueryWrapper<>();
|
|
|
+ if(keyName !=null && !"".equals(keyName)){
|
|
|
+ qw.like("factory_name",keyName);
|
|
|
+ }
|
|
|
+ PageHelper.startPage(page.getCurrentPage(),page.getPageSize());
|
|
|
+ List<Factory> factories = factoryMapper.selectList(qw);
|
|
|
+ PageInfo<Factory>pageInfos = new PageInfo<>(factories);
|
|
|
+ msg.data = factories;
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|