性能测试

yun-zuoyi
yunhao.wang 6 years ago
parent 7ce9ad399f
commit 02f95f0939

@ -47,4 +47,8 @@ public interface BaseMongoRepository<T, ID extends Serializable> extends MongoRe
List<T> listPager(Pager pager);
List<T> listPager(Pager pager,String orderByParam, int ascOrDesc);
long deleteByProperty(Bson bson);
long deleteByPropertyIn(String propName, Object[] propValues);
long deleteByIds(ID[] ids);
}

@ -104,7 +104,7 @@ public class BaseMongoRepositoryImpl<T, ID extends Serializable> extends SimpleM
Object val = idField.get(item);
if((type == long.class || type == Long.class) && (val == null || Long.parseLong(val.toString()) == 0)){
// long类型主键以snowflake为主键
idField.set(item, snowflakeIdMaker.nextId());
idField.set(item, snowflakeIdMaker.nextId() + System.currentTimeMillis());
} else if(type == String.class && (val==null || "".equals(val))){
// String类型主键以UUID为主键
idField.set(item, UUID.randomUUID().toString().replace("-", "").toLowerCase());
@ -324,4 +324,23 @@ public class BaseMongoRepositoryImpl<T, ID extends Serializable> extends SimpleM
findIter.forEach(saveBlock);
return packObjectListFromDocument(dList);
}
@Override
public long deleteByProperty(Bson bson) {
return mongoOperations.getCollection(this.entityInformation.getCollectionName()).deleteMany(bson).getDeletedCount();
}
@Override
public long deleteByPropertyIn(String propName, Object[] propValues) {
Bson bson = Filters.and(
Filters.in(propName, propValues)
);
return deleteByProperty(bson);
}
@Override
public long deleteByIds(ID[] ids) {
return deleteByPropertyIn("id",ids);
}
}

@ -34,29 +34,29 @@ public class SysConfig extends BaseBean {
private String name;
@Column(name="CONFIG_TYPE")
@ApiParam(value ="配置类型ID枚举1.系统配置..." , example ="-1")
@ApiParam(value ="参数类型ID枚举1.系统配置..." , example ="-1")
private Integer configType;
@Column(name="CONFIG_CODE")
@ApiParam(value ="配置代码")
@ApiParam(value ="参数代码")
private String configCode;
// 枚举 ImppEnumUtil.SYS_CONFIG_GROUP
@Column(name="CONFIG_GROUP")
@ApiParam(value ="配置组")
@ApiParam(value ="参数组")
private Integer configGroup;
// 枚举 ImppEnumUtil.SYS_VALUE_TYPE
@Column(name="CONFIG_VALUE_TYPE")
@ApiParam(value ="配置值类型")
@ApiParam(value ="参数值类型")
private String configValueType;
@Column(name="CONFIG_VALUE")
@ApiParam(value ="配置值")
@ApiParam(value ="参数值")
private String configValue;
@Column(name="CONFIG_DESCRIPTION")
@ApiParam(value ="配置描述")
@ApiParam(value ="参数描述")
private String configDescription;
}

@ -0,0 +1,33 @@
package cn.estsh.i3plus.pojo.platform.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
/**
* @Description :
* @Reference :
* @Author : yunhao
* @CreateDate : 2019-02-24 16:21
* @Modify:
**/
public class TestInfo extends BaseBean {
/**
*
*/
private double ram;
/**
* cpu
*/
private double cpu;
/**
* 线id
*/
private String threadId;
/**
*
*/
private String method;
}
Loading…
Cancel
Save