hxy 6 months ago
parent 3d4dd4258f
commit 760bf7611c

42
.gitignore vendored

@ -0,0 +1,42 @@
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# temp file
*.cache
*.diff
*.tmp
#IDEA
.idea/
.idea
*.ipr
*.iml
*.iws
.classpath
.project
.settings/
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
target/
.target
README.md
README.en.md
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="LibraryProject" />
</profile>
</annotationProcessing>
</component>
</project>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="dataSourceStorageLocal" created-in="IU-233.13135.103">
<data-source name="@localhost" uuid="4c50957f-8951-4932-9bae-090816341b45">
<database-info product="MySQL" version="8.0.37" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-j-8.2.0 (Revision: 06a1f724497fd81c6a659131fda822c9e5085b6c)" dbms="MYSQL" exact-version="8.0.37" exact-driver-version="8.2">
<extra-name-characters>#@</extra-name-characters>
<identifier-quote-string>`</identifier-quote-string>
</database-info>
<case-sensitivity plain-identifiers="lower" quoted-identifiers="lower" />
<secret-storage>master_key</secret-storage>
<user-name>root</user-name>
<schema-mapping>
<introspection-scope>
<node kind="schema" qname="@" />
</introspection-scope>
</schema-mapping>
</data-source>
</component>
</project>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="@localhost" uuid="4c50957f-8951-4932-9bae-090816341b45">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://localhost:3306</jdbc-url>
<jdbc-additional-properties>
<property name="com.intellij.clouds.kubernetes.db.host.port" />
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
<property name="com.intellij.clouds.kubernetes.db.container.port" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,2 @@
#n:information_schema
!<md> [null, 0, null, null, -2147483648, -2147483648]

@ -0,0 +1,2 @@
#n:mysql
!<md> [null, 0, null, null, -2147483648, -2147483648]

@ -0,0 +1,2 @@
#n:performance_schema
!<md> [null, 0, null, null, -2147483648, -2147483648]

@ -0,0 +1,2 @@
#n:sys
!<md> [null, 0, null, null, -2147483648, -2147483648]

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
<option name="workspaceImportForciblyTurnedOn" value="true" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="corretto-1.8" project-jdk-type="JavaSDK" />
</project>

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ArtifactsWorkspaceSettings">
<artifacts-to-build>
<artifact name="LibraryProject:war exploded" />
</artifacts-to-build>
</component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="dac93d0a-0542-4002-ae3c-0d607028706f" name="更改" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="LogFilters">
<option name="FILTER_ERRORS" value="false" />
<option name="FILTER_WARNINGS" value="false" />
<option name="FILTER_INFO" value="true" />
<option name="FILTER_DEBUG" value="true" />
<option name="CUSTOM_FILTER" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 3
}</component>
<component name="ProjectId" id="2h2KP2s9U983x7hVJ1I8vaYGlLL" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"Tomcat 服务器.未命名.executor": "Run",
"ignore.virus.scanning.warn.message": "true",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "E:/Code/tushuguan",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"project.structure.last.edited": "项目",
"project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.2",
"settings.editor.selected.configurable": "preferences.lookFeel",
"vue.rearranger.settings.migration": "true"
},
"keyToStringList": {
"DatabaseDriversLRU": [
"mysql"
]
}
}]]></component>
<component name="RunManager">
<configuration name="未命名" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat 8.5.75" ALTERNATIVE_JRE_ENABLED="false" nameIsGenerated="true">
<option name="BROWSER_ID" value="98ca6316-2f89-46d9-a9e5-fa9e2b0625b3" />
<option name="UPDATING_POLICY" value="restart-server" />
<deployment>
<artifact name="LibraryProject:war exploded">
<settings>
<option name="CONTEXT_PATH" value="/LibraryProject_war_exploded" />
</settings>
</artifact>
</deployment>
<server-settings>
<option name="BASE_DIRECTORY_NAME" value="0bb85483-698f-4d5f-b3d6-d2d336f69ac3" />
</server-settings>
<predefined_log_file enabled="true" id="Tomcat" />
<predefined_log_file enabled="true" id="Tomcat Catalina" />
<predefined_log_file id="Tomcat Manager" />
<predefined_log_file id="Tomcat Host Manager" />
<predefined_log_file id="Tomcat Localhost Access" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="7863" />
</RunnerSettings>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Cover">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Debug">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Profile">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<method v="2">
<option name="Make" enabled="true" />
<option name="BuildArtifacts" enabled="true">
<artifact name="LibraryProject:war exploded" />
</option>
</method>
</configuration>
</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="jdk-1.8.0_402-corretto-1.8.0_402-f644763e9732-af3fa2b8" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="默认任务">
<changelist id="dac93d0a-0542-4002-ae3c-0d607028706f" name="更改" comment="" />
<created>1716786704540</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1716786704540</updated>
<workItem from="1716786705564" duration="5659000" />
<workItem from="1716797574385" duration="1911000" />
<workItem from="1716887425711" duration="1268000" />
<workItem from="1717467310860" duration="639000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
</project>

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

@ -0,0 +1,162 @@
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 50733
Source Host : localhost:3306
Source Schema : library
Target Server Type : MySQL
Target Server Version : 50733
File Encoding : 65001
Date: 06/04/2021 13:18:44
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`username` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',
`password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码',
`adminType` int(11) NULL DEFAULT NULL COMMENT '管理员类型',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '管理员' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of admin
-- ----------------------------
INSERT INTO `admin` VALUES (1, 'admin', '12345', 1);
INSERT INTO `admin` VALUES (2, 'yx5411', '12345', 0);
INSERT INTO `admin` VALUES (4, 'xy1221', '12345', 0);
-- ----------------------------
-- Table structure for book_info
-- ----------------------------
DROP TABLE IF EXISTS `book_info`;
CREATE TABLE `book_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图书名称',
`author` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '作者',
`publish` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '出版社',
`isbn` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '书籍编号',
`introduction` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '简介',
`language` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '语言',
`price` double NULL DEFAULT NULL COMMENT '价格',
`publish_date` date NULL DEFAULT NULL COMMENT '出版时间',
`type_id` int(11) NULL DEFAULT NULL COMMENT '书籍类型',
`status` int(11) NULL DEFAULT NULL COMMENT '状态0未借出1已借出',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '图书信息' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of book_info
-- ----------------------------
INSERT INTO `book_info` VALUES (1, '西游记', '施耐庵', '机械工业出版社', '100011', '师徒四人去西天取真经', '中文', 42, '2020-03-20', 1, 0);
INSERT INTO `book_info` VALUES (2, '三国演义', '罗贯中', '清华大学出版社', '100012', '东汉末年分三国。。。', '中文', 48, '2018-03-30', 1, 1);
INSERT INTO `book_info` VALUES (3, '红楼梦', '曹雪芹', '机械工业出版社', '100013', '宝玉与众多男女之间故事', '中文', 39, '2019-04-04', 1, 1);
INSERT INTO `book_info` VALUES (4, '资本论', '马克思', '原子能出版社', '100014', '马克思的剩余价值理论', '英文', 42, '2019-04-05', 5, 0);
INSERT INTO `book_info` VALUES (5, '经济学原理', '马歇尔', '机械工业出版社', '100015', '西方经济学界公认为划时代的著作', '英文', 45, '2020-04-06', 5, 0);
INSERT INTO `book_info` VALUES (6, '大变局下的中国法治', '李卫东', '北京大学出版社', '100016', '十大经典法学著作', '中文', 42, '2015-04-05', 4, 1);
-- ----------------------------
-- Table structure for lend_list
-- ----------------------------
DROP TABLE IF EXISTS `lend_list`;
CREATE TABLE `lend_list` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`bookId` int(11) NULL DEFAULT NULL COMMENT '图书id',
`readerId` int(11) NULL DEFAULT NULL COMMENT '读者id',
`lendDate` datetime(0) NULL DEFAULT NULL COMMENT '借书时间',
`backDate` datetime(0) NULL DEFAULT NULL COMMENT '还书时间',
`backType` int(11) NULL DEFAULT NULL,
`exceptRemarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注信息',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '借阅记录(谁在何时借走了什么书,并且有没有归还,归还时间多少)' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of lend_list
-- ----------------------------
INSERT INTO `lend_list` VALUES (15, 1, 1, '2021-04-04 10:07:31', '2021-04-04 21:09:27', 0, NULL);
INSERT INTO `lend_list` VALUES (36, 2, 2, '2021-04-04 21:48:17', '2021-04-04 21:50:00', 2, NULL);
INSERT INTO `lend_list` VALUES (37, 3, 3, '2021-04-04 21:50:22', '2021-04-04 21:50:32', 3, NULL);
INSERT INTO `lend_list` VALUES (38, 5, 1, '2021-04-05 21:35:35', '2021-04-05 21:35:47', 1, NULL);
INSERT INTO `lend_list` VALUES (39, 6, 3, '2021-04-05 21:42:35', NULL, NULL, NULL);
-- ----------------------------
-- Table structure for notice
-- ----------------------------
DROP TABLE IF EXISTS `notice`;
CREATE TABLE `notice` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`topic` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '公告内容',
`author` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发布人',
`createDate` datetime(0) NULL DEFAULT NULL COMMENT '公告发布时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '公告' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of notice
-- ----------------------------
INSERT INTO `notice` VALUES (1, '公告内部测试1', '这是第一个内容测试啊', 'admin', '2021-04-01 21:35:53');
INSERT INTO `notice` VALUES (2, '公告内部测试2', '这是第二个内容测试啊', 'admin', '2021-04-02 22:38:03');
INSERT INTO `notice` VALUES (3, '公告内部测试3', '这是第三个内容测试啊', 'yx5411', '2021-04-03 06:47:54');
INSERT INTO `notice` VALUES (4, '公告内部测试4', '这是第四个内容测试啊', 'yx5411', '2021-04-04 06:48:01');
INSERT INTO `notice` VALUES (5, '公告内部测试5', '这是第五个内容测试啊', 'xy1221', '2021-04-04 06:49:03');
INSERT INTO `notice` VALUES (6, '公告内部测试6', '这是第六个内容测试啊', 'yx5411', '2021-04-05 07:48:04');
-- ----------------------------
-- Table structure for reader_info
-- ----------------------------
DROP TABLE IF EXISTS `reader_info`;
CREATE TABLE `reader_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`username` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',
`password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码',
`realName` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '真实姓名',
`sex` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '性别',
`birthday` date NULL DEFAULT NULL COMMENT '出生日期',
`address` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '籍贯',
`tel` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '电话',
`email` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱',
`registerDate` datetime(0) NULL DEFAULT NULL COMMENT '注册日期',
`readerNumber` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '读者编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '读者信息(包括登录账号密码等)' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of reader_info
-- ----------------------------
INSERT INTO `reader_info` VALUES (1, 'zhangsan', '12345', '彭于晏', '', '2001-04-01', '江西南昌', '13767134834', 'yu123@163.com', '2021-04-02 13:18:59', '8120116041');
INSERT INTO `reader_info` VALUES (2, 'mary', '12345', '陈恋', '', '2004-04-01', '湖北武汉', '15270839599', 'yx123@163.com', '2021-03-06 07:57:56', '8120116044');
INSERT INTO `reader_info` VALUES (3, 'cindy', '12345', '辛帝', '', '2010-04-04', '北京海淀', '13834141133', 'zs1314@163.com', '2021-04-04 13:36:42', '8120116042');
-- ----------------------------
-- Table structure for type_info
-- ----------------------------
DROP TABLE IF EXISTS `type_info`;
CREATE TABLE `type_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图书分类名称',
`remarks` char(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '图书类型表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of type_info
-- ----------------------------
INSERT INTO `type_info` VALUES (1, '文学类', '陶冶情操');
INSERT INTO `type_info` VALUES (2, '历史类', '了解历史文化');
INSERT INTO `type_info` VALUES (3, '工学类', '造火箭');
INSERT INTO `type_info` VALUES (4, '法学类', '学习法律,打官司');
INSERT INTO `type_info` VALUES (5, '经济学类', '搞经济');
INSERT INTO `type_info` VALUES (6, '统计学类', '学习统计,天下无敌');
SET FOREIGN_KEY_CHECKS = 1;

@ -0,0 +1,185 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.yx</groupId>
<artifactId>LibraryProject</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>LibraryProject Maven Webapp</name>
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<spring.version>5.1.3.RELEASE</spring.version>
<slf4j.version>1.6.6</slf4j.version>
<log4j.version>1.2.12</log4j.version>
<mysql.version>5.1.6</mysql.version>
<mybatis.version>3.4.5</mybatis.version>
</properties>
<dependencies>
<!-- spring -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.8</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!--fastjson-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.54</version>
</dependency>
<!-- log start -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- log end -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<!--druid连接池-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.16</version>
</dependency>
<!--分页-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.10</version>
</dependency>
<!--mybatis逆向工程依赖-->
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.7</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,28 @@
package com.yx.codeutil;
import java.io.IOException;
import java.io.OutputStream;
public interface IVerifyCodeGen {
/**
* codeos
*
* @param width
* @param height
* @param os
* @return
* @throws IOException
*/
String generate(int width, int height, OutputStream os) throws IOException;
/**
*
*
* @param width
* @param height
* @return
* @throws IOException
*/
VerifyCode generate(int width, int height) throws IOException;
}

@ -0,0 +1,50 @@
package com.yx.codeutil;
import java.awt.*;
import java.util.Random;
public class RandomUtils extends org.apache.commons.lang3.RandomUtils {
private static final char[] CODE_SEQ = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J',
'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '2', '3', '4', '5', '6', '7', '8', '9' };
private static final char[] NUMBER_ARRAY = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
private static Random random = new Random();
public static String randomString(int length) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < length; i++) {
sb.append(String.valueOf(CODE_SEQ[random.nextInt(CODE_SEQ.length)]));
}
return sb.toString();
}
public static String randomNumberString(int length) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < length; i++) {
sb.append(String.valueOf(NUMBER_ARRAY[random.nextInt(NUMBER_ARRAY.length)]));
}
return sb.toString();
}
public static Color randomColor(int fc, int bc) {
int f = fc;
int b = bc;
Random random = new Random();
if (f > 255) {
f = 255;
}
if (b > 255) {
b = 255;
}
return new Color(f + random.nextInt(b - f), f + random.nextInt(b - f), f + random.nextInt(b - f));
}
public static int nextInt(int bound) {
return random.nextInt(bound);
}
}

@ -0,0 +1,117 @@
package com.yx.codeutil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Random;
/**
*
*/
public class SimpleCharVerifyCodeGenImpl implements IVerifyCodeGen {
private static final Logger logger = LoggerFactory.getLogger(SimpleCharVerifyCodeGenImpl.class);
private static final String[] FONT_TYPES = { "\u5b8b\u4f53", "\u65b0\u5b8b\u4f53", "\u9ed1\u4f53", "\u6977\u4f53", "\u96b6\u4e66" };
private static final int VALICATE_CODE_LENGTH = 4;
/**
* 线
*
* @param graphics
* @param width
* @param height
*/
private static void fillBackground(Graphics graphics, int width, int height) {
// 填充背景
graphics.setColor(Color.WHITE);
//设置矩形坐标x y 为0
graphics.fillRect(0, 0, width, height);
// 加入干扰线条
for (int i = 0; i < 8; i++) {
//设置随机颜色算法参数
graphics.setColor(RandomUtils.randomColor(40, 150));
Random random = new Random();
int x = random.nextInt(width);
int y = random.nextInt(height);
int x1 = random.nextInt(width);
int y1 = random.nextInt(height);
graphics.drawLine(x, y, x1, y1);
}
}
/**
*
*
* @param width
* @param height
* @param os
* @return
* @throws IOException
*/
@Override
public String generate(int width, int height, OutputStream os) throws IOException {
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics graphics = image.getGraphics();
fillBackground(graphics, width, height);
String randomStr = RandomUtils.randomString(VALICATE_CODE_LENGTH);
createCharacter(graphics, randomStr);
graphics.dispose();
//设置JPEG格式
ImageIO.write(image, "JPEG", os);
return randomStr;
}
/**
*
*
* @param width
* @param height
* @return
*/
@Override
public VerifyCode generate(int width, int height) {
VerifyCode verifyCode = null;
try (
//将流的初始化放到这里就不需要手动关闭流
ByteArrayOutputStream baos = new ByteArrayOutputStream();
) {
String code = generate(width, height, baos);
verifyCode = new VerifyCode();
verifyCode.setCode(code);
verifyCode.setImgBytes(baos.toByteArray());
} catch (IOException e) {
logger.error(e.getMessage(), e);
verifyCode = null;
}
return verifyCode;
}
/**
*
*
* @param g
* @param randomStr
*/
private void createCharacter(Graphics g, String randomStr) {
char[] charArray = randomStr.toCharArray();
for (int i = 0; i < charArray.length; i++) {
//设置RGB颜色算法参数
g.setColor(new Color(50 + RandomUtils.nextInt(100),
50 + RandomUtils.nextInt(100), 50 + RandomUtils.nextInt(100)));
//设置字体大小,类型
g.setFont(new Font(FONT_TYPES[RandomUtils.nextInt(FONT_TYPES.length)], Font.BOLD, 26));
//设置x y 坐标
g.drawString(String.valueOf(charArray[i]), 15 * i + 5, 19 + RandomUtils.nextInt(8));
}
}
}

@ -0,0 +1,38 @@
package com.yx.codeutil;
public class VerifyCode {
private String code;
private byte[] imgBytes;
private long expireTime;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public byte[] getImgBytes() {
return imgBytes;
}
public void setImgBytes(byte[] imgBytes) {
this.imgBytes = imgBytes;
}
public long getExpireTime() {
return expireTime;
}
public void setExpireTime(long expireTime) {
this.expireTime = expireTime;
}
}

@ -0,0 +1,93 @@
package com.yx.controller;
import com.github.pagehelper.PageInfo;
import com.yx.po.Admin;
import com.yx.service.AdminService;
import com.yx.utils.DataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Arrays;
import java.util.List;
@Controller
public class AdminController {
@Autowired
private AdminService adminService;
@GetMapping("/adminIndex")
public String adminIndex(){
return "admin/adminIndex";
}
@RequestMapping("/adminAll")
@ResponseBody
public DataInfo queryAdminAll(Admin admin, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "15") Integer limit){
PageInfo<Admin> pageInfo = adminService.queryAdminAll(admin,pageNum,limit);
return DataInfo.ok("成功",pageInfo.getTotal(),pageInfo.getList());
}
/**
*
* @return
*/
@GetMapping("/adminAdd")
public String adminAdd(){
return "admin/adminAdd";
}
/**
*
* @param admin
* @return
*/
@RequestMapping("/addAdminSubmit")
@ResponseBody
public DataInfo addBookSubmit(Admin admin){
adminService.addAdminSubmit(admin);
return DataInfo.ok();
}
/**
* id
*/
@GetMapping("/queryAdminById")
public String queryAdminById(Integer id, Model model){
model.addAttribute("id",id);
return "admin/updateAdmin";
}
/**
*
*/
@RequestMapping("/updatePwdSubmit")
@ResponseBody
public DataInfo updatePwdSubmit(Integer id,String oldPwd,String newPwd){
Admin admin = adminService.queryAdminById(id);//根据id查询对象
if (!oldPwd.equals(admin.getPassword())){
return DataInfo.fail("输入的旧密码错误");
}else{
admin.setPassword(newPwd);
adminService.updateAdminSubmit(admin);//数据库修改
return DataInfo.ok();
}
}
/**
*
*/
@RequestMapping("/deleteAdminByIds")
@ResponseBody
public DataInfo deleteAdminByIds(String ids){
List<String> list = Arrays.asList(ids.split(","));
adminService.deleteAdminByIds(list);
return DataInfo.ok();
}
}

@ -0,0 +1,54 @@
package com.yx.controller;
import com.github.pagehelper.PageInfo;
import com.yx.po.Admin;
import com.yx.po.Notice;
import com.yx.service.AdminService;
import com.yx.service.NoticeService;
import com.yx.service.ReaderInfoService;
import com.yx.utils.DataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
public class BaseController {
@Autowired
private NoticeService noticeService;
/**
*
* @return
*/
@GetMapping("/index")
public String index(){
return "index";
}
/**
*
* @return
*/
@GetMapping("/welcome")
public String welcome(Model model){
//提供公告信息
PageInfo<Notice> pageInfo = noticeService.queryAllNotice(null,1,5);
if (pageInfo!=null){
List<Notice> noticeList = pageInfo.getList();
model.addAttribute("noticeList",noticeList);
}
return "welcome";
}
@GetMapping("/updatePassword")
public String updatePwd(){
return "pwdUpdate/updatePwd";
}
}

@ -0,0 +1,106 @@
package com.yx.controller;
import com.github.pagehelper.PageInfo;
import com.yx.po.BookInfo;
import com.yx.po.TypeInfo;
import com.yx.service.BookInfoService;
import com.yx.service.TypeInfoService;
import com.yx.utils.DataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
@Controller
public class BookInfoController {
@Autowired
private BookInfoService bookInfoService;
@Autowired
private TypeInfoService typeInfoService;
/**
*
* @return
*/
@GetMapping("/bookIndex")
public String bookIndex(){
return "book/bookIndex";
}
/**
* bookjson
* @param bookInfo
* @param pageNum
* @param limit
* @return
*/
@RequestMapping("/bookAll")
@ResponseBody //@ResponseBody将java对象转为json格式的数据表示该方法的返回结果直接写入 HTTP response body 中一般在异步ajax获取数据时使用
public DataInfo bookAll(BookInfo bookInfo, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "15") Integer limit){
PageInfo<BookInfo> pageInfo = bookInfoService.queryBookInfoAll(bookInfo,pageNum,limit);
return DataInfo.ok("成功",pageInfo.getTotal(),pageInfo.getList());//总条数getTotal数据封装成list,以便加载分页显示,由于加了ResponseBody,就会返回一个字符串
}
/**
*
*/
@GetMapping("/bookAdd")
public String bookAdd(){
return "book/bookAdd";
}
/**
*
*/
@RequestMapping("/addBookSubmit")
@ResponseBody
public DataInfo addBookSubmit(BookInfo info){
bookInfoService.addBookSubmit(info);
return DataInfo.ok();
}
/**
* id()
*/
@GetMapping("/queryBookInfoById")
public String queryTypeInfoById(Integer id, Model model){
BookInfo bookInfo= bookInfoService.queryBookInfoById(id);
model.addAttribute("info",bookInfo);
return "book/updateBook";
}
/**
*
*/
@RequestMapping("/updateBookSubmit")
@ResponseBody
public DataInfo updateBookSubmit(@RequestBody BookInfo info){
bookInfoService.updateBookSubmit(info);
return DataInfo.ok();
}
/**
*
*/
@RequestMapping("/deleteBook")
@ResponseBody
public DataInfo deleteBook(String ids){
List<String> list= Arrays.asList(ids.split(","));
bookInfoService.deleteBookByIds(list);
return DataInfo.ok();
}
@RequestMapping("/findAllList")
@ResponseBody
public List<TypeInfo> findAll(){
PageInfo<TypeInfo> pageInfo = typeInfoService.queryTypeInfoAll(null,1,100);
List<TypeInfo> lists = pageInfo.getList();
return lists;
}
}

@ -0,0 +1,192 @@
package com.yx.controller;
import com.github.pagehelper.PageInfo;
import com.yx.po.BookInfo;
import com.yx.po.LendList;
import com.yx.po.ReaderInfo;
import com.yx.service.BookInfoService;
import com.yx.service.LendListService;
import com.yx.service.ReaderInfoService;
import com.yx.utils.DataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@Controller
public class LendListController {
@Autowired
private LendListService lendListService;
@Autowired
private ReaderInfoService readerService;
@Autowired
private BookInfoService bookInfoService;
@GetMapping("/lendListIndex")
public String lendListIndex(){
return "lend/lendListIndex";
}
/**
*
* 1 request
* 2
* 3
*/
@ResponseBody
@RequestMapping("/lendListAll")
public DataInfo lendListAll(Integer type, String readerNumber, String name, Integer status,
@RequestParam(defaultValue = "1")Integer page,@RequestParam(defaultValue = "15")Integer limit){
LendList info=new LendList();
info.setBackType(type);
//创建读者对象
ReaderInfo reader=new ReaderInfo();
reader.setReaderNumber(readerNumber);
//把以上对象交给info
info.setReaderInfo(reader);
//图书对象
BookInfo book=new BookInfo();
book.setName(name);
book.setStatus(status);
info.setBookInfo(book);
//分页查询所有的记录信息
PageInfo pageInfo=lendListService.queryLendListAll(info,page,limit);
return DataInfo.ok("ok",pageInfo.getTotal(),pageInfo.getList());
}
/**
*
*/
@GetMapping("/addLendList")
public String addLendList(){
return "lend/addLendList";
}
/**
*
* 1
* 2
* 3
* cardnumber:
* ids id
*/
@ResponseBody
@RequestMapping("/addLend")
public DataInfo addLend(String readerNumber,String ids){
//获取图书id的集合
List<String> list= Arrays.asList(ids.split(","));
//判断卡号是否存在
ReaderInfo reader=new ReaderInfo();
reader.setReaderNumber(readerNumber);
PageInfo<ReaderInfo> pageInfo=readerService.queryAllReaderInfo(reader,1,1);
if(pageInfo.getList().size()==0){
return DataInfo.fail("卡号信息不存在");
}else{
ReaderInfo readerCard2=pageInfo.getList().get(0);
//可借书
for(String bid:list) {
LendList lendList = new LendList();
lendList.setReaderId(readerCard2.getId());//读者id
lendList.setBookId(Integer.valueOf(bid));//书的id
lendList.setLendDate(new Date());
lendListService.addLendListSubmit(lendList);
//更变书的状态
BookInfo info = bookInfoService.queryBookInfoById(Integer.valueOf(bid));
//设置书的状态
info.setStatus(1);
bookInfoService.updateBookSubmit(info);
}
}
return DataInfo.ok();
}
/**
*
*/
@ResponseBody
@RequestMapping("/deleteLendListByIds")
public DataInfo deleteLendListByIds(String ids, String bookIds){
List list=Arrays.asList(ids.split(","));//借阅记录的id
List blist=Arrays.asList(bookIds.split(","));//图书信息的id
lendListService.deleteLendListById(list,blist);
return DataInfo.ok();
}
/**
*
*/
@ResponseBody
@RequestMapping("/backLendListByIds")
public DataInfo backLendListByIds(String ids,String bookIds){
List list=Arrays.asList(ids.split(","));//借阅记录的id
List blist=Arrays.asList(bookIds.split(","));//图书信息的id
lendListService.updateLendListSubmit(list,blist);
return DataInfo.ok();
}
/**
*
*/
@GetMapping("/excBackBook")
public String excBackBook(HttpServletRequest request, Model model){
//获取借阅记录id
String id=request.getParameter("id");
String bId=request.getParameter("bookId");
model.addAttribute("id",id);
model.addAttribute("bid",bId);
return "lend/excBackBook";
}
/**
*
*/
@ResponseBody
@RequestMapping("/updateLendInfoSubmit")
public DataInfo updateLendInfoSubmit(LendList lendList){
lendListService.backBook(lendList);
return DataInfo.ok();
}
/**
* 线
*/
@RequestMapping("/queryLookBookList")
public String queryLookBookList(String flag,Integer id,Model model){
List<LendList> list=null;
if(flag.equals("book")){
list=lendListService.queryLookBookList(null,id);
}else{
list=lendListService.queryLookBookList(id,null);
}
model.addAttribute("info",list);
return "lend/lookBookList";
}
@RequestMapping("/queryLookBookList2")
public String queryLookBookList(HttpServletRequest request,Model model){
ReaderInfo readerInfo = (ReaderInfo) request.getSession().getAttribute("user");
List<LendList> list = list=lendListService.queryLookBookList(readerInfo.getId(),null);
model.addAttribute("info",list);
return "lend/lookBookList";
}
}

@ -0,0 +1,116 @@
package com.yx.controller;
import com.yx.codeutil.IVerifyCodeGen;
import com.yx.codeutil.SimpleCharVerifyCodeGenImpl;
import com.yx.codeutil.VerifyCode;
import com.yx.po.Admin;
import com.yx.po.ReaderInfo;
import com.yx.service.AdminService;
import com.yx.service.ReaderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
@Controller
public class LoginController {
@Autowired
private AdminService adminService;
@Autowired
private ReaderInfoService readerService;
/**
*
*/
@GetMapping("/login")
public String login(){
return "login";
}
/**
*
* @param request
* @param response
*/
@RequestMapping("/verifyCode")
public void verifyCode(HttpServletRequest request, HttpServletResponse response) {
IVerifyCodeGen iVerifyCodeGen = new SimpleCharVerifyCodeGenImpl();
try {
//设置长宽
VerifyCode verifyCode = iVerifyCodeGen.generate(80, 28);
String code = verifyCode.getCode();
//将VerifyCode绑定session
request.getSession().setAttribute("VerifyCode", code);
//设置响应头
response.setHeader("Pragma", "no-cache");
//设置响应头
response.setHeader("Cache-Control", "no-cache");
//在代理服务器端防止缓冲
response.setDateHeader("Expires", 0);
//设置响应内容类型
response.setContentType("image/jpeg");
response.getOutputStream().write(verifyCode.getImgBytes());
response.getOutputStream().flush();
} catch (IOException e) {
System.out.println("异常处理");
}
}
/**
*
*/
@RequestMapping("/loginIn")
public String loginIn(HttpServletRequest request, Model model){
//获取用户名与密码
String username = request.getParameter("username");
String password = request.getParameter("password");
String code=request.getParameter("captcha");
String type=request.getParameter("type");
//判断验证码是否正确验证码已经放入session
HttpSession session = request.getSession();
String realCode = (String)session.getAttribute("VerifyCode");
if (!realCode.toLowerCase().equals(code.toLowerCase())){
model.addAttribute("msg","验证码不正确");
return "login";
}else{
//验证码正确则判断用户名和密码
if(type.equals("1")){//管理员信息
//用户名和密码是否正确
Admin admin=adminService.queryUserByNameAndPassword(username,password);
if(admin==null){//该用户不存在
model.addAttribute("msg","用户名或密码错误");
return "login";
}
session.setAttribute("user",admin);
session.setAttribute("type","admin");
}else{//来自读者信息表
ReaderInfo readerInfo=readerService.queryUserInfoByNameAndPassword(username,password);
if(readerInfo==null){
model.addAttribute("msg","用户名或密码错误");
return "login";
}
session.setAttribute("user",readerInfo);
session.setAttribute("type","reader");
}
return "index";
}
}
/**
* 退
*/
@GetMapping("loginOut")
public String loginOut(HttpServletRequest request){
HttpSession session = request.getSession();
session.invalidate();//注销
return "/login";
}
}

@ -0,0 +1,88 @@
package com.yx.controller;
import com.github.pagehelper.PageInfo;
import com.yx.po.Notice;
import com.yx.service.NoticeService;
import com.yx.utils.DataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.xml.crypto.Data;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@Controller
public class NoticeController {
@Autowired
private NoticeService noticeService;
/**
*
*/
@GetMapping("/noticeIndexOfBack")
public String noticeIndexOfBack(){
return "notice/noticeIndexOfBack";
}
/**
*
*/
@GetMapping("/noticeIndexOfReader")
public String noticeIndexOfReader(){
return "notice/noticeIndexOfReader";
}
/**
*
*/
@RequestMapping("/noticeAll")
@ResponseBody
public DataInfo noticeAll(Notice notice,@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "15")Integer limit){
PageInfo<Notice> pageInfo = noticeService.queryAllNotice(notice, pageNum, limit);
return DataInfo.ok("成功",pageInfo.getTotal(),pageInfo.getList());
}
/**
*
*/
@GetMapping("/noticeAdd")
public String noticeAdd(){
return "notice/noticeAdd";
}
/**
*
*/
@RequestMapping("/addNoticeSubmit")
@ResponseBody
public DataInfo addNoticeSubmit(Notice notice){
//主题和内容可以页面获取,作者和时间在后台自动获取
notice.setAuthor("admin");//这里先暂且写admin
notice.setCreateDate(new Date());
noticeService.addNotice(notice);
return DataInfo.ok();
}
/**
*
*/
@GetMapping("/queryNoticeById")
public String queryNoticeById(Integer id, Model model){
Notice notice = noticeService.queryNoticeById(id);
model.addAttribute("info",notice);
return "notice/updateNotice";
}
/**
*
*/
@RequestMapping("/deleteNoticeByIds")
@ResponseBody
public DataInfo deleteNoticeByIds(String ids){
List<String> list = Arrays.asList(ids.split(","));
noticeService.deleteNoticeByIds(list);
return DataInfo.ok();
}
}

@ -0,0 +1,128 @@
package com.yx.controller;
import com.github.pagehelper.PageInfo;
import com.yx.po.Admin;
import com.yx.po.BookInfo;
import com.yx.po.ReaderInfo;
import com.yx.po.TypeInfo;
import com.yx.service.AdminService;
import com.yx.service.ReaderInfoService;
import com.yx.utils.DataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Arrays;
import java.util.List;
@Controller
public class ReaderInfoController {
@Autowired
private ReaderInfoService readerInfoService;
@Autowired
private AdminService adminService;
/**
*
*/
@GetMapping("/readerIndex")
public String readerIndex(){
return "reader/readerIndex";
}
/**
*
*/
@RequestMapping("/readerAll")
@ResponseBody
public DataInfo queryReaderAll(ReaderInfo readerInfo, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "15") Integer limit){
PageInfo<ReaderInfo> pageInfo = readerInfoService.queryAllReaderInfo(readerInfo,pageNum,limit);
return DataInfo.ok("成功",pageInfo.getTotal(),pageInfo.getList());
}
/**
*
*/
@RequestMapping("/readerAdd")
public String readerAdd(){
return "reader/readerAdd";
}
/**
*
*/
@RequestMapping("/addReaderSubmit")
@ResponseBody
public DataInfo addReaderSubmit(@RequestBody ReaderInfo readerInfo){
readerInfo.setPassword("123456");//设置默认密码
readerInfoService.addReaderInfoSubmit(readerInfo);
return DataInfo.ok();
}
/**
* id
*/
@GetMapping("/queryReaderInfoById")
public String queryReaderInfoById(Integer id, Model model){
ReaderInfo readerInfo = readerInfoService.queryReaderInfoById(id);
model.addAttribute("info",readerInfo);
return "reader/updateReader";
}
/**
*
*/
@RequestMapping("/updateReaderSubmit")
@ResponseBody
public DataInfo updateReaderSubmit(@RequestBody ReaderInfo readerInfo){
readerInfoService.updateReaderInfoSubmit(readerInfo);
return DataInfo.ok();
}
/**
*
*/
@RequestMapping("/deleteReader")
@ResponseBody
public DataInfo deleteReader(String ids){
List<String> list= Arrays.asList(ids.split(","));
readerInfoService.deleteReaderInfoByIds(list);
return DataInfo.ok();
}
/**
*
*/
@RequestMapping("/updatePwdSubmit2")
@ResponseBody
public DataInfo updatePwdSubmit(HttpServletRequest request, String oldPwd, String newPwd){
HttpSession session = request.getSession();
if(session.getAttribute("type")=="admin"){
//管理员
Admin admin = (Admin)session.getAttribute("user");
Admin admin1 = (Admin)adminService.queryAdminById(admin.getId());
if (!oldPwd.equals(admin1.getPassword())){
return DataInfo.fail("输入的旧密码错误");
}else{
admin1.setPassword(newPwd);
adminService.updateAdminSubmit(admin1);//数据库修改
}
}else{
//读者
ReaderInfo readerInfo = (ReaderInfo) session.getAttribute("user");
ReaderInfo readerInfo1 = readerInfoService.queryReaderInfoById(readerInfo.getId());//根据id查询对象
if (!oldPwd.equals(readerInfo1.getPassword())){
return DataInfo.fail("输入的旧密码错误");
}else{
readerInfo1.setPassword(newPwd);
readerInfoService.updateReaderInfoSubmit(readerInfo1);//数据库修改
}
}
return DataInfo.ok();
}
}

@ -0,0 +1,30 @@
package com.yx.controller;
import com.yx.po.BookInfo;
import com.yx.po.TypeInfo;
import com.yx.service.BookInfoService;
import com.yx.service.TypeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;
@Controller
public class StatisticsController {
@Autowired
private BookInfoService bookInfoService;
@Autowired
private TypeInfoService typeInfoService;
@GetMapping("statisticIndex")
public String statistics(Model model){
//根据图书类型查询图书数量
List<BookInfo> list = bookInfoService.getBookCountByType();
model.addAttribute("list",list);
return "count/statisticIndex";
}
}

@ -0,0 +1,89 @@
package com.yx.controller;
import com.github.pagehelper.PageInfo;
import com.yx.po.TypeInfo;
import com.yx.service.TypeInfoService;
import com.yx.utils.DataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
@Controller //声明后端控制器
public class TypeInfoController {
@Autowired
private TypeInfoService typeInfoService;
/**
*
* @return
*/
@GetMapping("/typeIndex")
public String typeIndex(){
return "type/typeIndex";
}
/**
* type
*/
@RequestMapping("/typeAll")
@ResponseBody //@ResponseBody将java对象转为json格式的数据表示该方法的返回结果直接写入 HTTP response body 中一般在异步ajax获取数据时使用
public DataInfo typeAll(String name, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "15") Integer limit){
PageInfo<TypeInfo> pageInfo = typeInfoService.queryTypeInfoAll(name,pageNum,limit);
return DataInfo.ok("成功",pageInfo.getTotal(),pageInfo.getList());//总条数getTotal数据封装成list,以便加载分页显示,由于加了ResponseBody,就会返回一个字符串
}
/**
*
*/
@GetMapping("/typeAdd")
public String typeAdd(){
return "type/typeAdd";
}
/**
*
*/
@PostMapping("/addTypeSubmit")
@ResponseBody
public DataInfo addTypeSubmit(TypeInfo info){
typeInfoService.addTypeSubmit(info);
return DataInfo.ok();
}
/**
* id()
*/
@GetMapping("/queryTypeInfoById")
public String queryTypeInfoById(Integer id, Model model){
TypeInfo info= typeInfoService.queryTypeInfoById(id);
model.addAttribute("info",info);
return "type/updateType";
}
/**
*
*/
@RequestMapping("/updateTypeSubmit")
@ResponseBody
public DataInfo updateTypeSubmit(@RequestBody TypeInfo info){
typeInfoService.updateTypeSubmit(info);
return DataInfo.ok();
}
/**
*
*/
@RequestMapping("/deleteType")
@ResponseBody
public DataInfo deleteType(String ids){
List<String> list= Arrays.asList(ids.split(","));
typeInfoService.deleteTypeByIds(list);
return DataInfo.ok();
}
}

@ -0,0 +1,66 @@
package com.yx.dao;
import com.yx.po.Admin;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AdminMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table admin
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table admin
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int insert(Admin record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table admin
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int insertSelective(Admin record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table admin
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
Admin selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table admin
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int updateByPrimaryKeySelective(Admin record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table admin
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int updateByPrimaryKey(Admin record);
/**
*
*/
List<Admin> queryAdminInfoAll(Admin admin);
/**
*
*/
Admin queryUserByNameAndPassword(@Param("username") String username,@Param("password") String password);
}

@ -0,0 +1,66 @@
package com.yx.dao;
import com.yx.po.BookInfo;
import java.awt.print.Book;
import java.util.List;
public interface BookInfoMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table book_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table book_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int insert(BookInfo record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table book_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int insertSelective(BookInfo record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table book_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
BookInfo selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table book_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int updateByPrimaryKeySelective(BookInfo record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table book_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int updateByPrimaryKey(BookInfo record);
/**
*
*/
List<BookInfo> queryBookInfoAll(BookInfo bookInfo);
/**
*
*/
List<BookInfo> getBookCountByType();
}

@ -0,0 +1,73 @@
package com.yx.dao;
import com.yx.po.LendList;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface LendListMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table lend_list
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
void deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table lend_list
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
void insert(LendList record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table lend_list
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
void insertSelective(LendList record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table lend_list
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
LendList selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table lend_list
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
void updateByPrimaryKeySelective(LendList record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table lend_list
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
void updateByPrimaryKey(LendList record);
/**
*
*/
List<LendList> queryLendListAll(LendList lendList);
/**
* 线
*/
List<LendList> queryLookBookList(@Param("rid") Integer rid, @Param("bid") Integer bid);
/**
* ()
*/
void updateLendListSubmit(LendList lendList);
}

@ -0,0 +1,62 @@
package com.yx.dao;
import com.yx.po.Notice;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface NoticeMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int insert(Notice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int insertSelective(Notice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
Notice selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int updateByPrimaryKeySelective(Notice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int updateByPrimaryKey(Notice record);
/**
*
*/
List<Notice> queryNoticeAll(Notice notice);
}

@ -0,0 +1,66 @@
package com.yx.dao;
import com.yx.po.ReaderInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ReaderInfoMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table reader_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table reader_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int insert(ReaderInfo record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table reader_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int insertSelective(ReaderInfo record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table reader_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
ReaderInfo selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table reader_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int updateByPrimaryKeySelective(ReaderInfo record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table reader_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
int updateByPrimaryKey(ReaderInfo record);
/**
*
*/
List<ReaderInfo> queryAllReaderInfo(ReaderInfo readerInfo);
/**
*
*/
ReaderInfo queryUserInfoByNameAndPassword(@Param("username") String username, @Param("password") String password);
}

@ -0,0 +1,35 @@
package com.yx.dao;
import com.yx.po.TypeInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TypeInfoMapper {
/**
*
*/
List<TypeInfo> queryTypeInfoAll(@Param(value = "name") String name);
/**
*
*/
void addTypeSubmit(TypeInfo info);
/**
* id
*/
TypeInfo queryTypeInfoById(Integer id);
/**
*
*/
void updateTypeSubmit(TypeInfo info);
/**
* ids
*/
void deleteTypeByIds(List<Integer> id);
//List<TypeInfo> queryTypeName();
}

@ -0,0 +1,35 @@
package com.yx.interceptor;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class LoginInterceptor implements HandlerInterceptor {
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
System.out.println("执行后,返回前执行....");
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
//在处理过程中进行拦截
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//已经登录了就放行 否则进行拦截
HttpSession session=request.getSession();
if(session.getAttribute("user")!=null){
return true;//放行
}else{
//没有登录 跳转到登录页面进行登录操作
response.sendRedirect(request.getContextPath()+"/login");
return false;
}
}
}

@ -0,0 +1,141 @@
package com.yx.po;
import java.io.Serializable;
public class Admin implements Serializable {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column admin.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Integer id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column admin.username
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String username;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column admin.password
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String password;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column admin.admin_type
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Integer adminType;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table admin
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column admin.id
*
* @return the value of admin.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column admin.id
*
* @param id the value for admin.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column admin.username
*
* @return the value of admin.username
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getUsername() {
return username;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column admin.username
*
* @param username the value for admin.username
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setUsername(String username) {
this.username = username == null ? null : username.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column admin.password
*
* @return the value of admin.password
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getPassword() {
return password;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column admin.password
*
* @param password the value for admin.password
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column admin.admin_type
*
* @return the value of admin.admin_type
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Integer getAdminType() {
return adminType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column admin.admin_type
*
* @param adminType the value for admin.admin_type
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setAdminType(Integer adminType) {
this.adminType = adminType;
}
}

@ -0,0 +1,386 @@
package com.yx.po;
import java.io.Serializable;
import java.util.Date;
public class BookInfo implements Serializable {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column book_info.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Integer id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column book_info.name
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String name;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column book_info.author
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String author;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column book_info.publish
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String publish;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column book_info.ISBN
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String isbn;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column book_info.introduction
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String introduction;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column book_info.language
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String language;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column book_info.price
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Double price;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column book_info.publish_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Date publishDate;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column book_info.type_id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Integer typeId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column book_info.status
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Integer status;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table book_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private TypeInfo typeInfo;//图书类型,在图书馆里中显示什么类型的书
private Integer counts;
public Integer getCounts() {
return counts;
}
public void setCounts(Integer counts) {
this.counts = counts;
}
public TypeInfo getTypeInfo() {
return typeInfo;
}
public void setTypeInfo(TypeInfo typeInfo) {
this.typeInfo = typeInfo;
}
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column book_info.id
*
* @return the value of book_info.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column book_info.id
*
* @param id the value for book_info.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column book_info.name
*
* @return the value of book_info.name
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column book_info.name
*
* @param name the value for book_info.name
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column book_info.author
*
* @return the value of book_info.author
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getAuthor() {
return author;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column book_info.author
*
* @param author the value for book_info.author
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setAuthor(String author) {
this.author = author == null ? null : author.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column book_info.publish
*
* @return the value of book_info.publish
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getPublish() {
return publish;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column book_info.publish
*
* @param publish the value for book_info.publish
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setPublish(String publish) {
this.publish = publish == null ? null : publish.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column book_info.ISBN
*
* @return the value of book_info.ISBN
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getIsbn() {
return isbn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column book_info.ISBN
*
* @param isbn the value for book_info.ISBN
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setIsbn(String isbn) {
this.isbn = isbn == null ? null : isbn.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column book_info.introduction
*
* @return the value of book_info.introduction
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getIntroduction() {
return introduction;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column book_info.introduction
*
* @param introduction the value for book_info.introduction
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setIntroduction(String introduction) {
this.introduction = introduction == null ? null : introduction.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column book_info.language
*
* @return the value of book_info.language
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getLanguage() {
return language;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column book_info.language
*
* @param language the value for book_info.language
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setLanguage(String language) {
this.language = language == null ? null : language.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column book_info.price
*
* @return the value of book_info.price
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Double getPrice() {
return price;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column book_info.price
*
* @param price the value for book_info.price
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setPrice(Double price) {
this.price = price;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column book_info.publish_date
*
* @return the value of book_info.publish_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Date getPublishDate() {
return publishDate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column book_info.publish_date
*
* @param publishDate the value for book_info.publish_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setPublishDate(Date publishDate) {
this.publishDate = publishDate;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column book_info.type_id
*
* @return the value of book_info.type_id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Integer getTypeId() {
return typeId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column book_info.type_id
*
* @param typeId the value for book_info.type_id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setTypeId(Integer typeId) {
this.typeId = typeId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column book_info.status
*
* @return the value of book_info.status
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Integer getStatus() {
return status;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column book_info.status
*
* @param status the value for book_info.status
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setStatus(Integer status) {
this.status = status;
}
}

@ -0,0 +1,249 @@
package com.yx.po;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
public class LendList implements Serializable {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column lend_list.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Integer id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column lend_list.book_id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Integer bookId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column lend_list.reader_id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Integer readerId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column lend_list.lend_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//接收页面输入的时间,将其格式化
@JSONField(format = "yyyy-MM-dd HH:mm:ss")//后端传的日期格式化
private Date lendDate;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column lend_list.back_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date backDate;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column lend_list.back_type
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Integer backType;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column lend_list.exceptRemarks
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String exceptRemarks;
private BookInfo bookInfo;
private ReaderInfo readerInfo;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table lend_list
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column lend_list.id
*
* @return the value of lend_list.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column lend_list.id
*
* @param id the value for lend_list.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column lend_list.book_id
*
* @return the value of lend_list.book_id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Integer getBookId() {
return bookId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column lend_list.book_id
*
* @param bookId the value for lend_list.book_id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setBookId(Integer bookId) {
this.bookId = bookId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column lend_list.reader_id
*
* @return the value of lend_list.reader_id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Integer getReaderId() {
return readerId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column lend_list.reader_id
*
* @param readerId the value for lend_list.reader_id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setReaderId(Integer readerId) {
this.readerId = readerId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column lend_list.lend_date
*
* @return the value of lend_list.lend_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Date getLendDate() {
return lendDate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column lend_list.lend_date
*
* @param lendDate the value for lend_list.lend_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setLendDate(Date lendDate) {
this.lendDate = lendDate;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column lend_list.back_date
*
* @return the value of lend_list.back_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Date getBackDate() {
return backDate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column lend_list.back_date
*
* @param backDate the value for lend_list.back_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setBackDate(Date backDate) {
this.backDate = backDate;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column lend_list.back_type
*
* @return the value of lend_list.back_type
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Integer getBackType() {
return backType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column lend_list.back_type
*
* @param backType the value for lend_list.back_type
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setBackType(Integer backType) {
this.backType = backType;
}
public String getExceptRemarks() {
return exceptRemarks;
}
public void setExceptRemarks(String exceptRemarks) {
this.exceptRemarks = exceptRemarks;
}
public BookInfo getBookInfo() {
return bookInfo;
}
public void setBookInfo(BookInfo bookInfo) {
this.bookInfo = bookInfo;
}
public ReaderInfo getReaderInfo() {
return readerInfo;
}
public void setReaderInfo(ReaderInfo readerInfo) {
this.readerInfo = readerInfo;
}
}

@ -0,0 +1,179 @@
package com.yx.po;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
public class Notice implements Serializable {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column notice.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Integer id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column notice.topic
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String topic;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column notice.content
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String content;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column notice.author
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String author;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column notice.create_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//接收页面传来的时间格式
@JSONField(format="yyyy-MM-dd HH:mm:ss")//对返回的时间对象用fastjson格式化时间
private Date createDate;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table notice
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column notice.id
*
* @return the value of notice.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column notice.id
*
* @param id the value for notice.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column notice.topic
*
* @return the value of notice.topic
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getTopic() {
return topic;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column notice.topic
*
* @param topic the value for notice.topic
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setTopic(String topic) {
this.topic = topic == null ? null : topic.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column notice.content
*
* @return the value of notice.content
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getContent() {
return content;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column notice.content
*
* @param content the value for notice.content
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column notice.author
*
* @return the value of notice.author
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getAuthor() {
return author;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column notice.author
*
* @param author the value for notice.author
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setAuthor(String author) {
this.author = author == null ? null : author.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column notice.create_date
*
* @return the value of notice.create_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Date getCreateDate() {
return createDate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column notice.create_date
*
* @param createDate the value for notice.create_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

@ -0,0 +1,373 @@
package com.yx.po;
import java.io.Serializable;
import java.util.Date;
public class ReaderInfo implements Serializable {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column reader_info.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Integer id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column reader_info.username
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String username;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column reader_info.password
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String password;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column reader_info.number
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column reader_info.real_name
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String realName;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column reader_info.sex
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String sex;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column reader_info.birthday
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Date birthday;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column reader_info.address
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String address;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column reader_info.tel
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String tel;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column reader_info.email
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String email;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column reader_info.register_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Date registerDate;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column reader_info.reader_number
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String readerNumber;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table reader_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column reader_info.id
*
* @return the value of reader_info.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column reader_info.id
*
* @param id the value for reader_info.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column reader_info.username
*
* @return the value of reader_info.username
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getUsername() {
return username;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column reader_info.username
*
* @param username the value for reader_info.username
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setUsername(String username) {
this.username = username == null ? null : username.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column reader_info.password
*
* @return the value of reader_info.password
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getPassword() {
return password;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column reader_info.password
*
* @param password the value for reader_info.password
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column reader_info.real_name
*
* @return the value of reader_info.real_name
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getRealName() {
return realName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column reader_info.real_name
*
* @param realName the value for reader_info.real_name
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setRealName(String realName) {
this.realName = realName == null ? null : realName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column reader_info.sex
*
* @return the value of reader_info.sex
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getSex() {
return sex;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column reader_info.sex
*
* @param sex the value for reader_info.sex
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setSex(String sex) {
this.sex = sex == null ? null : sex.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column reader_info.birthday
*
* @return the value of reader_info.birthday
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Date getBirthday() {
return birthday;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column reader_info.birthday
*
* @param birthday the value for reader_info.birthday
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column reader_info.address
*
* @return the value of reader_info.address
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getAddress() {
return address;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column reader_info.address
*
* @param address the value for reader_info.address
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setAddress(String address) {
this.address = address == null ? null : address.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column reader_info.tel
*
* @return the value of reader_info.tel
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getTel() {
return tel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column reader_info.tel
*
* @param tel the value for reader_info.tel
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setTel(String tel) {
this.tel = tel == null ? null : tel.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column reader_info.email
*
* @return the value of reader_info.email
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getEmail() {
return email;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column reader_info.email
*
* @param email the value for reader_info.email
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setEmail(String email) {
this.email = email == null ? null : email.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column reader_info.register_date
*
* @return the value of reader_info.register_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Date getRegisterDate() {
return registerDate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column reader_info.register_date
*
* @param registerDate the value for reader_info.register_date
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setRegisterDate(Date registerDate) {
this.registerDate = registerDate;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column reader_info.reader_number
*
* @return the value of reader_info.reader_number
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getReaderNumber() {
return readerNumber;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column reader_info.reader_number
*
* @param readerNumber the value for reader_info.reader_number
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setReaderNumber(String readerNumber) {
this.readerNumber = readerNumber == null ? null : readerNumber.trim();
}
}

@ -0,0 +1,103 @@
package com.yx.po;
import java.io.Serializable;
public class TypeInfo implements Serializable {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column type_info.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private Integer id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column type_info.name
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String name;
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column type_info.reamrks
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private String remarks;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table type_info
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column type_info.id
*
* @return the value of type_info.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column type_info.id
*
* @param id the value for type_info.id
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column type_info.name
*
* @return the value of type_info.name
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column type_info.name
*
* @param name the value for type_info.name
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column type_info.reamrks
*
* @return the value of type_info.reamrks
*
* @mbggenerated Tue Mar 30 16:30:04 CST 2021
*/
}

@ -0,0 +1,39 @@
package com.yx.service;
import com.github.pagehelper.PageInfo;
import com.yx.po.Admin;
import java.util.List;
public interface AdminService {
/**
*
*/
PageInfo<Admin> queryAdminAll(Admin admin,Integer pageNum,Integer limit);
/**
*
*/
void addAdminSubmit(Admin admin);
/**
* id
*/
Admin queryAdminById(Integer id);
/**
*
*/
void updateAdminSubmit(Admin admin);
/**
*
*/
void deleteAdminByIds(List<String> ids);
/**
*
*/
Admin queryUserByNameAndPassword(String username,String password);
}

@ -0,0 +1,38 @@
package com.yx.service;
import com.github.pagehelper.PageInfo;
import com.yx.po.BookInfo;
import java.util.List;
public interface BookInfoService {
/**
*
*/
PageInfo<BookInfo> queryBookInfoAll(BookInfo bookInfo,Integer pageNum,Integer limit);
/**
*
*/
void addBookSubmit(BookInfo bookInfo);
/**
* id
*/
BookInfo queryBookInfoById(Integer id);
/**
*
*/
void updateBookSubmit(BookInfo info);
/**
* ids
*/
void deleteBookByIds(List<String> ids);
/**
*
*/
List<BookInfo> getBookCountByType();
}

@ -0,0 +1,36 @@
package com.yx.service;
import com.github.pagehelper.PageInfo;
import com.yx.po.LendList;
import java.util.List;
public interface LendListService {
//分页查询
PageInfo<LendList> queryLendListAll(LendList lendList, int page, int limit);
//添加借阅记录
void addLendListSubmit(LendList lendList);
/**
*
*/
void deleteLendListById(List<String> ids, List<String> bookIds);
/**
*
*/
void updateLendListSubmit(List<String> ids, List<String> bookIds);
/**
*
*/
void backBook(LendList lendList);
/**
* 线
*/
List<LendList> queryLookBookList(Integer rid, Integer bid);
}

@ -0,0 +1,31 @@
package com.yx.service;
import com.github.pagehelper.PageInfo;
import com.yx.po.Notice;
import java.util.List;
public interface NoticeService {
/**
*
*/
PageInfo<Notice> queryAllNotice(Notice notice,Integer pageNum,Integer limit);
/**
*
*/
void addNotice(Notice notice);
/**
* 便
*
*/
Notice queryNoticeById(Integer id);
/**
*
* @param ids
*/
void deleteNoticeByIds(List<String> ids);
}

@ -0,0 +1,39 @@
package com.yx.service;
import com.github.pagehelper.PageInfo;
import com.yx.po.ReaderInfo;
import java.util.List;
public interface ReaderInfoService {
/**
*
*/
PageInfo<ReaderInfo> queryAllReaderInfo(ReaderInfo readerInfo,Integer pageNum,Integer limit);
/**
*
*/
void addReaderInfoSubmit(ReaderInfo readerInfo);
/**
*
*/
ReaderInfo queryReaderInfoById(Integer id);
/**
*
*/
void updateReaderInfoSubmit(ReaderInfo readerInfo);
/**
*
*/
void deleteReaderInfoByIds(List<String> ids);
/**
*
*/
ReaderInfo queryUserInfoByNameAndPassword(String username,String password);
}

@ -0,0 +1,34 @@
package com.yx.service;
import com.github.pagehelper.PageInfo;
import com.yx.po.TypeInfo;
import java.util.List;
public interface TypeInfoService {
/**
*
*/
PageInfo<TypeInfo> queryTypeInfoAll(String name, Integer pageNum, Integer limit);
/**
*
*/
void addTypeSubmit(TypeInfo info);
/**
* id
*/
TypeInfo queryTypeInfoById(Integer id);
/**
*
*/
void updateTypeSubmit(TypeInfo info);
/**
* ids
*/
void deleteTypeByIds(List<String> id);
}

@ -0,0 +1,52 @@
package com.yx.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yx.dao.AdminMapper;
import com.yx.po.Admin;
import com.yx.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("adminService")
public class AdminServiceImpl implements AdminService {
@Autowired
private AdminMapper adminMapper;
@Override
public PageInfo<Admin> queryAdminAll(Admin admin, Integer pageNum, Integer limit) {
PageHelper.startPage(pageNum,limit);
List<Admin> adminList = adminMapper.queryAdminInfoAll(admin);
return new PageInfo<>(adminList) ;
}
@Override
public void addAdminSubmit(Admin admin) {
adminMapper.insert(admin);
}
@Override
public Admin queryAdminById(Integer id) {
return adminMapper.selectByPrimaryKey(id);
}
@Override
public void updateAdminSubmit(Admin admin) {
adminMapper.updateByPrimaryKey(admin);
}
@Override
public void deleteAdminByIds(List<String> ids) {
for (String id : ids){
adminMapper.deleteByPrimaryKey(Integer.parseInt(id));
}
}
@Override
public Admin queryUserByNameAndPassword(String username, String password) {
return adminMapper.queryUserByNameAndPassword(username,password);
}
}

@ -0,0 +1,52 @@
package com.yx.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yx.dao.BookInfoMapper;
import com.yx.po.BookInfo;
import com.yx.service.BookInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("bookInfoService")
public class BookInfoServiceImpl implements BookInfoService {
@Autowired
private BookInfoMapper bookInfoMapper;
@Override
public PageInfo<BookInfo> queryBookInfoAll(BookInfo bookInfo, Integer pageNum, Integer limit) {
PageHelper.startPage(pageNum,limit);
List<BookInfo> bookInfoList = bookInfoMapper.queryBookInfoAll(bookInfo);
return new PageInfo<>(bookInfoList);
}
@Override
public void addBookSubmit(BookInfo bookInfo) {
bookInfoMapper.insert(bookInfo);
}
@Override
public BookInfo queryBookInfoById(Integer id) {
return bookInfoMapper.selectByPrimaryKey(id);
}
@Override
public void updateBookSubmit(BookInfo info) {
bookInfoMapper.updateByPrimaryKeySelective(info);
}
@Override
public void deleteBookByIds(List<String> ids) {
for (String id : ids){
bookInfoMapper.deleteByPrimaryKey(Integer.parseInt(id));
}
}
@Override
public List<BookInfo> getBookCountByType() {
return bookInfoMapper.getBookCountByType();
}
}

@ -0,0 +1,100 @@
package com.yx.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yx.dao.BookInfoMapper;
import com.yx.dao.LendListMapper;
import com.yx.po.BookInfo;
import com.yx.po.LendList;
import com.yx.service.LendListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service("lendListService")
public class LendListServiceImpl implements LendListService {
@Autowired
private LendListMapper lendListMapper;
@Autowired
private BookInfoMapper bookInfoMapper;
@Override
public PageInfo<LendList> queryLendListAll(LendList lendList, int page, int limit) {
PageHelper.startPage(page,limit);
List<LendList> list=lendListMapper.queryLendListAll(lendList);
PageInfo pageInfo=new PageInfo(list);
return pageInfo;
}
@Override
public void addLendListSubmit(LendList lendList) {
lendListMapper.insert(lendList);
}
@Override
public void deleteLendListById(List<String> ids, List<String> bookIds) {
//删除借阅记录
for(String id:ids){
lendListMapper.deleteByPrimaryKey(Integer.parseInt(id));
}
//更改图书标识,更新状态为未借出
for(String bid:bookIds){
//根据id查询图书记录信息
BookInfo bookInfo=bookInfoMapper.selectByPrimaryKey(Integer.parseInt(bid));
bookInfo.setStatus(0);//该为未借出
bookInfoMapper.updateByPrimaryKey(bookInfo);
}
}
@Override
public void updateLendListSubmit(List<String> ids, List<String> bookIds) {
for(String id:ids){
//根据id查询借阅记录信息
LendList lendList=new LendList();
lendList.setId(Integer.parseInt(id));
lendList.setBackDate(new Date());
lendList.setBackType(0);//正常还书
lendListMapper.updateLendListSubmit(lendList);//如果用updatePrimarykey会默认很多赋值为空
}
//修改书的状态
//更改图书标识,更新状态为未借出
for(String bid:bookIds){
//根据id查询图书记录信息
BookInfo bookInfo=bookInfoMapper.selectByPrimaryKey(Integer.parseInt(bid));
bookInfo.setStatus(0);//该为未借出
bookInfoMapper.updateByPrimaryKey(bookInfo);
}
}
@Override
public void backBook(LendList lendList) {
LendList lend=new LendList();
lend.setId(lendList.getId());
lend.setBackType(lendList.getBackType());
lend.setBackDate(new Date());
lend.setExceptRemarks(lendList.getExceptRemarks());
lend.setBookId(lendList.getBookId());
lendListMapper.updateLendListSubmit(lend);
//判断异常还书 如果是延期或者正常还书,需要更改书的状态
if(lend.getBackType()==0 || lend.getBackType()==1){
BookInfo bookInfo=bookInfoMapper.selectByPrimaryKey(lend.getBookId());
bookInfo.setStatus(0);//该为未借出
bookInfoMapper.updateByPrimaryKey(bookInfo);
}
}
@Override
public List<LendList> queryLookBookList(Integer rid, Integer bid) {
return lendListMapper.queryLookBookList(rid, bid);
}
}

@ -0,0 +1,42 @@
package com.yx.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yx.dao.NoticeMapper;
import com.yx.po.Notice;
import com.yx.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("noticeService")
public class NoticeServiceImpl implements NoticeService {
@Autowired
private NoticeMapper noticeMapper;
@Override
public PageInfo<Notice> queryAllNotice(Notice notice, Integer pageNum, Integer limit) {
PageHelper.startPage(pageNum,limit);//业务层实现分页
List<Notice> noticeList = noticeMapper.queryNoticeAll(notice);
return new PageInfo<>(noticeList);
}
@Override
public void addNotice(Notice notice) {
noticeMapper.insert(notice);
}
@Override
public Notice queryNoticeById(Integer id) {
return noticeMapper.selectByPrimaryKey(id);
}
@Override
public void deleteNoticeByIds(List<String> ids) {
for (String id : ids){
noticeMapper.deleteByPrimaryKey(Integer.parseInt(id));
}
}
}

@ -0,0 +1,52 @@
package com.yx.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yx.dao.ReaderInfoMapper;
import com.yx.po.ReaderInfo;
import com.yx.service.ReaderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("readerInfoService")
public class ReaderInfoServiceImpl implements ReaderInfoService {
@Autowired
private ReaderInfoMapper readerInfoMapper;
@Override
public PageInfo<ReaderInfo> queryAllReaderInfo(ReaderInfo readerInfo, Integer pageNum, Integer limit) {
PageHelper.startPage(pageNum,limit);
List<ReaderInfo> readerInfoList = readerInfoMapper.queryAllReaderInfo(readerInfo);
return new PageInfo<>(readerInfoList);
}
@Override
public void addReaderInfoSubmit(ReaderInfo readerInfo) {
readerInfoMapper.insert(readerInfo);
}
@Override
public ReaderInfo queryReaderInfoById(Integer id) {
return readerInfoMapper.selectByPrimaryKey(id);
}
@Override
public void updateReaderInfoSubmit(ReaderInfo readerInfo) {
readerInfoMapper.updateByPrimaryKey(readerInfo);
}
@Override
public void deleteReaderInfoByIds(List<String> ids) {
for (String id : ids){
readerInfoMapper.deleteByPrimaryKey(Integer.parseInt(id));
}
}
@Override
public ReaderInfo queryUserInfoByNameAndPassword(String username, String password) {
return readerInfoMapper.queryUserInfoByNameAndPassword(username, password);
}
}

@ -0,0 +1,52 @@
package com.yx.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yx.dao.TypeInfoMapper;
import com.yx.po.TypeInfo;
import com.yx.service.TypeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
@Service("typeInfoService")
public class TypeInfoServiceImpl implements TypeInfoService {
@Autowired
private TypeInfoMapper typeInfoMapper;
@Override
public PageInfo<TypeInfo> queryTypeInfoAll(String name,Integer pageNum,Integer limit) {
PageHelper.startPage(pageNum,limit);
List<TypeInfo> typeInfoList = typeInfoMapper.queryTypeInfoAll(name);
return new PageInfo<>(typeInfoList);
}
@Override
public void addTypeSubmit(TypeInfo info) {
typeInfoMapper.addTypeSubmit(info);
}
@Override
public TypeInfo queryTypeInfoById(Integer id) {
return typeInfoMapper.queryTypeInfoById(id);
}
@Override
public void updateTypeSubmit(TypeInfo info) {
typeInfoMapper.updateTypeSubmit(info);
}
@Override
public void deleteTypeByIds(List<String> id) {
List<Integer> list=new ArrayList<>();
for(String cid:id){
int id2= Integer.valueOf(cid);
list.add(id2);
}
typeInfoMapper.deleteTypeByIds(list);
}
}

@ -0,0 +1,18 @@
package com.yx.utils;
public class Constants {
public final static int OK_CODE = 0; //0表示Ok
public final static int FAIL_CODE = 400;
public final static String OK_MSG = "请求成功";
public final static String FAIL_MSG = "请求失败";
public final static int STATUS_0 = 0;//可用状态
public final static int STATUS_1 = 1;//禁用状态
public final static String CACHE_NAME = "KACache";
}

@ -0,0 +1,88 @@
package com.yx.utils;
import java.io.Serializable;
/**
*
*/
public class DataInfo implements Serializable {
private static final long serialVersionUID = 1L;
private Integer code;
private String msg;
private Object data; //json数据
private Long count; // 分页信息:总条数
public DataInfo() {
}
public DataInfo(Integer code, String msg, Object data) {
this.code = code;
this.msg = msg;
this.data = data;
}
public DataInfo(Integer code, String msg, Object data, Long count) {
this.code = code;
this.msg = msg;
this.data = data;
this.count = count;
}
public Integer getCode() {
return code;
}
public static DataInfo ok() {
return new DataInfo(Constants.OK_CODE, Constants.OK_MSG, null);
}
public static DataInfo ok(Object data) {
return new DataInfo(Constants.OK_CODE, Constants.OK_MSG, data);
}
public static DataInfo ok(String msg, long count, Object data) {
return new DataInfo(Constants.OK_CODE, Constants.OK_MSG, data,count);
}
public static DataInfo ok(String msg, Object data) {
return new DataInfo(Constants.OK_CODE, msg, data);
}
public static DataInfo fail(String msg) {
return new DataInfo(Constants.FAIL_CODE, msg, null);
}
public static DataInfo fail(int errorCode, String msg) {
return new DataInfo(errorCode, msg, null);
}
public void setCode(Integer code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
}

@ -0,0 +1,137 @@
<?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="com.yx.dao.AdminMapper">
<resultMap id="BaseResultMap" type="com.yx.po.Admin">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="adminType" jdbcType="INTEGER" property="adminType" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
id, username, password, adminType
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
select
<include refid="Base_Column_List" />
from admin
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
delete from admin
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yx.po.Admin">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
insert into admin (id, username, password,
adminType)
values (#{id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{adminType,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.yx.po.Admin">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
insert into admin
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="username != null">
username,
</if>
<if test="password != null">
password,
</if>
<if test="adminType != null">
adminType,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="adminType != null">
#{adminType,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yx.po.Admin">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
update admin
<set>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="adminType != null">
adminType = #{adminType,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yx.po.Admin">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
update admin
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
adminType = #{adminType,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="queryAdminInfoAll" parameterType="com.yx.po.Admin" resultType="com.yx.po.Admin">
SELECT * from admin
<where>
<if test="username!=null">
and username like '%${username}%'
</if>
<if test="adminType!=null">
and adminType like '%${adminType}%'
</if>
</where>
</select>
<select id="queryUserByNameAndPassword" resultType="com.yx.po.Admin">
select * from admin where username=#{username} and password=#{password}
</select>
</mapper>

@ -0,0 +1,238 @@
<?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="com.yx.dao.BookInfoMapper">
<resultMap id="BaseResultMap" type="com.yx.po.BookInfo">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="author" jdbcType="VARCHAR" property="author" />
<result column="publish" jdbcType="VARCHAR" property="publish" />
<result column="isbn" jdbcType="VARCHAR" property="isbn" />
<result column="introduction" jdbcType="VARCHAR" property="introduction" />
<result column="language" jdbcType="VARCHAR" property="language" />
<result column="price" jdbcType="DOUBLE" property="price" />
<result column="publish_date" jdbcType="DATE" property="publishDate" />
<result column="type_id" jdbcType="INTEGER" property="typeId" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
id, name, author, publish, isbn, introduction, language, price, publish_date, type_id,
status
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
select
<include refid="Base_Column_List" />
from book_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
delete from book_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yx.po.BookInfo">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
insert into book_info (id, name, author,
publish, isbn, introduction,
language, price, publish_date,
type_id, status)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR},
#{publish,jdbcType=VARCHAR}, #{isbn,jdbcType=VARCHAR}, #{introduction,jdbcType=VARCHAR},
#{language,jdbcType=VARCHAR}, #{price,jdbcType=DOUBLE}, #{publishDate,jdbcType=DATE},
#{typeId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.yx.po.BookInfo">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
insert into book_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="author != null">
author,
</if>
<if test="publish != null">
publish,
</if>
<if test="isbn != null">
isbn,
</if>
<if test="introduction != null">
introduction,
</if>
<if test="language != null">
language,
</if>
<if test="price != null">
price,
</if>
<if test="publishDate != null">
publish_date,
</if>
<if test="typeId != null">
type_id,
</if>
<if test="status != null">
status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="author != null">
#{author,jdbcType=VARCHAR},
</if>
<if test="publish != null">
#{publish,jdbcType=VARCHAR},
</if>
<if test="isbn != null">
#{isbn,jdbcType=VARCHAR},
</if>
<if test="introduction != null">
#{introduction,jdbcType=VARCHAR},
</if>
<if test="language != null">
#{language,jdbcType=VARCHAR},
</if>
<if test="price != null">
#{price,jdbcType=DOUBLE},
</if>
<if test="publishDate != null">
#{publishDate,jdbcType=DATE},
</if>
<if test="typeId != null">
#{typeId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yx.po.BookInfo">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
update book_info
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="author != null">
author = #{author,jdbcType=VARCHAR},
</if>
<if test="publish != null">
publish = #{publish,jdbcType=VARCHAR},
</if>
<if test="isbn != null">
isbn = #{isbn,jdbcType=VARCHAR},
</if>
<if test="introduction != null">
introduction = #{introduction,jdbcType=VARCHAR},
</if>
<if test="language != null">
language = #{language,jdbcType=VARCHAR},
</if>
<if test="price != null">
price = #{price,jdbcType=DOUBLE},
</if>
<if test="publishDate != null">
publish_date = #{publishDate,jdbcType=DATE},
</if>
<if test="typeId != null">
type_id = #{typeId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yx.po.BookInfo">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
update book_info
set name = #{name,jdbcType=VARCHAR},
author = #{author,jdbcType=VARCHAR},
publish = #{publish,jdbcType=VARCHAR},
isbn = #{isbn,jdbcType=VARCHAR},
introduction = #{introduction,jdbcType=VARCHAR},
language = #{language,jdbcType=VARCHAR},
price = #{price,jdbcType=DOUBLE},
publish_date = #{publishDate,jdbcType=DATE},
type_id = #{typeId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<resultMap id="queryBookAllMap" type="com.yx.po.BookInfo" extends="BaseResultMap">
<association property="typeInfo" javaType="com.yx.po.TypeInfo">
<id column="id" property="id"></id>
<result column="type_name" property="name"></result>
</association>
</resultMap>
<select id="queryBookInfoAll" parameterType="com.yx.po.BookInfo" resultMap="queryBookAllMap">
select book_info.*,type_info.name as type_name
from book_info,type_info
where type_info.id = book_info.type_id
<if test="name!=null">
and book_info.name like '%${name}%'
</if>
<if test="isbn!=null">
and book_info.isbn like '%${isbn}%'
</if>
<if test="typeId!=null">
and book_info.type_id like '%${typeId}%'
</if>
</select>
<!--根据图书类型获取图书对应数量信息-->
<select id="getBookCountByType" resultType="com.yx.po.BookInfo">
SELECT
count( book.id ) AS counts,
type.NAME
FROM
book_info book
LEFT JOIN type_info type ON type.id = book.type_id
GROUP BY
book.type_id
</select>
</mapper>

@ -0,0 +1,250 @@
<?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="com.yx.dao.LendListMapper">
<resultMap id="BaseResultMap" type="com.yx.po.LendList">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="bookId" jdbcType="INTEGER" property="bookId" />
<result column="readerId" jdbcType="INTEGER" property="readerId" />
<result column="lendDate" jdbcType="TIMESTAMP" property="lendDate" />
<result column="backDate" jdbcType="TIMESTAMP" property="backDate" />
<result column="backType" jdbcType="INTEGER" property="backType" />
<result column="exceptRemarks" jdbcType="VARCHAR" property="exceptRemarks" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
id, bookId, readerId, lendDate, backDate, backType, exceptRemarks
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
select
<include refid="Base_Column_List" />
from lend_list
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
delete from lend_list
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yx.po.LendList">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
insert into lend_list (id, bookId, readerId,
lendDate, backDate, backType,
exceptRemarks)
values (#{id,jdbcType=INTEGER}, #{bookId,jdbcType=INTEGER}, #{readerId,jdbcType=INTEGER},
#{lendDate,jdbcType=TIMESTAMP}, #{backDate,jdbcType=TIMESTAMP}, #{backType,jdbcType=INTEGER},
#{exceptRemarks,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.yx.po.LendList">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
insert into lend_list
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="bookId != null">
bookId,
</if>
<if test="readerId != null">
readerId,
</if>
<if test="lendDate != null">
lendDate,
</if>
<if test="backDate != null">
backDate,
</if>
<if test="backType != null">
backType,
</if>
<if test="exceptRemarks != null">
exceptRemarks,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="bookId != null">
#{bookId,jdbcType=INTEGER},
</if>
<if test="readerId != null">
#{readerId,jdbcType=INTEGER},
</if>
<if test="lendDate != null">
#{lendDate,jdbcType=TIMESTAMP},
</if>
<if test="backDate != null">
#{backDate,jdbcType=TIMESTAMP},
</if>
<if test="backType != null">
#{backType,jdbcType=INTEGER},
</if>
<if test="exceptRemarks != null">
#{exceptRemarks,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yx.po.LendList">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
update lend_list
<set>
<if test="bookId != null">
bookId = #{bookId,jdbcType=INTEGER},
</if>
<if test="readerId != null">
readerId = #{readerId,jdbcType=INTEGER},
</if>
<if test="lendDate != null">
lendDate = #{lendDate,jdbcType=TIMESTAMP},
</if>
<if test="backDate != null">
backDate = #{backDate,jdbcType=TIMESTAMP},
</if>
<if test="backType != null">
backType = #{backType,jdbcType=INTEGER},
</if>
<if test="exceptRemarks != null">
exceptRemarks = #{exceptRemarks,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yx.po.LendList">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
update lend_list
set bookId = #{bookId,jdbcType=INTEGER},
readerId = #{readerId,jdbcType=INTEGER},
lendDate = #{lendDate,jdbcType=TIMESTAMP},
backDate = #{backDate,jdbcType=TIMESTAMP},
backType = #{backType,jdbcType=INTEGER},
exceptRemarks = #{exceptRemarks,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<!--高级查询映射文件-->
<resultMap id="queryLendListAllMap" type="com.yx.po.LendList" extends="BaseResultMap">
<!--图书信息,需要得到图书名-->
<association property="bookInfo" javaType="com.yx.po.BookInfo">
<id property="id" column="id"></id>
<result property="name" column="bookName"></result>
</association>
<!--读者信息,需要得到读者卡号和真实姓名-->
<association property="readerInfo" javaType="com.yx.po.ReaderInfo">
<id property="id" column="id"></id>
<result property="realName" column="realName"></result>
<result property="readerNumber" column="readerNumber"></result>
</association>
</resultMap>
<!--查询所有记录-->
<select id="queryLendListAll" parameterType="com.yx.po.LendList" resultMap="queryLendListAllMap">
SELECT lend.*,
book.name as bookName,
reader.realName as realName,
reader.readerNumber
from lend_list lend LEFT JOIN book_info book on book.id=lend.bookId
LEFT JOIN reader_info reader on reader.id=lend.readerId
<!--带条件的高级查询-->
<where>
<if test="bookInfo!=null">
<!--根据图书名称查询-->
<if test="bookInfo.name!=null and bookInfo.name!=''">
and book.name like '%${bookInfo.name}%'
</if>
<!--还需判断返还时间是否为空
如果书已经被借走状态为1还没有还则返回时间=null
如果书已经归还状态为0则返回时间非空即还书时间
-->
<if test="bookInfo.status!=null and bookInfo.status==1">
and book.status=1 and backDate is null
</if>
<if test="bookInfo.status!=null and bookInfo.status==0">
and book.status=0 and backDate is not null
</if>
</if>
<!--根据借阅卡查询-->
<if test="readerInfo!=null">
<if test="readerInfo.readerNumber!=null and readerInfo.readerNumber!=''">
and readerNumber like '%${readerInfo.readerNumber}%'
</if>
</if>
<!--根据归还类型查询-->
<if test="backType!=null">
and backType=#{backType}
</if>
</where>
order by lend.lendDate desc
</select>
<!--还书-->
<update id="updateLendListSubmit" parameterType="com.yx.po.LendList">
update lend_list
<set>
backDate=#{backDate},
<if test="backType!=null">
backType=#{backType},
</if>
<if test="exceptRemarks!=null and exceptRemarks!=''">
exceptRemarks=#{exceptRemarks}
</if>
</set>
where id=#{id}
</update>
<!--查询时间线-->
<select id="queryLookBookList" resultMap="queryLendListAllMap">
SELECT
lend.*,
reader.readerNumber,
bookInfo.name AS bookName,
reader.realName AS realName
FROM
lend_list lend
LEFT JOIN reader_info reader ON reader.id = lend.readerId
LEFT JOIN book_info bookInfo ON bookInfo.id = lend.bookId
<where>
<if test="bid!=null">and bookInfo.id=#{bid} </if>
<if test="rid!=null">and reader.id=#{rid} </if>
</where>
order by lend.id desc
</select>
</mapper>

@ -0,0 +1,144 @@
<?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="com.yx.dao.NoticeMapper">
<resultMap id="BaseResultMap" type="com.yx.po.Notice">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="topic" jdbcType="VARCHAR" property="topic" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="author" jdbcType="VARCHAR" property="author" />
<result column="createDate" jdbcType="TIMESTAMP" property="createDate" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
id, topic, content, author, createDate
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
select
<include refid="Base_Column_List" />
from notice
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
delete from notice
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yx.po.Notice">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
insert into notice (id, topic, content,
author, createDate)
values (#{id,jdbcType=INTEGER}, #{topic,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
#{author,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.yx.po.Notice">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
insert into notice
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="topic != null">
topic,
</if>
<if test="content != null">
content,
</if>
<if test="author != null">
author,
</if>
<if test="createDate != null">
createDate,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="topic != null">
#{topic,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="author != null">
#{author,jdbcType=VARCHAR},
</if>
<if test="createDate != null">
#{createDate,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yx.po.Notice">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
update notice
<set>
<if test="topic != null">
topic = #{topic,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="author != null">
author = #{author,jdbcType=VARCHAR},
</if>
<if test="createDate != null">
createDate = #{createDate,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yx.po.Notice">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
update notice
set topic = #{topic,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
author = #{author,jdbcType=VARCHAR},
createDate = #{createDate,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="queryNoticeAll" parameterType="com.yx.po.Notice" resultType="com.yx.po.Notice">
select * from notice
<where>
<if test="topic!=null and topic!=''">
and topic like '%${topic}%'
</if>
</where>
order by createDate desc
</select>
</mapper>

@ -0,0 +1,227 @@
<?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="com.yx.dao.ReaderInfoMapper">
<resultMap id="BaseResultMap" type="com.yx.po.ReaderInfo">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="realName" jdbcType="VARCHAR" property="realName" />
<result column="sex" jdbcType="VARCHAR" property="sex" />
<result column="birthday" jdbcType="DATE" property="birthday" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="tel" jdbcType="VARCHAR" property="tel" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="registerDate" jdbcType="TIMESTAMP" property="registerDate" />
<result column="readerNumber" jdbcType="VARCHAR" property="readerNumber" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
id, username, password, realName, sex, birthday, address, tel, email, registerDate,
readerNumber
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
select
<include refid="Base_Column_List" />
from reader_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
delete from reader_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yx.po.ReaderInfo">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
insert into reader_info (id, username, password, realName, sex,
birthday, address, tel,
email, registerDate, readerNumber
)
values (#{id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{realName,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR},
#{birthday,jdbcType=DATE}, #{address,jdbcType=VARCHAR}, #{tel,jdbcType=VARCHAR},
#{email,jdbcType=VARCHAR}, #{registerDate,jdbcType=TIMESTAMP}, #{readerNumber,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.yx.po.ReaderInfo">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
insert into reader_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="username != null">
username,
</if>
<if test="password != null">
password,
</if>
<if test="realName != null">
realName,
</if>
<if test="sex != null">
sex,
</if>
<if test="birthday != null">
birthday,
</if>
<if test="address != null">
address,
</if>
<if test="tel != null">
tel,
</if>
<if test="email != null">
email,
</if>
<if test="registerDate != null">
registerDate,
</if>
<if test="readerNumber != null">
readerNumber,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="realName != null">
#{realName,jdbcType=VARCHAR},
</if>
<if test="sex != null">
#{sex,jdbcType=VARCHAR},
</if>
<if test="birthday != null">
#{birthday,jdbcType=DATE},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="tel != null">
#{tel,jdbcType=VARCHAR},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
<if test="registerDate != null">
#{registerDate,jdbcType=TIMESTAMP},
</if>
<if test="readerNumber != null">
#{readerNumber,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yx.po.ReaderInfo">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
update reader_info
<set>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="realName != null">
realName = #{realName,jdbcType=VARCHAR},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=VARCHAR},
</if>
<if test="birthday != null">
birthday = #{birthday,jdbcType=DATE},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="tel != null">
tel = #{tel,jdbcType=VARCHAR},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="registerDate != null">
registerDate = #{registerDate,jdbcType=TIMESTAMP},
</if>
<if test="readerNumber != null">
readerNumber = #{readerNumber,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yx.po.ReaderInfo">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Mar 30 16:30:04 CST 2021.
-->
update reader_info
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
realName = #{realName,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR},
birthday = #{birthday,jdbcType=DATE},
address = #{address,jdbcType=VARCHAR},
tel = #{tel,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
registerDate = #{registerDate,jdbcType=TIMESTAMP},
readerNumber = #{readerNumber,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="queryAllReaderInfo" resultType="com.yx.po.ReaderInfo" parameterType="com.yx.po.ReaderInfo">
select * from reader_info
<where>
<!--读者图书卡号-->
<if test="readerNumber!=null">
and readerNumber like '%${readerNumber}%'
</if>
<!--用户名-->
<if test="username!=null">
and username like '%${username}%'
</if>
<!--电话号-->
<if test="tel!=null">
and tel like '%${tel}%'
</if>
</where>
</select>
<select id="queryUserInfoByNameAndPassword" resultType="com.yx.po.ReaderInfo">
select * from reader_info where username=#{username} and password=#{password}
</select>
</mapper>

@ -0,0 +1,40 @@
<?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="com.yx.dao.TypeInfoMapper" >
<!--查询全部类型信息-->
<select id="queryTypeInfoAll" resultType="com.yx.po.TypeInfo">
select * from type_info
<where>
<if test="name!=null">
and name like '%${name}%'
</if>
</where>
</select>
<!--类型的添加-->
<insert id="addTypeSubmit">
insert into type_info (name,remarks)values(#{name},#{remarks})
</insert>
<!--根据id查询类型信息-->
<select id="queryTypeInfoById" resultType="com.yx.po.TypeInfo">
select * from type_info where id=#{id}
</select>
<!--修改图书类型-->
<update id="updateTypeSubmit">
update type_info set name=#{name},remarks=#{remarks} where id=#{id}
</update>
<!--删除类型-->
<delete id="deleteTypeByIds" parameterType="List">
delete from type_info where id in
<foreach collection="list" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="queryTypeName" resultType="com.yx.po.TypeInfo">
select type.name
from type_info type
</select>
</mapper>

@ -0,0 +1,4 @@
jdbc.driver = com.mysql.cj.jdbc.Driver
jdbc.url = jdbc:mysql://localhost:3306/library?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
jdbc.username = root
jdbc.password = 1233

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<classPathEntry location="D:\Maven\apache-maven-3.6.0\mvn\repository\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar" />
<context id="msqlTables" targetRuntime="MyBatis3">
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>
<jdbcConnection connectionURL="jdbc:mysql://localhost:3306/library?useUnicode=true&amp;characterEncoding=utf-8"
driverClass="com.mysql.jdbc.Driver" password="root" userId="root" >
<property name="nullCatalogMeansCurrent" value="true"/>
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!-- 生成实体类和数据库表一一对应 -->
<javaModelGenerator targetPackage="com.yx.po" targetProject="D:\IDEAProject\libraryProject\src\main\java">
<property name="enableSubPackages" value="true"/>
<!-- 从数据库返回的值被清理前后的空格 -->
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!--映射xml文件及dao接口-->
<sqlMapGenerator targetPackage="com.yx.dao" targetProject="D:\IDEAProject\libraryProject\src\main\resources">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<javaClientGenerator type="XMLMAPPER" targetPackage="com.yx.dao" targetProject="D:\IDEAProject\libraryProject\src\main\java">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!--数据库表-->
<table tableName="admin" domainObjectName="Admin"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false" >
<property name="useActualColumnNames" value="false"/>
</table>
<table tableName="book_info" domainObjectName="BookInfo"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false" >
<property name="useActualColumnNames" value="false"/>
</table>
<table tableName="lend_list" domainObjectName="LendList"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false" >
<property name="useActualColumnNames" value="false"/>
</table>
<table tableName="notice" domainObjectName="Notice"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false" >
<property name="useActualColumnNames" value="false"/>
</table>
<table tableName="reader_info" domainObjectName="ReaderInfo"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false" >
<property name="useActualColumnNames" value="false"/>
</table>
<table tableName="type_info" domainObjectName="TypeInfo"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false" >
<property name="useActualColumnNames" value="false"/>
</table>
</context>
</generatorConfiguration>

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<!--Spring接管MyBatis内容-->
<!--DataSource Druid连接池-->
<context:property-placeholder location="classpath:db.properties"/>
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<!--基本配置-->
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
<!--SqlSessionFactory 要DataSource支持-->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!--注入连接池-->
<property name="dataSource" ref="dataSource"/>
<!--使得实体类中用类名作为别名-->
<property name="typeAliasesPackage" value="com.yx.po"></property>
<!--分页-->
<property name="plugins">
<array>
<bean class="com.github.pagehelper.PageInterceptor">
<property name="properties">
<props>
<!--页号在合理值 0 - max-->
<prop key="reasonable">true</prop>
</props>
</property>
</bean>
</array>
</property>
</bean>
<!--Dao 需要 MapperScannerConfigurer支持-->
<bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.yx.dao"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean>
<!--告知spring注解位置保证注解有效性下面注解扫描表示Controller不扫给service和dao扫描-->
<context:component-scan base-package="com.yx">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"></context:exclude-filter>
</context:component-scan>
<!--引入一个事务管理器-->
<bean id="tx" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!--@Transactional 告诉spring定制事务是基于DataSourceTransactionManager-->
<tx:annotation-driven transaction-manager="tx"></tx:annotation-driven>
</beans>

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<!--开启注解扫描只扫描Controller注解-->
<context:component-scan base-package="com.yx.controller"></context:component-scan>
<!--注册注解驱动开启SpringMVC注解的支持-->
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
<!--声明类型转换若返回的是json就需要加这个进行转换-->
<property name="supportedMediaTypes">
<list>
<value>application/json</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<!--配置的视图解析器对象-->
<bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/pages/"/>
<property name="suffix" value=".jsp"/>
</bean>
<!--配置拦截器-->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<mvc:exclude-mapping path="/login"/>
<mvc:exclude-mapping path="/loginIn"/>
<mvc:exclude-mapping path="/verifyCode"/>
<bean class="com.yx.interceptor.LoginInterceptor"></bean>
</mvc:interceptor>
</mvc:interceptors>
<!--过滤静态资源-->
<mvc:default-servlet-handler></mvc:default-servlet-handler>
<mvc:resources mapping="/images/**" location="/images/"></mvc:resources>
<mvc:resources mapping="/css/**" location="/css/"></mvc:resources>
<mvc:resources mapping="/js/**" location="/js/"></mvc:resources>
<mvc:resources mapping="/lib/**" location="/lib/"></mvc:resources>
<mvc:resources mapping="/api/**" location="/api/"></mvc:resources>
</beans>

@ -0,0 +1,86 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<meta charset="utf-8">
<title>管理员添加</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<div class="layui-form-item">
<label class="layui-form-label required">用户名</label>
<div class="layui-input-block">
<input type="text" name="username" lay-verify="required" lay-reqtext="用户名不能为空" autocomplete="off" placeholder="请输入用户名" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">密码</label>
<div class="layui-input-block">
<input type="password" name="password" lay-verify="required" lay-reqtext="密码不能为空" placeholder="请输入密码" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">管理员类型</label>
<div class="layui-input-block">
<select class="layui-input" name="adminType" id="adminType">
<option value=""></option>
<option value="0">普通管理员</option>
<option value="1">高级管理员</option>
</select>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form'], function () {
var form = layui.form,
layer = layui.layer,
$ = layui.$;
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
//向后台发送数据提交添加
$.ajax({
url:"addAdminSubmit",
type:"POST",
data:datas,
success:function(result){
if(result.code==0){//如果成功
layer.msg('添加成功',{
icon:6,
time:500
},function(){
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
})
}else{
layer.msg("类型添加失败");
}
}
})
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,230 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>管理员管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div class="demoTable">
<div class="layui-form-item layui-form">
用户名:
<div class="layui-inline">
<input class="layui-input" name="username" id="username" autocomplete="off">
</div>
管理员类型:
<div class="layui-inline">
<select id="adminType" name="adminType" class="layui-input">
<option value="">请选择</option>
<option value="0">普通管理员</option>
<option value="1">高级管理员</option>
</select>
</div>
<button class="layui-btn" data-type="reload">搜索</button>
</div>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 添加 </button>
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete"> 删除 </button>
</div>
</script>
<!--表单,查询出的数据在这里显示-->
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
<script type="text/html" id="currentTableBar">
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">修改密码</a>
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
</script>
</div>
</div>
<script>
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
table.render({
elem: '#currentTableId',
url: '${pageContext.request.contextPath}/adminAll',//查询全部数据
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
cols: [[
{type: "checkbox", width: 50},
//{field: 'id', width: 100, title: 'ID', sort: true},
{field: 'username', width: 150, title: '用户名'},
{field: 'adminType', width: 200, title: '管理员类型',templet:function (res) {
if (res.adminType == '0'){
return '<span class="layui-btn layui-btn-normal layui-btn-xs">普通管理员</span>';
}else{
return '<span class="layui-btn layui-btn-normal layui-btn-xs" style="background-color: orangered;">高级管理员</span>';
}
}},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
limits: [10, 15, 20, 25, 50, 100],
limit: 15, <!--默认显示15条-->
page: true,
skin: 'line',
id:'testReload'
});
var $ = layui.$, active = {
reload: function(){
var username = $('#username').val();
var adminType = $('#adminType').val();
console.log(name)
//执行重载
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
}
,where: {
username: username,
adminType:adminType
}
}, 'data');
}
};
$('.demoTable .layui-btn').on('click', function(){
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
/**
* tool操作栏监听事件
*/
table.on('tool(currentTableFilter)', function (obj) {
var data=obj.data;
if (obj.event === 'edit') { // 监听修改操作
var index = layer.open({
title: '修改管理员信息',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['60%', '60%'],
content: '${pageContext.request.contextPath}/queryAdminById?id='+data.id,
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') { // 监听删除操作
layer.confirm('确定是否删除', function (index) {
//调用删除功能
deleteInfoByIds(data.id,index);
layer.close(index);
});
}
});
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
/**
* 获取选中记录的id信息
*/
function getCheackId(data){
var arr=new Array();
for(var i=0;i<data.length;i++){
arr.push(data[i].id);
}
//拼接id,变成一个字符串
return arr.join(",");
};
/**
* 提交删除功能
*/
function deleteInfoByIds(ids ,index){
//向后台发送请求
$.ajax({
url: "deleteAdminByIds",
type: "POST",
data: {ids: ids},
success: function (result) {
if (result.code == 0) {//如果成功
layer.msg('删除成功', {
icon: 6,
time: 500
}, function () {
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
});
} else {
layer.msg("删除失败");
}
}
})
};
/**
* toolbar栏监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'add') { // 监听添加操作
var index = layer.open({
title: '添加管理员',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['60%', '60%'],
content: '${pageContext.request.contextPath}/adminAdd',
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') {
/*
1、提示内容必须删除大于0条
2、获取要删除记录的id信息
3、提交删除功能 ajax
*/
//获取选中的记录信息
var checkStatus=table.checkStatus(obj.config.id);
var data=checkStatus.data;
if(data.length==0){//如果没有选中信息
layer.msg("请选择要删除的记录信息");
}else{
//获取记录信息的id集合,拼接的ids
var ids=getCheackId(data);
layer.confirm('确定是否删除', function (index) {
//调用删除功能
deleteInfoByIds(ids,index);
layer.close(index);
});
}
}
});
});
</script>
</body>
</html>

@ -0,0 +1,92 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<meta charset="utf-8">
<title>修改密码</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<input type="hidden" name="id" value="${id}">
<div class="layui-form-item">
<label class="layui-form-label required">旧密码</label>
<div class="layui-input-block">
<input type="password" name="oldPwd" lay-verify="required" lay-reqtext="旧密码不能为空" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label required">新密码</label>
<div class="layui-input-block">
<input type="password" name="newPwd" lay-verify="required" lay-reqtext="新密码不能为空" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label required">确认新密码</label>
<div class="layui-input-block">
<input type="password" name="newPwdAgain" lay-verify="required" lay-reqtext="新密码不能为空" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认修改</button>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form'], function () {
var form = layui.form,
layer = layui.layer,
$ = layui.$;
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
if (datas.newPwd != datas.newPwdAgain){
layer.msg("两次输入的新密码不一致,请重新输入")
}else{
//向后台发送数据提交添加
$.ajax({
url:"updatePwdSubmit",
type:"POST",
data: {
id:datas.id,
oldPwd:datas.oldPwd,
newPwd:datas.newPwd
},
success:function(result){
if(result.code==0){//如果成功
layer.msg("修改成功",{
icon:6,
time:500
},function(){
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
})
}else{
layer.msg(result.msg);
}
}
})
}
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,150 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<meta charset="utf-8">
<title>添加图书</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<div class="layui-form-item">
<label class="layui-form-label required">图书名称</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" lay-reqtext="图书名称不能为空" placeholder="请输入图书名称" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书编号</label>
<div class="layui-input-block">
<input type="text" name="isbn" lay-verify="required" lay-reqtext="图书编号不能为空" placeholder="请输入图书编号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书类别</label>
<div class="layui-input-block">
<select name="typeId" id="typeId" lay-verify="required">
<option value="">请选择</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书作者</label>
<div class="layui-input-block">
<input type="text" name="author" lay-verify="required" class="layui-input" autocomplete="off">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书出版社</label>
<div class="layui-input-block">
<input type="text" name="publish" lay-verify="required" class="layui-input" autocomplete="off">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书语言</label>
<div class="layui-input-block">
<input type="text" name="language" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书价格</label>
<div class="layui-input-block">
<input type="number" name="price" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">出版日期</label>
<div class="layui-input-block">
<input type="text" name="pubDate" id="date" lay-verify="date" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">图书介绍</label>
<div class="layui-input-block">
<textarea name="introduction" class="layui-textarea" placeholder="请输入介绍信息"></textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form','laydate'], function () {
var form = layui.form,
layer = layui.layer,
laydate=layui.laydate,
$ = layui.$;
//日期
laydate.render({
elem: '#date',
trigger:'click'
});
//动态获取图书类型的数据
$.get("findAllList",{},function (data) {
var list=data;
var select=document.getElementById("typeId");
if(list!=null|| list.size()>0){
for(var c in list){
var option=document.createElement("option");
option.setAttribute("value",list[c].id);
option.innerText=list[c].name;
select.appendChild(option);
}
}
form.render('select');
},"json")
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
//向后台发送数据提交添加
$.ajax({
url:"addBookSubmit",
type:"POST",
data:datas,
success:function(result){
if(result.code==0){//如果成功
layer.msg('添加成功',{
icon:6,
time:500
},function(){
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
})
}else{
layer.msg("添加失败");
}
}
})
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,251 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%--<%
String path=request.getContextPath();
String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>--%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>图书管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div class="demoTable">
<div class="layui-form-item layui-form ">
图书编号:
<div class="layui-inline">
<input class="layui-input" name="isbn" id="isbn" autocomplete="off">
</div>
书名:
<div class="layui-inline">
<input class="layui-input" name="name" id="name" autocomplete="off">
</div>
图书分类:
<div class="layui-inline">
<select id="typeId" name="typeId" lay-verify="required">
<option value="">请选择</option>
</select>
</div>
<button class="layui-btn" data-type="reload">搜索</button>
</div>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 添加 </button>
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete"> 删除 </button>
</div>
</script>
<!--表单,查询出的数据在这里显示-->
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
<script type="text/html" id="currentTableBar">
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="update">修改</a>
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
</script>
</div>
</div>
<script>
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
//动态获取图书类型的数据,即下拉菜单,跳出图书类型
$.get("findAllList",{},function (data) {
var list=data;
var select=document.getElementById("typeId");
if(list!=null|| list.size()>0){
for(var obj in list){
var option=document.createElement("option");
option.setAttribute("value",list[obj].id);
option.innerText=list[obj].name;
select.appendChild(option);
}
}
form.render('select');
},"json")
table.render({
elem: '#currentTableId',
url: '${pageContext.request.contextPath}/bookAll',//查询类型数据
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
cols: [[
{type: "checkbox", width: 50},
//{field: 'id', width: 100, title: 'ID', sort: true},
{field: 'isbn', width: 100, title: '图书编号'},
{field: 'name', width: 100, title: '图书名称'},
{templet:'<div>{{d.typeInfo.name}}</div>',width:100,title:'图书类型'},
{field: 'author', width: 80, title: '作者'},
{field: 'price', width: 80, title: '价格'},
{field: 'language', width: 80, title: '语言'},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
limits: [10, 15, 20, 25, 50, 100],
limit: 15, <!--默认显示15条-->
page: true,
skin: 'line',
id:'testReload'
});
var $ = layui.$, active = {
reload: function(){
var name = $('#name').val();
var isbn = $('#isbn').val();
var typeId = $('#typeId').val();
console.log(name)
//执行重载
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
}
,where: {
name: name,
isbn:isbn,
typeId:typeId
}
}, 'data');
}
};
$('.demoTable .layui-btn').on('click', function(){
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
/**
* tool操作栏监听事件
*/
table.on('tool(currentTableFilter)', function (obj) {
var data=obj.data;
if (obj.event === 'update') { // 监听修改操作
var index = layer.open({
title: '修改图书信息',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['100%', '100%'],
content: '${pageContext.request.contextPath}/queryBookInfoById?id='+data.id,
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') { // 监听删除操作
layer.confirm('确定是否删除', function (index) {
//调用删除功能
deleteInfoByIds(data.id,index);
layer.close(index);
});
}
});
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
/**
* 获取选中记录的id信息
*/
function getCheackId(data){
var arr=new Array();
for(var i=0;i<data.length;i++){
arr.push(data[i].id);
}
//拼接id,变成一个字符串
return arr.join(",");
};
/**
* 提交删除功能
*/
function deleteInfoByIds(ids ,index){
//向后台发送请求
$.ajax({
url: "deleteBook",
type: "POST",
data: {ids: ids},
success: function (result) {
if (result.code == 0) {//如果成功
layer.msg('删除成功', {
icon: 6,
time: 500
}, function () {
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
});
} else {
layer.msg("删除失败");
}
}
})
};
/**
* toolbar栏监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'add') { // 监听添加操作
var index = layer.open({
title: '添加图书',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['100%', '100%'],
content: '${pageContext.request.contextPath}/bookAdd',
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') {
/*
1、提示内容必须删除大于0条
2、获取要删除记录的id信息
3、提交删除功能 ajax
*/
//获取选中的记录信息
var checkStatus=table.checkStatus(obj.config.id);
var data=checkStatus.data;
if(data.length==0){//如果没有选中信息
layer.msg("请选择要删除的记录信息");
}else{
//获取记录信息的id集合,拼接的ids
var ids=getCheackId(data);
layer.confirm('确定是否删除', function (index) {
//调用删除功能
deleteInfoByIds(ids,index);
layer.close(index);
});
}
}
});
});
</script>
</body>
</html>

@ -0,0 +1,164 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page isELIgnored="false" %>
<html>
<head>
<meta charset="utf-8">
<title>修改图书</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<input type="hidden" name="id" value="${info.id}">
<div class="layui-form-item">
<label class="layui-form-label required">图书名称</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" value="${info.name}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书编号</label>
<div class="layui-input-block">
<input type="text" name="isbn" lay-verify="required"value="${info.isbn}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书类别</label>
<div class="layui-input-block">
<select name="typeId" id="typeId" lay-verify="required">
<option value="${info.typeId}">请选择</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书作者</label>
<div class="layui-input-block">
<input type="text" name="author" lay-verify="required" value="${info.author}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书出版社</label>
<div class="layui-input-block">
<input type="text" name="publish" lay-verify="required" value="${info.publish}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书语言</label>
<div class="layui-input-block">
<input type="text" name="language" value="${info.language}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书价格</label>
<div class="layui-input-block">
<input type="number" name="price" value="${info.price}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">出版日期</label>
<div class="layui-input-block">
<input type="text" name="publishDate" id="date"
value="<fmt:formatDate value="${info.publishDate}" pattern="yyyy-MM-dd"/>"
lay-verify="date" autocomplete="off" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">图书介绍</label>
<div class="layui-input-block">
<textarea name="introduction" class="layui-textarea" placeholder="请输入介绍信息">${info.introduction}</textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认修改</button>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form','laydate'], function () {
var form = layui.form,
layer = layui.layer,
laydate=layui.laydate,
$ = layui.$;
//日期
laydate.render({
elem: '#date',
trigger:'click'
});
//动态获取图书类型的数据
$.get("findAllList",{},function (data) {
//获取图书类型的值
var typeId=$('#typeId')[0].value;
var list=data;
var select=document.getElementById("typeId");
if(list!=null|| list.size()>0){
for(var c in list){
var option=document.createElement("option");
option.setAttribute("value",list[c].id);
option.innerText=list[c].name;
select.appendChild(option);
//如果类型和循环到的类型iD一致选中
if (list[c].id==typeId){
option.setAttribute("selected","selected");
layui.form.render('select');
}
}
}
form.render('select');
},"json")
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
//向后台发送数据提交添加
$.ajax({
url:"updateBookSubmit",
type:"POST",
// data:datas,
contentType:'application/json',
data:JSON.stringify(datas),
success:function(result){
if(result.code==0){//如果成功
layer.msg('修改成功',{
icon:6,
time:500
},function(){
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
})
}else{
layer.msg("修改失败");
}
}
})
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,68 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>统计数据</title>
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-min">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div id="main" style="width: 100%;min-height:500px"></div>
</div>
</div>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
layui.use(['layer', 'miniTab','echarts'], function () {
var $ = layui.jquery,
layer = layui.layer,
miniTab = layui.miniTab,
echarts = layui.echarts;
layui.use(['echarts'], function () {
var echarts = layui.echarts,
$ = layui.jquery;
console.log(echarts);
// 基于准备好的dom初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
//var myChart2 = echarts.init(document.getElementById('main2'));
// 指定图表的配置项和数据
var option = {
series : [
{
name: '访问来源',
type: 'pie',
radius: '55%',
data:[
<c:forEach items="${list}" var="type">
{value:${type.counts}, name:'${type.name}'},
</c:forEach>
,0
],
roseType: 'angle',
itemStyle: {
normal: {
shadowBlur: 200,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
// 使用刚指定的配置项和数据显示图表
myChart.setOption(option);
});
});
</script>
</body>
</html>

@ -0,0 +1,173 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--<%
String path=request.getContextPath();
String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>--%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>图书管理系统</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/layuimini.css?v=2.0.4" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/themes/default.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style id="layuimini-bg-color">
</style>
</head>
<body class="layui-layout-body layuimini-all">
<div class="layui-layout layui-layout-admin">
<div class="layui-header header">
<div class="layui-logo layuimini-logo"></div>
<div class="layuimini-header-content" >
<a>
<div class="layuimini-tool"><i title="展开" class="fa fa-outdent" data-side-fold="1"></i></div>
</a>
<!--电脑端头部菜单-->
<ul class="layui-nav layui-layout-left layuimini-header-menu layuimini-menu-header-pc layuimini-pc-show">
</ul>
<!--手机端头部菜单-->
<ul class="layui-nav layui-layout-left layuimini-header-menu layuimini-mobile-show">
<li class="layui-nav-item">
<a href="javascript:;"><i class="fa fa-list-ul"></i> 选择模块</a>
<dl class="layui-nav-child layuimini-menu-header-mobile">
</dl>
</li>
</ul>
<ul class="layui-nav layui-layout-right ">
<li class="layui-nav-item" lay-unselect>
<a href="javascript:;" data-refresh="刷新"><i class="fa fa-refresh"></i></a>
</li>
<li class="layui-nav-item" lay-unselect>
<a href="javascript:;" data-clear="清理" class="layuimini-clear"><i class="fa fa-trash-o"></i></a>
</li>
<li class="layui-nav-item mobile layui-hide-xs" lay-unselect>
<a href="javascript:;" data-check-screen="full"><i class="fa fa-arrows-alt"></i></a>
</li>
<li class="layui-nav-item layuimini-setting">
<a href="javascript:;"><span style="color: #BBBBBB">${sessionScope.user.username}</span></a>
<dl class="layui-nav-child">
<dd>
<a href="#" layuimini-content-href="${pageContext.request.contextPath}/updatePassword" data-title="修改密码" data-icon="fa fa-gears">修改密码</a>
</dd>
<dd>
<hr>
</dd>
<dd>
<a href="#" class="loginOut">退出登录</a>
</dd>
</dl>
</li>
</ul>
</div>
</div>
<!--无限极左侧菜单(功能管理)-->
<div class="layui-side layui-bg-black layuimini-menu-left">
</div>
<!--初始化加载层-->
<div class="layuimini-loader">
<div class="layuimini-loader-inner"></div>
</div>
<!--手机端遮罩层-->
<div class="layuimini-make"></div>
<!-- 移动导航 -->
<div class="layuimini-site-mobile"><i class="layui-icon"></i></div>
<div class="layui-body">
<div class="layuimini-tab layui-tab-rollTool layui-tab" lay-filter="layuiminiTab" lay-allowclose="true">
<ul class="layui-tab-title">
<li class="layui-this" id="layuiminiHomeTabId" lay-id=""></li>
</ul>
<div class="layui-tab-control">
<li class="layuimini-tab-roll-left layui-icon layui-icon-left"></li>
<li class="layuimini-tab-roll-right layui-icon layui-icon-right"></li>
<li class="layui-tab-tool layui-icon layui-icon-down">
<ul class="layui-nav close-box">
<li class="layui-nav-item">
<a href="javascript:;"><span class="layui-nav-more"></span></a>
<dl class="layui-nav-child">
<dd><a href="javascript:;" layuimini-tab-close="current">关 闭 当 前</a></dd>
<dd><a href="javascript:;" layuimini-tab-close="other">关 闭 其 他</a></dd>
<dd><a href="javascript:;" layuimini-tab-close="all">关 闭 全 部</a></dd>
</dl>
</li>
</ul>
</li>
</div>
<div class="layui-tab-content">
<div id="layuiminiHomeTabIframe" class="layui-tab-item layui-show"></div>
</div>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/js/lay-config.js?v=2.0.0" charset="utf-8"></script>
<script>
layui.use(['jquery', 'layer', 'miniAdmin','miniTongji'], function () {
var $ = layui.jquery,
layer = layui.layer,
miniAdmin = layui.miniAdmin,
miniTongji = layui.miniTongji;
var options = {
<c:choose>
<c:when test="${sessionScope.type.equals('reader')}">
iniUrl: "${pageContext.request.contextPath}/api/init2.json", // 初始化接口,读者
</c:when>
<c:otherwise>
iniUrl: "${pageContext.request.contextPath}/api/init.json", // 初始化接口,管理
</c:otherwise>
</c:choose>
clearUrl: "${pageContext.request.contextPath}/api/clear.json", // 缓存清理接口
urlHashLocation: true, // 是否打开hash定位
bgColorDefault: false, // 主题默认配置
menuChildOpen: true, // 是否默认展开菜单
loadingTime: 0, // 初始化加载时间
pageAnim: true, // iframe窗口动画
maxTabNum: 20, // 最大的tab打开数量
};
miniAdmin.render(options);
$('.loginOut').on("click", function () {
layer.msg('退出登录成功', {
icon: 6,
time: 500
},function () {
window.location = '${pageContext.request.contextPath}/loginOut';
});
});
});
</script>
</body>
</html>

@ -0,0 +1,151 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<meta charset="utf-8">
<title>借书</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<!---高级查询图书-->
<div class="layui-form-item">
<label class="layui-form-label required">图书名称</label>
<div class="layui-input-block">
<input class="layui-input" name="name" id="name" autocomplete="off" data-type="reload">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">图书列表</label>
<div class="layui-input-block">
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">借书卡号</label>
<div class="layui-input-block">
<input type="text" name="readerNumber" lay-verify="required" lay-reqtext="借书卡不能为空" placeholder="请输入借书卡" value="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认借书</button>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form', 'table'], function(){
// var table = layui.table;
var $ = layui.jquery,
form = layui.form,
table = layui.table;
//方法级渲染
table.render({
elem: '#currentTableId'
,url: '${pageContext.request.contextPath}/bookAll'
,cols: [[
{type: "checkbox", width: 50},
//{field: 'id', width: 100, title: 'ID', sort: true},
{field: 'isbn', width: 150, title: '图书编号'},
//获取对象中的属性 对象
{templet:'<div>{{d.typeInfo.name}}</div>', width: 80, title: '图书类型'},
{field: 'name', width: 80, title: '图书名称'},
{field: 'author', width: 80, title: '作者'},
{field: 'price', width: 80, title: '价格'},
{field: 'language', width: 80, title: '语言'},
]]
,id: 'testReload'
,height: 310,
page:false
});
var $ = layui.$, active = {
reload: function(){
var name = $('#name').val()
//执行重载
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
}
,where: {
name:name
}
}, 'data');
}
};
$('input[name=name]').change(function() {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
/**
* 获取选中记录的id信息
*/
function getCheackId(data){
var arr=new Array();
for(var i=0;i<data.length;i++){
arr.push(data[i].id);
}
//拼接id
return arr.join(",");
};
/**
* form添加操作
*/
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
var selectData = layui.table.checkStatus('testReload').data;
var ids=getCheackId(selectData);
var readerNumber=datas.readerNumber;
var value={readerNumber:readerNumber,ids:ids};
lendBook(value);
});
/**
* 提交删除功能
*/
function lendBook(datas){
//向后台发送请求
$.ajax({
url: "addLend",
type: "POST",
data: datas,
success: function (result) {
if (result.code == 0) {//如果成功
layer.msg('借书成功',{
icon:6,
time:500
},function(){
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
})
} else {
layer.msg(result.msg);
}
}
})
};
});
</script>
</body>
</html>

@ -0,0 +1,88 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page isELIgnored="false" %>
<html>
<head>
<meta charset="utf-8">
<title>异常还书</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<input type="hidden" name="id" value="${id}"/>
<input type="hidden" name="bookId" value="${bid}"/>
<div class="layui-form-item">
<label class="layui-form-label required">异常类型</label>
<div class="layui-input-block">
<select name="backType" id="backType" lay-verify="required">
<option value="">请选择</option>
<%-- <option value="0">正常还书</option>--%>
<option value="1">延迟还书</option>
<option value="2">破损还书</option>
<option value="3">丢失</option>
</select>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">异常备注</label>
<div class="layui-input-block">
<textarea name="remarks" class="layui-textarea" > </textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认还书</button>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form'], function () {
var form = layui.form,
layer = layui.layer,
$ = layui.$;
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
//向后台发送数据提交添加
$.ajax({
url:"updateLendInfoSubmit",
type:"POST",
data:datas,
// contentType:"application/json",
// data:JSON.stringify(datas),
success:function(result){
if(result.code==0){//如果成功
layer.msg('还书成功',{
icon:6,
time:500
},function(){
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
})
}else{
layer.msg("还书失败");
}
}
})
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,353 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>借阅管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div class="layuimini-main">
<div class="demoTable">
<div class="layui-form-item layui-form ">
借书卡
<div class="layui-inline">
<input class="layui-input" name="readerNumber" id="readerNumber" autocomplete="off">
</div>
图书名称
<div class="layui-inline">
<input class="layui-input" name="name" id="name" autocomplete="off">
</div>
归还类型
<div class="layui-inline">
<select class="layui-input" name="type" id="type">
<option value=""></option>
<option value="0">正常还书</option>
<option value="1">延迟还书</option>
<option value="2">破损还书</option>
<option value="3">丢失</option>
</select>
</div>
图书类型
<div class="layui-inline">
<select class="layui-input" name="status" id="status">
<option value=""></option>
<option value="0">未借出</option>
<option value="1">在借中</option>
</select>
</div>
<button class="layui-btn" data-type="reload">搜索</button>
</div>
</div>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 借书 </button>
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="back"> 还书 </button>
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete"> 删除 </button>
</div>
</script>
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
<script type="text/html" id="currentTableBar">
{{# if(d.backDate==null){ }}
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">异常还书</a>
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
{{# }else{ }}
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
{{# } }}
</script>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
table.render({
elem: '#currentTableId',
url: '${pageContext.request.contextPath}/lendListAll',//查询借阅图书记录
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
cols: [[
{type: "checkbox", width: 50},
//{field: 'id', width: 100, title: 'ID', sort: true},
{templet: '<div><a href="javascript:void(0)" style="color:#00b7ee" lay-event="bookInfoEvent">{{d.bookInfo.name}}</a></div>',
width: 100, title: '图书名称'},
{templet: '<div>{{d.readerInfo.readerNumber}}</div>', width: 120, title: '借书卡'},
{templet: '<div><a href="javascript:void(0)" style="color:#00b7ee" lay-event="readerInfoEvent">{{d.readerInfo.realName}}</a></div>',
width: 100, title: '借阅人'},
// {templet: '<div>{{d.reader.name}}</div>', width: 80, title: '借阅人'},
{templet:"<div>{{layui.util.toDateString(d.lendDate,'yyyy-MM-dd HH:mm:ss')}}</div>", width: 160, title: '借阅时间'},
{field: 'backDate', width: 160, title: '还书时间'},
{title:"还书类型",minWidth: 120,templet:function(res){
if(res.backType=='0'){
return '<span class="layui-badge layui-bg-green">正常还书</span>'
}else if(res.backType=='1'){
return '<span class="layui-badge layui-bg-gray">延迟还书</span>'
}else if(res.backType=='2') {
return '<span class="layui-badge layui-bg-yellow">破损还书</span>'
}else if(res.backType=='3'){
return '<span class="layui-badge layui-bg-green">丢失图书</span>'
}else{
return '<span class="layui-badge layui-bg-red">在借中</span>'
}
}},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
limits: [10, 15, 20, 25, 50, 100],
limit: 15,
page: true,
skin: 'line',
id:'testReload'
});
var $ = layui.$, active = {
reload: function(){
var name = $('#name').val();
var readerNumber = $('#readerNumber').val();
var backType = $('#backType').val();
var status = $('#status').val();
//执行重载
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
}
,where: {
name: name,
readerNumber:readerNumber,
backType:backType,
status:status
}
}, 'data');
}
};
$('.demoTable .layui-btn').on('click', function(){
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
/**
* tool操作栏监听事件
*/
table.on('tool(currentTableFilter)', function (obj) {
var data=obj.data;
if (obj.event === 'edit') { // 监听添加操作
var index = layer.open({
title: '异常还书',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['100%', '100%'],
content: '${pageContext.request.contextPath}/excBackBook?id='+data.id+"&bookId="+data.bookId,
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') { // 监听删除操作
layer.confirm('确定是否删除', function (index) {
//调用删除功能
//获取记录信息的id集合
deleteInfoByIds(data.id,data.bookId,index);
layer.close(index);
});
}else if( obj.event === 'bookInfoEvent') {//书的借阅线
//获取书的id
var bid=data.bookId;
queryLookBookList("book",bid);
}else{//读者借阅线
//获取读者的id
var rid=data.readerId;
queryLookBookList("user",rid);
}
});
/**
* 借阅线打开内容
*/
function queryLookBookList(flag,id){
var index = layer.open({
title: '借阅时间线',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['60%', '60%'],
content: '${pageContext.request.contextPath}/queryLookBookList?id='+id+"&flag="+flag,
});
$(window).on("resize", function () {
layer.full(index);
});
}
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
/**
* 获取选中记录的id信息
*/
function getCheackId(data){
var arr=new Array();
for(var i=0;i<data.length;i++){
arr.push(data[i].id);
}
//拼接id
return arr.join(",");
};
/**
* 获取选中记录的中图书id集合*/
function getCheackBookId(data){
var arr=new Array();
for(var i=0;i<data.length;i++){
arr.push(data[i].bookId);
}
//拼接id
return arr.join(",");
};
/**
* 提交删除功能
*/
function deleteInfoByIds(ids ,bookIds,index){
//向后台发送请求
$.ajax({
url: "deleteLendListByIds",
type: "POST",
data: {ids: ids,bookIds:bookIds},
success: function (result) {
if (result.code == 0) {//如果成功
layer.msg('删除成功', {
icon: 6,
time: 500
}, function () {
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
});
} else {
layer.msg("删除失败");
}
}
})
};
/**
* 提交还书功能
*/
function backBooksByIds(ids ,bookIds,index){
//向后台发送请求
$.ajax({
url: "backLendListByIds",
type: "POST",
data: {ids: ids,bookIds:bookIds},
success: function (result) {
if (result.code == 0) {//如果成功
layer.msg('还书成功', {
icon: 6,
time: 500
}, function () {
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
});
} else {
layer.msg("还书失败");
}
}
})
};
/**
* toolbar监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'add') { // 监听添加操作
var index = layer.open({
title: '借书管理',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['100%', '100%'],
content: '${pageContext.request.contextPath}/addLendList',
});
$(window).on("resize", function () {
layer.full(index);
});
}else if (obj.event === 'back'){//还书操作
//获取选中的记录信息
//获取选中的记录信息
var checkStatus=table.checkStatus(obj.config.id);
//debugger;
var data=checkStatus.data;
if(data.length==0){//如果没有选中信息
layer.msg("请选择要借阅还书的记录信息");
}else{
//获取记录信息的id集合
var ids=getCheackId(data);//借阅记录的id集合
var bookIds=getCheackBookId(data);//图书的id集合
layer.confirm('确定还书么', function (index) {
//调用还书功能
backBooksByIds(ids,bookIds,index);
layer.close(index);
});
}
} else if (obj.event === 'delete') {
/*
1、提示内容必须删除大于0条
2、获取要删除记录的id信息
3、提交删除功能 ajax
*/
//获取选中的记录信息
var checkStatus=table.checkStatus(obj.config.id);
var data=checkStatus.data;
if(data.length==0){//如果没有选中信息
layer.msg("请选择要删除的记录信息");
}else{
//获取记录信息的id集合
var ids=getCheackId(data);//借阅记录的id集合
var bookIds=getCheackBookId(data);//图书的id集合
layer.confirm('确定是否删除', function (index) {
//调用删除功能
deleteInfoByIds(ids,bookIds,index);
layer.close(index);
});
}
}
});
});
</script>
</body>
</html>

@ -0,0 +1,42 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page isELIgnored="false" %>
<html>
<head>
<meta charset="utf-8">
<title>时间线查询</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
<legend>借书时间线</legend>
</fieldset>
<ul class="layui-timeline">
<c:forEach var="lend" items="${info}" varStatus="status">
<li class="layui-timeline-item">
<div class="layui-timeline-content layui-text">
<div class="layui-timeline-title">
<fmt:formatDate value="${lend.lendDate}" pattern="yyyy年MM月dd日HH点mm分ss秒" /> <br/>
<span style="color: red"> ${lend.readerInfo.realName}</span> 借走 <span style="color: crimson"><<${lend.bookInfo.name}>></span><br/>
<c:if test="${lend.backDate == null}">
未归还
</c:if>
<c:if test="${lend.backDate != null}">
<fmt:formatDate value="${lend.backDate}" pattern="yyyy年MM月dd日HH点mm分ss秒" /> <span style="color: green">归还</span>,
</c:if>
</div>
</div>
</li>
</c:forEach>
</ul>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
</body>
</html>

@ -0,0 +1,127 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>图书管理系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
html, body {width: 100%;height: 100%;overflow: hidden}
body {background: url("${pageContext.request.contextPath}/images/loginbg.png") no-repeat center;}
body:after {content:'';background-repeat:no-repeat;background-size:cover;-webkit-filter:blur(3px);-moz-filter:blur(3px);-o-filter:blur(3px);-ms-filter:blur(3px);filter:blur(3px);position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;}
.layui-container {width: 100%;height: 100%;overflow: hidden}
.admin-login-background {width:450px;height:300px;position:absolute;left:65%;top:45%;margin-top:-120px;margin-left:-50px;opacity:0.9;}
.logo-title {text-align:center;letter-spacing:2px;padding:14px 0;}
.logo-title h1 {color:#1E9FFF;font-size:25px;font-weight:bold;}
.login-form {background-color:#fff;border:1px solid #fff;border-radius:3px;padding:14px 20px;box-shadow:0 0 8px #eeeeee;}
.login-form .layui-form-item {position:relative;}
.login-form .layui-form-item label {position:absolute;left:1px;top:1px;width:38px;line-height:36px;text-align:center;color:#d2d2d2;}
.login-form .layui-form-item input {padding-left:36px;}
.captcha-img img {height:34px;border:1px solid #e6e6e6;height:36px;width:100%;}
</style>
</head>
<body>
<div class="layui-container">
<div class="admin-login-background">
<div class="layui-form login-form">
<form class="layui-form" action="${pageContext.request.contextPath}/loginIn" method="post">
<div class="layui-form-item logo-title">
<h1>图书管理系统</h1>
<div style="color: red;text-align: center;">${msg}</div>
</div>
<div class="layui-form-item">
<label class="layui-icon layui-icon-username"></label>
<input type="text" name="username" lay-verify="required" placeholder="用户名" autocomplete="off" class="layui-input" >
</div>
<div class="layui-form-item">
<label class="layui-icon layui-icon-password"></label>
<input type="password" name="password" lay-verify="required" placeholder="密码" autocomplete="off" class="layui-input" >
</div>
<div class="layui-form-item">
<label class="layui-icon layui-icon-username"></label>
<select name="type" lay-verify="required">
<option value="">请选择用户类型</option>
<option value="1">管理员</option>
<option value="2">读者</option>
</select>
</div>
<div class="layui-form-item">
<div class="layui-input-inline">
<input type="text" name="captcha" style="width: 200px;" lay-verify="required" placeholder="验证码" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline">
<div class="field">
<a href="javascript:void(0)" onclick="getCode()"><img id="code" ></a>
</div>
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn layui-btn layui-btn-normal layui-btn-fluid" lay-submit="" lay-filter="login">登录</button>
</div>
</form>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script type="text/javascript">
getCode();
/**
* 获取验证码
*/
function getCode(){
document.getElementById("code").src=timestamp("verifyCode");
}
/**
* 实现刷新更滑验证码
*/
function timestamp(url){
var gettime=new Date().getTime();
if(url.indexOf("?")>-1){
url=url+"&timestamp="+gettime;
}else{
url=url+"?timestamp="+gettime;
}
return url;
}
layui.use(['form'], function () {
var form = layui.form,
layer = layui.layer;
form.on('submit(login)', function (data) {
data = data.field;
if (data.username == '') {
layer.msg('用户名不能为空');
return false;
}
if (data.password == '') {
layer.msg('密码不能为空');
return false;
}
if (data.captcha == '') {
layer.msg('验证码不能为空');
return false;
}
if (data.type == '') {
layer.msg('类型不能为空');
return false;
}
});
});
</script>
</body>
</html>

@ -0,0 +1,80 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%--<%
String path=request.getContextPath();
String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>--%>
<html>
<head>
<meta charset="utf-8">
<title>发布公告</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<div class="layui-form-item">
<label class="layui-form-label required">公告主题</label>
<div class="layui-input-block">
<input type="text" name="topic" lay-verify="required" lay-reqtext="公告主题不能为空" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label required">公告内容</label>
<div class="layui-input-block">
<textarea name="content" lay-verify="required" lay-reqtext="公告内容不能为空" autocomplete="off" class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form'], function () {
var form = layui.form,
layer = layui.layer,
$ = layui.$;
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
//向后台发送数据提交添加
$.ajax({
url:"addNoticeSubmit",
type:"POST",
data:datas,
success:function(result){
if(result.code==0){//如果成功
layer.msg('添加成功',{
icon:6,
time:500
},function(){
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
})
}else{
layer.msg("添加失败");
}
}
})
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,214 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>类型管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div class="demoTable">
公告主题:
<div class="layui-inline">
<input class="layui-input" name="topic" id="topic" autocomplete="off">
</div>
<button class="layui-btn" data-type="reload">搜索</button>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 发布公告 </button>
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete"> 删除 </button>
</div>
</script>
<!--表单,查询出的数据在这里显示-->
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
<script type="text/html" id="currentTableBar">
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="query">查询详情</a>
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
</script>
</div>
</div>
<script>
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
table.render({
elem: '#currentTableId',
url: '${pageContext.request.contextPath}/noticeAll',//查询类型数据
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
cols: [[
{type: "checkbox", width: 50},
//{field: 'id', width: 100, title: 'ID', sort: true},
{field: 'topic', width: 150, title: '公告主题'},
{field: 'content', width: 200, title: '公告内容'},
{field: 'author', width: 100, title: '发布者'},
{templet:"<div>{{layui.util.toDateString(d.createDate,'yyyy-MM-dd HH:mm:ss')}}</div>", width: 200, title: '发布时间'},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
limits: [10, 15, 20, 25, 50, 100],
limit: 15, <!--默认显示15条-->
page: true,
skin: 'line',
id:'testReload'
});
var $ = layui.$, active = {
reload: function(){
var topic = $('#topic').val();
console.log(name)
//执行重载
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
}
,where: {
topic: topic
}
}, 'data');
}
};
$('.demoTable .layui-btn').on('click', function(){
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
/**
* tool操作栏监听事件
*/
table.on('tool(currentTableFilter)', function (obj) {
var data=obj.data;
if (obj.event === 'query') { // 监听查询详情操作
var index = layer.open({
title: '查看公告',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['60%', '60%'],
content: '${pageContext.request.contextPath}/queryNoticeById?id='+data.id,
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') { // 监听删除操作
layer.confirm('确定是否删除', function (index) {
//调用删除功能
deleteInfoByIds(data.id,index);
layer.close(index);
});
}
});
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
/**
* 获取选中记录的id信息
*/
function getCheackId(data){
var arr=new Array();
for(var i=0;i<data.length;i++){
arr.push(data[i].id);
}
//拼接id,变成一个字符串
return arr.join(",");
};
/**
* 提交删除功能
*/
function deleteInfoByIds(ids ,index){
//向后台发送请求
$.ajax({
url: "deleteNoticeByIds",
type: "POST",
data: {ids: ids},
success: function (result) {
if (result.code == 0) {//如果成功
layer.msg('删除成功', {
icon: 6,
time: 500
}, function () {
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
});
} else {
layer.msg("删除失败");
}
}
})
};
/**
* toolbar栏监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'add') { // 监听发布公告操作
var index = layer.open({
title: '发布公告',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['60%', '60%'],
content: '${pageContext.request.contextPath}/noticeAdd',
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') {
/*
1、提示内容必须删除大于0条
2、获取要删除记录的id信息
3、提交删除功能 ajax
*/
//获取选中的记录信息
var checkStatus=table.checkStatus(obj.config.id);
var data=checkStatus.data;
if(data.length==0){//如果没有选中信息
layer.msg("请选择要删除的记录信息");
}else{
//获取记录信息的id集合,拼接的ids
var ids=getCheackId(data);
layer.confirm('确定是否删除', function (index) {
//调用删除功能
deleteInfoByIds(ids,index);
layer.close(index);
});
}
}
});
});
</script>
</body>
</html>

@ -0,0 +1,115 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>类型管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div class="demoTable">
公告主题:
<div class="layui-inline">
<input class="layui-input" name="topic" id="topic" autocomplete="off">
</div>
<button class="layui-btn" data-type="reload">搜索</button>
</div>
<!--表单,查询出的数据在这里显示-->
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
<script type="text/html" id="currentTableBar">
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="query">查询详情</a>
</script>
</div>
</div>
<script>
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
table.render({
elem: '#currentTableId',
url: '${pageContext.request.contextPath}/noticeAll',//查询类型数据
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
cols: [[
//{type: "checkbox", width: 50},
//{field: 'id', width: 100, title: 'ID', sort: true},
{field: 'topic', width: 150, title: '公告主题'},
{field: 'content', width: 200, title: '公告内容'},
{field: 'author', width: 100, title: '发布者'},
{templet:"<div>{{layui.util.toDateString(d.createDate,'yyyy-MM-dd HH:mm:ss')}}</div>", width: 200, title: '发布时间'},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
limits: [10, 15, 20, 25, 50, 100],
limit: 15, <!--默认显示15条-->
page: true,
skin: 'line',
id:'testReload'
});
var $ = layui.$, active = {
reload: function(){
var topic = $('#topic').val();
console.log(name)
//执行重载
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
}
,where: {
topic: topic
}
}, 'data');
}
};
$('.demoTable .layui-btn').on('click', function(){
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
/**
* tool操作栏监听事件
*/
table.on('tool(currentTableFilter)', function (obj) {
var data=obj.data;
if (obj.event === 'query') { // 监听查询详情操作
var index = layer.open({
title: '查看公告',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['60%', '60%'],
content: '${pageContext.request.contextPath}/queryNoticeById?id='+data.id,
});
$(window).on("resize", function () {
layer.full(index);
});
}
});
});
</script>
</body>
</html>

@ -0,0 +1,88 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page isELIgnored="false" %>
<%--<%
String path=request.getContextPath();
String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>--%>
<html>
<head>
<meta charset="utf-8">
<title>修改公告信息</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<input type="hidden" name="id" value="${info.id}">
<div class="layui-form-item">
<label class="layui-form-label">公告主题</label>
<div class="layui-input-block">
<input type="text" name="topic" readonly="true" value="${info.topic}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">发布人</label>
<div class="layui-input-block">
<input type="text" name="author" readonly="true" value="${info.author}" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">公告内容</label>
<div class="layui-input-block">
<textarea name="content" readonly="true" class="layui-textarea" > ${info.content}</textarea>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form'], function () {
var form = layui.form,
layer = layui.layer,
$ = layui.$;
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
//向后台发送数据提交添加
$.ajax({
url:"updateTypeSubmit",
type:"POST",
// data:datas,
contentType:"application/json",
data:JSON.stringify(datas),
success:function(result){
if(result.code==0){//如果成功
layer.msg('修改成功',{
icon:6,
time:500
},function(){
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
})
}else{
layer.msg("修改失败");
}
}
})
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,98 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>修改密码</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
.layui-form-item .layui-input-company {width: auto;padding-right: 10px;line-height: 38px;}
</style>
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div class="layui-form layuimini-form">
<div class="layui-form-item">
<label class="layui-form-label required">旧的密码</label>
<div class="layui-input-block">
<input type="password" name="oldPwd" id="oldPwd" lay-verify="required" lay-reqtext="旧密码不能为空" placeholder="请输入旧的密码" value="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">新的密码</label>
<div class="layui-input-block">
<input type="password" name="newPwd" id="newPwd" lay-verify="required" lay-reqtext="新密码不能为空" placeholder="请输入新的密码" value="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">确认密码</label>
<div class="layui-input-block">
<input type="password" name="againPwd" id="againPwd" lay-verify="required" lay-reqtext="密码不能为空" placeholder="请输入新的密码" value="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
</div>
</div>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
layui.use(['form'], function () {
var form = layui.form,
layer = layui.layer,
$ = layui.$;
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
if (datas.newPwd != datas.againPwd){
layer.msg("两次输入的新密码不一致,请重新输入")
}else{
//向后台发送数据提交添加
$.ajax({
url:"updatePwdSubmit2", //读者的修改密码
type:"POST",
data: {
oldPwd:datas.oldPwd,
newPwd:datas.newPwd
},
success:function(result){
if(result.code==0){//如果成功
layer.msg("修改成功",{
icon:6,
time:500
},function(){
var oldPassword = document.getElementById("oldPwd");
var newPassword = document.getElementById("newPwd");
var againPassword = document.getElementById("againPwd");
oldPassword.value = "";
newPassword.value = "";
againPassword.value = "";
})
}else{
layer.msg(result.msg);
}
}
})
}
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,123 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<meta charset="utf-8">
<title>添加读者</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<div class="layui-form-item">
<label class="layui-form-label required">读者卡号</label>
<div class="layui-input-block">
<input type="text" name="readerNumber" lay-verify="required" lay-reqtext="读者卡号不能为空" placeholder="请输入读者卡号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">用户名</label>
<div class="layui-input-block">
<input type="text" name="username" lay-verify="required" lay-reqtext="用户名不能为空" placeholder="请输入用户名" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">真实姓名</label>
<div class="layui-input-block">
<input type="text" name="realName" lay-verify="required" lay-reqtext="真实姓名不能为空" placeholder="请输入真实姓名" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">性别</label>
<div class="layui-input-block">
<input type="radio" name="sex" value="男" title="男" checked="checked"/>
<input type="radio" name="sex" value="女" title="女" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">出生日期</label>
<div class="layui-input-block">
<input type="text" name="birthday" id="date" lay-verify="required" class="layui-input" autocomplete="off">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">联系方式</label>
<div class="layui-input-block">
<input type="text" name="tel" lay-verify="required" class="layui-input" autocomplete="off">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">邮箱地址</label>
<div class="layui-input-block">
<input type="text" name="email" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form','laydate'], function () {
var form = layui.form,
layer = layui.layer,
laydate=layui.laydate,
$ = layui.$;
//日期
laydate.render({
elem: '#date',
trigger:'click'
});
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
//向后台发送数据提交添加
$.ajax({
url:"addReaderSubmit",
type:"POST",
//data:datas,
contentType:'application/json',
data:JSON.stringify(datas),
success:function(result){
if(result.code==0){//如果成功
layer.msg('添加成功',{
icon:6,
time:500
},function(){
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
})
}else{
layer.msg("添加失败");
}
}
})
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,235 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%--<%
String path=request.getContextPath();
String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>--%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>读者管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div class="demoTable">
<div class="layui-form-item layui-form ">
图书卡号:
<div class="layui-inline">
<input class="layui-input" name="readerNumber" id="readerNumber" autocomplete="off">
</div>
用户名:
<div class="layui-inline">
<input class="layui-input" name="username" id="username" autocomplete="off">
</div>
电话:
<div class="layui-inline">
<input class="layui-input" name="tel" id="tel" autocomplete="off">
</div>
<button class="layui-btn" data-type="reload">搜索</button>
</div>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 添加 </button>
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete"> 删除 </button>
</div>
</script>
<!--表单,查询出的数据在这里显示-->
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
<script type="text/html" id="currentTableBar">
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="update">修改</a>
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
</script>
</div>
</div>
<script>
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
table.render({
elem: '#currentTableId',
url: '${pageContext.request.contextPath}/readerAll',//查询数据
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
cols: [[
{type: "checkbox", width: 50},
//{field: 'id', width: 100, title: 'ID', sort: true},
{field: 'readerNumber', width: 150, title: '读者卡号'},
{field: 'username', width: 100, title: '用户名'},
{field: 'realName', width: 100, title: '真实姓名'},
{field: 'sex', width: 80, title: '性别'},
{field: 'tel', width: 150, title: '电话'},
{templet:"<div>{{layui.util.toDateString(d.registerDate,'yyyy-MM-dd HH:mm:ss')}}</div>", width: 200, title: '办卡时间'},
{templet: '<div>{{d.email}}</div>', width: 150, title: '邮箱'},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
limits: [10, 15, 20, 25, 50, 100],
limit: 15, <!--默认显示15条-->
page: true,
skin: 'line',
id:'testReload'
});
var $ = layui.$, active = {
reload: function(){
var readerNumber = $('#readerNumber').val();
var username = $('#username').val();
var tel = $('#tel').val();
console.log(name)
//执行重载
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
}
,where: {
readerNumber: readerNumber,
username:username,
tel:tel
}
}, 'data');
}
};
$('.demoTable .layui-btn').on('click', function(){
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
/**
* tool操作栏监听事件
*/
table.on('tool(currentTableFilter)', function (obj) {
var data=obj.data;
if (obj.event === 'update') { // 监听修改操作
var index = layer.open({
title: '修改读者信息',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['100%', '100%'],
content: '${pageContext.request.contextPath}/queryReaderInfoById?id='+data.id,
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') { // 监听删除操作
layer.confirm('确定是否删除', function (index) {
//调用删除功能
deleteInfoByIds(data.id,index);
layer.close(index);
});
}
});
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
/**
* 获取选中记录的id信息
*/
function getCheackId(data){
var arr=new Array();
for(var i=0;i<data.length;i++){
arr.push(data[i].id);
}
//拼接id,变成一个字符串
return arr.join(",");
};
/**
* 提交删除功能
*/
function deleteInfoByIds(ids ,index){
//向后台发送请求
$.ajax({
url: "deleteReader",
type: "POST",
data: {ids: ids},
success: function (result) {
if (result.code == 0) {//如果成功
layer.msg('删除成功', {
icon: 6,
time: 500
}, function () {
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
});
} else {
layer.msg("删除失败");
}
}
})
};
/**
* toolbar栏监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'add') { // 监听添加操作
var index = layer.open({
title: '添加图书',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['100%', '100%'],
content: '${pageContext.request.contextPath}/readerAdd',
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') {
/*
1、提示内容必须删除大于0条
2、获取要删除记录的id信息
3、提交删除功能 ajax
*/
//获取选中的记录信息
var checkStatus=table.checkStatus(obj.config.id);
var data=checkStatus.data;
if(data.length==0){//如果没有选中信息
layer.msg("请选择要删除的记录信息");
}else{
//获取记录信息的id集合,拼接的ids
var ids=getCheackId(data);
layer.confirm('确定是否删除', function (index) {
//调用删除功能
deleteInfoByIds(ids,index);
layer.close(index);
});
}
}
});
});
</script>
</body>
</html>

@ -0,0 +1,125 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page isELIgnored="false" %>
<html>
<head>
<meta charset="utf-8">
<title>修改图书</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<input type="hidden" name="id" value="${info.id}">
<div class="layui-form-item">
<label class="layui-form-label required">读者卡号</label>
<div class="layui-input-block">
<input type="text" name="readerNumber" lay-reqtext="读者卡号不能为空" value="${info.readerNumber}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">用户名</label>
<div class="layui-input-block">
<input type="text" name="username" lay-reqtext="用户名不能为空" value="${info.username}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">真实姓名</label>
<div class="layui-input-block">
<input type="text" name="realName" lay-reqtext="真实姓名不能为空" value="${info.realName}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">性别</label>
<div class="layui-input-block">
<input type="radio" name="sex" value="男" title="男" ${"男" eq info.sex ?"checked='checked'":''} />
<input type="radio" name="sex" value="女" title="女" ${"女" eq info.sex ?"checked='checked'":''} />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">出生日期</label>
<div class="layui-input-block">
<input type="text" name="birthday" id="date" lay-verify="required" value="<fmt:formatDate value='${info.birthday}' pattern='yyyy-MM-dd'/>" class="layui-input" autocomplete="off">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">联系方式</label>
<div class="layui-input-block">
<input type="text" name="tel" lay-verify="required" class="layui-input" value="${info.tel}" autocomplete="off">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">邮箱地址</label>
<div class="layui-input-block">
<input type="text" name="email" autocomplete="off" value="${info.email}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认修改</button>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form','laydate'], function () {
var form = layui.form,
layer = layui.layer,
laydate=layui.laydate,
$ = layui.$;
//日期
laydate.render({
elem: '#date',
trigger:'click'
});
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
//向后台发送数据提交添加
$.ajax({
url:"updateReaderSubmit",
type:"POST",
//data:datas,
contentType:'application/json',
data:JSON.stringify(datas),
success:function(result){
if(result.code==0){//如果成功
layer.msg('修改成功',{
icon:6,
time:500
},function(){
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
})
}else{
layer.msg("修改失败");
}
}
})
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,78 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<meta charset="utf-8">
<title>类型添加</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<div class="layui-form-item">
<label class="layui-form-label required">类型名称</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" lay-reqtext="类型名称不能为空" placeholder="请输入类型名称" value="" class="layui-input">
<tip>填写自己类型名称</tip>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注信息</label>
<div class="layui-input-block">
<textarea name="remarks" class="layui-textarea" placeholder="请输入备注信息"></textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form'], function () {
var form = layui.form,
layer = layui.layer,
$ = layui.$;
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
//向后台发送数据提交添加
$.ajax({
url:"addTypeSubmit",
type:"POST",
data:datas,
success:function(result){
if(result.code==0){//如果成功
layer.msg('添加成功',{
icon:6,
time:500
},function(){
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
})
}else{
layer.msg("类型添加失败");
}
}
})
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,212 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>类型管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div class="demoTable">
类型名称:
<div class="layui-inline">
<input class="layui-input" name="name" id="name" autocomplete="off">
</div>
<button class="layui-btn" data-type="reload">搜索</button>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 添加 </button>
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete"> 删除 </button>
</div>
</script>
<!--表单,查询出的数据在这里显示-->
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
<script type="text/html" id="currentTableBar">
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
</script>
</div>
</div>
<script>
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
table.render({
elem: '#currentTableId',
url: '${pageContext.request.contextPath}/typeAll',//查询类型数据
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
cols: [[
{type: "checkbox", width: 50},
//{field: 'id', width: 100, title: 'ID', sort: true},
{field: 'name', width: 180, title: '类型名称'},
{field: 'remarks', width: 280, title: '备注'},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
limits: [10, 15, 20, 25, 50, 100],
limit: 15, <!--默认显示15条-->
page: true,
skin: 'line',
id:'testReload'
});
var $ = layui.$, active = {
reload: function(){
var name = $('#name').val();
console.log(name)
//执行重载
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
}
,where: {
name: name
}
}, 'data');
}
};
$('.demoTable .layui-btn').on('click', function(){
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
/**
* tool操作栏监听事件
*/
table.on('tool(currentTableFilter)', function (obj) {
var data=obj.data;
if (obj.event === 'edit') { // 监听修改操作
var index = layer.open({
title: '修改图书类型',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['60%', '60%'],
content: '${pageContext.request.contextPath}/queryTypeInfoById?id='+data.id,
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') { // 监听删除操作
layer.confirm('确定是否删除', function (index) {
//调用删除功能
deleteInfoByIds(data.id,index);
layer.close(index);
});
}
});
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
/**
* 获取选中记录的id信息
*/
function getCheackId(data){
var arr=new Array();
for(var i=0;i<data.length;i++){
arr.push(data[i].id);
}
//拼接id,变成一个字符串
return arr.join(",");
};
/**
* 提交删除功能
*/
function deleteInfoByIds(ids ,index){
//向后台发送请求
$.ajax({
url: "deleteType",
type: "POST",
data: {ids: ids},
success: function (result) {
if (result.code == 0) {//如果成功
layer.msg('删除成功', {
icon: 6,
time: 500
}, function () {
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
});
} else {
layer.msg("删除失败");
}
}
})
};
/**
* toolbar栏监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'add') { // 监听添加操作
var index = layer.open({
title: '添加类型',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['60%', '60%'],
content: '${pageContext.request.contextPath}/typeAdd',
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') {
/*
1、提示内容必须删除大于0条
2、获取要删除记录的id信息
3、提交删除功能 ajax
*/
//获取选中的记录信息
var checkStatus=table.checkStatus(obj.config.id);
var data=checkStatus.data;
if(data.length==0){//如果没有选中信息
layer.msg("请选择要删除的记录信息");
}else{
//获取记录信息的id集合,拼接的ids
var ids=getCheackId(data);
layer.confirm('确定是否删除', function (index) {
//调用删除功能
deleteInfoByIds(ids,index);
layer.close(index);
});
}
}
});
});
</script>
</body>
</html>

@ -0,0 +1,82 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<%@ page isELIgnored="false" %>
<html>
<head>
<meta charset="utf-8">
<title>修改类型信息</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
body {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="layui-form layuimini-form">
<input type="hidden" name="id" value="${info.id}">
<div class="layui-form-item">
<label class="layui-form-label required">类型名称</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" value="${info.name}" class="layui-input">
<tip>填写自己类型名称</tip>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注信息</label>
<div class="layui-input-block">
<textarea name="remarks" class="layui-textarea" > ${info.remarks}</textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认修改</button>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form'], function () {
var form = layui.form,
layer = layui.layer,
$ = layui.$;
//监听提交
form.on('submit(saveBtn)', function (data) {
var datas=data.field;//form单中的数据信息
//向后台发送数据提交添加
$.ajax({
url:"updateTypeSubmit",
type:"POST",
// data:datas,
contentType:"application/json",
data:JSON.stringify(datas),
success:function(result){
if(result.code==0){//如果成功
layer.msg('修改成功',{
icon:6,
time:500
},function(){
parent.window.location.reload();
var iframeIndex = parent.layer.getFrameIndex(window.name);
parent.layer.close(iframeIndex);
})
}else{
layer.msg("修改失败");
}
}
})
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,99 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>首页</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
<style>
.layui-card {border:1px solid #f2f2f2;border-radius:5px;}
.icon {margin-right:10px;color:#1aa094;}
.icon-cray {color:#ffb800!important;}
.icon-blue {color:#1e9fff!important;}
.icon-tip {color:#ff5722!important;}
.layuimini-qiuck-module {text-align:center;margin-top: 10px}
.layuimini-qiuck-module a i {display:inline-block;width:100%;height:60px;line-height:60px;text-align:center;border-radius:2px;font-size:30px;background-color:#F8F8F8;color:#333;transition:all .3s;-webkit-transition:all .3s;}
.layuimini-qiuck-module a cite {position:relative;top:2px;display:block;color:#666;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:14px;}
.welcome-module {width:100%;height:210px;}
.panel {background-color:#fff;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}
.panel-body {padding:10px}
.panel-title {margin-top:0;margin-bottom:0;font-size:12px;color:inherit}
.label {display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em;margin-top: .3em;}
.layui-red {color:red}
.main_btn > p {height:40px;}
.layui-bg-number {background-color:#F8F8F8;}
.layuimini-notice:hover {background:#f6f6f6;}
.layuimini-notice {padding:7px 16px;clear:both;font-size:12px !important;cursor:pointer;position:relative;transition:background 0.2s ease-in-out;}
.layuimini-notice-title,.layuimini-notice-label {
padding-right: 70px !important;text-overflow:ellipsis!important;overflow:hidden!important;white-space:nowrap!important;}
.layuimini-notice-title {line-height:28px;font-size:14px;}
.layuimini-notice-extra {position:absolute;top:50%;margin-top:-8px;right:16px;display:inline-block;height:16px;color:#999;}
</style>
</head>
<body>
<div class="layuimini-container">
<div class="layui-col-md4">
<div class="layui-card">
<div class="layui-card-header"><i class="fa fa-bullhorn icon icon-tip"></i>系统公告</div>
<div class="layui-card-body layui-text">
<c:forEach var="notice" items="${noticeList}">
<div class="layuimini-notice">
<div class="layuimini-notice-title">${notice.topic}</div>
<div class="layuimini-notice-extra"><fmt:formatDate value="${notice.createDate}" pattern="yyyy-MM-dd HH:mm:ss" /></div>
<div class="layuimini-notice-content layui-hide">
${notice.content}
</div>
</div>
</c:forEach>
</div>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
layui.use(['layer', 'miniTab','echarts'], function () {
var $ = layui.jquery,
layer = layui.layer,
miniTab = layui.miniTab,
echarts = layui.echarts;
miniTab.listen();
/**
* 查看公告信息
**/
$('body').on('click', '.layuimini-notice', function () {
var title = $(this).children('.layuimini-notice-title').text(),
noticeTime = $(this).children('.layuimini-notice-extra').text(),
content = $(this).children('.layuimini-notice-content').html();
var html = '<div style="padding:15px 20px; text-align:justify; line-height: 22px;border-bottom:1px solid #e2e2e2;background-color: #2f4056;color: #ffffff">\n' +
'<div style="text-align: center;margin-bottom: 20px;font-weight: bold;border-bottom:1px solid #718fb5;padding-bottom: 5px"><h4 class="text-danger">' + title + '</h4></div>\n' +
'<div style="font-size: 12px">' + content + '</div>\n' +
'</div>\n';
parent.layer.open({
type: 1,
title: '系统公告'+'<span style="float: right;right: 1px;font-size: 12px;color: #b1b3b9;margin-top: 1px">'+noticeTime+'</span>',
area: '300px;',
shade: 0.8,
id: 'layuimini-notice',
btnAlign: 'c',
moveType: 1,
content:html
});
});
});
</script>
</body>
</html>

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<!--SpringMVC前端核心控制器启动Controller组件-->
<servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!--声明配置文件位置-->
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc.xml</param-value>
</init-param>
<!--懒汉式 饿汉式 可选创建servlet-->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!--防乱码-->
<filter>
<filter-name>encoding</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--配置监听器在项目启动时同时启动Spring工厂使得Dao和Service以及Druid连接池启动-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--配置静态资源-->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.js</url-pattern>
<url-pattern>*.css</url-pattern>
<url-pattern>*.png</url-pattern>
<url-pattern>*.jpg</url-pattern>
<url-pattern>/api/**</url-pattern>
<url-pattern>/css/**</url-pattern>
<url-pattern>/images/**</url-pattern>
<url-pattern>/js/*</url-pattern>
<url-pattern>/lib/*</url-pattern>
<url-pattern>/page/*</url-pattern>
</servlet-mapping>
<!--配置spring文件路径-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</context-param>
</web-app>

@ -0,0 +1,4 @@
{
"code": 1,
"msg": "服务端清理缓存成功"
}

@ -0,0 +1,73 @@
{
"homeInfo": {
"title": "首页",
"href": "welcome"
},
"logoInfo": {
"title": "图书管理",
"image": "images/favicon.ico",
"href": ""
},
"menuInfo": [
{
"title": "功能管理",
"icon": "fa fa-bars",
"href": "",
"target": "_self",
"child": [
{
"title": "借阅管理",
"href": "lendListIndex",
"icon": "fa fa-window-maximize",
"target": "_self"
},
{
"title": "图书管理",
"href": "bookIndex",
"icon": "fa fa-book",
"target": "_self"
},
{
"title": "读者管理",
"href": "readerIndex",
"icon": "fa fa-credit-card",
"target": "_self"
},
{
"title": "类型管理",
"href": "typeIndex",
"icon": "fa fa-file-text",
"target": "_self"
},
{
"title": "公告管理",
"href": "noticeIndexOfBack",
"icon": "fa fa-bell",
"target": "_self"
},
{
"title": "管理员管理",
"href": "adminIndex",
"icon": "fa fa-user-circle-o",
"target": "_self"
}
]
},
{
"title": "统计分析",
"icon": "fa fa-bar-chart",
"href": "",
"target": "_self",
"child": [
{
"title": "统计分析",
"href": "statisticIndex",
"icon": "fa fa-superpowers",
"target": "_self"
}
]
}
]
}

@ -0,0 +1,34 @@
{
"homeInfo": {
"title": "首页",
"href": "welcome"
},
"logoInfo": {
"title": "图书馆管理",
"image": "images/favicon.ico",
"href": ""
},
"menuInfo": [
{
"title": "功能管理",
"icon": "fa fa-address-book",
"href": "",
"target": "_self",
"child": [
{
"title": "公告管理",
"href": "noticeIndexOfReader",
"icon": "fa fa-window-maximize",
"target": "_self"
},
{
"title": "借阅管理",
"href": "queryLookBookList2",
"icon": "fa fa-gears",
"target": "_self"
}
]
}
]
}

@ -0,0 +1,254 @@
{
"code": 0,
"msg": "",
"count": 19,
"data": [
{
"authorityId": 1,
"authorityName": "系统管理",
"orderNumber": 1,
"menuUrl": null,
"menuIcon": "layui-icon-set",
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 0,
"parentId": -1
},
{
"authorityId": 2,
"authorityName": "用户管理",
"orderNumber": 2,
"menuUrl": "system/user",
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 0,
"parentId": 1
},
{
"authorityId": 3,
"authorityName": "查询用户",
"orderNumber": 3,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/21 13:54:16",
"authority": "user:view",
"checked": 0,
"updateTime": "2018/07/21 13:54:16",
"isMenu": 1,
"parentId": 2
},
{
"authorityId": 4,
"authorityName": "添加用户",
"orderNumber": 4,
"menuUrl": null,
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": "user:add",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 2
},
{
"authorityId": 5,
"authorityName": "修改用户",
"orderNumber": 5,
"menuUrl": null,
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": "user:edit",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 2
},
{
"authorityId": 6,
"authorityName": "删除用户",
"orderNumber": 6,
"menuUrl": null,
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": "user:delete",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 2
},
{
"authorityId": 7,
"authorityName": "角色管理",
"orderNumber": 7,
"menuUrl": "system/role",
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 0,
"parentId": 1
},
{
"authorityId": 8,
"authorityName": "查询角色",
"orderNumber": 8,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/21 13:54:59",
"authority": "role:view",
"checked": 0,
"updateTime": "2018/07/21 13:54:58",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 9,
"authorityName": "添加角色",
"orderNumber": 9,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "role:add",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 10,
"authorityName": "修改角色",
"orderNumber": 10,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "role:edit",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 11,
"authorityName": "删除角色",
"orderNumber": 11,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "role:delete",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 12,
"authorityName": "角色权限管理",
"orderNumber": 12,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "role:auth",
"checked": 0,
"updateTime": "2018/07/13 15:27:18",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 13,
"authorityName": "权限管理",
"orderNumber": 13,
"menuUrl": "system/authorities",
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/07/13 15:45:13",
"isMenu": 0,
"parentId": 1
},
{
"authorityId": 14,
"authorityName": "查询权限",
"orderNumber": 14,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/21 13:55:57",
"authority": "authorities:view",
"checked": 0,
"updateTime": "2018/07/21 13:55:56",
"isMenu": 1,
"parentId": 13
},
{
"authorityId": 15,
"authorityName": "添加权限",
"orderNumber": 15,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "authorities:add",
"checked": 0,
"updateTime": "2018/06/29 11:05:41",
"isMenu": 1,
"parentId": 13
},
{
"authorityId": 16,
"authorityName": "修改权限",
"orderNumber": 16,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/13 09:13:42",
"authority": "authorities:edit",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 13
},
{
"authorityId": 17,
"authorityName": "删除权限",
"orderNumber": 17,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "authorities:delete",
"checked": 0,
"updateTime": "2018/06/29 11:05:41",
"isMenu": 1,
"parentId": 13
},
{
"authorityId": 18,
"authorityName": "登录日志",
"orderNumber": 18,
"menuUrl": "system/loginRecord",
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/06/29 11:05:41",
"isMenu": 0,
"parentId": 1
},
{
"authorityId": 19,
"authorityName": "查询登录日志",
"orderNumber": 19,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/21 13:56:43",
"authority": "loginRecord:view",
"checked": 0,
"updateTime": "2018/07/21 13:56:43",
"isMenu": 1,
"parentId": 18
}
]
}

@ -0,0 +1,127 @@
{
"code": 0,
"msg": "",
"count": 1000,
"data": [
{
"id": 10000,
"username": "user-0",
"sex": "女",
"city": "城市-0",
"sign": "签名-0",
"experience": 255,
"logins": 24,
"wealth": 82830700,
"classify": "作家",
"score": 57
},
{
"id": 10001,
"username": "user-1",
"sex": "男",
"city": "城市-1",
"sign": "签名-1",
"experience": 884,
"logins": 58,
"wealth": 64928690,
"classify": "词人",
"score": 27
},
{
"id": 10002,
"username": "user-2",
"sex": "女",
"city": "城市-2",
"sign": "签名-2",
"experience": 650,
"logins": 77,
"wealth": 6298078,
"classify": "酱油",
"score": 31
},
{
"id": 10003,
"username": "user-3",
"sex": "女",
"city": "城市-3",
"sign": "签名-3",
"experience": 362,
"logins": 157,
"wealth": 37117017,
"classify": "诗人",
"score": 68
},
{
"id": 10004,
"username": "user-4",
"sex": "男",
"city": "城市-4",
"sign": "签名-4",
"experience": 807,
"logins": 51,
"wealth": 76263262,
"classify": "作家",
"score": 6
},
{
"id": 10005,
"username": "user-5",
"sex": "女",
"city": "城市-5",
"sign": "签名-5",
"experience": 173,
"logins": 68,
"wealth": 60344147,
"classify": "作家",
"score": 87
},
{
"id": 10006,
"username": "user-6",
"sex": "女",
"city": "城市-6",
"sign": "签名-6",
"experience": 982,
"logins": 37,
"wealth": 57768166,
"classify": "作家",
"score": 34
},
{
"id": 10007,
"username": "user-7",
"sex": "男",
"city": "城市-7",
"sign": "签名-7",
"experience": 727,
"logins": 150,
"wealth": 82030578,
"classify": "作家",
"score": 28
},
{
"id": 10008,
"username": "user-8",
"sex": "男",
"city": "城市-8",
"sign": "签名-8",
"experience": 951,
"logins": 133,
"wealth": 16503371,
"classify": "词人",
"score": 14
},
{
"id": 10009,
"username": "user-9",
"sex": "女",
"city": "城市-9",
"sign": "签名-9",
"experience": 484,
"logins": 25,
"wealth": 86801934,
"classify": "词人",
"score": 75
}
]
}

@ -0,0 +1,23 @@
{
"code": 0,
"msg": "",
"count": 16,
"data": [
{ "id":"001", "username":"张玉林", "sex":"女" },
{ "id":"002", "username":"刘晓军", "sex":"男" },
{ "id":"003", "username":"张恒", "sex":"男" },
{ "id":"004", "username":"朱一", "sex":"男" },
{ "id":"005", "username":"刘佳能", "sex":"女" },
{ "id":"006", "username":"晓梅", "sex":"女" },
{ "id":"007", "username":"马冬梅", "sex":"女" },
{ "id":"008", "username":"刘晓庆", "sex":"女" },
{ "id":"009", "username":"刘晓庆", "sex":"女" },
{ "id":"010", "username":"刘晓庆", "sex":"女" },
{ "id":"011", "username":"刘晓庆", "sex":"女" },
{ "id":"012", "username":"刘晓庆", "sex":"女" },
{ "id":"013", "username":"刘晓庆", "sex":"女" },
{ "id":"014", "username":"刘晓庆", "sex":"女" },
{ "id":"015", "username":"刘晓庆", "sex":"女" },
{ "id":"016", "username":"刘晓庆", "sex":"女" }
]
}

@ -0,0 +1,10 @@
{
"code": 1,
"msg": "上传成功",
"data": {
"url": [
"../images/logo.png",
"../images/captcha.jpg"
]
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save