Skip to content

Commit

Permalink
fix: fix order by sql error
Browse files Browse the repository at this point in the history
  • Loading branch information
sondertara committed Mar 7, 2022
1 parent 81c635c commit 8dd4a7d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ Maven Project
<dependency>
<groupId>com.sondertara</groupId>
<artifactId>joya</artifactId>
<version>0.0.7.201</version>
<version>0.0.7.202</version>
</dependency>
```

Gradle Project

```groovy
implementation 'com.sondertara:joya:0.0.7.201'
implementation 'com.sondertara:joya:0.0.7.202'
```

### 2.添加配置
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ allprojects {
def isRelease = false

group = 'com.sondertara'
version = '0.0.7.201'
version = '0.0.7.202'
archivesBaseName = 'joya'
sourceCompatibility = '1.8'

Expand Down
4 changes: 2 additions & 2 deletions docs/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Maven Project
<dependency>
<groupId>com.sondertara</groupId>
<artifactId>joya</artifactId>
<version>0.0.7.201</version>
<version>0.0.7.202</version>
</dependency>
```

Gradle Project

```groovy
implementation 'com.sondertara:joya:0.0.7.201'
implementation 'com.sondertara:joya:0.0.7.202'
```

## 新项目集成 :id=new_project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,14 +397,15 @@ public <T> NativeSqlQueryBuilder orderBy(TaraFunction<T, ?> fn, OrderParam.Order
* 排序参数如果是前端传进来,用QueryRequest接收的 ===> nativeSql.orderBy( queryRequest.getOrderBy(表别名) )
* 手写逻辑指定排序字段 ==> nativeSql.orderBy("su.age asc")
*/
public void orderBy(String... orderBySegment) {
public NativeSqlQueryBuilder orderBy(String... orderBySegment) {
if (null != orderBySegment && orderBySegment.length > 0) {
if (orderBy == null) {
// 多次调用此方法,用逗号拼接 ==> su.age asc,so.create_time desc
orderBy = new ArrayList<>();
}
this.orderBy.addAll(Arrays.asList(orderBySegment));
}
return this;
}

private void buildJoin() {
Expand Down

0 comments on commit 8dd4a7d

Please sign in to comment.