Skip to content

Commit

Permalink
Merge branch 'dev' into 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
chenrenfei committed Sep 29, 2024
2 parents 5ab7316 + 309488a commit 883c6b3
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion trunk/sqltoy-orm-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sagframe</groupId>
<version>5.6.25.RC3</version>
<version>5.6.25</version>
<name>sagacity-sqltoy</name>
<description>sqltoy core code</description>
<artifactId>sagacity-sqltoy</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,8 +853,8 @@ public static int getIntervalYears(Object floorDate, Object goalDate) {
*/
public static int getIntervalDays(Object floorDate, Object goalDate) {
BigDecimal result = new BigDecimal(
Double.valueOf(getIntervalMillSeconds(DateUtil.formatDate(floorDate, FORMAT.DATE_HORIZONTAL),
DateUtil.formatDate(goalDate, FORMAT.DATE_HORIZONTAL))) / (3600 * 1000 * 24));
Double.valueOf(getIntervalMillSeconds(formatDate(floorDate, FORMAT.DATE_HORIZONTAL),
formatDate(goalDate, FORMAT.DATE_HORIZONTAL))) / (3600 * 1000 * 24));
return result.setScale(1, RoundingMode.HALF_UP).intValue();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ public static String getParentPath(String fileName) {
* @return
*/
public static String skipPath(String basePath, String skipFile) {
String realFile = FileUtil.formatPath(skipFile).trim();
String realFile = formatPath(skipFile).trim();
if (realFile.indexOf("." + File.separator) == 0) {
realFile = realFile.substring(2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2226,12 +2226,19 @@ public static String combineArray(Object[] array) {
* @return
*/
public static String adjustMergeIntoSql(String sql, Integer dbType) {
String sqlTrimLow = sql.toLowerCase().trim();
// 非merge into 不做任何处理
if (!StringUtil.matches(sqlTrimLow, MERGE_INTO_PATTERN)) {
return sql;
}
boolean isBranchEnd = sqlTrimLow.endsWith(";");
// sqlserver merge into 要以;结尾
if (dbType == DBType.SQLSERVER) {
String sqlTrimLow = sql.toLowerCase().trim();
if (StringUtil.matches(sqlTrimLow, MERGE_INTO_PATTERN) && !sqlTrimLow.endsWith(";")) {
return sql.concat(";");
}
if (dbType == DBType.SQLSERVER && !isBranchEnd) {
return sql.concat(";");
}
// 其他数据库merge into 以;结尾则需要剔除分号
if (isBranchEnd) {
return sql.substring(0, sql.lastIndexOf(";"));
}
return sql;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/sqltoy-orm-solon-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.sagframe</groupId>
<version>5.6.25.RC3</version>
<version>5.6.25</version>

<artifactId>sagacity-sqltoy-solon-plugin</artifactId>
<name>sagacity-sqltoy-solon-plugin</name>
Expand Down
2 changes: 1 addition & 1 deletion trunk/sqltoy-orm-spring-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sagframe</groupId>
<version>5.6.25.RC3</version>
<version>5.6.25</version>
<name>sagacity-sqltoy-spring-starter</name>
<artifactId>sagacity-sqltoy-spring-starter</artifactId>
<description>sqltoy springboot starter</description>
Expand Down
2 changes: 1 addition & 1 deletion trunk/sqltoy-orm-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sagframe</groupId>
<version>5.6.25.RC3</version>
<version>5.6.25</version>
<name>sagacity-sqltoy-spring</name>
<description>sagacity-sqltoy-spring</description>
<artifactId>sagacity-sqltoy-spring</artifactId>
Expand Down

0 comments on commit 883c6b3

Please sign in to comment.