mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-09 08:57:17 +08:00
style: 调整代码风格 null == xx => xx == null(更符合大众风格)
This commit is contained in:
@@ -121,7 +121,7 @@ public class MybatisBaseEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandl
|
||||
@Override
|
||||
public E getNullableResult(ResultSet rs, String columnName) throws SQLException {
|
||||
Object value = rs.getObject(columnName, this.propertyType);
|
||||
if (null == value || rs.wasNull()) {
|
||||
if (value == null || rs.wasNull()) {
|
||||
return null;
|
||||
}
|
||||
return this.valueOf(value);
|
||||
@@ -130,7 +130,7 @@ public class MybatisBaseEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandl
|
||||
@Override
|
||||
public E getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
|
||||
Object value = rs.getObject(columnIndex, this.propertyType);
|
||||
if (null == value || rs.wasNull()) {
|
||||
if (value == null || rs.wasNull()) {
|
||||
return null;
|
||||
}
|
||||
return this.valueOf(value);
|
||||
@@ -139,7 +139,7 @@ public class MybatisBaseEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandl
|
||||
@Override
|
||||
public E getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
|
||||
Object value = cs.getObject(columnIndex, this.propertyType);
|
||||
if (null == value || cs.wasNull()) {
|
||||
if (value == null || cs.wasNull()) {
|
||||
return null;
|
||||
}
|
||||
return this.valueOf(value);
|
||||
|
@@ -97,7 +97,7 @@ public class QueryWrapperHelper {
|
||||
public static <Q, R> QueryWrapper<R> build(Q query, Sort sort) {
|
||||
QueryWrapper<R> queryWrapper = new QueryWrapper<>();
|
||||
// 没有查询条件,直接返回
|
||||
if (null == query) {
|
||||
if (query == null) {
|
||||
return queryWrapper;
|
||||
}
|
||||
// 设置排序条件
|
||||
@@ -125,7 +125,7 @@ public class QueryWrapperHelper {
|
||||
*/
|
||||
public static <Q, R> QueryWrapper<R> build(Q query, List<Field> fields, QueryWrapper<R> queryWrapper) {
|
||||
// 没有查询条件,直接返回
|
||||
if (null == query) {
|
||||
if (query == null) {
|
||||
return queryWrapper;
|
||||
}
|
||||
// 解析并拼接查询条件
|
||||
@@ -161,7 +161,7 @@ public class QueryWrapperHelper {
|
||||
String fieldName = ReflectUtil.getFieldName(field);
|
||||
// 没有 @Query 注解,默认等值查询
|
||||
Query queryAnnotation = AnnotationUtil.getAnnotation(field, Query.class);
|
||||
if (null == queryAnnotation) {
|
||||
if (queryAnnotation == null) {
|
||||
return Collections.singletonList(q -> q.eq(CharSequenceUtil.toUnderlineCase(fieldName), fieldValue));
|
||||
}
|
||||
// 解析单列查询
|
||||
|
Reference in New Issue
Block a user