Skip to content

Commit

Permalink
isxcode#266 add isToday() and isNotToday()
Browse files Browse the repository at this point in the history
  • Loading branch information
ispong committed Aug 17, 2022
1 parent 438b25b commit b8883b9
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 11 deletions.
11 changes: 0 additions & 11 deletions ISSUES.md

This file was deleted.

18 changes: 18 additions & 0 deletions docs/en-us/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## v1.8.1

### 💥️ Breaking Change

- nothing

### ✨ Feature

- add isToday() and isNotToday()

### 🎨 Enhancement

- nothing

### 🐛 Fix

- nothing


## v1.2.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,28 @@ public T eq(String columnName, Object value) {
return getSelf();
}

@Override
public T isToday(String columnName) {

if (DataBaseType.MONGO.equals(dataBaseType)) {
return getSelf();
}

sqlConditions.add(new SqlCondition(SqlOperateType.EQ, "date_format(" + getColumnName(columnName) + ",'%Y-%m-%d')", "date_format(now(), '%Y-%m-%d')"));
return getSelf();
}

@Override
public T isNotToday(String columnName) {

if (DataBaseType.MONGO.equals(dataBaseType)) {
return getSelf();
}

sqlConditions.add(new SqlCondition(SqlOperateType.NE, "date_format(" + getColumnName(columnName) + ",'%Y-%m-%d')", "date_format(now(), '%Y-%m-%d')"));
return getSelf();
}

@Override
public T ne(String columnName, Object value) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,22 @@ public interface FlysqlCondition<T> {
*/
T sql(String sqlStr);

/**
* isToday()
*
* @param columnName columnName
* @return se
* @since 0.0.1
*/
T isToday(String columnName);

/**
* isNotToday()
*
* @param columnName columnName
* @return se
* @since 0.0.1
*/
T isNotToday(String columnName);

}

0 comments on commit b8883b9

Please sign in to comment.