8000 更新通用Mapper和分页插件最新版本。 · coderhxt/Mybatis-Spring@248f70f · GitHub
[go: up one dir, main page]

Skip to content

Commit 248f70f

Browse files
committed
更新通用Mapper和分页插件最新版本。
1 parent f53275c commit 248f70f

File tree

6 files changed

+3
-48
lines changed

6 files changed

+3
-48
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
<jdk.version>1.6</jdk.version>
2424
<!-- 依赖版本 -->
2525
<mybatis.version>3.3.0</mybatis.version>
26-
<mapper.version>3.3.0</mapper.version>
27-
<pagehelper.version>4.0.3</pagehelper.version>
26+
<mapper.version>3.3.4</mapper.version>
27+
<pagehelper.version>4.1.1</pagehelper.version>
2828
<mysql.version>5.1.29</mysql.version>
2929
<spring.version>4.1.2.RELEASE</spring.version>
3030
</properties>

src/main/java/com/isea533/mybatis/controller/demo/CountryController.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.github.pagehelper.PageInfo;
44
import com.isea533.mybatis.model.Country;
5-
import com.isea533.mybatis.model.CountryQueryModel;
65
import com.isea533.mybatis.service.CountryService;
76
import org.springframework.beans.factory.annotation.Autowired;
87
import org.springframework.stereotype.Controller;
@@ -40,24 +39,6 @@ public ModelAndView getList(Country country,
4039
return result;
4140
}
4241

43-
/**
44-
* 测试pageinfo,参数必须包含pageNum和pageSize
45-
* <p/>
46-
* 这个方法以及调用的相关方法看起来可能很难理解,如果不理解,就不要使用这种方式!
47-
* <p/>
48-
* 例如http://[baseurl]/pageInfo?pageNum=1&pageSize=20&countryname=Ch
49-
*
50-
* @param queryModel
51-
* @return
52-
*/
53-
@RequestMapping(value = "pageInfo", produces = "application/json")
54-
public ModelAndView pageInfo(CountryQueryModel queryModel) {
55-
ModelAndView result = new ModelAndView();
56-
PageInfo<Country> pageInfo = countryService.selectByCountryQueryModel(queryModel);
57-
result.addObject("pageInfo", pageInfo);
58-
return result;
59-
}
60-
6142
@RequestMapping(value = "view", method = RequestMethod.GET)
6243
public ModelAndView view(Country country) {
6344
ModelAndView result = new ModelAndView();

src/main/java/com/isea533/mybatis/mapper/CountryMapper.java

Lines changed: 0 additions & 9 deletions
Origin 8000 al file line numberDiff line numberDiff line change
@@ -24,18 +24,9 @@
2424

2525
package com.isea533.mybatis.mapper;
2626

27-
import com.github.pagehelper.PageInfo;
2827
import com.isea533.mybatis.model.Country;
29-
import com.isea533.mybatis.model.CountryQueryModel;
3028
import com.isea533.mybatis.util.MyMapper;
3129

3230
public interface CountryMapper extends MyMapper<Country> {
3331

34-
/**
35-
* 分页查询
36-
*
37-
* @param queryModel
38-
* @return
39-
*/
40-
PageInfo<Country> selectByCountryQueryModel(CountryQueryModel queryModel);
4132
}

src/main/java/com/isea533/mybatis/service/CountryService.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.isea533.mybatis.service;
22

3-
import com.github.pagehelper.PageInfo;
43
import com.isea533.mybatis.model.Country;
5-
import com.isea533.mybatis.model.CountryQueryModel;
64

75
import java.util.List;
86

@@ -22,12 +20,4 @@ public interface CountryService extends IService<Country> {
2220
*/
2321
List<Country> selectByCountry(Country country, int page, int rows);
2422

25-
/**
26-
* 分页查询,分页插件4.0.3版本特性演示
27-
*
28-
* @param queryModel
29-
* @return
30-
*/
31-
PageInfo<Country> selectByCountryQueryModel(CountryQueryModel queryModel);
32-
3323
}

src/main/java/com/isea533/mybatis/service/impl/CountryServiceImpl.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
package com.isea533.mybatis.service.impl;
22

33
import com.github.pagehelper.PageHelper;
4-
import com.github.pagehelper.PageInfo;
5-
import com.isea533.mybatis.mapper.CountryMapper;
64
import com.isea533.mybatis.model.Country;
7-
import com.isea533.mybatis.model.CountryQueryModel;
85
import com.isea533.mybatis.service.CountryService;
96
import org.springframework.stereotype.Service;
107
import tk.mybatis.mapper.entity.Example;
@@ -37,8 +34,4 @@ public List<Country> selectByCountry(Country country, int page, int rows) {
3734
return selectByExample(example);
3835
}
3936

40-
@Override
41-
public PageInfo<Country> selectByCountryQueryModel(CountryQueryModel queryModel) {
42-
return ((CountryMapper) getMapper()).selectByCountryQueryModel(queryModel);
43-
}
4437
}

src/main/resources/applicationContext.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
dialect=mysql
8181
reasonable=true
8282
supportMethodsArguments=true
83-
returnPageInfo=check
8483
params=count=countSql
84+
autoRuntimeDialect=true
8585
</value>
8686
</property>
8787
</bean>

0 commit comments

Comments
 (0)
0