spring+springMVC+mybatis实现的物业管理系统

news2024/11/24 10:29:12

本系统借用了前辈的页面框架来实现了一个物业管理系统,使用到的主要技术有:SSM框架,MySql 8.0数据库,tomcat 8.0,使用maven进行依赖管理,前端页面使用的是jsp。整个系统分为用户端和管理员端。
用户端功能有:
1、管理个人信息,包括个人资料、家庭成员、车辆信息、宠物信息。
用户个人资料的功能有增加、删除、查找、修改用户信息以及用户登陆,Controller层代码如下:

@Controller
@RequestMapping("/userProfile")
public class UserProfileController {
    @Autowired
    private IUserProfileService userProfileService;

    @RequestMapping("/findAll")
    public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size) throws Exception {
        ModelAndView mv = new ModelAndView();
        List<UserProfile> userProfileList=userProfileService.findAll(page,size);
        PageInfo userProfilePageInfo = new PageInfo(userProfileList);
        mv.addObject("userProfilePageInfo",userProfilePageInfo);
        mv.setViewName("userProfile-list");
        return mv;
    }
    @RequestMapping("/findById")
    public ModelAndView findById(@RequestParam(name = "UserId", required = true) Integer UserId) throws Exception {
        ModelAndView mv = new ModelAndView();
        UserProfile userProfile =userProfileService.findById(UserId);
        mv.addObject("userProfile",userProfile);
        mv.setViewName("userProfile-show");
        return mv;
    }

    @RequestMapping("/findById2")
    public ModelAndView findById2(@RequestParam(name = "UserId", required = true) Integer UserId) throws Exception {
        ModelAndView mv = new ModelAndView();
        UserProfile userProfile =userProfileService.findById(UserId);
        mv.addObject("userProfile",userProfile);
        mv.setViewName("user-list");
        return mv;
    }

    @RequestMapping("/delete")
    public String deletePermission(@RequestParam(name = "UserId", required = true) Integer UserId) throws Exception{
        userProfileService.updateUserStatus(UserId);
        return "redirect:findAll";
    }

    @RequestMapping("/save")
    public String save(UserProfile userProfile) throws Exception {
        userProfileService.save(userProfile);
        return "redirect:/userlogin.jsp";
    }
    @RequestMapping("/update")
    public String update(UserProfile userProfile) throws Exception {
        userProfileService.updateUserProfile(userProfile);
        return "redirect:findAll";
    }
    @RequestMapping("/update2")
    public String update2(UserProfile userProfile) throws Exception {
        userProfileService.updateUserProfile(userProfile);
        return "redirect:/pages/user-list.jsp";
    }
    @RequestMapping("/verify")
    public String Verify(UserProfile userProfile, HttpSession session) throws Exception {
        System.out.println("用户登录"+userProfile);
        UserProfile userProfileVerify = userProfileService.verifyUserProfile(userProfile);
        System.out.println("用户登录"+userProfile);
        if(userProfileVerify==null)
            return "redirect:/userlogin.jsp";
        else{
            session.setAttribute("userInfoLogin",userProfileVerify);
            return "main-user";
        }
    }
}

数据持久层实现数据库数据的查询、更新等,使用的是mybatis注解的形式,代码如下:

    @Select("select * from user_profile")
    public List<UserProfile> findAll(int page, int size) throws Exception;

    @Insert("insert into user_profile(User_name,House_id,User_native_place,User_unit,User_id_number,User_tel,User_check_in_time,User_sex,User_password,User_status) values(#{UserName},#{HouseId},#{UserNativePlace},#{UserUnit},#{UserIdNumber},#{UserTel},#{UserCheckInTime},#{UserSex},#{UserPassword},1)")
    void save(UserProfile userProfile);

    @Delete("delete from user_profile where User_id=#{UserId}")
    void deleteuserProfileById(Integer UserId);

    @Select("select * from user_profile where User_id=#{UserId}")
    UserProfile findById(Integer UserId);

    @Update("update user_profile set User_name=#{UserName},House_id=#{HouseId},User_native_place=#{UserNativePlace},User_unit=#{UserUnit},User_id_number=#{UserIdNumber},User_tel=#{UserTel},User_check_in_time=#{UserCheckInTime},User_check_out_time=#{UserCheckOutTime},User_sex=#{UserSex},User_age=#{UserAge},User_note=#{UserNote},User_password=#{UserPassword},User_status=#{UserStatus} where User_id=#{UserId}")
    void update(UserProfile userProfile);
    //验证登陆
    @Select("select * from user_profile where User_id_number=#{UserIdNumber} and User_password=#{UserPassword} and User_status=1")
    UserProfile verifyUserProfile(UserProfile userProfile);

    @Update("update user_profile set User_status= 0 where User_id=#{UserId}")
    void updateUserStatus(Integer UserId);

2、管理缴费信息,包括物业费、水电费、停车费。
物业费管理的Controller层:

 @Autowired
    private IPropertyFeeService propertyFeeService;

    @RequestMapping("/findAll")
    public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size) throws Exception {
        ModelAndView mv = new ModelAndView();
        List<PropertyFee> propertyFeeList =propertyFeeService.findAll(page,size);
        PageInfo propertyFeePageInfo = new PageInfo(propertyFeeList);
        mv.addObject("propertyFeePageInfo", propertyFeePageInfo);
        mv.setViewName("propertyFee-list");
        return mv;
    }
    @RequestMapping("/findById")
    public ModelAndView findById(@RequestParam(name = "PropertyFeeId", required = true) Integer PropertyFeeId) throws Exception {
        ModelAndView mv = new ModelAndView();
        PropertyFee propertyFee = propertyFeeService.findById(PropertyFeeId);
        mv.addObject("propertyFee",propertyFee);
        mv.setViewName("propertyFee-show");
        return mv;
    }

    @RequestMapping("/delete")
    public String deletePermission(@RequestParam(name = "PropertyFeeId", required = true) Integer PropertyFeeId) throws Exception{
        propertyFeeService.deletepropertyFeeById(PropertyFeeId);
        return "redirect:findAll";
    }

    @RequestMapping("/save")
    public String save(PropertyFee propertyFee) throws Exception {
        System.out.println("新增:"+propertyFee);
        propertyFeeService.save(propertyFee);
        return "redirect:findAll";
    }
    @RequestMapping("/update")
    public String update(PropertyFee propertyFee) throws Exception {
        System.out.println("修改:"+propertyFee);
        propertyFeeService.updatePropertyFee(propertyFee);
        return "redirect:findAll";
    }
    @RequestMapping("/findByUserId")
    public ModelAndView findByUserId(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size,@RequestParam(name = "UserId", required = true) Integer UserId) throws Exception {
        ModelAndView mv = new ModelAndView();
        List<PropertyFee> propertyFeeList=propertyFeeService.findByUserId(page, size, UserId);
        PageInfo propertyFeePageInfos = new PageInfo(propertyFeeList);
        mv.addObject("propertyFeePageInfos",propertyFeePageInfos);
        mv.setViewName("propertyFees-list");
        return mv;
    }

物业费管理的Dao层:

    @Select("select * from property_fee")
    public List<PropertyFee> findAll(int page, int size) throws Exception;

    @Insert("insert into property_fee(User_id,User_name,Property_address,Property_year,Property_month,Property_fee_total,Property_fee_pay,Property_fee_owe,Property_fee_pay_time,Property_fee_pay_method,Property_fee_handler,Property_fee_note) values(#{UserId},#{UserName},#{PropertyAddress},#{PropertyYear},#{PropertyMonth},#{PropertyFeeTotal},#{PropertyFeePay},#{PropertyFeeOwe},#{PropertyFeePayTime},#{PropertyFeePayMethod},#{PropertyFeeHandler},#{PropertyFeeNote})")
    void save(PropertyFee propertyFee);

    @Delete("delete from property_fee where Property_fee_id=#{PropertyFeeId}")
    void deletepropertyFeeById(Integer PropertyFeeId);

    @Select("select * from property_fee where Property_fee_id=#{PropertyFeeId}")
    PropertyFee findById(Integer PropertyFeeId);

    @Update("update property_fee set User_id=#{UserId},User_name=#{UserName},Property_address=#{PropertyAddress},Property_year=#{PropertyYear},Property_month=#{PropertyMonth},Property_fee_total=#{PropertyFeeTotal},Property_fee_pay=#{PropertyFeePay},Property_fee_owe=#{PropertyFeeOwe},Property_fee_pay_time=#{PropertyFeePayTime},Property_fee_pay_method=#{PropertyFeePayMethod},Property_fee_handler=#{PropertyFeeHandler},Property_fee_note=#{PropertyFeeNote} where Property_fee_id=#{PropertyFeeId}")
    void update(PropertyFee propertyFee);

    @Select("select * from property_fee where User_id=#{UserId}")
    List<PropertyFee> findByUserId(int page, int size,@Param("UserId")Integer UserId) throws Exception;

3、员工评价,查看以往评价以及对员工进行评价。
员工评价的Controller层如下:

    @Autowired
    private IEmployeeEvaluateService employeeEvaluateService;

    @RequestMapping("/findAll")
    public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size) throws Exception {
        ModelAndView mv = new ModelAndView();
        List<EmployeeEvaluate> employeeEvaluateList = employeeEvaluateService.findAll(page,size);
        PageInfo employeeEvaluatePageInfo = new PageInfo(employeeEvaluateList);
        mv.addObject("employeeEvaluatePageInfo", employeeEvaluatePageInfo);
        mv.setViewName("employeeEvaluate-list");
        return mv;
    }
    @RequestMapping("/findById")
    public ModelAndView findById(@RequestParam(name = "EvaluateId", required = true) Integer EvaluateId) throws Exception {
        ModelAndView mv = new ModelAndView();
        EmployeeEvaluate employeeEvaluate = employeeEvaluateService.findById(EvaluateId);
        mv.addObject("employeeEvaluate",employeeEvaluate);
        mv.setViewName("employeeEvaluate-show");
        return mv;
    }

    @RequestMapping("/delete")
    public String deletePermission(@RequestParam(name = "EvaluateId", required = true) Integer EvaluateId) throws Exception{
        employeeEvaluateService.deleteemployeeEvaluateById(EvaluateId);
        return "redirect:findAll";
    }

    @RequestMapping("/save")
    public String save(EmployeeEvaluate employeeEvaluate) throws Exception {
        employeeEvaluateService.save(employeeEvaluate);
        return "redirect:findAll";
    }
    @RequestMapping("/update")
    public String update(EmployeeEvaluate employeeEvaluate) throws Exception {
        employeeEvaluateService.updateEmployeeEvaluate(employeeEvaluate);
        return "redirect:findAll";
    }

员工评价的Dao层代码如下:

    @Select("select * from employee_evaluate")
    public List<EmployeeEvaluate> findAll(int page, int size) throws Exception;

    @Insert("insert into employee_evaluate(Evaluate_content,Evaluate_stars,User_id,Employee_id) values(#{EvaluateContent},#{EvaluateStars},#{UserId},#{EmployeeId})")
    void save(EmployeeEvaluate employeeEvaluate);

    @Delete("delete from employee_evaluate where Evaluate_id=#{EvaluateId}")
    void deleteemployeeEvaluateById(Integer EvaluateId);

    @Select("select * from employee_evaluate where Evaluate_id=#{EvaluateId}")
    EmployeeEvaluate findById(Integer EvaluateId);

    @Update("update employee_evaluate set Evaluate_content=#{EvaluateContent},Evaluate_stars=#{EvaluateStars},User_id=#{UserId},Employee_id=#{EmployeeId} where Evaluate_id=#{EvaluateId}")
    void update(EmployeeEvaluate employeeEvaluate);


在这里插入图片描述

在这里插入图片描述
管理员端的功能主要有:
在这里插入图片描述

1、人事管理
在这里插入图片描述
人事管理的功能以岗位考核为例提供代码示例:
岗位考核的Controller层代码如下:

    @Autowired
    private IEmployeeExamService employeeExamService;

    @RequestMapping("/findAll")
    public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size) throws Exception {
        ModelAndView mv = new ModelAndView();
        List<EmployeeExam> employeeExamList = employeeExamService.findAll(page,size);
        PageInfo employeeExamPageInfo = new PageInfo(employeeExamList);
        mv.addObject("employeeExamPageInfo", employeeExamPageInfo);
        mv.setViewName("employeeExam-list");
        return mv;
    }
    @RequestMapping("/findById")
    public ModelAndView findById(@RequestParam(name = "ExamId", required = true) Integer ExamId) throws Exception {
        ModelAndView mv = new ModelAndView();
        EmployeeExam employeeExam = employeeExamService.findById(ExamId);
        mv.addObject("employeeExam",employeeExam);
        mv.setViewName("employeeExam-show");
        return mv;
    }

    @RequestMapping("/delete")
    public String deletePermission(@RequestParam(name = "ExamId", required = true) Integer ExamId) throws Exception{
        employeeExamService.deleteemployeeExamById(ExamId);
        return "redirect:findAll";
    }

    @RequestMapping("/save")
    public String save(EmployeeExam employeeExam) throws Exception {
        employeeExamService.save(employeeExam);
        return "redirect:findAll";
    }
    @RequestMapping("/update")
    public String update(EmployeeExam employeeExam) throws Exception {
        employeeExamService.updateEmployeeExam(employeeExam);
        return "redirect:findAll";
    }

岗位考核的Service层代码如下:

    @Autowired
    IEmployeeExamDao employeeExamDao;
    @Override
    public List<EmployeeExam> findAll(int page, int size) throws Exception {
        PageHelper.startPage(page, size);
        return employeeExamDao.findAll(page,size);
    }

    @Override
    public void save(EmployeeExam employeeExam) {
        employeeExamDao.save(employeeExam);

    }

    @Override
    public void deleteemployeeExamById(Integer ExamId) {
        employeeExamDao.deleteemployeeExamById(ExamId);
    }

    @Override
    public EmployeeExam findById(Integer ExamId) {
        return employeeExamDao.findById(ExamId);
    }

    @Override
    public void updateEmployeeExam(EmployeeExam employeeExam) {
        employeeExamDao.update(employeeExam);
    }

岗位考核的Dao层代码如下:

    @Select("select * from employee_exam")
    public List<EmployeeExam> findAll(int page, int size) throws Exception;

    @Insert("insert into employee_exam(Employee_id,Exam_name,Exam_time,Exam_score,Exam_note) values(#{EmployeeId},#{ExamName},#{ExamTime},#{ExamScore},#{ExamNote})")
    void save(EmployeeExam employeeExam);

    @Delete("delete from employee_exam where Exam_id=#{ExamId}")
    void deleteemployeeExamById(Integer ExamId);

    @Select("select * from employee_exam where Exam_id=#{ExamId}")
    EmployeeExam findById(Integer ExamId);

    @Update("update employee_exam set Employee_id=#{EmployeeId},Exam_name=#{ExamName},Exam_time=#{ExamTime},Exam_score=#{ExamScore},Exam_note=#{ExamNote} where Exam_id=#{ExamId}")
    void update(EmployeeExam employeeExam);

2、房产信息管理
在这里插入图片描述
以项目信息为例提供代码示例:
Controller层代码如下:

    @Autowired
    private IProjectProfileService projectProfileService;

    @RequestMapping("/findAll")
    public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size) throws Exception {
        ModelAndView mv = new ModelAndView();
        List<ProjectProfile> projectProfileList =projectProfileService.findAll(page,size);
        PageInfo projectProfilePageInfo = new PageInfo(projectProfileList);
        mv.addObject("projectProfilePageInfo", projectProfilePageInfo);
        mv.setViewName("projectProfile-list");
        return mv;
    }
    @RequestMapping("/findById")
    public ModelAndView findById(@RequestParam(name = "ProjectId", required = true) Integer ProjectId) throws Exception {
        ModelAndView mv = new ModelAndView();
        ProjectProfile projectProfile = projectProfileService.findById(ProjectId);
        mv.addObject("projectProfile",projectProfile);
        mv.setViewName("projectProfile-show");
        return mv;
    }

    @RequestMapping("/delete")
    public String deletePermission(@RequestParam(name = "ProjectId", required = true) Integer ProjectId) throws Exception{
        projectProfileService.deleteprojectProfileById(ProjectId);
        return "redirect:findAll";
    }

    @RequestMapping("/save")
    public String save(ProjectProfile projectProfile) throws Exception {
        projectProfileService.save(projectProfile);
        return "redirect:findAll";
    }
    @RequestMapping("/update")
    public String update(ProjectProfile projectProfile) throws Exception {
        projectProfileService.updateProjectProfile(projectProfile);
        return "redirect:findAll";
    }

Service层代码如下:

    @Autowired
    IProjectProfileDao projectProfileDao;
    @Override
    public List<ProjectProfile> findAll(int page, int size) throws Exception {
        PageHelper.startPage(page, size);
        return  projectProfileDao.findAll(page,size);
    }

    @Override
    public void save(ProjectProfile projectProfile) {
        projectProfileDao.save(projectProfile);
    }

    @Override
    public void deleteprojectProfileById(Integer ProjectId) {
        projectProfileDao.deleteprojectProfileById(ProjectId);
    }

    @Override
    public ProjectProfile findById(Integer ProjectId) {
        return projectProfileDao.findById(ProjectId);
    }

    @Override
    public void updateProjectProfile(ProjectProfile projectProfile) {
        projectProfileDao.update(projectProfile);
    }

Dao层代码如下:

    @Select("select * from project_profile")
    public List<ProjectProfile> findAll(int page, int size) throws Exception;

    @Insert("insert into project_profile(Project_name,Project_class,Project_fee,Employee_id,Project_note) values(#{ProjectName},#{ProjectClass},#{ProjectFee},#{EmployeeId},#{ProjectNote})")
    void save(ProjectProfile projectProfile);

    @Delete("delete from project_profile where Project_id=#{ProjectId}")
    void deleteprojectProfileById(Integer ProjectId);

    @Select("select * from project_profile where Project_id=#{ProjectId}")
    ProjectProfile findById(Integer ProjectId);

    @Update("update project_profile set Project_name=#{ProjectName},Project_class=#{ProjectClass},Project_fee=#{ProjectFee},Employee_id=#{EmployeeId},Project_note=#{ProjectNote} where Project_id=#{ProjectId}")
    void update(ProjectProfile projectProfile);

3、客户信息管理
在这里插入图片描述
以车辆信息为例提供代码示例:
Controller层:

    @Autowired
    private IUserCarService userCarService;

    @RequestMapping("/findAll")
    public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "8") int size) throws Exception {
        ModelAndView mv = new ModelAndView();
        List<UserCar> userCarList=userCarService.findAll(page,size);
        PageInfo userCarPageInfo = new PageInfo(userCarList);
        mv.addObject("userCarPageInfo", userCarPageInfo);
        mv.setViewName("userCar-list");
        return mv;
    }
    @RequestMapping("/findById")
    public ModelAndView findById(@RequestParam(name = "CarId", required = true) Integer CarId) throws Exception {
        ModelAndView mv = new ModelAndView();
        UserCar userCar =userCarService.findById(CarId);
        mv.addObject("userCar",userCar);
        mv.setViewName("userCar-show");
        return mv;
    }

    @RequestMapping("/delete")
    public String deletePermission(@RequestParam(name = "CarId", required = true) Integer CarId) throws Exception{
        userCarService.deleteuserCarById(CarId);
        return "redirect:findAll";
    }

    @RequestMapping("/save")
    public String save(UserCar userCar) throws Exception {
        userCarService.save(userCar);
        return "redirect:findAll";
    }
    @RequestMapping("/update")
    public String update(UserCar userCar) throws Exception {
        userCarService.updateUserCar(userCar);
        return "redirect:findAll";
    }
    @RequestMapping("/findByUserId")
    public ModelAndView findByUserId(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size,@RequestParam(name = "UserId", required = true) Integer UserId) throws Exception {
        ModelAndView mv = new ModelAndView();
        List<UserCar> userCarList=userCarService.findByUserId(page, size, UserId);
        PageInfo userCarPageInfos = new PageInfo(userCarList);
        mv.addObject("userCarPageInfos",userCarPageInfos);
        mv.setViewName("userCars-list");
        return mv;
    }

Service层:

    @Autowired
    IUserCarDao userCarDao;
    @Override
    public List<UserCar> findAll(int page, int size) throws Exception {
        PageHelper.startPage(page, size);
        return  userCarDao.findAll(page,size);
    }

    @Override
    public void save(UserCar userCar) {
        userCarDao.save(userCar);
    }

    @Override
    public void deleteuserCarById(Integer CarId) {
        userCarDao.deleteuserCarById(CarId);
    }

    @Override
    public UserCar findById(Integer CarId) {
        return userCarDao.findById(CarId);
    }

    @Override
    public void updateUserCar(UserCar userCar) {
        userCarDao.update(userCar);

    }

    @Override
    public List<UserCar> findByUserId(int page, int size,Integer UserId) throws Exception {
        PageHelper.startPage(page, size);
        return userCarDao.findByUserId(page,size,UserId);
    }

Dao层:

    @Select("select * from user_car")
    public List<UserCar> findAll(int page, int size) throws Exception;

    @Insert("insert into user_car(Car_name,Car_id_number,User_id,Car_parking_place,Car_note) values(#{CarName},#{CarIdNumber},#{UserId},#{CarParkingPlace},#{CarNote})")
    void save(UserCar userCar);

    @Delete("delete from user_car where Car_id=#{CarId}")
    void deleteuserCarById(Integer CarId);

    @Select("select * from user_car where Car_id=#{CarId}")
    UserCar findById(Integer CarId);

    @Update("update user_car set Car_name=#{CarName},Car_id_number=#{CarIdNumber},User_id=#{UserId},Car_parking_place=#{CarParkingPlace},Car_note=#{CarNote} where Car_id=#{CarId}")
    void update(UserCar userCar);

    @Select("select * from user_car where User_id=#{UserId}")
    List<UserCar> findByUserId(int page, int size,@Param("UserId")Integer UserId) throws Exception;

4、收费管理
在这里插入图片描述
以房屋租赁费为例提供代码示例:
Controller层代码如下:

    @Autowired
    private IHouseLeaseService houseLeaseService;

    @RequestMapping("/findAll")
    public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size) throws Exception {
        ModelAndView mv = new ModelAndView();
        List<HouseLease> houseLeaseList =houseLeaseService.findAll(page,size);
        PageInfo houseLeasePageInfo = new PageInfo(houseLeaseList);
        mv.addObject("houseLeasePageInfo", houseLeasePageInfo);
        mv.setViewName("houseLease-list");
        return mv;
    }
    @RequestMapping("/findById")
    public ModelAndView findById(@RequestParam(name = "HouseLeaseId", required = true) Integer HouseLeaseId) throws Exception {
        ModelAndView mv = new ModelAndView();
        HouseLease houseLease = houseLeaseService.findById(HouseLeaseId);
        mv.addObject("houseLease",houseLease);
        mv.setViewName("houseLease-show");
        return mv;
    }

    @RequestMapping("/delete")
    public String deletePermission(@RequestParam(name = "HouseLeaseId", required = true) Integer HouseLeaseId) throws Exception{
        houseLeaseService.deletehouseLeaseById(HouseLeaseId);
        return "redirect:findAll";
    }

    @RequestMapping("/save")
    public String save(HouseLease houseLease) throws Exception {
        houseLeaseService.save(houseLease);
        return "redirect:findAll";
    }
    @RequestMapping("/update")
    public String update(HouseLease houseLease) throws Exception {
        houseLeaseService.updateHouseLease(houseLease);
        return "redirect:findAll";
    }

Service层代码如下:

    @Autowired
    IHouseLeaseDao houseLeaseDao;
    @Override
    public List<HouseLease> findAll(int page, int size) throws Exception {
        PageHelper.startPage(page, size);
        return  houseLeaseDao.findAll(page,size);
    }

    @Override
    public void save(HouseLease houseLease) {
        houseLeaseDao.save(houseLease);
    }

    @Override
    public void deletehouseLeaseById(Integer HouseLeaseId) {
        houseLeaseDao.deletehouseLeaseById(HouseLeaseId);
    }

    @Override
    public HouseLease findById(Integer HouseLeaseId) {
        return houseLeaseDao.findById(HouseLeaseId);
    }

    @Override
    public void updateHouseLease(HouseLease houseLease) {
        houseLeaseDao.update(houseLease);
    }

Dao层代码如下:

    @Select("select * from house_lease")
    public List<HouseLease> findAll(int page, int size) throws Exception;

    @Insert("insert into house_lease(User_id,User_name,House_lease_begin_time,House_lease_end_time,House_lease_unit_price,House_lease_fee_total,House_lease_fee_deposit,House_lease_note) values(#{UserId},#{UserName},#{HouseLeaseBeginTime},#{HouseLeaseEndTime},#{HouseLeaseUnitPrice},#{HouseLeaseFeeTotal},#{HouseLeaseFeeDeposit},#{HouseLeaseNote})")
    void save(HouseLease houseLease);

    @Delete("delete from house_lease where House_lease_id=#{HouseLeaseId}")
    void deletehouseLeaseById(Integer HouseLeaseId);

    @Select("select * from house_lease where House_lease_id=#{HouseLeaseId}")
    HouseLease findById(Integer HouseLeaseId);

    @Update("update house_lease set User_id=#{UserId},User_name=#{UserName},House_lease_begin_time=#{HouseLeaseBeginTime},House_lease_end_time=#{HouseLeaseEndTime},House_lease_unit_price=#{HouseLeaseUnitPrice},House_lease_fee_total=#{HouseLeaseFeeTotal},House_lease_fee_deposit=#{HouseLeaseFeeDeposit},House_lease_note=#{HouseLeaseNote} where House_lease_id=#{HouseLeaseId}")
    void update(HouseLease houseLease);

如果有需要完整项目的可以v我(备注来源):es_lad或者点此下载。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/614932.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Vue.js 中的权限控制是什么?如何进行权限控制?

Vue.js 中的权限控制是什么&#xff1f;如何进行权限控制&#xff1f; 在现代 Web 应用程序中&#xff0c;权限控制是一个重要的话题。Vue.js 作为一种现代的前端框架&#xff0c;提供了一些有用的工具和技术来实现权限控制。本文将介绍 Vue.js 中的权限控制的概念、作用以及如…

一文教你认清云渲染的优势和劣势

在当今数字化时代&#xff0c;云渲染作为一项创新的技术方案&#xff0c;正逐渐成为许多行业中的热门话题。与传统的本地渲染相比&#xff0c;云渲染具备许多独特的优势和劣势。本文将深入探讨云渲染的各项特点&#xff0c;帮助您全面了解这一技术&#xff0c;并为您提供有关云…

js+canvas实现劈腿关系图

【我愿称多对一 一对多关系为劈腿关系】 【仓库地址】gitgithub.com:yyccmmkk/rl.git 【显示所有线路细节】 【合并线路】 【合并同一个目标点线路】 【合并同一个出发点线路】 【数据结构】 原始数据只需要提供节点自身id 父点节id&#xff0c;劈腿关系图自动处理 [{id:z…

基于CSDN上海城市开发者社区第一次线下沙龙的筹备经验分享

引言 由于时间较为紧张、邹老师行程安排紧凑等因素影响&#xff0c;结合实际情况&#xff0c;改茶话会为聚餐&#xff0c;所以在举办线下沙龙的时候一定要根据实际情况来斟酌活动形式。本次活动是和哈士奇&#xff0c;哈哥一起筹备&#xff0c;也得到了哈哥的大力支持&#xff…

如何进行物联网开发可以快速完成产品研发?

物联网产品的研发与开发过程&#xff0c;是一个不断探索、创新、实践的过程&#xff0c;需要很长的周期&#xff0c;在这个过程中&#xff0c;项目团队往往需要投入大量的人力、物力和时间。同时&#xff0c;物联网产品研发过程中还涉及到大量的专业技术和知识&#xff0c;需要…

从git上拉取项目

目录 一、前期准备&#xff0c;获取git下载链接 二、idea下载 2.1.打开git下载界面 2.2.进入下载界面 2.3.下载前期配置 2.4.输入账号密码 2.5.下载完成后idea打开 2.6.下载完成后文件目录展示 三、命令行下载 3.1.打开所需要下载的项目路径 3.2.进入黑窗口 …

【算法系列之数组I】leetcode54.螺旋矩阵

704. 二分查找 力扣题目链接 给定一个 n 个元素有序的&#xff08;升序&#xff09;整型数组 nums 和一个目标值 target &#xff0c;写一个函数搜索 nums 中的 target&#xff0c;如果目标值存在返回下标&#xff0c;否则返回 -1。 输入: nums [-1,0,3,5,9,12], target 9…

【618备战巡礼】“三高”之第一高--如何打造高可用系统 | 京东云技术团队

前言 我们经常会说互联网“三高”&#xff0c;那什么是三高呢&#xff1f;我们常说的三高&#xff0c;高并发、高可用、高性能&#xff0c;这些技术是构建现代互联网应用程序所必需的。对于京东618备战来说&#xff0c;所有的中台系统服务&#xff0c;无疑都是围绕着三高来展开…

一文说清DC-DC BUCK电路(非常详细)

目录 摘要 BUCK原理 DC-DC芯片框图 自举电容 输出电感 输出电容和纹波 损耗 总结 摘要 DC-DC BUCK&#xff0c;是硬件工程师工作中使用频率非常高的电路&#xff0c;可以这么说&#xff0c;只要板子不是迷你型的&#xff0c;十有八九都有DC-DC。因此&#xff0c;对它的…

Win10安装mac虚拟机

参考文章 按照上面的参考文章进行了安装并完成了安装&#xff0c;结合安装过程中遇到的问题&#xff0c;进行一个总结。 要想在win10上安装mac虚拟机&#xff0c;需要准备三样东西&#xff1a; &#xff08;1&#xff09;虚拟机平台&#xff1a;用来装载mac虚拟机 &#xf…

【分布族谱】学生t分布,及其与正态分布、卡方分布的关系

文章目录 简介正态分布与卡方分布用scipy来验证三者关系 简介 1908年&#xff0c;戈塞特在酿酒厂工作&#xff0c;由于酒厂禁止员工发表酿酒相关的研究成果&#xff0c;所以他以Student为笔名发表了有关t分布的研究&#xff0c;故而这个著名的分布被命名为学生分布。 如果有两…

计算机基础--->操作系统(3)【内存管理】

文章目录 内存管理内存管理主要做什么&#xff1f;什么是内存碎片&#xff1f;常见内存管理方式虚拟内存什么是虚拟内存&#xff1f;虚拟内存的作用&#xff1f;没有虚拟内存的问题什么是虚拟地址和物理地址&#xff1f; 分段机制分页机制转址旁路缓存&#xff08;TLB、快表&am…

MySQL唯一约束失效深度剖析

详细情况&#xff1a; 业务反馈&#xff1a;“用int查出来有两条数据&#xff0c;char类型查出来只有一条数据 &#xff0c;这几个字段还是uk的 ”&#xff08;版本MySQL 5.7.25&#xff09; 表结构如下&#xff1a; CREATE TABLE test_table (id bigint(20) NOT NULL AUTO_IN…

构建方便残障人士使用的网站 web enhance the accessibility

文章目录 前言检测网站是否符合残障人士使用window版软件edge浏览器插件版 前端开发为残障人士的通用标准img标签a标签字体与颜色显示或隐藏的元素可交互的元素标记元素类别 总结 前言 网站的构建往往会忽略一群特殊的人群&#xff0c;在某些方便存在障碍的网民&#xff0c;比…

Docker镜像管理

Docker 概述 Docker是什么 Docker是一个开源的应用容器引擎&#xff0c;基于go语言开发并遵循了apache2.0协议开源。 Docker是在Linux容器里运行应用的开源工具&#xff0c;是一种轻量级的“虚拟机”。 Docker 的容器技术可以在一台主机上轻松为任何应用创建一个轻量级的、可移…

基于状态的维护(CBM)如何推动设备效率提高?

基于状态的维护&#xff08;Condition-Based Maintenance&#xff0c;CBM&#xff09;是一种先进的维护策略&#xff0c;通过实时监测和分析设备的状态数据&#xff0c;预测设备故障并采取相应的维护措施。CBM基于数据驱动的方法&#xff0c;能够提高设备的可用性、降低维修成本…

PDF怎么转成PPT文件免费?分享几个方法!

PDF文件和PPT文件是常见的两类文件&#xff0c;广泛应用于打工人和学生党之间。每种文件格式都有自己的优势&#xff0c;在不同的情况下使用。PDF格式具有出色的浏览效果&#xff0c;能有效保护文档内容免受随意篡改&#xff0c;而且在传输过程中不会出现乱码问题。然而&#x…

Apifox 发请求时如何自动获取Cookie 和 token

介绍 用户登录到网站或 App 是非常常见的的场景&#xff0c;登录成功后一般会返回登录凭证&#xff08;一般为 Cookie 或者 token&#xff09;&#xff0c;后续其它接口发起请求时会携带 Cookie 或者 token 到服务器进行校验。校验通过&#xff0c;则返回相关的数据&#xff0…

【Linux网络编程】应用层HTTP协议篇

应用层 一、应用层1.1、再谈协议1.2、HTTP协议1.2.1、认识URL1.2.2、urlencode和urldecode1.2.3、HTTP协议格式1.2.4、HTTP的方法1.2.5、HTTP的状态码1.2.6、HTTP常见的Header 二、结合代码理解HTTP通信流程 一、应用层 程序员写的一个个解决我们实际问题, 满足我们日常需求的…

Stable Diffusion原理说明

本文参考&#xff1a;深入浅出讲解Stable Diffusion原理&#xff0c;新手也能看明白 - 知乎 目录 1、Stable Diffusion能做什么&#xff1f; 2、扩散模型&#xff08;Diffusion model&#xff09; &#xff08;1&#xff09;前向扩散&#xff08;Forward Diffusion&#xff…