mapper.java.vm 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. package ${packageName}.mapper;
  2. import java.util.List;
  3. import ${packageName}.domain.${ClassName};
  4. #if($table.sub)
  5. import ${packageName}.domain.${subClassName};
  6. #end
  7. /**
  8. * ${functionName}Mapper接口
  9. *
  10. * @author ${author}
  11. * @date ${datetime}
  12. */
  13. public interface ${ClassName}Mapper
  14. {
  15. /**
  16. * 查询${functionName}
  17. *
  18. * @param ${pkColumn.javaField} ${functionName}ID
  19. * @return ${functionName}
  20. */
  21. public ${ClassName} select${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField});
  22. /**
  23. * 查询${functionName}列表
  24. *
  25. * @param ${className} ${functionName}
  26. * @return ${functionName}集合
  27. */
  28. public List<${ClassName}> select${ClassName}List(${ClassName} ${className});
  29. /**
  30. * 新增${functionName}
  31. *
  32. * @param ${className} ${functionName}
  33. * @return 结果
  34. */
  35. public int insert${ClassName}(${ClassName} ${className});
  36. /**
  37. * 修改${functionName}
  38. *
  39. * @param ${className} ${functionName}
  40. * @return 结果
  41. */
  42. public int update${ClassName}(${ClassName} ${className});
  43. /**
  44. * 删除${functionName}
  45. *
  46. * @param ${pkColumn.javaField} ${functionName}ID
  47. * @return 结果
  48. */
  49. public int delete${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField});
  50. /**
  51. * 批量删除${functionName}
  52. *
  53. * @param ${pkColumn.javaField}s 需要删除的数据ID
  54. * @return 结果
  55. */
  56. public int delete${ClassName}ByIds(String[] ${pkColumn.javaField}s);
  57. #if($table.sub)
  58. /**
  59. * 批量删除${subTable.functionName}
  60. *
  61. * @param customerIds 需要删除的数据ID
  62. * @return 结果
  63. */
  64. public int delete${subClassName}By${subTableFkClassName}s(String[] ${pkColumn.javaField}s);
  65. /**
  66. * 批量新增${subTable.functionName}
  67. *
  68. * @param ${subclassName}List ${subTable.functionName}列表
  69. * @return 结果
  70. */
  71. public int batch${subClassName}(List<${subClassName}> ${subclassName}List);
  72. /**
  73. * 通过${functionName}ID删除${subTable.functionName}信息
  74. *
  75. * @param ${pkColumn.javaField} ${functionName}ID
  76. * @return 结果
  77. */
  78. public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField});
  79. #end
  80. }