1. deleted->is_deleted

2. fastjson升级
This commit is contained in:
mazhicheng 2019-09-08 12:01:13 +08:00
parent 347150a1d5
commit 186c127fdb
12 changed files with 24 additions and 22 deletions

View File

@ -36,7 +36,7 @@ subprojects {
mysqlConnectorVersion = "8.0.16"
mybatisStarterVersion = "2.0.1"
mybatisPlusVersion = "3.1.2"
fastjsonVersion = "1.2.58"
fastjsonVersion = "1.2.60"
lombokVersion = "1.18.8"
}
dependencies {

View File

@ -75,7 +75,7 @@ public class EntityBinder<T> extends BaseBinder<T> {
// 结果转换Map
Map<String, T> valueEntityMap = new HashMap<>();
// 通过中间表关联Entity
// @BindEntity(entity = Organization.class, condition = "this.department_id=department.id AND department.org_id=id AND department.deleted=0")
// @BindEntity(entity = Organization.class, condition = "this.department_id=department.id AND department.org_id=id AND department.is_deleted=0")
// Organization organization;
if(middleTable != null){
Map<String, Object> middleTableResultMap = middleTable.executeOneToOneQuery(annoObjectForeignKeyList);

View File

@ -251,7 +251,7 @@ public class ConditionManager {
middleTable.connect(middleTableEqualsToAnnoObjectFKColumn, middleTableEqualsToRefEntityPkColumn);
}
}
else{ // equals附加条件暂只支持列在左侧 department.deleted=0
else{ // equals附加条件暂只支持列在左侧 department.is_deleted=0
String leftExpression = express.getLeftExpression().toString();
if(leftExpression != null && leftExpression.startsWith(tableName+".")){
middleTable.addAdditionalCondition(removeLeftAlias(operator.toString()));

View File

@ -27,10 +27,11 @@ public abstract class BaseEntity implements Serializable {
private Long id;
/***
* 默认逻辑删除标记deleted=0有效
* 默认逻辑删除标记is_deleted=0有效
*/
@TableLogic
@JSONField(serialize = false)
@TableField("is_deleted")
private boolean deleted = false;
/***

View File

@ -50,7 +50,7 @@ public class Dictionary extends BaseExtEntity {
*/
@Length(max = 200, message = "数据字典备注长度超长!")
@TableField
private String comment;
private String description;
/***
* 排序号
@ -62,7 +62,7 @@ public class Dictionary extends BaseExtEntity {
* 是否为系统预置预置不可删除
*/
@TableField
private boolean system = true;
private boolean deletable = false;
/***
* 是否可编辑
@ -102,12 +102,12 @@ public class Dictionary extends BaseExtEntity {
this.itemValue = itemValue;
}
public String getComment() {
return comment;
public String getDescription() {
return description;
}
public void setComment(String comment) {
this.comment = comment;
public void setDescription(String description) {
this.description = description;
}
public int getSortId() {
@ -118,12 +118,12 @@ public class Dictionary extends BaseExtEntity {
this.sortId = sortId;
}
public boolean isSystem() {
return system;
public boolean isDeletable() {
return deletable;
}
public void setSystem(boolean system) {
this.system = system;
public void setDeletable(boolean deletable) {
this.deletable = deletable;
}
public boolean isEditable() {

View File

@ -161,7 +161,8 @@ public class SqlExecutor {
int rs = stmt.executeUpdate();
return rs >= 0;
} catch(Exception e){
log.error("执行sql查询异常", e);
String sqlInfo = S.substring(sql, 0, 50) + "...";
log.error("执行sql查询异常: "+sqlInfo, e);
throw e;
}
}

View File

@ -21,9 +21,9 @@ public class FieldBinderVO extends User{
private String deptName;
// 支持级联字段关联相同条件的entity+condition将合并为一条SQL查询
@BindField(entity = Organization.class, field="name", condition="this.department_id=department.id AND department.org_id=id AND department.deleted=0")
@BindField(entity = Organization.class, field="name", condition="this.department_id=department.id AND department.org_id=id AND department.is_deleted=0")
private String orgName;
@BindField(entity = Organization.class, field="telphone", condition="this.department_id=department.id AND department.org_id=id AND department.deleted=0")
@BindField(entity = Organization.class, field="telphone", condition="this.department_id=department.id AND department.org_id=id AND department.is_deleted=0")
private String orgTelphone;
// 绑定数据字典枚举

View File

@ -10,7 +10,7 @@ import java.util.List;
@Data
public class DictionaryVO extends Dictionary {
@BindEntityList(entity=Dictionary.class, condition="this.type=type AND parent_id>0 AND deleted=0")
@BindEntityList(entity=Dictionary.class, condition="this.type=type AND parent_id>0 AND is_deleted=0")
private List<Dictionary> children;
}

View File

@ -27,7 +27,7 @@ public class PositionVO extends Position {
@BindEntity(entity = Position.class, condition = "this.parent_id = id")
private Position parentPosition;
@BindEntityList(entity = Department.class, condition = "this.id = if_position_department.position_id AND if_position_department.department_id = id AND if_position_department.deleted = 0")
@BindEntityList(entity = Department.class, condition = "this.id = if_position_department.position_id AND if_position_department.department_id = id AND if_position_department.is_deleted = 0")
private List<Department> departmentList;
private List<PositionVO> children;

View File

@ -34,7 +34,7 @@ public class UserVO extends User {
private String orgTelphone;
// 通过中间表关联Entity
@BindEntity(entity = Organization.class, condition = "this.department_id=department.id AND department.org_id=id") // AND deleted=0
@BindEntity(entity = Organization.class, condition = "this.department_id=department.id AND department.org_id=id") // AND is_deleted=0
private Organization organization;
// 支持通过中间表的多-多Entity实体关联

View File

@ -79,7 +79,7 @@ public class PermissionServiceImpl extends BaseServiceImpl<PermissionMapper, Per
}
/**
* 批量创建或更新或删除entityentity.id存在如果deleted = 1表示逻辑删除=0表示更新若entity.id不存在否则新建
* 批量创建或更新或删除entityentity.id存在如果is_deleted = 1表示逻辑删除=0表示更新若entity.id不存在否则新建
*
* @param entityList
* @return

View File

@ -23,7 +23,7 @@ public class RoleVO extends Role {
private String statusLabel;
/**支持通过中间表的多-多Entity实体关联*/
@BindEntityList(entity = Permission.class, condition="this.id=role_permission.role_id AND role_permission.permission_id=id AND role_permission.deleted=0")
@BindEntityList(entity = Permission.class, condition="this.id=role_permission.role_id AND role_permission.permission_id=id AND role_permission.is_deleted=0")
private List<Permission> permissionList;
@TableField(exist = false)