目录
项目简介:
需求说明:
项目截图:
1.登录界面
2.管理首页-查看图书
3.图书详情
4.查看读者列表
5.编辑读者信息
6.借还日志
项目源码参考:
项目源码下载:
项目简介:
项目编号:J103
图书借阅管理系统
基于Springboot 2.7 + MyBatis3 的图书馆管理系统。主要功能包括:
图书查询、图书管理、图书编辑、读者管理、图书的借阅与归还以及借还日志记录等。
开发环境:idea 、eclipse 两个都支持
数据库:建议mysql 8,或者mysql 5.7、5.5也可以
需求说明:
用户分为两类:读者、管理员。图书馆管理员可以修改读者信息,修改书目信息,查看所有借还
日志等;读者仅可以修改个人信息、借阅或归还书籍和查看自己的借还日志。
项目截图:
1.登录界面
2.管理首页-查看图书
3.图书详情
4.查看读者列表
5.编辑读者信息
6.借还日志
项目源码参考:
Admin.java
package demo.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
/**
*
* @TableName admin
*/
@TableName(value ="admin")
public class Admin implements Serializable {
/**
*
*/
@TableId
private Long adminId;
/**
*
*/
private String password;
/**
*
*/
private String username;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/**
*
*/
public Long getAdminId() {
return adminId;
}
/**
*
*/
public void setAdminId(Long adminId) {
this.adminId = adminId;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
Admin other = (Admin) that;
return (this.getAdminId() == null ? other.getAdminId() == null : this.getAdminId().equals(other.getAdminId()))
&& (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
&& (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getAdminId() == null) ? 0 : getAdminId().hashCode());
result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", adminId=").append(adminId);
sb.append(", password=").append(password);
sb.append(", username=").append(username);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
AdminMapper.java
package demo.mapper;
import demo.domain.Admin;
/**
* @author Hello
* @description 针对表【admin】的数据库操作Mapper
* @createDate 2023-02-08 10:54:20
* @Entity demo.domain.Admin
*/
public interface AdminMapper {
int deleteByPrimaryKey(Long id);
int insert(Admin record);
int insertSelective(Admin record);
Admin selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(Admin record);
int updateByPrimaryKey(Admin record);
}
AdminMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="demo.mapper.AdminMapper">
<resultMap id="BaseResultMap" type="demo.domain.Admin">
<id property="adminId" column="admin_id" jdbcType="BIGINT"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="username" column="username" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
admin_id,password,username
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from admin
where admin_id = #{adminId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from admin
where admin_id = #{adminId,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="admin_id" keyProperty="adminId" parameterType="demo.domain.Admin" useGeneratedKeys="true">
insert into admin
( admin_id,password,username
)
values (#{adminId,jdbcType=BIGINT},#{password,jdbcType=VARCHAR},#{username,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" keyColumn="admin_id" keyProperty="adminId" parameterType="demo.domain.Admin" useGeneratedKeys="true">
insert into admin
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="adminId != null">admin_id,</if>
<if test="password != null">password,</if>
<if test="username != null">username,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="adminId != null">#{adminId,jdbcType=BIGINT},</if>
<if test="password != null">#{password,jdbcType=VARCHAR},</if>
<if test="username != null">#{username,jdbcType=VARCHAR},</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="demo.domain.Admin">
update admin
<set>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
</set>
where admin_id = #{adminId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="demo.domain.Admin">
update admin
set
password = #{password,jdbcType=VARCHAR},
username = #{username,jdbcType=VARCHAR}
where admin_id = #{adminId,jdbcType=BIGINT}
</update>
</mapper>
项目源码下载:
https://download.csdn.net/download/xia15000506007/87427738