OlapXmldocImpl.java
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.tianbo.service.imp;
import com.tianbo.common.ModelAndPage;
import com.tianbo.mapper.TOlapXmldocMapper;
import com.tianbo.model.TOlapXmldoc;
import com.tianbo.model.TOlapXmldocExample;
import com.tianbo.service.OlapXmldocService;
import com.tianbo.util.dao.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
/**
* Created by Mr.Xu on 2017/9/14.
*/
@Service
public class OlapXmldocImpl implements OlapXmldocService {
@Autowired
private TOlapXmldocMapper olapXmldocMapper;
public List<TOlapXmldoc> findXmldoc()throws Exception{
TOlapXmldocExample olapxmldoc=new TOlapXmldocExample();
List<TOlapXmldoc> olapXmldocList=olapXmldocMapper.selectByExample(olapxmldoc);
return olapXmldocList;
}
public ModelAndPage findXmldoc(int start, int pagelenth)throws Exception{
TOlapXmldocExample tOlapXmldocExample=new TOlapXmldocExample();
Page page=new Page(start,pagelenth);
tOlapXmldocExample.setPage(page);
int count=olapXmldocMapper.countByExample(tOlapXmldocExample);
page.setCount(count);
List<TOlapXmldoc> tOlapXmldocList=olapXmldocMapper.selectByExample(tOlapXmldocExample);
ModelAndPage<TOlapXmldoc> modelAndPage=new ModelAndPage<TOlapXmldoc>(tOlapXmldocList,page);
return modelAndPage;
}
public void addXmldoc(TOlapXmldoc olapXmldoc){olapXmldocMapper.insert(olapXmldoc);}
public TOlapXmldoc findByid(BigDecimal docid) throws Exception{
TOlapXmldoc olapXmldoc=new TOlapXmldoc();
olapXmldoc=olapXmldocMapper.selectByPrimaryKey(docid);
return olapXmldoc;
}
public void updateXmldoc(TOlapXmldoc olapXmldoc){olapXmldocMapper.updateByPrimaryKey(olapXmldoc);}
public int deleteXmldoc(BigDecimal docid){olapXmldocMapper.deleteByPrimaryKey(docid); return 1;}
}