ServiceImpl.java.vm 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. package ${package}.service;
  2. import java.util.List;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.stereotype.Service;
  5. import ${package}.mapper.${className}Mapper;
  6. import ${package}.domain.${className};
  7. import ${package}.service.I${className}Service;
  8. import com.ruoyi.common.utils.text.Convert;
  9. /**
  10. * ${tableComment} 服务层实现
  11. *
  12. * @author ${author}
  13. * @date ${datetime}
  14. */
  15. @Service
  16. public class ${className}ServiceImpl implements I${className}Service
  17. {
  18. @Autowired
  19. private ${className}Mapper ${classname}Mapper;
  20. /**
  21. * 查询${tableComment}信息
  22. *
  23. * @param ${primaryKey.attrname} ${tableComment}ID
  24. * @return ${tableComment}信息
  25. */
  26. @Override
  27. public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname})
  28. {
  29. return ${classname}Mapper.select${className}ById(${primaryKey.attrname});
  30. }
  31. /**
  32. * 查询${tableComment}列表
  33. *
  34. * @param ${classname} ${tableComment}信息
  35. * @return ${tableComment}集合
  36. */
  37. @Override
  38. public List<${className}> select${className}List(${className} ${classname})
  39. {
  40. return ${classname}Mapper.select${className}List(${classname});
  41. }
  42. /**
  43. * 新增${tableComment}
  44. *
  45. * @param ${classname} ${tableComment}信息
  46. * @return 结果
  47. */
  48. @Override
  49. public int insert${className}(${className} ${classname})
  50. {
  51. return ${classname}Mapper.insert${className}(${classname});
  52. }
  53. /**
  54. * 修改${tableComment}
  55. *
  56. * @param ${classname} ${tableComment}信息
  57. * @return 结果
  58. */
  59. @Override
  60. public int update${className}(${className} ${classname})
  61. {
  62. return ${classname}Mapper.update${className}(${classname});
  63. }
  64. /**
  65. * 删除${tableComment}对象
  66. *
  67. * @param ids 需要删除的数据ID
  68. * @return 结果
  69. */
  70. @Override
  71. public int delete${className}ByIds(String ids)
  72. {
  73. return ${classname}Mapper.delete${className}ByIds(Convert.toStrArray(ids));
  74. }
  75. }