|
1 | 1 | ## Changelog
|
2 | 2 |
|
| 3 | +### 5.0.4 - 2017-08-01 |
| 4 | + |
| 5 | +- Add a simple configuration support for the Phoenix database, You can configure `helperDialect=phoenix`. Can also automatically identify the Phoenix database jdbc url. |
| 6 | +- Simplified cache of `msCountMap` |
| 7 | +- Add `countSuffix` count query suffix configuration parameters, this parameter is configured for `PageInterceptor`, the default value is `_COUNT`. |
| 8 | +- Add custom count query support, see below for details. |
| 9 | + |
| 10 | +#### Add custom count query support |
| 11 | + |
| 12 | +Add `countSuffix` count query suffix configuration parameters, this parameter is configured for `PageInterceptor`, the default value is `_COUNT`. |
| 13 | + |
| 14 | +The paging plugin will preferentially find the handwritten paging query by the current query `msId + countSuffix`. |
| 15 | + |
| 16 | +If there is no custom query, the query is still automatically created using the previous way. |
| 17 | + |
| 18 | +For example, if there are two queries: |
| 19 | +```xml |
| 20 | +<select id="selectLeftjoin" resultType="com.github.pagehelper.model.Country"> |
| 21 | + select a.id,b.countryname,a.countrycode from country a |
| 22 | + left join country b on a.id = b.id |
| 23 | + order by a.id |
| 24 | +</select> |
| 25 | +<select id="selectLeftjoin_COUNT" resultType="Long"> |
| 26 | + select count(distinct a.id) from country a |
| 27 | + left join country b on a.id = b.id |
| 28 | +</select> |
| 29 | +``` |
| 30 | +The above `countSuffix` uses the default value of` _COUNT`, and the paging plugin will automatically get the query to `selectLeftjoin_COUNT`. This query needs to ensure that the result is correct. |
| 31 | + |
| 32 | +The value of the return value must be `resultType =" Long "`, and the same parameter used by `selectLeftjoin` 'is used, so it is used in SQL to follow the selection of` selectLeftjoin`'. |
| 33 | + |
| 34 | +Because the `selectLeftjoin_COUNT` method is invoked automatically, there is no need to provide the appropriate method on the interface, or if it is required to be invoked separately. |
| 35 | + |
| 36 | +The above method to perform the portion of the output log is as follows: |
| 37 | +``` |
| 38 | +DEBUG [main] - ==> Preparing: select count(distinct a.id) from country a left join country b on a.id = b.id |
| 39 | +DEBUG [main] - ==> Parameters: |
| 40 | +TRACE [main] - <== Columns: C1 |
| 41 | +TRACE [main] - <== Row: 183 |
| 42 | +DEBUG [main] - <== Total: 1 |
| 43 | +DEBUG [main] - Cache Hit Ratio [com.github.pagehelper.mapper.CountryMapper]: 0.0 |
| 44 | +DEBUG [main] - ==> Preparing: select a.id,b.countryname,a.countrycode from country a left join country b on a.id = b.id order by a.id LIMIT 10 |
| 45 | +DEBUG [main] - ==> Parameters: |
| 46 | +TRACE [main] - <== Columns: ID, COUNTRYNAME, COUNTRYCODE |
| 47 | +TRACE [main] - <== Row: 1, Angola, AO |
| 48 | +TRACE [main] - <== Row: 2, Afghanistan, AF |
| 49 | +TRACE [main] - <== Row: 3, Albania, AL |
| 50 | +``` |
| 51 | + |
3 | 52 | ### 5.0.3 -2017-06-20
|
4 | 53 |
|
5 | 54 | - Solve the `supportMethodsArguments` parameter problem. It is recommended to upgrade to the latest version.
|
|
0 commit comments