AreaInfoService.java 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. package com.lqkj.info.service;
  2. import java.util.List;
  3. import com.lqkj.info.mapper.AreaInfoMapper;
  4. import com.lqkj.type.service.AreaTypeService;
  5. import org.apache.commons.lang.StringEscapeUtils;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Service;
  8. import com.lqkj.info.entity.AreaInfo;
  9. /**
  10. * 区域对象:area_infoService业务层处理
  11. *
  12. * @author lqkj
  13. * @date 2024-11-11
  14. */
  15. @Service
  16. public class AreaInfoService
  17. {
  18. @Autowired
  19. private AreaInfoMapper areaInfoMapper;
  20. @Autowired
  21. private AreaTypeService areaTypeService;
  22. /**
  23. * 查询区域对象:area_info
  24. *
  25. * @param areaId 区域对象:area_info主键
  26. * @return 区域对象:area_info
  27. */
  28. public AreaInfo selectAreaInfoByAreaId(Integer areaId)
  29. {
  30. return areaInfoMapper.selectAreaInfoByAreaId(areaId);
  31. }
  32. /**
  33. * 查询区域对象:area_info列表
  34. *
  35. * @param areaInfo 区域对象:area_info
  36. * @return 区域对象:area_info
  37. */
  38. public List<AreaInfo> selectAreaInfoList(AreaInfo areaInfo)
  39. {
  40. List<AreaInfo> areaInfos = areaInfoMapper.selectAreaInfoList(areaInfo);
  41. areaInfos.stream().forEach(areaInfo1 -> {
  42. areaInfo1.setTypeName(areaTypeService.selectAreaTypeByTypeId(areaInfo1.getTypeId()).getTypeName());
  43. });
  44. return areaInfos;
  45. }
  46. /**
  47. * 新增区域对象:area_info
  48. *
  49. * @param areaInfo 区域对象:area_info
  50. * @return 结果
  51. */
  52. public int insertAreaInfo(AreaInfo areaInfo)
  53. {
  54. // areaInfo.setLocation(StringEscapeUtils.unescapeHtml(areaInfo.getLocation().toString()));
  55. areaInfo.setMemo(StringEscapeUtils.unescapeHtml(areaInfo.getMemo()));
  56. return areaInfoMapper.insertAreaInfo(areaInfo);
  57. }
  58. /**
  59. * 修改区域对象:area_info
  60. *
  61. * @param areaInfo 区域对象:area_info
  62. * @return 结果
  63. */
  64. public int updateAreaInfo(AreaInfo areaInfo)
  65. {
  66. // areaInfo.setLocation(StringEscapeUtils.unescapeHtml(areaInfo.getLocation().toString()));
  67. areaInfo.setMemo(StringEscapeUtils.unescapeHtml(areaInfo.getMemo()));
  68. return areaInfoMapper.updateAreaInfo(areaInfo);
  69. }
  70. /**
  71. * 批量删除区域对象:area_info
  72. *
  73. * @param areaIds 需要删除的区域对象:area_info主键
  74. * @return 结果
  75. */
  76. public int deleteAreaInfoByAreaIds(Integer[] areaIds)
  77. {
  78. return areaInfoMapper.deleteAreaInfoByAreaIds(areaIds);
  79. }
  80. /**
  81. * 删除区域对象:area_info信息
  82. *
  83. * @param areaId 区域对象:area_info主键
  84. * @return 结果
  85. */
  86. public int deleteAreaInfoByAreaId(Integer areaId)
  87. {
  88. return areaInfoMapper.deleteAreaInfoByAreaId(areaId);
  89. }
  90. }