SpringBoot+MybatisPlus Restful示例

news2025/4/8 2:36:05

增删改查,分页

CREATE TABLE `tbl_book` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `desc_ription` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `sensitive_Info` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `sensitive_Info2` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=85 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (74, '图林原创', 'Nginx经典教程', 'F5 NGINX核心人员倾力打造,关注基础用法和现代场景,新技术趋势下经典全新解读,涵盖容器,Kubernetes,NJS语言,新协议支持等', NULL, NULL, '2023-11-10 21:12:07', NULL);
INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (75, '全栈开发', 'Vue.Js前端开发基础与项目实战', '系统深入从原理进行分析,详细介绍前端的发展和常用Vue.js功能模块,内容实用,全面讲解Vue.js生态链且涵盖后端架构相关知识,项目实战详细介绍实用插件和构建PC端网站的步骤及前后端开发流程', NULL, NULL, '2023-11-10 21:14:49', NULL);
INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (76, '架构', '凤凰架构', '从架构演进,架构设计思维,分布式基石,不可变基础设施,技术方法论5个维度全面探索如何构建可靠的大型分布式系统', NULL, NULL, '2023-11-10 21:16:38', NULL);
INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (77, '华章科技', 'Maven实战', '国内首本Maven著作,内容全面,实战性强,公认的Maven专家执笔,中外技术专家联合推荐,权威性无需置疑', NULL, NULL, '2023-11-10 21:18:31', NULL);
INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (78, 'Broadview', '深入理解Apache Dubbo与实战', NULL, NULL, NULL, '2023-11-10 21:19:46', NULL);
INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (79, '图林程序设计丛书', 'SQL查询', '赢得世界赞誉的SQL经典著作', NULL, NULL, '2023-11-10 21:20:27', NULL);
INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (80, '华章科技', '分布式中间件技术实战', NULL, NULL, NULL, '2023-11-10 21:21:31', NULL);
INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (81, '异步图书', 'SpringBoot源码解读与原理分析', NULL, NULL, NULL, '2023-11-10 21:22:09', NULL);
INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (82, '图林程序', 'SQL必知必会', '畅销全球的数据库入门经典', NULL, NULL, '2023-11-10 21:23:03', NULL);
INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (83, 'Java专家系列', 'JDBC数据库程序设计', '本书讨论的内容主要是如何利用Java程序语言,编写与数据库相关的应用程序.从最开始Java语言与数据库管理系统的介绍,JDBC API的实用,乃至最后Java数据库应用程序开发的实战.都将在本书中详细说明.详细的实例讲解和完整的章节安排,非常适合Java初学者快速学习实用Java开发数据库相关的应用程序,范例程序丰富,代码和运行结果以图文并茂的方式配合呈现', NULL, NULL, '2023-11-10 21:26:50', NULL);
INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (84, 'GOTOP', '鸟哥的Linux私房菜', '经久不衰的Linux经典教程', NULL, NULL, '2023-11-10 21:27:45', NULL);

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.2</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>ssmp</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>ssmp</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.4.3</version>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
            <version>1.2.16</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

application.properties

实体类

package com.example.ssmp.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Value;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @author hrui
 * @date 2023/11/10 0:34
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
//@TableName("tbl_book")  已全局配置
public class Book {
    //标识id为表的主键
    //value为id的名称(和表字段一样可以不写)  type为主键自增情况
    //auto为数据库自增
    //ASSIGN_UUID 通过uuid进行主键的自增
    //@TableId(value = "id",type=IdType.AUTO)    已全局配置
    private String id;
    private String type;
    private String name;
    private String descRiption;
    //insert的时候触发的时候自动填充
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    //update触发的时候自动填充
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

//    @TableField(select = true, insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
//    private String sensitiveInfo; // 只在查询中展示
//
//    private transient String sensitiveInfo2;

}

DAO层

业务层

实现类

控制器

package com.example.ssmp.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.ssmp.pojo.Book;
import com.example.ssmp.service.BookService;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @author hrui
 * @date 2023/11/10 0:42
 */
@RestController
@RequestMapping("/books")
public class BookController {

    @Autowired
    private BookService bookService;

    @GetMapping
    public R getAllBooks(){
        return new R(true, bookService.list());
    }
    @GetMapping("/{pageNum}/{pageSize}")
    public R getAllBooks(@PathVariable Integer pageNum,@PathVariable Integer pageSize,Book book){

        Page<Book> page=new Page<>(pageNum,pageSize);
        LambdaQueryWrapper<Book> lambdaQueryWrapper=new LambdaQueryWrapper<>();

        lambdaQueryWrapper.like(Strings.isNotEmpty(book.getName()), Book::getName, book.getName());
        lambdaQueryWrapper.like(Strings.isNotEmpty(book.getType()), Book::getType, book.getType());
        lambdaQueryWrapper.like(Strings.isNotEmpty(book.getDescRiption()), Book::getDescRiption, book.getDescRiption());
        page = bookService.page(page,lambdaQueryWrapper);
        /**
         * 存在情况
         * 比如第三页只有一条数据,删除后getAll,传过来的页面是3  但是返回的是无数据
         */
        if(pageNum>page.getPages()){
            //重查一遍
            page=new Page<>(page.getPages(),pageSize);
            page=bookService.page(page,lambdaQueryWrapper);
        }
        return new R(true, page);
    }

    @GetMapping("/{id}")
    public R getById(@PathVariable String id){
        Book book = bookService.getById(id);
        return new R(book!=null, book,book!=null?"成功":"数据同步失败,自动刷新");
    }

    @PostMapping
    public R save(@RequestBody Book book){
        System.out.println(123);
        boolean save = bookService.save(book);
        R r = new R(save);
        return r;
    }

//    @PutMapping
//    public Object update(@RequestBody Book book){
//        return bookService.updateById(book);
//    }

    @PutMapping
    public R update(@RequestBody List<Book> books){//用Book[]也可以  数据格式:[{},{}]
        boolean b = bookService.updateBatchById(books);
        return new R(b,b?"更新成功":"数据同步失败,自动刷新");
    }

//    @DeleteMapping("/{id}")
//    public Object delete(@PathVariable String id){
//        return bookService.removeById(id);
//    }

    @DeleteMapping("/{ids}")//http://localhost:8080/books/52,53
    public R delete(@PathVariable List<String> ids){
        boolean b = bookService.removeByIds(ids);
        return new R(b,b?"删除成功":"数据同步失败,自动刷新");
    }
}

统一返回

package com.example.ssmp.controller;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @author hrui
 * @date 2023/11/10 7:03
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Accessors(chain = true)
public class R {
    private Boolean flag;//表示调用是否成功
    private Object data;
    private String msg;

    public R(Boolean flag){
        this.flag=flag;
    }

    public R(String msg){
        this.flag=false;
        this.msg=msg;
    }

    public R(Boolean flag,Object data){
        this.flag=flag;
        this.data=data;
    }

    public R(Boolean flag,String msg){
        this.flag=flag;
        this.msg=msg;
    }
}

全局异常处理

package com.example.ssmp.exception;

import com.example.ssmp.controller.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author hrui
 * @date 2023/11/10 10:39
 */
@RestControllerAdvice
@Slf4j
public class PExceptionAdvice {

    //private static final Logger log= LoggerFactory.getLogger(PExceptionAdvice.class);

    @ExceptionHandler(Exception.class)
    public R doException(Exception e){
        //记录日志
        log.error("exception", e);

        e.printStackTrace();
        return new R("服务器故障,稍后再试");
    }
}

 MybatisPlus 自动填充配置

package com.example.ssmp.congif;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author hrui
 * @date 2023/11/10 3:14
 */
@Component
public class DateHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        this.strictInsertFill(metaObject,"createTime", Date.class,new Date());
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        this.strictUpdateFill(metaObject,"updateTime",Date.class,new Date());
    }
}

 MybatisPlus分页配置

package com.example.ssmp.congif;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author hrui
 * @date 2023/11/10 3:10
 */
@Configuration
public class MyBatisPlusPageInterceptor {

    /**
     * 添加分页插件
     */
//    @Bean
//    public MybatisPlusInterceptor mybatisPlusInterceptor() {
//        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
//        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));//如果配置多个插件,切记分页最后添加
//        //interceptor.addInnerInterceptor(new PaginationInnerInterceptor()); 如果有多数据源可以不配具体类型 否则都建议配上具体的DbType
//        return interceptor;
//    }

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor mybatisPlusInterceptor=new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return mybatisPlusInterceptor;
    }
}

前端

<!DOCTYPE html>

<html>

<head>

    <!-- 页面meta -->

    <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>基于SpringBoot整合SSM案例</title>

    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">

    <!-- 引入样式 -->

    <link rel="stylesheet" href="../plugins/elementui/index.css">

    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">

    <link rel="stylesheet" href="../css/style.css">

</head>

<body class="hold-transition">

<div id="app">

    <div class="content-header">

        <h1>图书管理</h1>

    </div>

    <div class="app-container">

        <div class="box">

            <div class="filter-container">
                <el-input placeholder="图书类别" v-model="pagination.type" style="width: 200px;" class="filter-item"></el-input>
                <el-input placeholder="图书名称" v-model="pagination.name"  style="width: 200px;" class="filter-item"></el-input>
                <el-input placeholder="图书描述" v-model="pagination.descRiption" style="width: 200px;" class="filter-item"></el-input>
                <el-button @click="getAll()" class="dalfBut">查询</el-button>
                <el-button type="primary" class="butT" @click="handleCreate()">新建</el-button>
            </div>

            <el-table size="small" current-row-key="id" :data="dataList" stripe highlight-current-row>

                <el-table-column type="index" align="center" label="序号"></el-table-column>

                <el-table-column prop="type" label="图书类别" align="center"></el-table-column>

                <el-table-column prop="name" label="图书名称" align="center"></el-table-column>

                <el-table-column prop="descRiption" label="描述" align="center"></el-table-column>

                <el-table-column label="操作" align="center">

                    <template slot-scope="scope">

                        <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>

                        <el-button type="danger" size="mini" @click="handleDelete(scope.row)">删除</el-button>

                    </template>

                </el-table-column>

            </el-table>

            <!--分页组件-->
            <div class="pagination-container">

                <el-pagination
                        class="pagiantion"

                        @current-change="handleCurrentChange"

                        :current-page="pagination.currentPage"

                        :page-size="pagination.pageSize"

                        layout="total, prev, pager, next, jumper"

                        :total="pagination.total">

                </el-pagination>

            </div>

            <!-- 新增标签弹层 -->

            <div class="add-form">

                <el-dialog title="新增图书" :visible.sync="dialogFormVisible">

                    <el-form ref="dataAddForm" :model="formData" :rules="rules" label-position="right" label-width="100px">

                        <el-row>

                            <el-col :span="12">

                                <el-form-item label="图书类别" prop="type">

                                    <el-input v-model="formData.type"/>

                                </el-form-item>

                            </el-col>

                            <el-col :span="12">

                                <el-form-item label="图书名称" prop="name">

                                    <el-input v-model="formData.name"/>

                                </el-form-item>

                            </el-col>

                        </el-row>


                        <el-row>

                            <el-col :span="24">

                                <el-form-item label="描述">

                                    <el-input v-model="formData.descRiption" type="textarea"></el-input>

                                </el-form-item>

                            </el-col>

                        </el-row>

                    </el-form>

                    <div slot="footer" class="dialog-footer">

                        <el-button @click="cancel()">取消</el-button>

                        <el-button type="primary" @click="handleAdd()">确定</el-button>

                    </div>

                </el-dialog>

            </div>

            <!-- 编辑标签弹层 -->

            <div class="add-form">

                <el-dialog title="编辑检查项" :visible.sync="dialogFormVisible4Edit">

                    <el-form ref="dataEditForm" :model="formData" :rules="rules" label-position="right" label-width="100px">

                        <el-row>

                            <el-col :span="12">

                                <el-form-item label="图书类别" prop="type">

                                    <el-input v-model="formData.type"/>

                                </el-form-item>

                            </el-col>

                            <el-col :span="12">

                                <el-form-item label="图书名称" prop="name">

                                    <el-input v-model="formData.name"/>

                                </el-form-item>

                            </el-col>

                        </el-row>

                        <el-row>

                            <el-col :span="24">

                                <el-form-item label="描述">

                                    <el-input v-model="formData.descRiption" type="textarea"></el-input>

                                </el-form-item>

                            </el-col>

                        </el-row>

                    </el-form>

                    <div slot="footer" class="dialog-footer">

                        <el-button @click="cancel()">取消</el-button>

                        <el-button type="primary" @click="handleEdit()">确定</el-button>

                    </div>

                </el-dialog>

            </div>

        </div>

    </div>

</div>

</body>

<!-- 引入组件库 -->

<script src="../js/vue.js"></script>

<script src="../plugins/elementui/index.js"></script>

<script type="text/javascript" src="../js/jquery.min.js"></script>

<script src="../js/axios-0.18.0.js"></script>

<script>
    var vue = new Vue({
        el: '#app',
        data:{
            dataList: [],//当前页要展示的列表数据
            dialogFormVisible: false,//添加表单是否可见
            dialogFormVisible4Edit:false,//编辑表单是否可见
            formData: {},//表单数据
            rules: {//校验规则
                type: [{ required: true, message: '图书类别为必填项', trigger: 'blur' }],
                name: [{ required: true, message: '图书名称为必填项', trigger: 'blur' }]
            },
            pagination: {//分页相关模型数据
                currentPage: 1,//当前页码
                pageSize:10,//每页显示的记录数
                total:0,//总记录数

                type:"",//图书类别
                name:"",//图书名称
                descRiption:""//描述
            }
        },

        //钩子函数,VUE对象初始化完成后自动执行
        created() {
            //调用查询全部数据的操作
            this.getAll();
        },

        methods: {
            //列表
            // getAll() {
            //     //发送异步请求
            //     axios.get("/books").then((res)=>{
            //         console.log(res)
            //         if(res.data.flag){
            //             this.dataList=res.data.data
            //         }
            //     })
            // },

            //弹出添加窗口
            handleCreate() {
                this.resetForm()
                //打开新增窗口
                this.dialogFormVisible=true
            },

            //重置表单
            resetForm() {
                //清理数据
                this.formData={}
            },

            //添加
            handleAdd () {

                axios.post("/books",this.formData).then((res)=>{
                    console.log(res)
                    if(res.data.flag){
                        this.dialogFormVisible=false
                        this.$message.success("添加成功")
                    }else{
                        //this.$message.error("添加失败")
                        this.$message.error(res.data.msg)
                    }
                }).finally(()=>{
                    //重新加载数据
                    this.getAll()
                })
            },

            //取消
            cancel(){
                //关闭新增窗口
                this.dialogFormVisible=false

                this.dialogFormVisible4Edit=false
                this.$message.info("当前操作取消")
            },
            // 删除
            handleDelete(row) {
                //弹出提示框 防止误删
                this.$confirm("此操作永久删除,是否继续?",{type: "info"}).then(()=>{
                    //确定
                    let id=row.id
                    axios.delete("/books/"+id).then((res)=>{
                        if(res.data.flag){
                            this.$message.success("删除成功")
                        }else{
                            //this.$message.error("数据同步失败,自动刷新")
                            this.$message.error(res.data.msg)
                        }
                    }).finally(()=>{
                        //重新加载数据
                        this.getAll()
                    })
                  //取消
                }).catch(()=>{
                    this.$message.info("取消操作")
                })

            },

            //弹出编辑窗口
            handleUpdate(row) {
                axios.get("/books/"+row.id).then((res)=>{
                    if(res.data.flag&&res.data.data!=null){
                        this.formData=res.data.data
                        this.dialogFormVisible4Edit=true
                    }else{
                        //this.$message.error("数据同步失败,自动刷新")
                        this.$message.error(res.data.msg)
                        this.dialogFormVisible4Edit=false
                    }
                }).finally(()=>{
                    //刷新页面
                    this.getAll()
                })
                //this.formData=row
                //this.dialogFormVisible4Edit=true
            },

            //修改
            handleEdit() {
                var data=[]
                data.push(this.formData)
                axios.put("/books",data).then((res)=>{
                    console.log(res)
                    if(res.data.flag){
                        //关闭弹窗
                        this.dialogFormVisible4Edit=false
                        this.$message.success("修改成功")
                    }else{
                        //this.$message.error("修改失败")
                        this.$message.error(res.data.msg)
                    }
                }).finally(()=>{
                    //重新加载数据
                    this.getAll()
                })
            },

            //分页查询
            getAll(){
                axios.get("/books/"+this.pagination.currentPage+"/"+this.pagination.pageSize+"?name="+this.pagination.name+"&type="+this.pagination.type+"&descRiption="+this.pagination.descRiption).then((res)=>{
                    console.log(res)
                    if(res.data.flag){
                        this.dataList=res.data.data.records
                        this.pagination.currentPage=res.data.data.current//当前页
                        this.pagination.pageSize=res.data.data.size//
                        this.pagination.total=res.data.data.total//总条数
                    }
                })
            },

            //切换页码
            handleCurrentChange(currentPage) {
                //修改页为当前页
                this.pagination.currentPage=currentPage
                //执行查询
                this.getAll()
            },

            //条件查询
        }
    })

</script>

</html>

前端页面网盘地址

链接:https://pan.baidu.com/s/1BcQXH8gdPZuPfxJ0Lx2wcg 
提取码:uude 
--来自百度网盘超级会员V4的分享

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

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

相关文章

JavaScript基础入门04

目录 1.WebAPI 背景知识 1.1什么是 WebAPI 1.2什么是 API 2.DOM 基本概念 2.1什么是 DOM 2.2DOM 树 3.获取元素 3.1querySelector 3.2querySelectorAll 4.事件初识 4.1基本概念 4.2事件三要素 4.3简单示例 5.操作元素 5.1获取/修改元素内容 5.2获取/修改元素属性…

微服务版mall电商项目本地开发环境启动前后端服务详细指导教程

微服务版mall电商项目本地开发环境启动前后端服务详细指导教程 前言1 克隆mall-swarm 电商项目源码2 安装启动mall-swarm项目需要的第三方服务2.1 安装MySql8 并初始化数据2.2 安装Nacos2.3 安装Redis2.4 RabbitMQ安装2.5 ElasticSearch安装2.6 MongoDB安装2.7 Minio安装 3 启动…

多目标优化框架

随着模型越来越复杂&#xff0c;优化目标越来越多&#xff0c;传统算法都慢慢地无法胜任复杂优化任务&#xff0c;更为智能的优化方法也就应运而生了。其中有一类是进化优化算法&#xff0c;这类算法的思想来源是自然界的“优胜劣汰”法则&#xff0c;通过不停地保留好的个体最…

Linux学习-破解Root密码

破解root密码思路 1&#xff09;重启系统,进入 救援模式 开启虚拟机A&#xff0c;在此界面按e键 在linux开头的该行&#xff0c;将此行的ro修改为rw 然后空格输入 rd.break 按 ctrl x 启动&#xff0c;会看到switch_root:/# 2&#xff09;切换到硬盘操作系统环境 # chroot …

浅谈工厂电能管理系统改造与产品选型

叶根胜 安科瑞电气股份有限公司 上海嘉定202001 摘要&#xff1a;随着经济的快速发展&#xff0c;能源紧张和环境恶化引起了全世界的密切关注。电能在所有能源中消耗量大&#xff0c;但不可或缺&#xff0c;因此对电能的统一管理尤为重要。只有准确可靠的计量电能、分级管理和…

显卡服务器租用价格受哪些因素影响

显卡服务器也叫做GPU服务器&#xff0c;是一种有高性能显卡的服务器系统&#xff0c;显卡服务器能在大数据处理、科学计算等领域有很好的性能表现。今天小编就给大家讲一讲显卡服务器租用价格受哪些因素影响呢&#xff1f; 1.显卡类型和数量&#xff1a;一般说来中高端显卡的租…

【华为OD题库-007】代表团坐车-Java

题目 某组织举行会议&#xff0c;来了多个代表团同时到达&#xff0c;接待处只有一辆汽车&#xff0c;可以同时接待多个代表团&#xff0c;为了提高车辆利用率&#xff0c;请帮接待员计算可以坐满车的接待方案&#xff0c;输出方案数量。 约束: 1.一个团只能上一辆车&#xff0…

性格软弱怎么办?如何改变性格软弱?

软弱指的是身体衰弱无力气&#xff0c;而这里要说的是性格软弱&#xff0c;性格软弱的人&#xff0c;大多是不自信的&#xff0c;无主见&#xff0c;容易妥协&#xff0c;害怕产生矛盾&#xff0c;遇到问题就想逃避&#xff0c;自我否定&#xff0c;担心自己这也不行那也不行。…

剑指JUC原理-18.同步协作

&#x1f44f;作者简介&#xff1a;大家好&#xff0c;我是爱吃芝士的土豆倪&#xff0c;24届校招生Java选手&#xff0c;很高兴认识大家&#x1f4d5;系列专栏&#xff1a;Spring源码、JUC源码&#x1f525;如果感觉博主的文章还不错的话&#xff0c;请&#x1f44d;三连支持&…

AD9371 Crossbar 和 I、Q数据 映射JESD204B传输层

AD9371 系列快速入口 AD9371ZCU102 移植到 ZCU106 &#xff1a; AD9371 官方例程构建及单音信号收发 ad9371_tx_jesd -->util_ad9371_xcvr接口映射&#xff1a; AD9371 官方例程之 tx_jesd 与 xcvr接口映射 AD9371 官方例程 时钟间的关系与生成 &#xff1a; AD9371 官方…

vim相关命令讲解!

本文旨在讲解vim 以及其相关的操作&#xff01; 希望读完本文&#xff0c;读者会有一定的收获&#xff01;好的&#xff0c;干货马上就来&#xff01; 初识vim 在讲解vim之前&#xff0c;我们首先要了解vim是什么&#xff0c;有什么作用&#xff1f;只有了解了vim才能更好的理…

ModStartBlog v8.5.0 评论开关布局调整,系统后台全面优化

ModStart 是一个基于 Laravel 模块化极速开发框架。模块市场拥有丰富的功能应用&#xff0c;支持后台一键快速安装&#xff0c;让开发者能快的实现业务功能开发。 系统完全开源&#xff0c;基于 Apache 2.0 开源协议。 功能特性 丰富的模块市场&#xff0c;后台一键快速安装 …

怎么用电脑开发安卓app?能外包吗?

随着智能手机的普及&#xff0c;安卓应用程序的开发需求也越来越高&#xff0c;许多人都想开发自己的安卓应用程序&#xff0c;但苦于缺乏相关知识和技能&#xff0c;本文将介绍如何使用电脑开发安卓应用程序&#xff0c;以及是否可以将开发工作外包给专业的开发团队。 一、了…

7天入门python系列之第三天Python的函数和模块

第3天主要是学习Python的函数和模块 编者打算开一个python 初学主题的系列文章&#xff0c;用于指导想要学习python的同学。关于文章有任何疑问都可以私信作者。对于初学者想在7天内入门Python&#xff0c;这是一个紧凑的学习计划。但并不是不可完成的。第三天开始python函数和…

python3GUI--PyQt5打包心得(二)nuitka、inno Setup(详细图文演示、附所有软件)

文章目录 一&#xff0e;前言二&#xff0e;准备1.nuitka1.1介绍1.3项目地址1.3安装 2.mingw641.1介绍1.2下载安装 3.Inno Setup1.1介绍1.2安装 三&#xff0e;nuitka打包1.打包2.装mingw643.装ccahe4.打包完成 四&#xff0e;测试效果五&#xff0e;inno Setup制作安装软件1.配…

呼叫中心系统如果对接大模型

电话机器人对接大模型的例子 介绍 自chatgpt3.5发布以来&#xff0c;各种大模型飞速发展&#xff0c;各行各业都有接入大模型的需求&#xff0c;呼叫中心行业非常适合通过接入大模型用AI来回答用户的各种咨询&#xff0c;降低人力资源&#xff0c;使用顶顶通呼叫中心中间件&a…

日志收集的方式和优点

日志是组织 IT 环境中发生的所有事情的记录。它们通常是一系列带有时间戳的消息&#xff0c;可为您提供有关网络中所有活动的第一手信息。 网络中的每个设备和应用程序都会生成日志数据以及用于监控网络流量的 NetFlow 数据&#xff0c;日志是安全信息和事件管理&#xff08;S…

宠物医院信息展示预约小程序的效果如何

养宠家庭越来越多&#xff0c;随之带来的就是宠物健康问题&#xff0c;生活条件稍微好点的家庭&#xff0c;只要宠物生病或洗护、寄养、美容等就会前往宠物医院&#xff0c;而近些年来&#xff0c;市场中的宠物医院也在连年增加&#xff0c;可以预见市场需求度较高。 而对宠物…

Linux shell编程学习笔记23:[] [[]]的用法小结

上回梳理 了Linux Shell编程中 () 、$()和 (())的用法&#xff0c;现在接着梳理 [] 和[[]]的用法。 1 单中括号&#xff08;方括号&#xff09;[] 1.1 检测某个条件是否成立 [和test等同&#xff0c;是 Shell 内置命令&#xff0c;用来检测某个条件是否成立。条件成立时退出状…

vue实战——登出【详解】

登出逻辑 弹窗询问用户是否确定登出清除登录状态 登录状态通常存储在 vuex 和 sessionStorage 中&#xff0c;更彻底的登出还可以把所有本地存储数据都清除掉&#xff0c;如 Cookie 和 localStorage 。跳转到登录页面 代码实现 <div class"loginBox" v-if"is…