Skip to content

Commit

Permalink
1.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
xuejmnet committed Jun 30, 2023
1 parent 1910cc0 commit c4acc43
Show file tree
Hide file tree
Showing 24 changed files with 73 additions and 31 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<packaging>pom</packaging>
<version>1.1.7</version>
<version>1.1.8</version>
<name>easy-query</name>
<description>java object query distributed connector</description>
<url>https://github.com/xuejmnet/easy-query</url>
Expand Down
4 changes: 2 additions & 2 deletions samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easy-query-all</artifactId>
<groupId>com.easy-query</groupId>
<version>1.1.7</version>
<version>1.1.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>com.easy-query</groupId>
<artifactId>sql-springboot-starter</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions samples/spring-sharding-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
<dependency>
<groupId>com.easy-query</groupId>
<artifactId>sql-processor</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.easy-query</groupId>
<artifactId>sql-springboot-starter</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.easy.query.springshardingdemo.controller;

import com.easy.query.api.proxy.client.EasyProxyQuery;
import com.easy.query.core.api.pagination.EasyPageResult;
import com.easy.query.springshardingdemo.domain.OrderEntity;
import com.easy.query.springshardingdemo.domain.proxy.OrderEntityProxy;
import com.easy.query.springshardingdemo.dto.OrderGroupWithAvgOrderNoVO;
Expand All @@ -11,6 +12,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
Expand Down Expand Up @@ -144,4 +146,15 @@ public Object groupByWithAvgOrderNo3() {
long end = System.currentTimeMillis();
return Arrays.asList(list, (end - start) + "(ms)");
}
@GetMapping("/page")
public Object page(@RequestParam("pageIndex") Integer pageIndex,@RequestParam("pageSize") Integer pageSize) {
long start = System.currentTimeMillis();
List<String> userIds = Arrays.asList("小明", "小绿");
EasyPageResult<OrderEntity> pageResult = easyProxyQuery.queryable(OrderEntityProxy.DEFAULT)
.where((filter, t) -> filter.in(t.userId(), userIds))
.orderByAsc((order, t) -> order.column(t.userId()))
.toPageResult(pageIndex, pageSize);
long end = System.currentTimeMillis();
return Arrays.asList(pageResult, (end - start) + "(ms)");
}
}
6 changes: 3 additions & 3 deletions samples/springbootdemo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@
<dependency>
<groupId>com.easy-query</groupId>
<artifactId>sql-core</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.easy-query</groupId>
<artifactId>sql-api4j</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.easy-query</groupId>
<artifactId>sql-springboot-starter</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion sql-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easy-query-all</artifactId>
<groupId>com.easy-query</groupId>
<version>1.1.7</version>
<version>1.1.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
import java.sql.SQLXML;
import java.sql.Time;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.util.Iterator;
import java.util.List;
import java.util.function.Function;
Expand Down Expand Up @@ -123,13 +127,38 @@ public SQLXML getSQLXML(int columnIndex) throws SQLException {
public Timestamp getTimestamp(int columnIndex) throws SQLException {
Object value = currentResultSetRow.getValue(columnIndex);
setWasNull(value == null);
if(this.wasNull){
return null;
}
if(value instanceof Timestamp){
return (Timestamp) value;
}
if(value instanceof LocalDateTime){
return Timestamp.valueOf((LocalDateTime)value);
}
if(value instanceof LocalDate){
long ts = ((LocalDate)value).atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli();
return new Timestamp(ts);
}
if(value instanceof java.util.Date){
return new Timestamp(((java.util.Date)value).getTime());
}
return (Timestamp) value;
}

@Override
public Time getTime(int columnIndex) throws SQLException {
Object value = currentResultSetRow.getValue(columnIndex);
setWasNull(value == null);
if(this.wasNull){
return null;
}
if(value instanceof Time){
return (Time) value;
}
if(value instanceof LocalTime){
return Time.valueOf((LocalTime)value);
}
return (Time) value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.easy.query.core.exception.EasyQuerySQLCommandException;
import com.easy.query.core.expression.func.AggregationType;
import com.easy.query.core.expression.segment.FuncColumnSegment;
import com.easy.query.core.expression.segment.MaybeAggregateColumnSegment;
import com.easy.query.core.expression.segment.SQLSegment;
import com.easy.query.core.logging.Log;
import com.easy.query.core.logging.LogFactory;
Expand Down Expand Up @@ -131,9 +132,9 @@ private List<AggregateValue> createAggregationUnitValues() {

boolean aggregateColumn = EasySQLSegmentUtil.isAggregateColumn(sqlSegment);
if(aggregateColumn){
FuncColumnSegment maybeAggregateColumnSegment = (FuncColumnSegment) sqlSegment;
MaybeAggregateColumnSegment maybeAggregateColumnSegment = (MaybeAggregateColumnSegment) sqlSegment;
AggregateValue aggregateValue = new AggregateValue(i, AggregationUnitFactory.create(maybeAggregateColumnSegment.getAggregationType()));
if(Objects.equals(AggregationType.AVG,maybeAggregateColumnSegment.getAggregationType())){
if(maybeAggregateColumnSegment instanceof FuncColumnSegment &&Objects.equals(AggregationType.AVG,maybeAggregateColumnSegment.getAggregationType())){
Map<AggregationType, ColumnIndexFuncColumnSegment> aggregationTypeFuncColumnSegmentMap = streamMergeContext.getGroupMergeContext().getColumnMapping().get(maybeAggregateColumnSegment);
if(aggregationTypeFuncColumnSegmentMap==null){
throw new UnsupportedOperationException("not found sum or count projects, avg column:" + EasyClassUtil.getInstanceSimpleName(sqlSegment));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public Object getValue(EasyResultSet resultSet) throws SQLException {
return time.toLocalTime();
}
return null;

}

@Override
Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
</parent>

<artifactId>sql-db-support</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-h2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-mssql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-mysql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-pgsql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-sqlite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
</parent>

<artifactId>sql-extension</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sql-extension/sql-kt-springboot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-extension/sql-springboot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
</parent>

<artifactId>sql-platform</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sql-platform/sql-api-proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>sql-platform</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
</parent>

<artifactId>sql-api-proxy</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sql-platform/sql-api4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-platform/sql-api4kt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
</parent>

<artifactId>sql-processor</artifactId>
Expand Down
10 changes: 5 additions & 5 deletions sql-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easy-query-all</artifactId>
<groupId>com.easy-query</groupId>
<version>1.1.7</version>
<version>1.1.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -29,7 +29,7 @@
<dependency>
<groupId>com.easy-query</groupId>
<artifactId>sql-processor</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -41,19 +41,19 @@
<dependency>
<groupId>com.easy-query</groupId>
<artifactId>sql-h2</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.easy-query</groupId>
<artifactId>sql-api4j</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.easy-query</groupId>
<artifactId>sql-api-proxy</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<scope>compile</scope>
</dependency>
<!-- mysql驱动 -->
Expand Down

0 comments on commit c4acc43

Please sign in to comment.