# 智慧社区管理系统-基础管理-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}}
房屋编号

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

相关内容

热门资讯

监控摄像头接入GB28181平... 流程简介将监控摄像头的视频在网站和APP中直播,要解决的几个问题是:1&...
Windows10添加群晖磁盘... 在使用群晖NAS时,我们需要通过本地映射的方式把NAS映射成本地的一块磁盘使用。 通过...
protocol buffer... 目录 目录 什么是protocol buffer 1.protobuf 1.1安装  1.2使用...
在Word、WPS中插入AxM... 引言 我最近需要写一些文章,在排版时发现AxMath插入的公式竟然会导致行间距异常&#...
Fluent中创建监测点 1 概述某些仿真问题,需要创建监测点,用于获取空间定点的数据࿰...
educoder数据结构与算法...                                                   ...
MySQL下载和安装(Wind... 前言:刚换了一台电脑,里面所有东西都需要重新配置,习惯了所...
MFC文件操作  MFC提供了一个文件操作的基类CFile,这个类提供了一个没有缓存的二进制格式的磁盘...
有效的括号 一、题目 给定一个只包括 '(',')','{','}'...
【Ctfer训练计划】——(三... 作者名:Demo不是emo  主页面链接:主页传送门 创作初心ÿ...