第四:引入mybatis

本项目使用mysql存储,数据库操作使用mybatis

引入pom.xml

		<!-- 引入mybatis的starter -->
		<dependency>
			<groupId>org.mybatis.spring.boot</groupId>
			<artifactId>mybatis-spring-boot-starter</artifactId>
			<version>2.1.1</version>
		</dependency>

		<!-- 引入mysql驱动 -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
		</dependency>
		
		<!-- 引入分页插件 -->
		<dependency>
			<groupId>com.github.pagehelper</groupId>
			<artifactId>pagehelper-spring-boot-autoconfigure</artifactId>
			<version>${pagehelper-spring.version}</version>
		</dependency>

		<dependency>
			<groupId>com.github.pagehelper</groupId>
			<artifactId>pagehelper</artifactId>
			<version>${pagehelper.version}</version>
		</dependency>

在这里插入图片描述
获取forms的值

   function getFormData(forms) {
            var unindexed_array = $(forms).serializeArray();
            var indexed_array = {};
            $.map(unindexed_array, function (n, i) {
                if (indexed_array[n['name']] == undefined || indexed_array[n['name']] == null) {
                    indexed_array[n['name']] = $.trim(n['value']);
                } else {
                    indexed_array[n['name']] = indexed_array[n['name']] + "," + $.trim(n['value']);
                }
            });
            return indexed_array;
        }
发布了12 篇原创文章 · 获赞 0 · 访问量 365

猜你喜欢

转载自blog.csdn.net/weixin_46279293/article/details/104287543