| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.github.pagehelper.Page;
|
| | | import com.moral.common.bean.Constants;
|
| | | import com.moral.common.bean.PageBean;
|
| | | import com.moral.common.bean.PageResult;
|
| | | import com.moral.common.util.ExampleUtil;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public PageResult query(Integer orgId, String deviceName, Integer pageSize, Integer pageNo) {
|
| | | if(!ObjectUtils.isEmpty(pageSize)&&!ObjectUtils.isEmpty(pageNo)){
|
| | | PageHelper.startPage(pageNo,pageSize);
|
| | | }
|
| | | List list = deviceMapper.selectByOrgIdAndDevName(orgId,deviceName);
|
| | | if(list instanceof Page){
|
| | | return new PageResult(((Page) list).getTotal(),list);
|
| | | }
|
| | | return new PageResult(null,list);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public PageBean queryByPageBean(PageBean pageBean) {
|
| | | Example example = ExampleUtil.generateExample(ENTITY_CLASS,pageBean);
|
| | | List<Example.Criteria> criteriaList = example.getOredCriteria();
|