update 模板列表查询
This commit is contained in:
+12
-13
@@ -87,7 +87,7 @@ public class ActivitiModelerController {
|
||||
@ApiImplicitParam(name = "category_id", value = "类型id")
|
||||
@SuppressWarnings("deprecation")
|
||||
@GetMapping("/create")
|
||||
public void newModel(HttpServletRequest request, HttpServletResponse response, String category_id)
|
||||
public void newModel(HttpServletRequest request, HttpServletResponse response)
|
||||
throws IOException {
|
||||
// 初始化一个空模型
|
||||
Model model = repositoryService.newModel();
|
||||
@@ -126,19 +126,18 @@ public class ActivitiModelerController {
|
||||
|
||||
@ApiOperation(value = "模板列表")
|
||||
@ApiImplicitParams({ @ApiImplicitParam(name = "name", value = "名称"),
|
||||
@ApiImplicitParam(name = "category_id", value = "类型id") })
|
||||
@ApiImplicitParam(name = "category", value = "类型") })
|
||||
@GetMapping("/modelList")
|
||||
public Result<List<Model>> modelList(String name, String category_id) {
|
||||
//String sql = "select distinct RES.* from ACT_RE_MODEL RES WHERE RES.TENANT_ID_ = '子系统1' and RES.NAME_<>'' and RES.CATEGORY_=#{category} order by RES.CREATE_TIME_ desc";
|
||||
String sql = "select distinct RES.* from ACT_RE_MODEL RES WHERE RES.NAME_<>'' order by RES.CREATE_TIME_ desc";
|
||||
NativeModelQuery nativeModelQuery = repositoryService.createNativeModelQuery();
|
||||
//if (StringUtils.isNull(category_id)) {
|
||||
// sql = sql.replace("and RES.CATEGORY_=#{category}", "");
|
||||
//}else {
|
||||
// nativeModelQuery.parameter("category", category_id);
|
||||
//}
|
||||
nativeModelQuery.sql(sql);
|
||||
List<Model> list = nativeModelQuery.list();
|
||||
public Result<List<Model>> modelList(String name, String category) {
|
||||
ModelQuery modelQuery = repositoryService.createModelQuery();
|
||||
if (StringUtils.isNotBlank(category)) {
|
||||
modelQuery.modelCategoryLike("%"+category+"%");
|
||||
}
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
modelQuery.modelNameLike("%" + name + "%");
|
||||
}
|
||||
|
||||
List<Model> list = modelQuery.orderByCreateTime().desc().list();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user