# 智慧社区管理系统-基础管理-04业主管理
创始人
2024-03-16 00:33:08
0

一后端

1entity

package com.woniu.community.entity;import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;@Data
@AllArgsConstructor
@NoArgsConstructor
public class Owner {private  int id;private  String userName;private String tel;//联系方式private String sex;private String identity;//身份证号private int houseId;private String remarks;//备注private  String password;//密码private String houseNumbers;
}

2:OwnerMapper

package com.woniu.community.mapper;import com.woniu.community.entity.Owner;import java.util.List;public interface OwnerMapper {List selectAll(String tel,String identity,int start,int size);int  count(String tel,String identity);int insertOwner(Owner owner);int  deleteOwner(int id);int  updateOwner(Owner owner);Owner selectById(int  id);
}

3:IOwnerService

package com.woniu.community.service;import com.woniu.community.entity.HttpResult;
import com.woniu.community.entity.Owner;import java.util.List;public interface IOwnerService {/*** 查询所有* @param tel* @param identity* @param pageIndex* @param pageSize* @return*/HttpResult selectAll(String tel, String identity, int pageIndex, int pageSize);/*** 添加* @param owner* @return*/HttpResult insertOwner(Owner owner);/*** 删除* @param id* @return*/HttpResult  deleteOwner(int id);/*** 修改* @param owner* @return*/HttpResult  updateOwner(Owner owner);/*** 根据id查询* @param id* @return*/HttpResult selectById(int  id);}

4:OwnerServiceImpl

package com.woniu.community.service.impl;import com.woniu.community.entity.HttpResult;
import com.woniu.community.entity.Owner;
import com.woniu.community.mapper.OwnerMapper;
import com.woniu.community.service.IOwnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import java.util.List;@Service
public class OwnerServiceImpl implements IOwnerService {@Autowired(required = false)private OwnerMapper ownerMapper;/*** 查询所有** @param tel* @param identity* @param pageIndex* @param pageSize* @return*/@Overridepublic HttpResult selectAll(String tel, String identity, int pageIndex, int pageSize) {HttpResult result=null;List owners = ownerMapper.selectAll(tel, identity, (pageIndex - 1) * pageSize, pageSize);int count = ownerMapper.count(tel, identity);if (owners!=null&&owners.size()>0){result=new HttpResult(owners,count,200,null);}else{result=new HttpResult(null,0,500,"没有更多数据");}return result;}/*** 添加** @param owner* @return*/@Overridepublic HttpResult insertOwner(Owner owner) {HttpResult result=null;int count = ownerMapper.insertOwner(owner);if (count>0){result=new HttpResult(null,0,200,"添加成功");}else{result=new HttpResult(null,0,500,"添加失败");}return result;}/*** 删除** @param id* @return*/@Overridepublic HttpResult deleteOwner(int id) {HttpResult result=null;int count = ownerMapper.deleteOwner(id);if (count>0){result=new HttpResult(null,0,200,"删除成功");}else{result=new HttpResult(null,0,500,"删除失败");}return result;}/*** 修改** @param owner* @return*/@Overridepublic HttpResult updateOwner(Owner owner) {HttpResult result=null;int count = ownerMapper.updateOwner(owner);if (count>0){result=new HttpResult(null,0,200,"修改成功");}else{result=new HttpResult(null,0,500,"修改失败");}return result;}/*** 根据id查询** @param id* @return*/@Overridepublic HttpResult selectById(int id) {HttpResult result=null;Owner owner = ownerMapper.selectById(id);if (owner!=null){result=new HttpResult(owner,0,200,null);}else{result=new HttpResult(null,0,500,null);}return result;}
}

5:OwnerCOntroller

package com.woniu.community.controller;import com.woniu.community.entity.HttpResult;
import com.woniu.community.entity.Owner;
import com.woniu.community.service.IOwnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
@RequestMapping("/owner")
@CrossOrigin(origins = "*")
public class OwnerController {@Autowiredprivate IOwnerService iOwnerService;@RequestMapping("/list")HttpResult selectAll(String tel, String identity, int pageIndex, int pageSize){return iOwnerService.selectAll(tel,identity,pageIndex,pageSize);}@RequestMapping("/add")HttpResult insertOwner(Owner owner){return iOwnerService.insertOwner(owner);}@RequestMapping("/delete")HttpResult  deleteOwner(int id){return iOwnerService.deleteOwner(id);}@RequestMapping("/update")HttpResult  updateOwner(Owner owner){return iOwnerService.updateOwner(owner);}@RequestMapping("/info")HttpResult selectById(int  id){return iOwnerService.selectById(id);}
}

前端代码




Title


电话:身份证号:
业主管理
ID姓名性别联系方式身份证号房屋编号操作
{{o.id}}{{o.userName}}{{o.sex}}{{o.tel}}{{o.identity}}{{o.houseNumbers}}



Title


{{title}}
房屋编号

在这里插入图片描述
在这里插入图片描述

相关内容

热门资讯

修复 爱普生 EPSON L4... L4151 L4153 L4156 L4158 L4163 L4165 L4166 L4168 L4...
【PdgCntEditor】解... 一、问题背景 大部分的图书对应的PDF,目录中的页码并非PDF中直接索引的页码...
监控摄像头接入GB28181平... 流程简介将监控摄像头的视频在网站和APP中直播,要解决的几个问题是:1&...
在Word、WPS中插入AxM... 引言 我最近需要写一些文章,在排版时发现AxMath插入的公式竟然会导致行间距异常&#...
protocol buffer... 目录 目录 什么是protocol buffer 1.protobuf 1.1安装  1.2使用...
【前端】‘??‘与‘||‘有什... 0 问题 经常写const data = res.data.a ?? ''或者const d...
Windows10添加群晖磁盘... 在使用群晖NAS时,我们需要通过本地映射的方式把NAS映射成本地的一块磁盘使用。 通过...
牛客计算器的改良(Python... 文章目录1.题目描述2.输入描述:3.输出描述:4.示例15.分析6.代码7.结语 链接࿱...
正大杯|市调大赛|2023备赛... 关键信息 同时随着精细化养宠趋势的深入,宠物消费类目日渐丰富。 本报告通过 Niuco...
QGIS下载在线地图(Goog... 前言 国内外有很多在线地图下载软件,但功能单一,基本上只能下载数据&#x...