service.java.vm 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package ${packageName}.service;
  2. import com.aidex.common.core.service.BaseTreeService;
  3. import com.aidex.common.core.domain.TreeNode;
  4. import java.util.List;
  5. import ${packageName}.domain.${ClassName};
  6. /**
  7. * ${functionName}Service接口
  8. * @author ${functionAuthor}
  9. * @email ${functionAuthorEmail}
  10. * @date ${datetime}
  11. */
  12. public interface ${ClassName}Service extends BaseTreeService<${ClassName}>
  13. {
  14. #if($hasDisableEnable)
  15. /**
  16. * 更新${functionName}状态
  17. * @param ${className}
  18. * @return 结果
  19. */
  20. public int updateStatus(${ClassName} ${className});
  21. #end
  22. /**
  23. * 根据展开层级和父节点递归获取展示的数据
  24. * @param level 展开层级
  25. * @param id 父节点ID
  26. * @return
  27. */
  28. public List<${ClassName}> listDataByLevel(int level, String id);
  29. /**
  30. * 构建前端所需要树结构
  31. * @param level展开层级
  32. * @param id 父节点ID
  33. * @return
  34. */
  35. public List<TreeNode> buildTree(int level, String id);
  36. /**
  37. * 构建前端所需要树结构(排除当前节点及子节点)
  38. * @param level 展开层级
  39. * @param id 父节点ID
  40. * @param exclude${ClassName} 排除节点信息
  41. * @return
  42. */
  43. public List<TreeNode> buildTreeDataExcludeChild(int level, String id, ${ClassName} exclude${ClassName});
  44. /**
  45. * 根据父节点ID查询是否存在子节点
  46. * @param parentId
  47. * @return
  48. */
  49. public boolean hasChildByParentId(String parentId);
  50. /**
  51. * 树表格检索
  52. * @param queryParams 检索对象
  53. * @return
  54. */
  55. public List<${ClassName}> search${ClassName}List(${ClassName} queryParams);
  56. /**
  57. * 树检索
  58. * @param queryParams 检索对象
  59. * @return
  60. */
  61. public List<TreeNode> search${ClassName}(${ClassName} queryParams);
  62. #foreach($column in $columns)
  63. #if($column.isUnique == "1")
  64. #set($attrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
  65. /**
  66. * 校验${column.columnComment}的唯一性
  67. * @param ${className}
  68. */
  69. public void check${attrName}Unique(${ClassName} ${className});
  70. #end
  71. #end
  72. }