springboot+mybetis实验报告

编程入门 行业动态 更新时间:2024-10-11 15:20:50

springboot+mybetis实验<a href=https://www.elefans.com/category/jswz/34/1770268.html style=报告"/>

springboot+mybetis实验报告

 中北大学软件学院

 实验报告

专   业:

软件工程

方   向:

X方向

课程名称:

JavaEE框架与应用开发

班   级:

学   号:

姓   名:

辅导教师:

董晓丽

2021年9月制

           

                      成绩:             

实验时间

年 月 日 时至  时

学时数

4学时

  1. 实验名称 

Spring Boot2整合Mybatis框架

2.实验目的

1)掌握Spring Boot2集成Mybatis框架方法

2)掌握Spring Boot2简单实践应用

3.实验内容

图书信息管理子系统,功能包括:1)用户注册、登录功能;2)管理员用户:图书信息的增、删、改、查,文件上传;普通用户:图书信息查询(单条件查询、多条件查询)。

要求:1)后台采用数据库存储技术;2)前台采用视图技术;3)所有类、变量命名遵循课上要求的命名规则;4)U+平台按时提交实验报告与软件作品源代码。

4.文件描述:

nuczmfspringboot.sb_book20211007.controller//控制层

nuczmfspringboot.sb_book20211007.controller.ControllerByM_zmf_1913040848//管理员管理控制类

nuczmfspringboot.sb_book20211007.controller.ControllerByMaide_zmf_1913040848// 管理员登录控制类

nuczmfspringboot.sb_book20211007.controller.ControllerByU_zmf_1913040848//用户管理控制类

nuczmfspringboot.sb_book20211007.controller.Controllerbyuser_zmf_1913040848//用户登录注册控制类

nuczmfspringboot.sb_book20211007.controller.ControllerByusers_zmf_1913040848//用户个人中心控制类

nuczmfspringboot.sb_book20211007.Dao//持久层

nuczmfspringboot.sb_book20211007.Dao.IMaideDao_zmf_1913040848//管理员模型持久类

nuczmfspringboot.sb_book20211007.Dao.IUBookDao_zmf_1913040848//用户购买图书持久类

nuczmfspringboot.sb_book20211007.Dao.IUserDao_zmf_1913040848//用户持久类

nuczmfspringboot.sb_book20211007.Dao.IZBookDao_zmf_1913040848//总图书持久类

nuczmfspringboot.sb_book20211007.entily//模型层

nuczmfspringboot.sb_book20211007.entily.Maide_zmf_1913040848//管理员模型类

nuczmfspringboot.sb_book20211007.entily.UBook_zmf_1913040848//用户购买图书模型类

nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848//用户模型类

nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848//总图书模型类

nuczmfspringboot.sb_book20211007.Service//服务层

nuczmfspringboot.sb_book20211007.Service.IMaideService_zmf_1913040848//管理员服务层接口

nuczmfspringboot.sb_book20211007.Service.impl.MapperServiceZmf1913040848Impl//管理员实现类

nuczmfspringboot.sb_book20211007.Service.IUBookService_zmf_1913040848用户购买图书服务接口

nuczmfspringboot.sb_book20211007.Service.impl.UBookServiceZmf1913040848Impl用户购买图书实现类

nuczmfspringboot.sb_book20211007.Service.IUserService_zmf_1913040848用户服务接口

nuczmfspringboot.sb_book20211007.Service.impl.UserServiceZmf1913040848Impl用户实现类

nuczmfspringboot.sb_book20211007.Service.IZBookService_zmf_1913040848总图书服务接口

nuczmfspringboot.sb_book20211007.Service.impl.ZBookServiceZmf1913040848Impl总图书实现类

nuczmfspringboot.sb_book20211007.SbBook20211007Application//主函数类

mybatis文件夹

mybatis/mybatis-config.xml//mybatis配置文件

mybatis/mapper/MaideMapper_zmf_1913040848.xml//管理员配置文件

mybatis/mapper/UBookMapper_zmf_1913040848.xml//用户购买图书配置文件

mybatis/mapper/UserMapper_zmf_1913040848.xml//用户配置文件中

mybatis/mapper/ZBookMappper_zmf_1913040848.xml//总图书配置文件

static.css//css

static.jpg//图片

static.jquery-easyui-1.8.6//easyui框架

webapp\WEB_INF\jsp\book//图书jsp页面

\webapp\WEB_INF\jsp\maide//管理员jsp页面

webapp\WEB_INF\jsp\user//用户jsp页面

5.实验源代码

mybatis/mybatis-config.xml

<?xml version="1.0" encoding="UTF-8" ?>
        <!DOCTYPE configuration
                PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
                ".dtd">
<configuration>
    <!-- 设置驼峰表示法-->
    <!--
     <settings>
      <setting name="mapUnderscoreToCamelCase" value="true" />
     </settings>
    -->
    <typeAliases>
        <!-- 批量导入基本类别名 -->
        <package name="nuczmfspringboot.sb_book20211007.entily"/>
    </typeAliases>
</configuration>

application.properties

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driverspring.datasource.url=jdbc:mysql://localhost:3306/sb_211007spring.datasource.username=rootspring.datasource.password=123456mybatis.config-location=classpath:mybatis/mybatis-config.xmlmybatis.mapper-locations=classpath:mybatis/mapper/*.xmlspring.jackson.serialization.indent-output=truelogging.level.nuc.edu.cn.chapter05_mybatis1_20191125.dao=debugspring.mvc.view.prefix=/WEB_INF/jsp/spring.mvc.view.suffix=.jspserver.port=8086

pom.xml

<?xml version="1.0" encoding="UTF-8"?><project xmlns=".0.0" xmlns:xsi=""xsi:schemaLocation=".0.0 .0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.5.5</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>nuc-zmf-springboot</groupId><artifactId>sb20210927</artifactId><version>0.0.1-SNAPSHOT</version><name>sb20210927</name><description>Demo project for Spring Boot</description><properties><java.version>11</java.version></properties><dependencies><dependency><groupId>javax.servlet</groupId><artifactId>jstl</artifactId><scope>provided</scope></dependency><dependency><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><scope>provided</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId><scope>provided</scope></dependency><dependency><groupId>org.apache.tomcat.embed</groupId><artifactId>tomcat-embed-jasper</artifactId><scope>provided</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>2.1.1</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><scope>runtime</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><scope>test</scope></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build></project>

nuczmfspringboot.sb_book20211007.entily.Maide_zmf_1913040848

package nuczmfspringboot.sb_book20211007.entily;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/10/31 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************//*** @ProjectName : sb_book20211007* @ClassName : Maide* @Description : 请描述该类的功能
* @author : zmf* @Date : 2021/10/31 16:37* @version v1.0* Copyright (c) All Rights Reserved,中北大学朱梦飞,. */public class Maide_zmf_1913040848 {private String mname_zmf_1913040848;private String mpassword_zmf_1913040848;public String getmname_zmf_1913040848() {return mname_zmf_1913040848;}public void setmname_zmf_1913040848(String mname_zmf_1913040848) {this.mname_zmf_1913040848 = mname_zmf_1913040848;}public String getmpassword_zmf_1913040848() {return mpassword_zmf_1913040848;}public void setmpassword_zmf_1913040848(String mpassword_zmf_1913040848) {this.mpassword_zmf_1913040848 = mpassword_zmf_1913040848;}public Maide_zmf_1913040848(String mname_zmf_1913040848, String mpassword_zmf_1913040848) {this.mname_zmf_1913040848 = mname_zmf_1913040848;this.mpassword_zmf_1913040848 = mpassword_zmf_1913040848;}}

nuczmfspringboot.sb_book20211007.entily.UBook_zmf_1913040848

package nuczmfspringboot.sb_book20211007.entily;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/11/4 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************//*** @ProjectName : sb_book20211007* @ClassName : UBook* @Description : 请描述该类的功能
* @author : zmf* @Date : 2021/11/4 17:01* @version v1.0* Copyright (c) All Rights Reserved,中北大学朱梦飞,. */public class UBook_zmf_1913040848 {private int bid_zmf_1913040848;private String bname_zmf_1913040848;private String blei_zmf_1913040848;private double bpice_zmf_1913040848;private int bshu_zmf_1913040848;private String bfengmain_zmf_1913040848;private int buid_zmf_1913040848;private String bstate_zmf_1913040848;private String bdata_zmf_1913040848;public int getbid_zmf_1913040848() {return bid_zmf_1913040848;}public void setbid_zmf_1913040848(int bid_zmf_1913040848) {this.bid_zmf_1913040848 = bid_zmf_1913040848;}public String getbname_zmf_1913040848() {return bname_zmf_1913040848;}public void setbname_zmf_1913040848(String bname_zmf_1913040848) {this.bname_zmf_1913040848 = bname_zmf_1913040848;}public String getblei_zmf_1913040848() {return blei_zmf_1913040848;}public void setblei_zmf_1913040848(String blei_zmf_1913040848) {this.blei_zmf_1913040848 = blei_zmf_1913040848;}public double getbpice_zmf_1913040848() {return bpice_zmf_1913040848;}public void setbpice_zmf_1913040848(double bpice_zmf_1913040848) {this.bpice_zmf_1913040848 = bpice_zmf_1913040848;}public int getbshu_zmf_1913040848() {return bshu_zmf_1913040848;}public void setbshu_zmf_1913040848(int bshu_zmf_1913040848) {this.bshu_zmf_1913040848 = bshu_zmf_1913040848;}public String getbfengmain_zmf_1913040848() {return bfengmain_zmf_1913040848;}public void setbfengmain_zmf_1913040848(String bfengmain_zmf_1913040848) {this.bfengmain_zmf_1913040848 = bfengmain_zmf_1913040848;}public int getbuid_zmf_1913040848() {return buid_zmf_1913040848;}public void setbuid_zmf_1913040848(int buid_zmf_1913040848) {this.buid_zmf_1913040848 = buid_zmf_1913040848;}public String getbstate_zmf_1913040848() {return bstate_zmf_1913040848;}public void setbstate_zmf_1913040848(String bstate_zmf_1913040848) {this.bstate_zmf_1913040848 = bstate_zmf_1913040848;}public String getbdata_zmf_1913040848() {return bdata_zmf_1913040848;}public void setbdata_zmf_1913040848(String bdata_zmf_1913040848) {this.bdata_zmf_1913040848 = bdata_zmf_1913040848;}public UBook_zmf_1913040848(int bid_zmf_1913040848, String bname_zmf_1913040848, String blei_zmf_1913040848, double bpice_zmf_1913040848, int bshu_zmf_1913040848, String bfengmain_zmf_1913040848, int buid_zmf_1913040848, String bstate_zmf_1913040848, String bdata_zmf_1913040848) {this.bid_zmf_1913040848 = bid_zmf_1913040848;this.bname_zmf_1913040848 = bname_zmf_1913040848;this.blei_zmf_1913040848 = blei_zmf_1913040848;this.bpice_zmf_1913040848 = bpice_zmf_1913040848;this.bshu_zmf_1913040848 = bshu_zmf_1913040848;this.bfengmain_zmf_1913040848 = bfengmain_zmf_1913040848;this.buid_zmf_1913040848 = buid_zmf_1913040848;this.bstate_zmf_1913040848 = bstate_zmf_1913040848;this.bdata_zmf_1913040848 = bdata_zmf_1913040848;}}

nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848

package nuczmfspringboot.sb_book20211007.entily;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/11/4 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************//*** @ProjectName : sb_book20211007* @ClassName : User* @Description : 请描述该类的功能
* @author : zmf* @Date : 2021/11/4 11:49* @version v1.0* Copyright (c) All Rights Reserved,中北大学朱梦飞,. */public class User_zmf_1913040848 {private int uid_zmf_1913040848;private String uname_zmf_1913040848;private String upassword_zmf_1913040848;private String uxingm_zmf_1913040848;private int uage_zmf_1913040848;private  String usex_zmf_1913040848;private String uqq_zmf_1913040848;private  int utem_zmf_1913040848;private String uemail_zmf_1913040848;public int getuid_zmf_1913040848() {return uid_zmf_1913040848;}public void setuid_zmf_1913040848(int uid_zmf_1913040848) {this.uid_zmf_1913040848 = uid_zmf_1913040848;}public String getuname_zmf_1913040848() {return uname_zmf_1913040848;}public void setuname_zmf_1913040848(String uname_zmf_1913040848) {this.uname_zmf_1913040848 = uname_zmf_1913040848;}public String getupassword_zmf_1913040848() {return upassword_zmf_1913040848;}public void setupassword_zmf_1913040848(String upassword_zmf_1913040848) {this.upassword_zmf_1913040848 = upassword_zmf_1913040848;}public String getuxingm_zmf_1913040848() {return uxingm_zmf_1913040848;}public void setuxingm_zmf_1913040848(String uxingm_zmf_1913040848) {this.uxingm_zmf_1913040848 = uxingm_zmf_1913040848;}public int getuage_zmf_1913040848() {return uage_zmf_1913040848;}public void setuage_zmf_1913040848(int uage_zmf_1913040848) {this.uage_zmf_1913040848 = uage_zmf_1913040848;}public String getusex_zmf_1913040848() {return usex_zmf_1913040848;}public void setusex_zmf_1913040848(String usex_zmf_1913040848) {this.usex_zmf_1913040848 = usex_zmf_1913040848;}public String getuqq_zmf_1913040848() {return uqq_zmf_1913040848;}public void setuqq_zmf_1913040848(String uqq_zmf_1913040848) {this.uqq_zmf_1913040848 = uqq_zmf_1913040848;}public int getutem_zmf_1913040848() {return utem_zmf_1913040848;}public void setutem_zmf_1913040848(int utem_zmf_1913040848) {this.utem_zmf_1913040848 = utem_zmf_1913040848;}public String getuemail_zmf_1913040848() {return uemail_zmf_1913040848;}public void setuemail_zmf_1913040848(String uemail_zmf_1913040848) {this.uemail_zmf_1913040848 = uemail_zmf_1913040848;}public User_zmf_1913040848(int uid_zmf_1913040848, String uname_zmf_1913040848, String upassword_zmf_1913040848, String uxingm_zmf_1913040848, int uage_zmf_1913040848, String usex_zmf_1913040848, String uqq_zmf_1913040848, int utem_zmf_1913040848, String uemail_zmf_1913040848) {this.uid_zmf_1913040848 = uid_zmf_1913040848;this.uname_zmf_1913040848 = uname_zmf_1913040848;this.upassword_zmf_1913040848 = upassword_zmf_1913040848;this.uxingm_zmf_1913040848 = uxingm_zmf_1913040848;this.uage_zmf_1913040848 = uage_zmf_1913040848;this.usex_zmf_1913040848 = usex_zmf_1913040848;this.uqq_zmf_1913040848 = uqq_zmf_1913040848;this.utem_zmf_1913040848 = utem_zmf_1913040848;this.uemail_zmf_1913040848 = uemail_zmf_1913040848;}}

nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848

package nuczmfspringboot.sb_book20211007.entily;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/10/31 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************//*** @ProjectName : sb_book20211007* @ClassName : Zbook* @Description : 请描述该类的功能
* @author : zmf* @Date : 2021/10/31 18:09* @version v1.0* Copyright (c) All Rights Reserved,中北大学朱梦飞,. */public class Zbook_zmf_1913040848 {private int bid_zmf_1913040848;private String bname_zmf_1913040848;private String blei_zmf_1913040848;private double bpice_zmf_1913040848;private int bshu_zmf_1913040848;private String bfengmian_zmf_1913040848;private String bzuozhe_zmf_1913040848;private String bjianjie_zmf_1913040848;public String getbzuozhe_zmf_1913040848() {return bzuozhe_zmf_1913040848;}public void setbzuozhe_zmf_1913040848(String bzuozhe_zmf_1913040848) {this.bzuozhe_zmf_1913040848 = bzuozhe_zmf_1913040848;}public String getbjianjie_zmf_1913040848() {return bjianjie_zmf_1913040848;}public void setbjianjie_zmf_1913040848(String bjianjie_zmf_1913040848) {this.bjianjie_zmf_1913040848 = bjianjie_zmf_1913040848;}public int getbid_zmf_1913040848() {return bid_zmf_1913040848;}public void setbid_zmf_1913040848(int bid_zmf_1913040848) {this.bid_zmf_1913040848 = bid_zmf_1913040848;}public String getbname_zmf_1913040848() {return bname_zmf_1913040848;}public void setbname_zmf_1913040848(String bname_zmf_1913040848) {this.bname_zmf_1913040848 = bname_zmf_1913040848;}public String getblei_zmf_1913040848() {return blei_zmf_1913040848;}public void setblei_zmf_1913040848(String blei_zmf_1913040848) {this.blei_zmf_1913040848 = blei_zmf_1913040848;}public double getbpice_zmf_1913040848() {return bpice_zmf_1913040848;}public void setbpice_zmf_1913040848(double bpice_zmf_1913040848) {this.bpice_zmf_1913040848 = bpice_zmf_1913040848;}public int getbshu_zmf_1913040848() {return bshu_zmf_1913040848;}public void setbshu_zmf_1913040848(int bshu_zmf_1913040848) {this.bshu_zmf_1913040848 = bshu_zmf_1913040848;}public String getbfengmian_zmf_1913040848() {return bfengmian_zmf_1913040848;}public void setbfengmian_zmf_1913040848(String bfengmian_zmf_1913040848) {this.bfengmian_zmf_1913040848 = bfengmian_zmf_1913040848;}public Zbook_zmf_1913040848(int bid_zmf_1913040848, String bname_zmf_1913040848, String blei_zmf_1913040848, double bpice_zmf_1913040848, int bshu_zmf_1913040848, String bfengmian_zmf_1913040848, String bzuozhe_zmf_1913040848, String bjianjie_zmf_1913040848) {this.bid_zmf_1913040848 = bid_zmf_1913040848;this.bname_zmf_1913040848 = bname_zmf_1913040848;this.blei_zmf_1913040848 = blei_zmf_1913040848;this.bpice_zmf_1913040848 = bpice_zmf_1913040848;this.bshu_zmf_1913040848 = bshu_zmf_1913040848;this.bfengmian_zmf_1913040848 = bfengmian_zmf_1913040848;this.bzuozhe_zmf_1913040848 = bzuozhe_zmf_1913040848;this.bjianjie_zmf_1913040848 = bjianjie_zmf_1913040848;}}

nuczmfspringboot.sb_book20211007.Dao.IMaideDao_zmf_1913040848

package nuczmfspringboot.sb_book20211007.Dao;import org.apache.ibatis.annotations.Mapper;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/10/31 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************/@Mapperpublic interface IMaideDao_zmf_1913040848 {public String yanzheng_zmf_1913040848(String mname);}

nuczmfspringboot.sb_book20211007.Dao.IUBookDao_zmf_1913040848

package nuczmfspringboot.sb_book20211007.Dao;import nuczmfspringboot.sb_book20211007.entily.UBook_zmf_1913040848;import org.apache.ibatis.annotations.Mapper;import org.apache.ibatis.annotations.Param;import java.util.List;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/11/4 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************/@Mapperpublic interface IUBookDao_zmf_1913040848 {public List<UBook_zmf_1913040848> allubookbybuid_zmf_1913040848(int buid);public List<UBook_zmf_1913040848> allubookbybuidandbstate_zmf_1913040848(@Param("buid") int buid, @Param("bstate") String bstate);public UBook_zmf_1913040848 allubookbyuidanbid_zmf_1913040848(@Param("buid") int buid, @Param("bid") int bid);public boolean addubook_zmf_1913040848(UBook_zmf_1913040848 uBookZmf1913040848);public boolean ubookdelete_zmf_1913040848(@Param("uid") int uid, @Param("bid") int bid);public boolean ubookupdata_zmf_1913040848(@Param("uid") int uid, @Param("bid") int bid, @Param("bstate") String bstate, @Param("bdata") String bdata);public boolean ubookupdatabyshu_zmf_1913040848(@Param("uid") int uid, @Param("bid") int bid, @Param("bshu") int bshu);}

nuczmfspringboot.sb_book20211007.Dao.IUserDao_zmf_1913040848

package nuczmfspringboot.sb_book20211007.Dao;import nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848;import org.apache.ibatis.annotations.Mapper;import org.apache.ibatis.annotations.Param;import java.util.List;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/11/4 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************/@Mapperpublic interface IUserDao_zmf_1913040848 {public List<User_zmf_1913040848> alluser_zmf_1913040848();public List<User_zmf_1913040848> alluserbyuname_zmf_1913040848(String uname);public User_zmf_1913040848 userbyuid_zmf_1913040848(int uid);public List<User_zmf_1913040848> alluserbyusex_zmf_1913040848(String usex);public List<User_zmf_1913040848> alluserbyuage_zmf_1913040848(int uage);public List<User_zmf_1913040848> alluserbyuxingm_zmf_1913040848(String uxingm);public boolean userdelete_zmf_1913040848(int uid);public boolean userupdate_zmf_1913040848(User_zmf_1913040848 user);public boolean updatepassword_zmf_1913040848(@Param("uid") int uid, @Param("upassword") String upassword);public boolean insertuser_zmf_1913040848(@Param("uname") String uname, @Param("upassword") String upassword);}

nuczmfspringboot.sb_book20211007.Dao.IZBookDao_zmf_1913040848

package nuczmfspringboot.sb_book20211007.Dao;import nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848;import org.apache.ibatis.annotations.Mapper;import org.apache.ibatis.annotations.Param;import java.util.List;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/10/10 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************/@Mapperpublic interface IZBookDao_zmf_1913040848 {public List<Zbook_zmf_1913040848> allbookbyblei_zmf_1913040848(String blei);public List<Zbook_zmf_1913040848> allbook_zmf_1913040848();public List<Zbook_zmf_1913040848> allbookbybname_zmf_1913040848(String bname);public List<Zbook_zmf_1913040848> allbookbybpice_zmf_1913040848(double bpice);public List<Zbook_zmf_1913040848> allbookbybpice1_zmf_1913040848(@Param("bpice1") double bpice1, @Param("bpice2") double bpice2);public List<Zbook_zmf_1913040848> allbookbybzuozhe_zmf_1913040848(String bzuozhe);public Zbook_zmf_1913040848 allbookbybid_zmf_1913040848(int bid);public boolean addbook_zmf_1913040848(Zbook_zmf_1913040848 zbook);public boolean detelebookbyid_zmf_1913040848(int bid);public boolean updatebook_zmf_1913040848(Zbook_zmf_1913040848 zbook);}

mybatis/mapper/MaideMapper_zmf_1913040848.xml

<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"".dtd"><mapper namespace="nuczmfspringboot.sb_book20211007.Dao.IMaideDao_zmf_1913040848"><select id="yanzheng_zmf_1913040848" parameterType="String" resultType="String">select mpassword from maide where mname = #{mname}</select></mapper>

mybatis/mapper/UBookMapper_zmf_1913040848.xml

<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"".dtd"><mapper namespace="nuczmfspringboot.sb_book20211007.Dao.IUBookDao_zmf_1913040848"><select id="allubookbybuid_zmf_1913040848" parameterType="int" resultType="nuczmfspringboot.sb_book20211007.entily.UBook_zmf_1913040848">select * from ubook where buid = #{buid}</select><select id="allubookbybuidandbstate_zmf_1913040848" resultType="nuczmfspringboot.sb_book20211007.entily.UBook_zmf_1913040848">select * from ubook where buid = #{buid} and bstate = #{bstate}</select><insert id="addubook_zmf_1913040848" parameterType="nuczmfspringboot.sb_book20211007.entily.UBook_zmf_1913040848">insert into ubook value (null,#{bname},#{blei},#{bpice},#{bshu},#{bfengmain},#{buid},#{bstate},#{bdata} )</insert><delete id="ubookdelete_zmf_1913040848">delete from ubook where buid = #{uid} and bid = #{bid}</delete><update id="ubookupdata_zmf_1913040848">update ubook set bstate = #{bstate} ,bdata = #{bdata} where buid = #{uid} and bid = #{bid}</update><update id="ubookupdatabyshu_zmf_1913040848">update ubook set bshu = #{bshu} where buid = #{uid} and bid = #{bid}</update><select id="allubookbyuidanbid_zmf_1913040848" resultType="nuczmfspringboot.sb_book20211007.entily.UBook_zmf_1913040848">select * from ubook where buid = #{buid} and bid = #{bid}</select></mapper>

mybatis/mapper/UserMapper_zmf_1913040848.xml

<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"".dtd"><mapper namespace="nuczmfspringboot.sb_book20211007.Dao.IUserDao_zmf_1913040848"><select id="alluser_zmf_1913040848" resultType="nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848">select * from user</select><select id="alluserbyuname_zmf_1913040848" parameterType="String" resultType="nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848">select * from user where uname = #{uname}</select><select id="userbyuid_zmf_1913040848" parameterType="int" resultType="nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848">select * from user where uid = #{uid}</select><select id="alluserbyusex_zmf_1913040848" parameterType="String" resultType="nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848">select * from user where  usex = #{usex}</select><select id="alluserbyuage_zmf_1913040848" parameterType="int" resultType="nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848">select * from user where uage = #{uage}</select><select id="alluserbyuxingm_zmf_1913040848" parameterType="String" resultType="nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848">select * from user where uxingm = #{uxingm}</select><delete id="userdelete_zmf_1913040848" parameterType="int" >delete from user where uid = #{uid}</delete><update id="userupdate_zmf_1913040848" parameterType="nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848">update user set uname = #{uname} , upassword = #{upassword} , uxingm = #{uxingm} , uage = #{uage} , usex = #{usex} , uqq = #{uqq} , utem = #{utem} , uemail = #{uemail} where uid = #{uid}</update><update id="updatepassword_zmf_1913040848">update user set upassword = #{upassword} where uid = #{uid}</update><insert id="insertuser_zmf_1913040848">insert into user value (null,#{uname},#{upassword},null ,null ,null ,null ,null ,null )</insert></mapper>

mybatis/mapper/ZBookMappper_zmf_1913040848.xml

<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"".dtd"><mapper namespace="nuczmfspringboot.sb_book20211007.Dao.IZBookDao_zmf_1913040848"><select id="allbookbyblei_zmf_1913040848" parameterType="String" resultType="nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848">select * from zbook where blei = #{blei}</select><select id="allbook_zmf_1913040848" resultType="nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848">select * from zbook</select><insert id="addbook_zmf_1913040848" parameterType="nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848">insert into zbook value (null,#{bname},#{blei},#{bpice},#{bshu},#{bfengmain})</insert><delete id="detelebookbyid_zmf_1913040848" parameterType="int">delete from zbook where bid = #{bid}</delete><update id="updatebook_zmf_1913040848" parameterType="nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848">update zbook set bname = #{bname},blei = #{blei},bpice = #{bpice},bshu = #{bshu}, bfengmian = #{bfengmian} where  bid = #{bid}</update><select id="allbookbybid_zmf_1913040848" parameterType="int" resultType="nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848">select * from zbook where bid = #{bid}</select><select id="allbookbybname_zmf_1913040848" parameterType="String" resultType="nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848">select * from zbook where bname like  concat('%',#{bname},'%');</select><select id="allbookbybzuozhe_zmf_1913040848" parameterType="String" resultType="nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848">select * from zbook where bzuozhe like  concat('%',#{bzuozhe},'%');</select><select id="allbookbybpice_zmf_1913040848" parameterType="double" resultType="nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848">select * from zbook where bpice = #{bpice};</select><select id="allbookbybpice1_zmf_1913040848" resultType="nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848">select * from zbook where bpice > #{bpice1} and #{bpice2} > bpice;</select></mapper>

nuczmfspringboot.sb_book20211007.Service.IMaideService_zmf_1913040848

public interface IMaideService_zmf_1913040848 {public String yanzheng_zmf_1913040848(String mname) ;}

nuczmfspringboot.sb_book20211007.Service.IUBookService_zmf_1913040848

package nuczmfspringboot.sb_book20211007.Service;import nuczmfspringboot.sb_book20211007.entily.UBook_zmf_1913040848;import java.util.List;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/11/4 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************/public interface IUBookService_zmf_1913040848 {public List<UBook_zmf_1913040848> allubookbybuid_zmf_1913040848(int buid);public boolean addubook_zmf_1913040848(UBook_zmf_1913040848 uBookZmf1913040848);public List<UBook_zmf_1913040848> allubookbybuidandbstate_zmf_1913040848(int buid, String bstate);public boolean ubookdelete_zmf_1913040848(int uid, int bid);public boolean ubookupdata_zmf_1913040848(int uid, int bid, String bstate, String bdata);public boolean ubookupdatabyshu_zmf_1913040848(int uid, int bid, int bshu);public UBook_zmf_1913040848 allubookbyuidanbid_zmf_1913040848(int buid, int bid);}

nuczmfspringboot.sb_book20211007.Service.IUserService_zmf_1913040848

package nuczmfspringboot.sb_book20211007.Service;import nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848;import java.util.List;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/11/4 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************/public interface IUserService_zmf_1913040848 {public List<User_zmf_1913040848> alluser_zmf_1913040848();public List<User_zmf_1913040848> alluserbyuname_zmf_1913040848(String uname);public User_zmf_1913040848 userbyuid_zmf_1913040848(int uid);public List<User_zmf_1913040848> alluserbyusex_zmf_1913040848(String usex);public List<User_zmf_1913040848> alluserbyuage_zmf_1913040848(int uage);public List<User_zmf_1913040848> alluserbyuxingm_zmf_1913040848(String uxingm);public boolean userdelete_zmf_1913040848(int uid);public boolean userupdate_zmf_1913040848(User_zmf_1913040848 user);public boolean updatepassword_zmf_1913040848(int uid, String upassword);public boolean insertuser_zmf_1913040848(String uname, String upassword);}

nuczmfspringboot.sb_book20211007.Service.IZBookService_zmf_1913040848

package nuczmfspringboot.sb_book20211007.Service;import nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848;import java.util.List;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/10/31 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************/public interface IZBookService_zmf_1913040848 {public List<Zbook_zmf_1913040848> allbookbyblei_zmf_1913040848(String blei);public List<Zbook_zmf_1913040848> allbook_zmf_1913040848();public List<Zbook_zmf_1913040848> allbookbybname_zmf_1913040848(String bname);public List<Zbook_zmf_1913040848> allbookbybpice_zmf_1913040848(double bpice);public List<Zbook_zmf_1913040848> allbookbybzuozhe_zmf_1913040848(String bzuozhe);public Zbook_zmf_1913040848 allbookbybid_zmf_1913040848(int bid);public boolean addbook_zmf_1913040848(Zbook_zmf_1913040848 zbook);public boolean detelebookbyid_zmf_1913040848(int bid);public boolean updatebook_zmf_1913040848(Zbook_zmf_1913040848 zbook);public List<Zbook_zmf_1913040848> allbookbybpice1_zmf_1913040848(double bpice1, double bpice2);}

nuczmfspringboot.sb_book20211007.SbBook20211007Application

package nuczmfspringboot.sb_book20211007;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplicationpublic class SbBook20211007Application {public static void main(String[] args) {SpringApplication.run(SbBook20211007Application.class, args);}}

nuczmfspringboot.sb_book20211007.controller.ControllerByM_zmf_1913040848

package nuczmfspringboot.sb_book20211007.controller;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/10/31 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************/import nuczmfspringboot.sb_book20211007.Service.IUBookService_zmf_1913040848;import nuczmfspringboot.sb_book20211007.Service.IUserService_zmf_1913040848;import nuczmfspringboot.sb_book20211007.Service.IZBookService_zmf_1913040848;import nuczmfspringboot.sb_book20211007.entily.UBook_zmf_1913040848;import nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848;import nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.util.FileCopyUtils;import org.springframework.web.bind.annotation.PostMapping;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.multipart.MultipartFile;import org.springframework.web.servlet.ModelAndView;import java.io.FileOutputStream;import java.text.SimpleDateFormat;import java.util.ArrayList;import java.util.Date;import java.util.List;/*** @ProjectName : sb_book20211007* @ClassName : ControllerByBook* @Description : 请描述该类的功能
* @author : zmf* @Date : 2021/10/31 20:36* @version v1.0* Copyright (c) All Rights Reserved,中北大学朱梦飞,. */@Controller@RequestMapping("book")public class ControllerByM_zmf_1913040848 {@Autowiredprivate IZBookService_zmf_1913040848 IBS;@Autowiredprivate IUserService_zmf_1913040848 IUS;@Autowiredprivate IUBookService_zmf_1913040848 IUBS;ModelAndView mv=new ModelAndView();@RequestMapping("mg")public ModelAndView mg(int b){String yemian ="mbookall";System.out.println(b);switch (b){case 1:yemian="mbookall";List<Zbook_zmf_1913040848> zbooks =IBS.allbook_zmf_1913040848();mv.addObject("zbooks",zbooks);System.out.println(zbooks);break;case 2: yemian="../user/muserall";List<User_zmf_1913040848> users=IUS.alluser_zmf_1913040848();mv.addObject("users",users);break;case 3: yemian="mbookc";break;case 4: yemian="../user/muserc";break;case 5: yemian="mbookx";break;case 6: yemian="mbookxiu";break;case 7: yemian="../user/muserx";break;case 8: yemian="../user/muserallx";break;case 9: yemian="../user/muserall";break;case 10: yemian="../user/muserxiu";break;case 11: yemian="maddbook";break;}mv.setViewName("/book/mg");mv.addObject("yemian",yemian);return mv;}@RequestMapping("xing")public ModelAndView xing(int bid){Zbook_zmf_1913040848 zbook=IBS.allbookbybid_zmf_1913040848(bid);mv.addObject("zbook",zbook);mv=mg(5);return mv;}@PostMapping("cha")public ModelAndView cha(int bid,String bname,String bpice,String blei,String bzuozhe){System.out.println(bpice);List<Zbook_zmf_1913040848> zbooks=new ArrayList<>();if(bid!=0){Zbook_zmf_1913040848 zb= IBS.allbookbybid_zmf_1913040848(bid);mv.addObject("zbook",zb);mv=mg(5);return mv;}if (!bname.equals("空")){List<Zbook_zmf_1913040848> zb1=IBS.allbookbybname_zmf_1913040848(bname);zbooks=zb1;}if(bpice!="0"){int x=0;System.out.println(zbooks.size());List<Zbook_zmf_1913040848> zb2=IBS.allbookbybpice_zmf_1913040848(Double.valueOf(bpice));if(zbooks.size()==0){zbooks=zb2;}else {for (Zbook_zmf_1913040848 zbook:zb2){for (Zbook_zmf_1913040848 zbook1:zbooks){if(zbook.getbid_zmf_1913040848()==zbook1.getbid_zmf_1913040848()){x++;}}if(x==0){zbooks.add(zbook);}}}}System.out.println("===>"+blei);if(!blei.equals("空")){int x=0;List<Zbook_zmf_1913040848> zb3=IBS.allbookbyblei_zmf_1913040848(blei);if(zbooks.size()==0){zbooks=zb3;}else {for (Zbook_zmf_1913040848 zbook:zb3){for (Zbook_zmf_1913040848 zbook1:zbooks){if(zbook.getbid_zmf_1913040848()==zbook1.getbid_zmf_1913040848()){x++;}}if(x==0){zbooks.add(zbook);}}}}if(!bzuozhe.equals("空")){int x=0;List<Zbook_zmf_1913040848> zb4=IBS.allbookbybzuozhe_zmf_1913040848(bzuozhe);if(zbooks.size()==0){zbooks=zb4;}else {for (Zbook_zmf_1913040848 zbook:zb4){for (Zbook_zmf_1913040848 zbook1:zbooks){if(zbook.getbid_zmf_1913040848()==zbook1.getbid_zmf_1913040848()){x++;}}if(x==0){zbooks.add(zbook);}}}}mv.addObject("zbooks",zbooks);mv=mg(0);return mv;}@RequestMapping("bdelete")public ModelAndView bdelete(int bid){if(IBS.detelebookbyid_zmf_1913040848(bid)){mv.addObject("a",1);}else {mv.addObject("a",2);}mv=mg(1);return mv;}@RequestMapping("bupdate")public ModelAndView bupdate(int bid){Zbook_zmf_1913040848 zbook=IBS.allbookbybid_zmf_1913040848(bid);mv.addObject("zbook",zbook);mv=mg(6);return mv;}@PostMapping("bupdates")public ModelAndView bupdates(int bid, MultipartFile bfengmian, String bname, String bzuozhe,String bpice,int bshu,String bjianjie,String blei){String f;System.out.println(bfengmian.isEmpty());if(!bfengmian.isEmpty()){String path = "D:/sb_boot2021007/src/main/resources/static/jpg/";System.out.println(bfengmian);System.out.println(bfengmian.getOriginalFilename());String fileName = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());String suffix = bfengmian.getOriginalFilename().substring(bfengmian.getOriginalFilename().lastIndexOf("."));if (!suffix.equals(".jpg")) {System.out.println(path +fileName+ suffix);}try {FileCopyUtils.copy(bfengmian.getInputStream(), new FileOutputStream(path + fileName + suffix));} catch (Exception e) {// TODO: handle exceptione.printStackTrace();mv.addObject("a",3);mv=mg(1);return mv;}f="../jpg/" + fileName + suffix;}else {Zbook_zmf_1913040848 zbook=IBS.allbookbybid_zmf_1913040848(bid);f=zbook.getbfengmian_zmf_1913040848();}double bpices=Double.valueOf(bpice);Zbook_zmf_1913040848 zbook=new Zbook_zmf_1913040848(bid,bname,blei,bpices,bshu,f,bzuozhe,bjianjie);if(IBS.updatebook_zmf_1913040848(zbook)){mv.addObject("a",4);mv=mg(1);return mv;}mv.addObject("a",3);mv=mg(1);return mv;}@RequestMapping("ugb")public ModelAndView ugb(int uid){String uname=IUS.userbyuid_zmf_1913040848(uid).getuname_zmf_1913040848();List<UBook_zmf_1913040848> uBookZmf1913040848s =IUBS.allubookbybuid_zmf_1913040848(uid);mv.addObject("uname",uname);mv.addObject("ubooks", uBookZmf1913040848s);mv=mg(7);return mv;}@PostMapping("chauser")public ModelAndView chauser(int uid,String uname,int uage,String usex,String uxingm){List<User_zmf_1913040848> users=new ArrayList<>();if(uid!=0){User_zmf_1913040848 user= IUS.userbyuid_zmf_1913040848(uid);mv.addObject("user",user);mv=mg(8);return mv;}if (!uname.equals("空")){List<User_zmf_1913040848> U1=IUS.alluserbyuname_zmf_1913040848(uname);users=U1;}if(uage!=0){int x=0;List<User_zmf_1913040848> U2=IUS.alluserbyuage_zmf_1913040848(uage);if(users.size()==0){users=U2;}else {for (User_zmf_1913040848 user:U2){for (User_zmf_1913040848 user1:users){if(user.getuid_zmf_1913040848()==user1.getuid_zmf_1913040848()){x++;}}if(x==0){users.add(user);}}}}if(!usex.equals("空")){int x=0;List<User_zmf_1913040848> U3=IUS.alluserbyusex_zmf_1913040848(usex);if(users.size()==0){users=U3;}else {for (User_zmf_1913040848 user:U3){for (User_zmf_1913040848 user1:users){if(user.getuid_zmf_1913040848()==user1.getuid_zmf_1913040848()){x++;}}if(x==0){users.add(user);}}}}if(!uxingm.equals("空")) {int x = 0;List<User_zmf_1913040848> U4 = IUS.alluserbyuxingm_zmf_1913040848(uxingm);if (users.size() == 0) {users = U4;} else {for (User_zmf_1913040848 user : U4) {for (User_zmf_1913040848 user1 : users) {if (user.getuid_zmf_1913040848() == user1.getuid_zmf_1913040848() ) {x++;}}if (x == 0) {users.add(user);}}}}System.out.println(users);mv.addObject("users",users);mv=mg(9);return mv;}@RequestMapping("userdelete")public ModelAndView userdelete(int uid){if(IUS.userdelete_zmf_1913040848(uid)){mv.addObject("a",1);}else {mv.addObject("a",2);}mv=mg(2);return mv;}@PostMapping("maddbooks")public ModelAndView maddbooks( String bname, String bzuozhe,String bpice,int bshu,String bjianjie,String blei,MultipartFile bfengmian ){String path = "D:/sb_boot2021007/src/main/resources/static/jpg/";System.out.println(bfengmian);System.out.println(bfengmian.getOriginalFilename());String fileName = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());String suffix = bfengmian.getOriginalFilename().substring(bfengmian.getOriginalFilename().lastIndexOf("."));if (!suffix.equals(".jpg")) {System.out.println(path +fileName+ suffix);}try {FileCopyUtils.copy(bfengmian.getInputStream(), new FileOutputStream(path + fileName + suffix));} catch (Exception e) {// TODO: handle exceptione.printStackTrace();mv=mg(11);return mv;}String f="../jpg/" + fileName + suffix;double bpices=Double.valueOf(bpice);Zbook_zmf_1913040848 zbook=new Zbook_zmf_1913040848(0,bname,blei,bpices,bshu,f,bzuozhe,bjianjie);if(IBS.addbook_zmf_1913040848(zbook)){mv=mg(1);return mv;}mv=mg(11);return mv;}@PostMapping("userupdates")public ModelAndView userupdates(String uname,String upassword,String uxingm,int uage,String usex,int utem,String uemail,String uqq){User_zmf_1913040848 user=new User_zmf_1913040848(0,uname,upassword,uxingm,uage,usex,uqq,utem,uemail);if(IUS.userupdate_zmf_1913040848(user)){mv=mg(2);return mv;}mv=mg(10);return mv;}@RequestMapping("userupdate")public ModelAndView userupdate(int uid){User_zmf_1913040848 user =IUS.userbyuid_zmf_1913040848(uid);mv.addObject("user",user);mv=mg(10);return mv;}}

nuczmfspringboot.sb_book20211007.controller.ControllerByMaide_zmf_1913040848

package nuczmfspringboot.sb_book20211007.controller;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/10/31 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************/import nuczmfspringboot.sb_book20211007.Service.IMaideService_zmf_1913040848;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.util.DigestUtils;import org.springframework.web.bind.annotation.PostMapping;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.servlet.ModelAndView;/*** @ProjectName : sb_book20211007* @ClassName : ControllerByMaide* @Description : 请描述该类的功能
* @author : zmf* @Date : 2021/10/31 16:54* @version v1.0* Copyright (c) All Rights Reserved,中北大学朱梦飞,. */@Controller@RequestMapping("maide")public class ControllerByMaide_zmf_1913040848 {@Autowiredprivate IMaideService_zmf_1913040848 IMS;@RequestMapping("mdenglv")public ModelAndView mdenglv(){ModelAndView mv=new ModelAndView();mv.setViewName("/maide/mdenglv");return mv;}@PostMapping("myanzheng")public String myanzheng(String mname,String mpassword){String mpw=IMS.yanzheng_zmf_1913040848(mname);System.out.println("-->"+mpw);String mpws= DigestUtils.md5DigestAsHex(mpassword.getBytes());if(mpws.equals(mpw)){return "redirect:/book/mg?b=1";}return "redirect:/maide/mdenglv?a=1";}}

nuczmfspringboot.sb_book20211007.controller.ControllerByU_zmf_1913040848

package nuczmfspringboot.sb_book20211007.controller;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/11/5 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************/import nuczmfspringboot.sb_book20211007.Service.IUBookService_zmf_1913040848;import nuczmfspringboot.sb_book20211007.Service.IUserService_zmf_1913040848;import nuczmfspringboot.sb_book20211007.Service.IZBookService_zmf_1913040848;import nuczmfspringboot.sb_book20211007.entily.UBook_zmf_1913040848;import nuczmfspringboot.sb_book20211007.entily.Zbook_zmf_1913040848;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.PostMapping;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.servlet.ModelAndView;import java.text.SimpleDateFormat;import java.util.ArrayList;import java.util.Date;import java.util.List;/*** @ProjectName : sb_book20211007* @ClassName : ControllerByU* @Description : 请描述该类的功能
* @author : zmf* @Date : 2021/11/5 11:18* @version v1.0* Copyright (c) All Rights Reserved,中北大学朱梦飞,. */@Controller@RequestMapping("book")public class ControllerByU_zmf_1913040848 {@Autowiredprivate IZBookService_zmf_1913040848 IBS;@Autowiredprivate IUserService_zmf_1913040848 IUS;@Autowiredprivate IUBookService_zmf_1913040848 IUBS;ModelAndView mv=new ModelAndView();@RequestMapping("ug")public ModelAndView ug(int x,int uid){String yemian ="booktuijian";String blei="玄幻";List<Zbook_zmf_1913040848> zbooks1 =new ArrayList<>();switch (x){case 1:yemian="booktuijian";List<Zbook_zmf_1913040848> zks =IBS.allbook_zmf_1913040848();List<Zbook_zmf_1913040848> zbooks=new ArrayList<>();for(Zbook_zmf_1913040848 zbook:zks){if(zbook.getbshu_zmf_1913040848()>1000){zbooks.add(zbook);}}mv.addObject("zbooks",zbooks);System.out.println(zbooks);break;case 2: yemian="bookxuanhuang";zbooks1 =IBS.allbookbyblei_zmf_1913040848(blei);mv.addObject("zbooks",zbooks1);break;case 3: yemian="bookxiuz";blei="修真";zbooks1 =IBS.allbookbyblei_zmf_1913040848(blei);mv.addObject("zbooks",zbooks1);break;case 4: yemian="bookyin";blei="异能";zbooks1 =IBS.allbookbyblei_zmf_1913040848(blei);mv.addObject("zbooks",zbooks1);break;case 5: yemian="bookchuanye";blei="穿越";zbooks1 =IBS.allbookbyblei_zmf_1913040848(blei);mv.addObject("zbooks",zbooks1);break;case 6: yemian="bookzongcai";blei="总裁";zbooks1 =IBS.allbookbyblei_zmf_1913040848(blei);mv.addObject("zbooks",zbooks1);break;case 7: yemian="bookgongdou";blei="宫斗";zbooks1 =IBS.allbookbyblei_zmf_1913040848(blei);mv.addObject("zbooks",zbooks1);break;case 8: yemian="booklishi";blei="历史";zbooks1 =IBS.allbookbyblei_zmf_1913040848(blei);mv.addObject("zbooks",zbooks1);break;case 9: yemian="bookjuns";blei="军事";zbooks1 =IBS.allbookbyblei_zmf_1913040848(blei);mv.addObject("zbooks",zbooks1);break;case 10: yemian="bookwenhua";blei="文化";zbooks1 =IBS.allbookbyblei_zmf_1913040848(blei);mv.addObject("zbooks",zbooks1);break;case 11: yemian="bookchaxun";break;case 12: yemian="bookshujia";break;}mv.setViewName("/book/ug");mv.addObject("uid",uid);mv.addObject("yemian",yemian);return mv;}@PostMapping("addshujia")public ModelAndView addshujia(int bid,int bus,int uid){Zbook_zmf_1913040848 zbook=IBS.allbookbybid_zmf_1913040848(bid);int x=0;if(zbook.getblei_zmf_1913040848().equals("推荐")){x=1;}if(zbook.getblei_zmf_1913040848().equals("玄幻")){x=2;}if(zbook.getblei_zmf_1913040848().equals("修真")){x=3;}if(zbook.getblei_zmf_1913040848().equals("异能")){x=4;}if(zbook.getblei_zmf_1913040848().equals("穿越")){x=5;}if(zbook.getblei_zmf_1913040848().equals("总裁")){x=6;}if(zbook.getblei_zmf_1913040848().equals("宫斗")){x=7;}if(zbook.getblei_zmf_1913040848().equals("历史")){x=8;}if(zbook.getblei_zmf_1913040848().equals("军事")){x=9;}if(zbook.getblei_zmf_1913040848().equals("文化")){x=10;}System.out.println(zbook.getbfengmian_zmf_1913040848());UBook_zmf_1913040848 uBookZmf1913040848 =new UBook_zmf_1913040848(zbook.getbid_zmf_1913040848(),zbook.getbname_zmf_1913040848(),zbook.getblei_zmf_1913040848(),zbook.getbpice_zmf_1913040848(),bus,zbook.getbfengmian_zmf_1913040848(),uid,"购物车",null);if(IUBS.addubook_zmf_1913040848(uBookZmf1913040848)){mv.addObject("f",1);}else {mv.addObject("f",2);}mv=ug(x,uid);return mv;}@RequestMapping("bookshujias")public ModelAndView bookshujias(int uid){List<UBook_zmf_1913040848> ubooks1=IUBS.allubookbybuidandbstate_zmf_1913040848(uid,"购物车");List<UBook_zmf_1913040848> ubooks2=IUBS.allubookbybuidandbstate_zmf_1913040848(uid,"已购");mv.addObject("ubooks1",ubooks1);mv.addObject("ubooks2",ubooks2);mv=ug(12,uid);return mv;}@RequestMapping("ubookdelete")public ModelAndView ubookdelete(int uid,int bid){boolean c=IUBS.ubookdelete_zmf_1913040848(uid,bid);System.out.println(c);mv = bookshujias(uid);return mv;}@RequestMapping("ubookupdata")public ModelAndView ubookupdata(int uid,int bid){String bstate="已购";String fileName = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());System.out.println(fileName);UBook_zmf_1913040848 uBookZmf1913040848 =IUBS.allubookbyuidanbid_zmf_1913040848(uid, bid);Zbook_zmf_1913040848 zbook=IBS.allbookbybid_zmf_1913040848(bid);int bshu=zbook.getbshu_zmf_1913040848()- uBookZmf1913040848.getbshu_zmf_1913040848();zbook.setbshu_zmf_1913040848(bshu);boolean t=IBS.updatebook_zmf_1913040848(zbook);boolean c=IUBS.ubookupdata_zmf_1913040848(uid,bid,bstate,fileName);System.out.println(c+"--->"+t);mv = bookshujias(uid);return mv;}@RequestMapping("ubookupdatabyjia")public ModelAndView ubookupdatabyjia(int uid,int bid,int bshu){bshu++;boolean c = IUBS.ubookupdatabyshu_zmf_1913040848(uid,bid,bshu);System.out.println(c);mv = bookshujias(uid);return mv;}@RequestMapping("ubookupdatabyjian")public ModelAndView ubookupdatabyjian(int uid,int bid,int bshu){bshu--;System.out.println(uid+"-->"+bid+"-->"+bshu);boolean c = IUBS.ubookupdatabyshu_zmf_1913040848(uid,bid,bshu);System.out.println(c);mv = bookshujias(uid);return mv;}@RequestMapping("bookchaxuns")public  ModelAndView bookchaxuns(String bpice1,String bpice2,String blei,String bname){List<Zbook_zmf_1913040848> zbooks=new ArrayList<>();if(!bpice1.equals("0")&&!bpice2.equals("0")){double bpice3=Double.valueOf(bpice1);double bpice4=Double.valueOf(bpice2);if(bpice3<bpice4){zbooks=IBS.allbookbybpice1_zmf_1913040848(bpice3,bpice4);}}return null;}}

nuczmfspringboot.sb_book20211007.controller.Controllerbyuser_zmf_1913040848

package nuczmfspringboot.sb_book20211007.controller;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/10/7 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************/import nuczmfspringboot.sb_book20211007.Service.IUserService_zmf_1913040848;import nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.PostMapping;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.servlet.ModelAndView;import java.util.List;/*** @ProjectName : sb_book20211007* @ClassName : controller* @Description : 请描述该类的功能
* @author : zmf* @Date : 2021/10/7 21:13* @version v1.0* Copyright (c) All Rights Reserved,中北大学朱梦飞,. */@Controllerpublic class Controllerbyuser_zmf_1913040848 {@Autowiredprivate IUserService_zmf_1913040848 IUS;@RequestMapping("/denglv")public ModelAndView denglv(){ModelAndView mv=new ModelAndView();mv.setViewName("/denglv");return mv;}@PostMapping("/denglvs")public  ModelAndView denglvs(String uname,String upassword){List<User_zmf_1913040848> users =IUS.alluserbyuname_zmf_1913040848(uname);int uid=0;ModelAndView mv=new ModelAndView();for(User_zmf_1913040848 user:users){if(user.getupassword_zmf_1913040848().equals(upassword)){uid=user.getuid_zmf_1913040848();}}if(uid==0){mv=denglvout();return mv;}mv.setViewName("redirect:/book/ug?x=1&uid="+uid);return mv;}@RequestMapping("/denglvout")public ModelAndView denglvout(){ModelAndView mv=new ModelAndView();mv.setViewName("/denglvout");return mv;}@RequestMapping("/zhuce")public ModelAndView zhuce(){ModelAndView mv=new ModelAndView();mv.setViewName("/zhuce");return mv;}@PostMapping("zhuces")public  ModelAndView zhuces(String uname,String upassword){ModelAndView mv=new ModelAndView();List<User_zmf_1913040848> users=IUS.alluserbyuname_zmf_1913040848(uname);int x=0;for (User_zmf_1913040848 user:users){if(user.getuname_zmf_1913040848().equals(uname)){x++;}}if (x == 0) {if(IUS.insertuser_zmf_1913040848(uname,upassword)){mv.addObject("a",1);mv.setViewName("/denglv");return mv;}else {mv.addObject("a",2);mv.setViewName("/denglv");return mv;}}else {mv.addObject("a",3);mv.setViewName("/zhuce");return mv;}}}

nuczmfspringboot.sb_book20211007.controller.ControllerByusers_zmf_1913040848

package nuczmfspringboot.sb_book20211007.controller;/*** ************************************************************************* 项目名称: sb_book20211007 <br/>* 文件名称<br/>* 文件描述: 这里添加您的类文件描述,说明当前文件要包含的功能。 <br/>* 文件创建:zmf <br/>* 创建时间: 2021/11/7 <br/>* 中北大学朱梦飞 Copyright (c) All Rights Reserved. <br/>** @version v1.0 <br/>* @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>* *************************************************************************/import nuczmfspringboot.sb_book20211007.Service.IUserService_zmf_1913040848;import nuczmfspringboot.sb_book20211007.entily.User_zmf_1913040848;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.PostMapping;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.servlet.ModelAndView;/*** @ProjectName : sb_book20211007* @ClassName : ControllerByusers* @Description : 请描述该类的功能
* @author : zmf* @Date : 2021/11/7 16:15* @version v1.0* Copyright (c) All Rights Reserved,中北大学朱梦飞,. */@Controller@RequestMapping("user")public class ControllerByusers_zmf_1913040848 {@Autowiredprivate IUserService_zmf_1913040848 IUS;@RequestMapping("ugerenz")public ModelAndView ugerenz(int uid){ModelAndView mv=new ModelAndView();User_zmf_1913040848 user=IUS.userbyuid_zmf_1913040848(uid);mv.addObject("user",user);mv.setViewName("/user/ugerenz");return mv;}@PostMapping("xiugaimi")public ModelAndView xiugaim(int uid,String mima,String queren){ModelAndView mv=new ModelAndView();if(mima.equals(queren)){System.out.println("---<>");if(IUS.updatepassword_zmf_1913040848(uid,mima)){mv.setViewName("redirect:/denglv");return mv;}else {return ugerenz(uid);}}else {return ugerenz(uid);}}@PostMapping("xiugaigeren")public ModelAndView xiugaigeren(int uid,String uxingm,String usex,int uage,String uqq,int utem,String uemail){User_zmf_1913040848 user1=IUS.userbyuid_zmf_1913040848(uid);User_zmf_1913040848 user=new User_zmf_1913040848(uid,user1.getuname_zmf_1913040848(),user1.getupassword_zmf_1913040848(),uxingm,uage,usex,uqq,utem,uemail);System.out.println(IUS.userupdate_zmf_1913040848(user));return ugerenz(uid);}}

denglv.jsp

<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%><html><HEAD><title>图书管理登陆页面</title><link href="css/denglv.css" rel=stylesheet><script>function tan1() {var x=0;x= ${a};if(x==1){alert("注册成功!");}if(x==2){alert("注册失败!");}}</script></HEAD><body onpageshow="tan1()"><div class="quanjv"><div class="gg"></div><div class="biaoti" id="denglvye">图书管理系统登陆页面</div><div class="biaodan" id="denglvb"><form action="denglvs" method="post"><table border="1" cellspacing="0"><tr><td>账号:</td><td><input type="text" name="uname"/></td></tr><tr><td>密码:</td><td><input type="password" name="upassword"></td></tr><tr><td colspan="2">&nbsp;&nbsp;<input type="submit" value="登录"/>&nbsp;<button><a href="../maide/mdenglv" style="text-decoration: none">管理员登录</a> </button>&nbsp;<input type="reset" value="重置"></td></tr></table></form><div style="text-align: center">点击这里☞<a href="/zhuce">注册</a></div></div></div></body></html>

denglvout.jsp

<%--Created by IntelliJ IDEA.User: zmfDate: 2021/10/8Time: 9:34To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" language="java" %><html><head><title>登陆错误</title><script>function tiaozhuang() {location.replace("denglv");}</script><link href="css/denglvout.css" rel="stylesheet"/></head><body><div class="a"><img src="=475793710,2163330819&fm=26&fmt=auto"></div><div class="b">用户名或密码错误,请重新登陆。 <br><button type="button" onclick="tiaozhuang()">返回</button></div></body></html>

zhuce.jsp

  <%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%><html><HEAD><title>图书管理注册页面</title><link href="css/denglv.css" rel=stylesheet><style>a:link{text-decoration: none;}</style><script>function tan2() {var x=0;x=${a};if(x==3){alert("账户名已被占用!")}}</script></HEAD><body onpageshow="tan2()"><div class="quanjv"><div class="gg"></div><div class="biaoti" id="zhuye">图书管理系统注册页面</div><div class="biaodan" id="zhuceb"><form action="/zhuces" method="post"><table border="1" cellspacing="0"><tr><td>账号:</td><td><input type="text" name="uname"/></td></tr><tr><td>密码:</td><td><input type="password" name="upassword"></td></tr><tr><td colspan="2">&nbsp;&nbsp;<input type="submit" value="注册"/>&nbsp;<input type="reset" value="重置">&nbsp;<button><a href="/denglv">返回</a></button></td></tr></table></form></div></div></body></html>

book/ug.jsp

<%--Created by IntelliJ IDEA.User: zmfDate: 2021/10/8Time: 11:04To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri=""%><html><head><title>显示全部图书</title></head><body><jsp:include page="bookhead.jsp"></jsp:include><div STYLE="color: #CCE6FF"><c:out value="${yemian}"></c:out></div><div style="height: 100%"><jsp:include page="${yemian}.jsp"></jsp:include>
<jsp:include page="bookleft.jsp"></jsp:include></div></body></html>

book/bookhead.jsp

<%--Created by IntelliJ IDEA.User: zmfDate: 2021/10/9Time: 16:58To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="javax.servlet.http.Cookie" %>
<%@ taglib prefix="c" uri=""%><html><head><link rel="stylesheet" type="text/css" href="../jquery-easyui-1.8.6/themes/default/easyui.css"><link rel="stylesheet" type="text/css" href="../jquery-easyui-1.8.6/themes/icon.css"><link href="../css/head.css" rel=stylesheet><title>网页头</title><script type="text/javascript" >function cook() {<%Cookie c = new Cookie("username","helloweenvsfei");   // 新建Cookiec.setMaxAge(0);                          // 设置生命周期为0,不能为负数response.addCookie(c);%>}</script></head><body><div class="quan"><div class="biao"><img src="../jpg/biao.jpg" style="width: 27px;height: 27px;"></div><div class="ming">发际线保护组织</div><div class="user"><c:out value="${user.uname_zmf_1913040848}"></c:out>&nbsp;&nbsp;<a class="easyui-linkbutton l-btn l-btn-small" href="../user/ugerenz?uid=${uid}" style="width: 80px">个人中心</a>&nbsp;<a class="easyui-linkbutton l-btn l-btn-small" href="../denglv" onclick="cook()" style="width: 80px">退出</a></div></div></body></html>

book/bookleft.jsp

<%--Created by IntelliJ IDEA.User: zmfDate: 2021/10/9Time: 22:09To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" language="java" %><html><head><title>菜单栏</title><link href="../css/bookleft.css" rel=stylesheet><script>function ff() {var x=0;x=${f};if(x==1){document.getElementById("shujia").style.display="";}if(x==2){alert("加入错误!")}}</script><style>.shujia{position:absolute;background: red;width: 10px;height: 10px;border-radius: 5px;right: 0;}</style></head><body onpageshow="ff()"><div style="height: 100%"><ul><div class="ca"><li>菜单栏</li></div><li><a href="/book/ug?x=1&uid=${uid}">推荐图书</a></li><li><span>分类图书</span><div class="ct"><div class="ctn"><a>男生</a><div class="ctn-drop"><a  href="/book/ug?x=2&uid=${uid}">玄幻</a><a  href="/book/ug?x=3&uid=${uid}">修真</a><a  href="/book/ug?x=4&uid=${uid}">异能</a></div></div><div class="ctw"><a >女生</a><div class="ctw-drop"><a href="/book/ug?x=5&uid=${uid}">穿越</a><a href="/book/ug?x=6&uid=${uid}">总裁</a><a href="/book/ug?x=7&uid=${uid}">宫斗</a></div></div><div class="ctc"><a>出版读物</a><div class="ctc-drop"><a href="/book/ug?x=8&uid=${uid}">历史</a><a href="/book/ug?x=9&uid=${uid}">军事</a><a href="/book/ug?x=10&uid=${uid}">文化</a></div></div></div></li><li><a href="/book/ug?x=11&uid=${uid}">查询图书</a></li><li><a href="/book/bookshujias?uid=${uid}"><div class="shujia" style="display: none;"></div>我的书架</a></li><li class="kf"><a href="">在线客服</a></li></ul></div></body></html>

book/booktuijian.jsp

<%--Created by IntelliJ IDEA.User: zmfDate: 2021/10/10Time: 14:03To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri=""%><html><head><title>Title</title><link href="../css/tuijian.css" rel=stylesheet><script>function init() {setInterval("changeImg()",5000);}var i=2;function changeImg() {i++;document.getElementById("lunbotu").src="../jpg/"+i+".jpg";if(i==4){i=1;}}</script><style>a:link{text-decoration: none;}img{margin: auto;height: 200px;width: 150px;}.book{font-family: 幼圆;font-size: 15px;text-align: center;}.books{display: flex;flex-direction: row;flex-wrap: wrap;justify-content:left;align-items:baseline;}.bookss{width: 210px;height: 350px;border: 30px solid transparent;}</style></head><body onpageshow="init()"><div class="quanc" style="background-image: url('../jpg/tuijian.jpg'); background-repeat:no-repeat;background-size: 100% 100% "><div class="biaoti"><h3>推荐页面</h3></div><div class="lunzhuang"><img id="lunbotu" src="../jpg/2.jpg" style="height: 100%"></div><div class="books"><c:forEach items="${zbooks}" var="zbooks" varStatus="sta"><div class="bookss"><img src="${zbooks.bfengmian_zmf_1913040848}" alt="封面无法显示" title="封面"/><div class="book">编号:<c:out value="${zbooks.bid_zmf_1913040848}"></c:out><div class="name" title="类别:${zbooks.blei_zmf_1913040848}"><c:out value="${zbooks.bname_zmf_1913040848}"></c:out></div><div title="价格"><c:out value="${zbooks.bpice_zmf_1913040848}"></c:out>元</div><br><form action="/book/addshujia" method="post"><input type="number" value="${zbooks.bid_zmf_1913040848}" style="display: none" name="bid"><input type="number" name="bus" style="width: 40px"><input type="number" value="${uid}" style="display: none" name="uid"><input type="submit" value="加入书架"></form></div></div></c:forEach></div></div></body></html>

book/bookxiuz.jsp

<%--Created by IntelliJ IDEA.User: zmfDate: 2021/10/10Time: 14:03To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri=""%><html><head><title>Title</title><link href="../css/tuijian.css" rel=stylesheet><script>function init() {setInterval("changeImg()",5000);}var i=2;function changeImg() {i++;document.getElementById("lunbotu").src="../jpg/"+i+".jpg";if(i==4){i=1;}}</script><style>a:link{text-decoration: none;}img{margin: auto;height: 200px;width: 150px;}.book{font-family: 幼圆;font-size: 15px;text-align: center;}.books{display: flex;flex-direction: row;flex-wrap: wrap;justify-content:left;align-items:baseline;}.bookss{width: 210px;height: 350px;border: 30px solid transparent;}</style></head><body onpageshow="init()"><div class="quanc" style="background-image: url('../jpg/nansheng.jpg'); background-repeat:no-repeat;background-size: 100% 100% "><div class="biaoti"><h3>男生-修真页面</h3></div><div class="lunzhuang"><img id="lunbotu" src="../jpg/2.jpg" style="height: 100%"></div><div class="books"><c:forEach items="${zbooks}" var="zbooks" varStatus="sta"><div class="bookss"><img src="${zbooks.bfengmian_zmf_1913040848}" alt="封面无法显示" title="封面"/><div class="book">编号:<c:out value="${zbooks.bid_zmf_1913040848}"></c:out><div class="name" title="类别:${zbooks.blei_zmf_1913040848}"><c:out value="${zbooks.bname_zmf_1913040848}"></c:out></div><div title="价格"><c:out value="${zbooks.bpice_zmf_1913040848}"></c:out>元</div><br><form action="/book/addshujia" method="post"><input type="number" value="${zbooks.bid_zmf_1913040848}" style="display: none"><input type="number" name="bus" style="width: 40px"><input type="number" value="${uid}" style="display: none"><input type="submit" value="加入书架"></form></div></div></c:forEach></div></div></body></html>

book/bookgongdou.jsp

<%--Created by IntelliJ IDEA.User: zmfDate: 2021/10/10Time: 14:03To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri=""%><html><head><title>Title</title><link href="../css/tuijian.css" rel=stylesheet><script>function init() {setInterval("changeImg()",5000);}var i=2;function changeImg() {i++;document.getElementById("lunbotu").src="../jpg/"+i+".jpg";if(i==4){i=1;}}</script><style>a:link{text-decoration: none;}img{margin: auto;height: 200px;width: 150px;}.book{font-family: 幼圆;font-size: 15px;text-align: center;}.books{display: flex;flex-direction: row;flex-wrap: wrap;justify-content:left;align-items:baseline;}.bookss{width: 210px;height: 350px;border: 30px solid transparent;}</style></head><body onpageshow="init()"><div class="quanc" style="background-image: url('../jpg/nvsheng.jpg'); background-repeat:no-repeat;background-size: 100% 100% "><div class="biaoti"><h3>女生-宫斗页面</h3></div><div class="lunzhuang"><img id="lunbotu" src="../jpg/2.jpg" style="height: 100%"></div><div class="books"><c:forEach items="${zbooks}" var="zbooks" varStatus="sta"><div class="bookss"><img src="${zbooks.bfengmian_zmf_1913040848}" alt="封面无法显示" title="封面"/><div class="book">编号:<c:out value="${zbooks.bid_zmf_1913040848}"></c:out><div class="name" title="类别:${zbooks.blei}"><c:out value="${zbooks.bname_zmf_1913040848}"></c:out></div><div title="价格"><c:out value="${zbooks.bpice_zmf_1913040848}"></c:out>元</div><br><form action="/book/addshujia" method="post"><input type="number" value="${zbooks.bid_zmf_1913040848}" style="display: none"><input type="number" name="bus" style="width: 40px"><input type="number" value="${uid}" style="display: none"><input type="submit" value="加入书架"></form></div></div></c:forEach></div></div></body></html>

book/bookwenhua.jsp

<%--Created by IntelliJ IDEA.User: zmfDate: 2021/10/10Time: 14:03To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri=""%><html><head><title>Title</title><link href="../css/tuijian.css" rel=stylesheet><script>function init() {setInterval("changeImg()",5000);}var i=2;function changeImg() {i++;document.getElementById("lunbotu").src="../jpg/"+i+".jpg";if(i==4){i=1;}}</script><style>a:link{text-decoration: none;}img{margin: auto;height: 200px;width: 150px;}.book{font-family: 幼圆;font-size: 15px;text-align: center;}.books{display: flex;flex-direction: row;flex-wrap: wrap;justify-content:left;align-items:baseline;}.bookss{width: 210px;height: 350px;border: 30px solid transparent;}</style></head><body onpageshow="init()"><div class="quanc" style="background-image: url('../jpg/wenhua.jpg'); background-repeat:no-repeat;background-size: 100% 100% "><div class="biaoti"><h3>名著-文化页面</h3></div><div class="lunzhuang"><img id="lunbotu" src="../jpg/2.jpg" style="height: 100%"></div><div class="books"><c:forEach items="${zbooks}" var="zbooks" varStatus="sta"><div class="bookss"><img src="${zbooks.bfengmian_zmf_1913040848}" alt="封面无法显示" title="封面"/><div class="book">编号:<c:out value="${zbooks.bid_zmf_1913040848}"></c:out><div class="name" title="类别:${zbooks.blei_zmf_1913040848}"><c:out value="${zbooks.bname_zmf_1913040848}"></c:out></div><div title="价格"><c:out value="${zbooks.bpice_zmf_1913040848}"></c:out>元</div><br><form action="/book/addshujia" method="post"><input type="number" value="${zbooks.bid_zmf_1913040848}" style="display: none"><input type="number" name="bus" style="width: 40px"><input type="number" value="${uid}" style="display: none"><input type="submit" value="加入书架"></form></div></div></c:forEach></div></div></body></html>

book/bookchuanye.jsp

book/bookjuns.jsp

book/booklishi.jsp

book/bookxuanhuang.jsp

book/bookyin.jsp

book/bookzongcai.jsp

同上

book/bookshujia.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri=""%><html><head><title>我的书架</title><link href="../css/tuijian.css" rel=stylesheet><link href="../css/shujia.css" rel=stylesheet><SCRIPT>function weig() {document.getElementById("yigz").style.display="none";document.getElementById("weigz").style.display="block";}function yig() {document.getElementById("weigz").style.display="none";document.getElementById("yigz").style.display="block";}function quanb() {document.getElementById("weigz").style.display="block";document.getElementById("yigz").style.display="block";}</SCRIPT></head><body><div class="quanc"><div class="taitou"><div class="quanbu" id="quanbu" onclick="quanb()">全部图书</div><div class="weig" id="weig" onclick="weig()">未购图书</div><div class="yig" id="yig" onclick="yig()">已购图书</div></div ><div class="weigz"id="weigz"><div style="font-family: 华文彩云;font-size: 30px;color: #1e282c;background: #CCE6FF;border-left: 10px #0c7cd5 solid;font-weight: bolder" class="as">未购图书</div><c:forEach items="${ubooks1}" var="ubooks1" varStatus="sta"><div class="kong"></div><div class="qian"><div class="fenm"><img src="${ubooks1.bfengmain_zmf_1913040848}" style="margin: 0 auto;"></div><div class="kongz"></div><div class="tusm">图书名称:<br><c:out value="${ubooks1.bname_zmf_1913040848}"></c:out></div><div class="kongz"></div><div class="lei">图书类别:<br><c:out value="${ubooks1.blei_zmf_1913040848}"></c:out></div><div class="kongz"></div><div class="jiag">图书价格:<br>¥<c:out value="${ubooks1.bpice_zmf_1913040848}"></c:out></div><div class="kongz"></div><div class="shu"><div class="jia"><a href="/book/ubookupdatabyjian?uid=${ubooks1.buid_zmf_1913040848}&bid=${ubooks1.bid_zmf_1913040848}&bshu=${ubooks1.bshu_zmf_1913040848}">-</a></div><div class="shuz"><c:out value="${ubooks1.bshu_zmf_1913040848}"></c:out></div><div class="jia"><a href="/book/ubookupdatabyjia?uid=${ubooks1.buid_zmf_1913040848}&bid=${ubooks1.bid_zmf_1913040848}&bshu=${ubooks1.bshu_zmf_1913040848}">+</a></div></div><div class="kongz"></div><div class="zongjia">总价:<br>¥<c:out value="${ubooks1.bpice_zmf_1913040848*ubooks1.bshu_zmf_1913040848}"></c:out></div><div class="kongz"></div><div class="caoz"><button><a href="/book/ubookdelete?uid=${ubooks1.buid_zmf_1913040848}&bid=${ubooks1.bid_zmf_1913040848}">删除</a></button><button><a href="/book/ubookupdata?uid=${ubooks1.buid_zmf_1913040848}&bid=${ubooks1.bid_zmf_1913040848}">购买</a> </button></div></div><div class="kong"></div></c:forEach></div><div class="weigz" id="yigz"><div style="font-family: 华文彩云;font-size: 30px;color: #1e282c;background: #CCE6FF;border-left: 10px #0c7cd5 solid;font-weight: bolder"class="as1">已购图书</div><c:forEach items="${ubooks2}" var="ubooks2" varStatus="sta"><div class="kong"></div><div class="qian"><div class="fenm"><img src="${ubooks2.bfengmain_zmf_1913040848}"></div><div class="kongz"></div><div><div class="ts">图书名称:<br><c:out value="${ubooks2.bname_zmf_1913040848}"></c:out></div></div><div class="kongz"></div><div class="tsz">图书类别:<br><c:out value="${ubooks2.blei_zmf_1913040848}"></c:out></div><div class="kongz"></div><div class="tsz">图书价格:<br>¥<c:out value="${ubooks2.bpice_zmf_1913040848}"></c:out></div><div class="kongz"></div><div class="tsz"><div>购买数量:<br><c:out value="${ubooks2.bshu_zmf_1913040848}"></c:out></div></div><div class="kongz"></div><div class="tsz">总价:<br>¥<c:out value="${ubooks2.bpice_zmf_1913040848*ubooks2.bshu_zmf_1913040848}"></c:out></div><div class="kongz"></div><div class="tsz"><button><a href="/book/ubookdelete?uid=${ubooks2.buid_zmf_1913040848}&bid=${ubooks2.bid_zmf_1913040848}">删除记录</a></button></div></div><div class="kong"></div></c:forEach></div></div></body></html>

book/bookchaxun.jsp

<%--Created by IntelliJ IDEA.User: zmfDate: 2021/10/10Time: 14:03To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri=""%><html><head><title>Title</title><link href="../css/tuijian.css" rel=stylesheet><style>a:link{text-decoration: none;}img{margin: auto;height: 200px;width: 150px;}.book{font-family: 幼圆;font-size: 15px;text-align: center;}.books{display: flex;flex-direction: row;flex-wrap: wrap;justify-content:left;align-items:baseline;}.bookss{width: 210px;height: 350px;border: 30px solid transparent;}</style></head><body><div class="quanc" style="background-image: url('../jpg/tuijian.jpg'); background-repeat:no-repeat;background-size: 100% 100% "><div class="biaoti"><h3>查询页面</h3></div><form action="/book/bookchaxuns" method="post"><div style="height: 28px;width: 100%;background: #6ab8f7;display: flex; font-size: 23px;border-left: 5px #0c7cd5 solid"><div style="width: 8%;text-align: center;">价格区间:</div><div style="width: 8%;height: 28px; margin-top: auto;margin-bottom: auto;"><input type="text" name="bpice1" value="0" style="width: 30px">~<input type="text" name="bpice2" value="0" style="width: 30px"></div><div style="width: 8%;text-align: center">图书类别:</div><div style="width: 8%;height: 28px;margin-top: auto;margin-bottom: auto;"><select name="blei" size="1"><option value="玄幻" selected>玄幻</option><option value="修真">修真</option><option value="异能">异能</option><option value="穿越">穿越</option><option value="总裁">总裁</option><option value="宫斗">宫斗</option><option value="历史">历史</option><option value="军事">军事</option><option value="文化">文化</option></select></div><div style="width: 8%;text-align: center;">图书名称:</div><div style="width: 8%;height: 28px;margin-top: auto;margin-bottom: auto;" ><input type="text" name="bname" style="width: 100px;"></div><div style="width: 8%;text-align: center;"><input type="submit" value="查询" ></div></div></form><div class="books"><c:forEach items="${zbooks}" var="zbooks" varStatus="sta"><div class="bookss"><img src="${zbooks.bfengmian_zmf_1913040848}" alt="封面无法显示" title="封面"/><div class="book">编号:<c:out value="${zbooks.bid_zmf_1913040848}"></c:out><div class="name" title="类别:${zbooks.blei_zmf_1913040848}"><c:out value="${zbooks.bname_zmf_1913040848}"></c:out></div><div title="价格"><c:out value="${zbooks.bpice_zmf_1913040848}"></c:out>元</div><br><form action="/book/addshujia" method="post"><input type="number" value="${zbooks.bid_zmf_1913040848}" style="display: none" name="bid"><input type="number" name="bus" style="width: 40px"><input type="number" value="${uid}" style="display: none" name="uid"><input type="submit" value="加入书架"></form></div></div></c:forEach></div></div></body></html>

user/ugerenz.jsp

<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%><html><head><title>个人中心</title><style>a:link{text-decoration: none;}.kong{width: 100%;height: 20px;}.user{display: none;}.mi{color: indigo}.mi:hover{cursor: pointer;color: #CCE6FF;}.ff:hover{color: #CCE6FF;}.shujia:hover{color: #CCE6FF;}</style><script>function xiugai() {document.getElementById("xiu").style.display="block";document.getElementById("jibeng").style.display="none";document.getElementById("jibengx").style.display="none";}function fanhui() {document.getElementById("xiu").style.display="none";document.getElementById("jibeng").style.display="block";document.getElementById("jibengx").style.display="none";}function xiu() {document.getElementById("xiu").style.display="none";document.getElementById("jibeng").style.display="none";document.getElementById("jibengx").style.display="block";}</script></head><body><jsp:include page="../book/bookhead.jsp"></jsp:include><div style="width: 100%;height: 40px;border-left: 10px solid #6ab8f7; background: #6b9cde;display: flex;"><div style="font-family: 华文彩云;font-weight: bolder;font-size: 35px;color: #CCE6FF;width: 150px">个人中心</div><div style="width: 80%"></div><div style="width: 180px;margin: auto;font-weight: bolder"><a href="../book/bookshujias?uid=${user.uid_zmf_1913040848}" style="width: 110px" class="shujia">我的书架</a><a onclick="xiugai()" style="width: 110px;" class="mi">修改密码</a><a href="../book/ug?x=1&uid=${user.uid_zmf_1913040848}" style="width: 60px" class="ff">返回</a></div></div><div class="kong"></div><div style="width: 40%;height: 70%;border: 2px solid black;margin: auto;font-size: 25px;font-family: 新宋体;" id="jibeng"><div style="width: 100%;border-bottom: 1px solid black;font-weight: bolder;font-size: 20px;font-family: 幼圆;height: 30px">基本资料</div><div class="kong"></div><div>账户名:<c:out value="${user.uname_zmf_1913040848}"></c:out></div><div class="kong"></div><div>真实姓名:<c:out value="${user.uxingm_zmf_1913040848}"></c:out></div><div class="kong"></div><div>性别:<c:out value="${user.usex_zmf_1913040848}"></c:out></div><div class="kong"></div><div>年龄:<c:out value="${user.uage_zmf_1913040848}"></c:out></div><div class="kong"></div><div>联系方式:<div class="kong"></div><div style="width: 400px;margin-left: 175px">QQ:<c:out value="${user.uqq_zmf_1913040848}"></c:out></div><div class="kong"></div><div style="width: 400px;margin-left: 150px">电话:<c:out value="${user.utem_zmf_1913040848}"></c:out></div><div class="kong"></div><div style="width: 400px;margin-left: 100px">电子邮箱:<c:out value="${user.uemail_zmf_1913040848}"></c:out></div></div><div style="width: 100px;height:50px;margin-left: auto;margin-right: auto;margin-top: auto; "><button style="width: 70px;height: 30px;font-weight: bolder;font-family: 黑体;font-size: 20px;" onclick="xiu()">修改</button></div></div><div id="xiu" class="xiu" style="width: 400px;height: 200px;margin: auto;border: 2px solid black;display: none"><div style="height: 30px;border-bottom: 1px solid black; text-align: center;font-size: 20px;font-family: 黑体;">修改密码</div><div><form action="/user/xiugaimi" method="post"><div class="kong"></div><input type="number" value="${user.uid_zmf_1913040848}" name="uid" style="display: none"><div>密码:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="mima"></div><div class="kong"></div><div>确认密码:<input type="text" name="queren"></div><div style="height: 50px"></div><div style="width: 150px;height: 25px; bottom: 10px;margin: auto;"><input type="submit" value="修改" style="height: 25px;width: 50px;">&nbsp;&nbsp;&nbsp;&nbsp;<button onclick="fanhui()">返回</button></div></form></div></div><div style="width: 40%;height: 70%;border: 2px solid black;margin: auto;font-size: 25px;font-family: 新宋体;display: none" id="jibengx"><div style="width: 100%;border-bottom: 1px solid black;font-weight: bolder;font-size: 20px;font-family: 幼圆;height: 30px">修改基本资料</div><form action="/user/xiugaigeren" method="post"><div class="kong"></div><div>账户名:<c:out value="${user.uname_zmf_1913040848}"></c:out></div><input type="number" value="${user.uid_zmf_1913040848}" name="uid" style="display: none"><div class="kong"></div><div>真实姓名:<input type="text" value="${user.uxingm_zmf_1913040848}" name="uxingm"></div><div>&nbsp;性别:&nbsp;<select name="usex" size="3"><option value="${user.usex_zmf_1913040848}" selected><c:out value="${user.usex_zmf_1913040848}"></c:out></option><option value="男">男</option><option value="女">女</option></select></div><div class="kong"></div><div>&nbsp;年龄:&nbsp;<input type="number" value="${user.uage_zmf_1913040848}" name="uage">&nbsp;</div><div class="kong"></div><div>联系方式:<div class="kong"></div><div style="width: 400px;margin-left: 175px">QQ:<input type="text" value="${user.uqq_zmf_1913040848}" name="uqq"/></div><div class="kong"></div><div style="width: 400px;margin-left: 150px">电话:<input type="tel" value="${user.utem_zmf_1913040848}" name="utem"/></div><div class="kong"></div><div style="width: 400px;margin-left: 100px">电子邮箱:<input type="email" value="${user.uemail_zmf_1913040848}" name="uemail"></div></div><div class="kong"></div><div style="width: 250px;height:30px;margin-left: auto;margin-right: auto;margin-top: auto; "><input type="submit" value="修改" style="width: 70px;height: 30px;font-weight: bolder;font-family: 黑体;font-size: 20px;">&nbsp;&nbsp;<button onclick="fanhui()" style="width: 70px;height: 30px;font-weight: bolder;font-family: 黑体;font-size: 20px;">返回</button></div></form></div></body></html>

book/mg.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri=""%><html><head><% response.setHeader("Pragma","No-cache");response.setHeader("Cache-Control","no-cache");response.setDateHeader("Expires",0);response.flushBuffer();%><META HTTP-EQUIV = "Pragma" CONTENT = "no-cache"><META HTTP-EQUIV = "Cache-Control" CONTENT = "no-cache"><META HTTP-EQUIV = "Expires" CONTENT = "0"><title>管理员界面</title><script>function tan() {var x=0;x=${a};if(x==1){alert("删除成功!");}if(x==2){alert("删除失败!");}if(x==3){alert("修改失败!");}if(x==4){alert("修改成功!");}}</script></head><body onpageshow="tan()"><jsp:include page="mtoud.jsp"></jsp:include><div class="zz"><jsp:include page="${yemian}.jsp"></jsp:include></div><c:set var="a" value="${0}" scope="request"/></body></html>

book/mtoud.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri=""%><html><head><title>菜单</title></head><style>ul {list-style-type: none;margin: 0;padding: 0;overflow: hidden;background-color: #333;}li {float: left;}li a, .dropbtn {display: inline-block;color: white;text-align: center;padding: 14px 16px;text-decoration: none;}li a:hover, .dropdown:hover, .dropbtn {background-color: #111;}.dropdown {display: inline-block;}.dropdown-content {display: none;position: absolute;background-color: #f9f9f9;min-width: 160px;box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);}.dropdown-content a {color: black;padding: 12px 16px;text-decoration: none;display: block;}.dropdown-content a:hover {background-color: #f1f1f1}.dropdown:hover .dropdown-content {display: block;}</style></head><body><ul><li><a class="active" href="/book/mg?b=1">图书</a></li><li><a href="/book/mg?b=2">用户</a></li><li><div class="dropdown"><a class="dropbtn">查询</a><div class="dropdown-content"><a href="/book/mg?b=3">图书查询</a><a href="/book/mg?b=4">用户查询</a></div></div></li><li><a href="/book/mg?b=11">图书添加</a></li><li><a href="../denglv">退出</a></li></ul></body></html>

book/mbookall.jsp

<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%><html><head><title>图书</title><style>a:link{text-decoration: none;}img{width: 300px;height: 200px;}</style></head><body><table border="1" cellspacing="0" width="100%"><tr style="background: #3d3d3d;font-family: 黑体;color: #CCE6FF;font-size: 30px;text-align: center"><td style="width: 22%">封面</td><td style="width: 8%">图书编号</td><td style="width: 20%">图书名称</td><td style="width: 10%">图书类别</td><td style="width: 10%">图书价格</td><td style="width: 20%">图书数量</td><td style="width: 10%">操作</td></tr><c:forEach items="${zbooks}" var="zbooks" varStatus="sta"><tr style="text-align: center"><td><img src="${zbooks.bfengmian_zmf_1913040848}" rel="图片无法显示"></td><td><c:out value="${zbooks.bid_zmf_1913040848}"></c:out></td><td><a href="/book/xing?b=5&bid=${zbooks.bid_zmf_1913040848}"><c:out value="${zbooks.bname_zmf_1913040848}"></c:out></a> </td><td><c:out value="${zbooks.blei_zmf_1913040848}"></c:out></td><td title="元"><c:out value="${zbooks.bpice_zmf_1913040848}"></c:out></td><td title="本"><c:out value="${zbooks.bshu_zmf_1913040848}"></c:out></td><td><button><a href="/book/bdelete?bid=${zbooks.bid_zmf_1913040848}">删除</a></button><button><a href="/book/bupdate?bid=${zbooks.bid_zmf_1913040848}">修改</a></button></td></tr></c:forEach></table></body></html>

book/mbookx.jsp

<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%><html><head><title>图书</title><style>a:link{text-decoration: none;}img{width: 200px;height: 150px;}.fenmian{width: 200px;height: 150px;}.xiang{position: absolute;top: 60px;left: 230px;height: 150px;}.mulv{position: absolute;top: 230px;}</style></head><body><div class="fenmian"><img src="../jpg/1.jpg"></div><div class="xiang"><table border="1" cellspacing="0"><tr><td>图书名:</td><td><c:out value="${zbook.bname_zmf_1913040848}"></c:out></td><td>作者名:</td><td><c:out value="${zbook.bzuozhe_zmf_1913040848}"></c:out></td></tr><tr><td>价格:</td><td><c:out value="${zbook.bpice_zmf_1913040848}"></c:out></td><td>数量:</td><td><c:out value="${zbook.bshu_zmf_1913040848}"></c:out></td></tr><tr><td>图书简介:</td><td><c:out value="${zbook.bjianjie_zmf_1913040848}"></c:out></td><td>类别:</td><td><c:out value="${zbook.blei_zmf_1913040848}"></c:out></td></tr></table></div><div class="mulv"><table border="1" cellspacing="0"><tr><td>目录</td><td>购买用户</td><td>购买数量</td></tr><tr></tr></table></div></body></html>

user/muserall.jsp

<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%><html><head><title>用户</title><style>a:link{text-decoration: none;}</style></head><body><table border="1" cellspacing="0" width="100%"><tr style="background: #3d3d3d;font-family: 黑体;color: #CCE6FF;font-size: 30px;text-align: center"><td style="width: 8%" rowspan="2">用户编号</td><td style="width: 15%;" rowspan="2">用户账号</td><td style="width: 15%;" rowspan="2">用户密码</td><td style="width: 10%;" rowspan="2">用户姓名</td><td style="width: 7%;" rowspan="2">用户年龄</td><td style="width: 8%;" rowspan="2">用户性别</td><td style="width: 32%" colspan="3">用户联系方式</td><td style="width: 5%;" rowspan="2">操作</td></tr><tr style="background: #5f5f5f;font-family: 黑体;color: #F8F8F8;font-size: 30px;text-align: center"><td style="width: 10%">QQ</td><td style="width: 10%">电话</td><td style="width: 12%">电子邮箱</td></tr><c:forEach items="${users}" var="users" varStatus="sta"><tr style="text-align: center"><td><c:out value="${users.uid_zmf_1913040848}"></c:out></td><td><a href="/book/ugb?uid=${users.uid_zmf_1913040848}" title="用户购买详情"><c:out value="${users.uname_zmf_1913040848}"></c:out></a> </td><td><c:out value="${users.upassword_zmf_1913040848}"></c:out></td><td><c:out value="${users.uxingm_zmf_1913040848}"></c:out></td><td><c:out value="${users.uage_zmf_1913040848}"></c:out></td><td><c:out value="${users.usex_zmf_1913040848}"></c:out></td><td><c:out value="${users.uqq_zmf_1913040848}"></c:out></td><td><c:out value="${users.utem_zmf_1913040848}"></c:out></td><td><c:out value="${users.uemail_zmf_1913040848}"></c:out></td><td><button><a href="/book/userdelete?uid=${users.uid_zmf_1913040848}">删除</a></button><button><a href="/book/userupdate?uid=${users.uid_zmf_1913040848}">修改</a></button></td></tr></c:forEach></table></body></html>

user/muserallx.jsp

<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%><html><head><title>用户</title><style>a:link{text-decoration: none;}</style></head><body><table border="1" cellspacing="0" width="100%"><tr style="background: #3d3d3d;font-family: 黑体;color: #CCE6FF;font-size: 30px;text-align: center"><td style="width: 8%" rowspan="2">用户编号</td><td style="width: 15%;" rowspan="2">用户账号</td><td style="width: 15%;" rowspan="2">用户密码</td><td style="width: 10%;" rowspan="2">用户姓名</td><td style="width: 7%;" rowspan="2">用户年龄</td><td style="width: 8%;" rowspan="2">用户性别</td><td style="width: 32%" colspan="3">用户联系方式</td><td style="width: 5%;" rowspan="2">操作</td></tr><tr style="background: #5f5f5f;font-family: 黑体;color: #F8F8F8;font-size: 30px;text-align: center"><td style="width: 10%">QQ</td><td style="width: 10%">电话</td><td style="width: 12%">电子邮箱</td></tr><tr style="text-align: center"><td><c:out value="${user.uid_zmf_1913040848}"></c:out></td><td><a href="/book/ugb?uid=${user.uid_zmf_1913040848}" title="用户购买详情"><c:out value="${user.uname_zmf_1913040848}"></c:out></a> </td><td><c:out value="${user.upassword_zmf_1913040848}"></c:out></td><td><c:out value="${user.uxingm_zmf_1913040848}"></c:out></td><td><c:out value="${user.uage_zmf_1913040848}"></c:out></td><td><c:out value="${user.usex_zmf_1913040848}"></c:out></td><td><c:out value="${user.uqq_zmf_1913040848}"></c:out></td><td><c:out value="${user.utem_zmf_1913040848}"></c:out></td><td><c:out value="${user.uemail_zmf_1913040848}"></c:out></td><td><button><a href="/book/uaerdelete?uid=${user.uid_zmf_1913040848}">删除</a></button><button><a href="/book/userupdate?uid=${user.uid_zmf_1913040848}">修改</a></button></td></tr></table></body></html>

book/mbookc.jsp

<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%><html><head><title>管理员图书查询</title></head><body><table border="1" cellspacing="0"><form action="/book/cha" method="post"><tr><td>图书编号:<input type="number" value="0" name="bid"></td><td> 图书名称:<input type="text" value="空"  name="bname"></td><td>图书价格:<input type="text" value="0"  name="bpice"></td><td> 图书类别:<select name="blei" size="3"><option value="空" selected>空</option><option value="玄幻">玄幻</option><option value="修真">修真</option><option value="异能">异能</option><option value="穿越">穿越</option><option value="总裁">总裁</option><option value="宫斗">宫斗</option><option value="历史">历史</option><option value="军事">军事</option><option value="文化">文化</option></select></td><td>图书作者:<input type="text" value="空"  name="bzuozhe"></td><td><input type="submit" value="查询"></td></tr></form></table></body></html>

user/muserc.jsp

<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%><html><head><title>管理员用户查询</title></head><body><table border="1" cellspacing="0"><form action="/book/chauser" method="post"><tr><td>用户编号:<input type="number" value="0" name="uid"></td><td>用户账号:<input type="text" value="空"  name="uname"></td><td>用户年龄:<input type="number" value="0"  name="uage"></td><td>用户性别:<select name="usex" size="3"><option value="空" selected>空</option><option value="男">男</option><option value="女">女</option></select></td><td>用户姓名:<input type="text" value="空"  name="uxingm"></td><td><input type="submit" value="查询"></td></tr></form></table></body></html>

book/mbookxiu.jsp

<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%><html><head><title>修改图书信息</title><style>img{width: 300px;height: 200px;}</style></head><body><form action="/book/bupdates" method="post" enctype="multipart/form-data"><input type="number" value="${zbook.bid_zmf_1913040848}" name="bid" style="display: none"/><div class="fenmian"><img src="../jpg/1.jpg"><input type="file" name="bfengmian"/></div><table border="1" cellspacing="0"><tr><td>图书名:</td><td><input type="text" value="${zbook.bname_zmf_1913040848}" name="bname"></td><td>作者名:</td><td><input type="text" value="${zbook.bzuozhe_zmf_1913040848}" name="bzuozhe"></td></tr><tr><td>价格:</td><td><input type="text" value="${zbook.bpice_zmf_1913040848}" name="bpice"></td><td>数量:</td><td><input type="number" value="${zbook.bshu_zmf_1913040848}" name="bshu"></td></tr><tr><td>图书简介:</td><td><input type="text" value="${zbook.bjianjie_zmf_1913040848}" name="bjianjie"></td><td>类别:</td><td><select name="blei" size="3"><option value="${zbook.blei_zmf_1913040848}" selected><c:out value="${zbook.blei_zmf_1913040848}"></c:out></option><option value="玄幻">玄幻</option><option value="修真">修真</option><option value="异能">异能</option><option value="穿越">穿越</option><option value="总裁">总裁</option><option value="宫斗">宫斗</option><option value="历史">历史</option><option value="军事">军事</option><option value="文化">文化</option></select></td></tr></table><input type="submit" value="修改"/></form></body></html>

user/muserxiu.jsp

<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%><html><head><title>修改用户信息</title><style>img{width: 300px;height: 200px;}</style></head><body><form action="/book/userupdates" method="post" ><table border="1" cellspacing="0"><tr><td>用户账户:</td><td><input type="text" value="${user.uname_zmf_1913040848}" name="uname"></td><td>用户姓名:</td><td><input type="text" value="${user.uxingm_zmf_1913040848}" name="uxingm"></td></tr><tr><td>年龄:</td><td><input type="number" value="${user.uage_zmf_1913040848}" name="uage"></td><td>性别:</td><td><select name="usex" size="3"><option value="${user.usex_zmf_1913040848}" selected><c:out value="${user.usex_zmf_1913040848}"></c:out></option><option value="男">男</option><option value="女">女</option></select></td></tr><tr><td>联系方式-移动电话:</td><td><input type="tel" value="${user.utem_zmf_1913040848}" name="utem"></td><td>联系方式-电子邮箱:</td><td><input type="email" value="${user.uemail_zmf_1913040848}" name="uemail"></td><td>联系方式-QQ:</td><td><input type="text" value="${user.uqq_zmf_1913040848}" name="uqq"></td></tr></table><input type="submit" value="修改"/></form></body></html>

book/maddbook.jsp

<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri=""%><html><head><title>添加图书信息</title></head><body><form action="/book/maddbooks" method="post" enctype="multipart/form-data"><table border="1" cellspacing="0"><tr><td>图书名:</td><td><input type="text"  name="bname"></td><td>作者名:</td><td><input type="text"  name="bzuozhe"></td></tr><tr><td>价格:</td><td><input type="text"  name="bpice"></td><td>数量:</td><td><input type="number"  name="bshu"></td></tr><tr><td>图书简介:</td><td><input type="text"  name="bjianjie"></td><td>类别:</td><td><select name="blei" size="3"><option value="玄幻" selected>玄幻</option><option value="修真">修真</option><option value="异能">异能</option><option value="穿越">穿越</option><option value="总裁">总裁</option><option value="宫斗">宫斗</option><option value="历史">历史</option><option value="军事">军事</option><option value="文化">文化</option></select></td></tr><tr><td>上传封面:</td><td> <input type="file" name="bfengmian"/></td><td colspan="2"><input type="submit" value="修改"/></td></tr></table></form></body></html>

6.实验结论及心得

  经过这次实验我感受到shpringboot框架和mybatis的便捷性,极大的提高了编写速度,还大大减低代码重复率,以前每次进行dao层实现的时候都要多次new jdbc的方法来实现,现在直接在接口处注解或者在.Xml文件处配置不但降低了代码重复还降低了耦合,代码修改时没必要进行大量的修改,我结合css和easyui框架完成的前台,前台设计还是比较简陋,还是缺少设计能力和画面构造能力。完成中多次出现bug,最后还是解决了,感谢老师在实验课的具体指导。

更多推荐

springboot+mybetis实验报告

本文发布于:2023-06-29 08:30:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/942130.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报告   springboot   mybetis

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!