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