Compare commits

..

1 Commits
main ... master

Author SHA1 Message Date
Hungrydad d8e606c9f0 “提交项目”
2 years ago

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

@ -0,0 +1,13 @@
<component name="ArtifactManager">
<artifact type="exploded-war" name="novelweb:war exploded">
<output-path>$PROJECT_DIR$/out/artifacts/novelweb_war_exploded</output-path>
<root id="root">
<element id="directory" name="WEB-INF">
<element id="directory" name="classes">
<element id="module-output" name="novelweb" />
</element>
</element>
<element id="javaee-facet-resources" facet="novelweb/web/Web" />
</root>
</artifact>
</component>

@ -0,0 +1,7 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<ScalaCodeStyleSettings>
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
</ScalaCodeStyleSettings>
</code_scheme>
</component>

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="USE_RELEASE_OPTION" value="false" />
<bytecodeTargetLevel target="8" />
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="Java EE 6-Java EE 6">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/javax.ejb.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/javax.persistence.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="lib">
<CLASSES>
<root url="file://$PROJECT_DIR$/web/WEB-INF/lib" />
<root url="jar://D:/Java学习/apache-tomcat-8.5.93/lib/servlet-api.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/web/WEB-INF/lib" recursive="false" />
</library>
</component>

@ -0,0 +1,5 @@
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/novelweb.iml" filepath="$PROJECT_DIR$/novelweb.iml" />
</modules>
</component>
</project>

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

Binary file not shown.

Binary file not shown.

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/web/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/web" relative="/" />
</webroots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/web/WEB-INF/classes" />
<output-test url="file://$MODULE_DIR$/web/WEB-INF/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Tomcat 8.5.35" level="application_server_libraries" />
<orderEntry type="library" name="Java EE 6-Java EE 6" level="project" />
</component>
</module>

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

@ -0,0 +1,86 @@
<?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.mapper.BookshelfMapper">
<resultMap type="Bookshelf" id="queryMap">
<id property="id" column="id"/>
<result property="novelid" column="novelid"/>
<result property="userid" column="userid"/>
<association property="novelinfoVO" javaType="Novelinfo">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="categoryid" column="categoryid"/>
<result property="author" column="author"/>
<result property="noveldesc" column="noveldesc"/>
<result property="updatetime" column="updatetime"/>
<result property="wordsnum" column="wordsnum"/>
<result property="viewcount" column="viewcount"/>
<result property="progress" column="progress"/>
<result property="favcount" column="favcount"/>
<result property="novelcover" column="novelcover"/>
</association>
<association property="userinfoVO" javaType="Userinfo">
<id property="id" column="id"/>
<result property="tel" column="tel"/>
<result property="pwd" column="pwd"/>
<result property="nickname" column="nickname"/>
<result property="birthday" column="birthday"/>
<result property="sex" column="sex"/>
<result property="headurl" column="headurl"/>
</association>
<association property="novelcategoryVO" javaType="Novelcategory">
<id property="id" column="id"/>
<result property="name" column="b_name"/>
</association>
</resultMap>
<sql id="Where_Clause">
<where>
<if test="id!=null and id!=0">
and a.id= #{id}
</if>
<if test="novelid!=null and novelid!=0">
and a.novelid= #{novelid}
</if>
<if test="userid!=null and userid!=0">
and a.userid= #{userid}
</if>
<if test="progress!=null and progress!=0">
and b.progress= #{progress}
</if>
</where>
</sql>
<select id="query" parameterType="java.util.Map" resultMap="queryMap">
select a.*,b.name,b.categoryid,b.author,b.noveldesc,b.updatetime,b.wordsnum,b.viewcount,b.progress,b.favcount,b.novelcover,c.tel,c.pwd,c.nickname,c.birthday,c.sex,c.headurl,d.name b_name from bookshelf a
left join novelinfo b on a.novelid=b.id left join userinfo c on a.userid=c.id left join novelcategory d on b.categoryid=d.id
<include refid="Where_Clause"/>
<if test="page">
limit #{offset} ,#{pageSize}
</if>
</select>
<select id="getCount" parameterType="java.util.Map" resultType="Int">
select count(*) nums from bookshelf a left join novelinfo b on a.novelid=b.id left join userinfo c on
a.userid=c.id left join novelcategory d on b.categoryid=d.id
<include refid="Where_Clause"/>
</select>
<select id="queryBookshelfById" parameterType="int" resultType="Bookshelf">
select * from bookshelf where id=${value}
</select>
<insert id="insertBookshelf" useGeneratedKeys="true" keyProperty="id" parameterType="Bookshelf">
insert into bookshelf
(novelid,userid)
values
(#{novelid},#{userid});
</insert>
<update id="updateBookshelf" parameterType="Bookshelf">
update bookshelf set
novelid=#{novelid},userid=#{userid}
where
id=#{id}
</update>
<delete id="deleteBookshelf" parameterType="int">
delete from bookshelf where id=${value}
</delete>
</mapper>

@ -0,0 +1,46 @@
<?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.mapper.NoticeinfoMapper">
<sql id="Where_Clause">
<where>
<if test="id!=null and id!=0">
and id= #{id}
</if>
<if test="title!=null and title!=''">
and title=#{title}
</if>
</where>
</sql>
<select id="query" parameterType="java.util.Map" resultType="Noticeinfo">
select * from noticeinfo
<include refid="Where_Clause"/>
<if test="page">
limit #{offset} ,#{pageSize}
</if>
</select>
<select id="getCount" parameterType="java.util.Map" resultType="Int">
select count(0) from noticeinfo
<include refid="Where_Clause"/>
</select>
<select id="queryNoticeinfoById" parameterType="int" resultType="Noticeinfo">
select * from noticeinfo where id=${value}
</select>
<insert id="insertNoticeinfo" useGeneratedKeys="true" keyProperty="id" parameterType="Noticeinfo">
insert into noticeinfo
(title,tcontents,updatetime)
values
(#{title},#{tcontents},#{updatetime});
</insert>
<update id="updateNoticeinfo" parameterType="Noticeinfo">
update noticeinfo set
title=#{title},tcontents=#{tcontents},updatetime=#{updatetime}
where
id=#{id}
</update>
<delete id="deleteNoticeinfo" parameterType="int">
delete from noticeinfo where id=${value}
</delete>
</mapper>

@ -0,0 +1,45 @@
<?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.mapper.NovelcategoryMapper">
<sql id="Where_Clause">
<where>
<if test="id!=null and id!=0">
and id= #{id}
</if>
<if test="name!=null and name!=''">
and name like concat('%',#{name},'%')
</if>
</where>
</sql>
<select id="query" parameterType="java.util.Map" resultType="Novelcategory">
select * from novelcategory
<include refid="Where_Clause"/>
<if test="page">
limit #{offset} ,#{pageSize}
</if>
</select>
<select id="getCount" parameterType="java.util.Map" resultType="Int">
select count(0) from novelcategory
<include refid="Where_Clause"/>
</select>
<select id="queryNovelcategoryById" parameterType="int" resultType="Novelcategory">
select * from novelcategory where id=${value}
</select>
<insert id="insertNovelcategory" useGeneratedKeys="true" keyProperty="id" parameterType="Novelcategory">
insert into novelcategory
(name)
values
(#{name});
</insert>
<update id="updateNovelcategory" parameterType="Novelcategory">
update novelcategory set
name=#{name}
where
id=#{id}
</update>
<delete id="deleteNovelcategory" parameterType="int">
delete from novelcategory where id=${value}
</delete>
</mapper>

@ -0,0 +1,82 @@
<?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.mapper.NovelchapterMapper">
<resultMap type="Novelchapter" id="queryMap">
<id property="id" column="id"/>
<result property="novelid" column="novelid"/>
<result property="title" column="title"/>
<result property="contents" column="contents"/>
<result property="wordscount" column="wordscount"/>
<association property="novelinfoVO" javaType="Novelinfo">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="categoryid" column="categoryid"/>
<result property="author" column="author"/>
<result property="noveldesc" column="noveldesc"/>
<result property="updatetime" column="updatetime"/>
<result property="wordsnum" column="wordsnum"/>
<result property="viewcount" column="viewcount"/>
<result property="progress" column="progress"/>
<result property="favcount" column="favcount"/>
<result property="novelcover" column="novelcover"/>
</association>
</resultMap>
<sql id="Where_Clause">
<where>
<if test="id!=null and id!=0">
and a.id= #{id}
</if>
<if test="novelid!=null and novelid!=0">
and a.novelid= #{novelid}
</if>
<if test="title!=null and title!=''">
and a.title like concat('%',#{title},'%')
</if>
</where>
</sql>
<select id="query" parameterType="java.util.Map" resultMap="queryMap">
select
a.*,b.name,b.categoryid,b.author,b.noveldesc,b.updatetime,b.wordsnum,b.viewcount,b.progress,b.favcount,b.novelcover
from novelchapter a left join novelinfo b on a.novelid=b.id
<include refid="Where_Clause"/>
<if test="sorts==null or sorts==''">
order by a.id asc
</if>
<if test="sorts!=null and sorts!=''">
order by a.id ${sorts}
</if>
<if test="page">
limit #{offset} ,#{pageSize}
</if>
</select>
<select id="getCount" parameterType="java.util.Map" resultType="Int">
select count(*) nums from novelchapter a left join novelinfo b on a.novelid=b.id
<include refid="Where_Clause"/>
</select>
<select id="queryNovelchapterById" parameterType="int" resultType="Novelchapter">
select * from novelchapter where id=${value}
</select>
<insert id="insertNovelchapter" useGeneratedKeys="true" keyProperty="id" parameterType="Novelchapter">
insert into novelchapter
(novelid,title,contents,wordscount)
values
(#{novelid},#{title},#{contents},#{wordscount});
</insert>
<update id="updateNovelchapter" parameterType="Novelchapter">
update novelchapter set
novelid=#{novelid},title=#{title},contents=#{contents},wordscount=#{wordscount}
where
id=#{id}
</update>
<delete id="deleteNovelchapter" parameterType="int">
delete from novelchapter where id=${value}
</delete>
<delete id="deleteNovelchapterByNovelid" parameterType="int">
delete from novelchapter where novelid=${value}
</delete>
</mapper>

@ -0,0 +1,92 @@
<?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.mapper.NovelcommentMapper">
<resultMap type="Novelcomment" id="queryMap">
<id property="id" column="id"/>
<result property="novelid" column="novelid"/>
<result property="userid" column="userid"/>
<result property="contents" column="contents"/>
<result property="commenttime" column="commenttime"/>
<association property="novelinfoVO" javaType="Novelinfo">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="categoryid" column="categoryid"/>
<result property="author" column="author"/>
<result property="noveldesc" column="noveldesc"/>
<result property="updatetime" column="updatetime"/>
<result property="wordsnum" column="wordsnum"/>
<result property="viewcount" column="viewcount"/>
<result property="progress" column="progress"/>
<result property="favcount" column="favcount"/>
<result property="novelcover" column="novelcover"/>
</association>
<association property="userinfoVO" javaType="Userinfo">
<id property="id" column="id"/>
<result property="tel" column="tel"/>
<result property="pwd" column="pwd"/>
<result property="nickname" column="nickname"/>
<result property="birthday" column="birthday"/>
<result property="sex" column="sex"/>
<result property="headurl" column="headurl"/>
</association>
</resultMap>
<sql id="Where_Clause">
<where>
<if test="id!=null and id!=0">
and a.id= #{id}
</if>
<if test="novelid!=null and novelid!=0">
and a.novelid= #{novelid}
</if>
<if test="userid!=null and userid!=0">
and a.userid= #{userid}
</if>
<if test="commenttimeStart!=null and commenttimeStart!=''">
and a.commenttime&gt;=#{commenttimeStart}
</if>
<if test="commenttimeEnd!=null and commenttimeEnd!=''">
and a.commenttime&lt;=#{commenttimeEnd}
</if>
<if test="name!=null and name!=''">
and b.name like concat('%',#{name},'%')
</if>
</where>
</sql>
<select id="query" parameterType="java.util.Map" resultMap="queryMap">
select
a.*,b.name,b.categoryid,b.author,b.noveldesc,b.updatetime,b.wordsnum,b.viewcount,b.progress,b.favcount,b.novelcover,c.tel,c.pwd,c.nickname,c.birthday,c.sex,c.headurl
from novelcomment a left join novelinfo b on a.novelid=b.id left join userinfo c on a.userid=c.id
<include refid="Where_Clause"/>
<if test="page">
limit #{offset} ,#{pageSize}
</if>
</select>
<select id="getCount" parameterType="java.util.Map" resultType="Int">
select count(*) nums from novelcomment a left join novelinfo b on a.novelid=b.id left join userinfo c on
a.userid=c.id
<include refid="Where_Clause"/>
</select>
<select id="queryNovelcommentById" parameterType="int" resultType="Novelcomment">
select * from novelcomment where id=${value}
</select>
<insert id="insertNovelcomment" useGeneratedKeys="true" keyProperty="id" parameterType="Novelcomment">
insert into novelcomment
(novelid,userid,contents,commenttime)
values
(#{novelid},#{userid},#{contents},#{commenttime});
</insert>
<update id="updateNovelcomment" parameterType="Novelcomment">
update novelcomment set
novelid=#{novelid},userid=#{userid},contents=#{contents},commenttime=#{commenttime}
where
id=#{id}
</update>
<delete id="deleteNovelcomment" parameterType="int">
delete from novelcomment where id=${value}
</delete>
</mapper>

@ -0,0 +1,92 @@
<?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.mapper.NovelinfoMapper">
<resultMap type="Novelinfo" id="queryMap">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="categoryid" column="categoryid"/>
<result property="author" column="author"/>
<result property="noveldesc" column="noveldesc"/>
<result property="updatetime" column="updatetime"/>
<result property="wordsnum" column="wordsnum"/>
<result property="viewcount" column="viewcount"/>
<result property="progress" column="progress"/>
<result property="favcount" column="favcount"/>
<result property="novelcover" column="novelcover"/>
<association property="novelcategoryVO" javaType="Novelcategory">
<id property="id" column="id"/>
<result property="name" column="b_name"/>
</association>
</resultMap>
<sql id="Where_Clause">
<where>
<if test="id!=null and id!=0">
and a.id= #{id}
</if>
<if test="name!=null and name!=''">
and a.name like concat('%',#{name},'%')
</if>
<if test="categoryid!=null and categoryid!=0">
and a.categoryid= #{categoryid}
</if>
<if test="author!=null and author!=''">
and a.author like concat('%',#{author},'%')
</if>
<if test="progress!=null and progress!=0">
and a.progress= #{progress}
</if>
<if test="keyword!=null and keyword!=''">
and ( a.name like concat('%',#{keyword},'%') or a.author like concat('%',#{keyword},'%'))
</if>
</where>
</sql>
<select id="query" parameterType="java.util.Map" resultMap="queryMap">
select a.*,b.name b_name from novelinfo a left join novelcategory b on a.categoryid=b.id
<include refid="Where_Clause"/>
<if test="sorts=='view'">
order by viewcount desc
</if>
<if test="sorts==null or sorts==''">
order by id desc
</if>
<if test="sorts=='fav'">
order by favcount desc
</if>
<if test="sorts=='utime'">
order by updatetime desc
</if>
<if test="page">
limit #{offset} ,#{pageSize}
</if>
</select>
<select id="getCount" parameterType="java.util.Map" resultType="Int">
select count(*) nums from novelinfo a left join novelcategory b on a.categoryid=b.id
<include refid="Where_Clause"/>
</select>
<select id="queryNovelinfoById" parameterType="int" resultType="Novelinfo">
select * from novelinfo where id=${value}
</select>
<insert id="insertNovelinfo" useGeneratedKeys="true" keyProperty="id" parameterType="Novelinfo">
insert into novelinfo
(name,categoryid,author,noveldesc,updatetime,wordsnum,viewcount,progress,favcount,novelcover)
values
(#{name},#{categoryid},#{author},#{noveldesc},#{updatetime},#{wordsnum},#{viewcount},#{progress},#{favcount},#{novelcover});
</insert>
<update id="updateNovelinfo" parameterType="Novelinfo">
update novelinfo set
name=#{name},categoryid=#{categoryid},author=#{author},noveldesc=#{noveldesc},updatetime=#{updatetime},wordsnum=#{wordsnum},viewcount=#{viewcount},progress=#{progress},favcount=#{favcount},novelcover=#{novelcover}
where
id=#{id}
</update>
<delete id="deleteNovelinfo" parameterType="int">
delete from novelinfo where id=${value}
</delete>
</mapper>

@ -0,0 +1,62 @@
<?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.mapper.SwiperinfoMapper">
<resultMap type="Swiperinfo" id="queryMap">
<id property="id" column="id"/>
<result property="pic" column="pic"/>
<result property="novelid" column="novelid"/>
<association property="novelinfoVO" javaType="Novelinfo">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="categoryid" column="categoryid"/>
<result property="author" column="author"/>
<result property="noveldesc" column="noveldesc"/>
<result property="updatetime" column="updatetime"/>
<result property="wordsnum" column="wordsnum"/>
<result property="viewcount" column="viewcount"/>
<result property="progress" column="progress"/>
<result property="favcount" column="favcount"/>
<result property="novelcover" column="novelcover"/>
</association>
</resultMap>
<sql id="Where_Clause">
<where>
<if test="id!=null and id!=0">
and a.id= #{id}
</if>
</where>
</sql>
<select id="query" parameterType="java.util.Map" resultMap="queryMap">
select
a.*,b.name,b.categoryid,b.author,b.noveldesc,b.updatetime,b.wordsnum,b.viewcount,b.progress,b.favcount,b.novelcover
from swiperinfo a left join novelinfo b on a.novelid=b.id
<include refid="Where_Clause"/>
<if test="page">
limit #{offset} ,#{pageSize}
</if>
</select>
<select id="getCount" parameterType="java.util.Map" resultType="Int">
select count(*) nums from swiperinfo a left join novelinfo b on a.novelid=b.id
<include refid="Where_Clause"/>
</select>
<select id="querySwiperinfoById" parameterType="int" resultType="Swiperinfo">
select * from swiperinfo where id=${value}
</select>
<insert id="insertSwiperinfo" useGeneratedKeys="true" keyProperty="id" parameterType="Swiperinfo">
insert into swiperinfo
(pic,novelid)
values
(#{pic},#{novelid});
</insert>
<update id="updateSwiperinfo" parameterType="Swiperinfo">
update swiperinfo set
pic=#{pic},novelid=#{novelid}
where
id=#{id}
</update>
<delete id="deleteSwiperinfo" parameterType="int">
delete from swiperinfo where id=${value}
</delete>
</mapper>

@ -0,0 +1,43 @@
<?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.mapper.TadminMapper">
<sql id="Where_Clause">
<where>
<if test="id!=null and id!=0">and id= #{id}</if>
<if test="uname!=null and uname!=''">and uname=#{uname}</if>
<if test="upwd!=null and upwd!=''">and upwd=#{upwd}</if>
</where>
</sql>
<select id="query" parameterType="java.util.Map"
resultType="Tadmin">
select * from tadmin
<include refid="Where_Clause"/>
<if test="page">
limit #{offset} ,#{pageSize}
</if>
</select>
<select id="getCount" parameterType="java.util.Map"
resultType="Int">
select count(0) from tadmin
<include refid="Where_Clause"/>
</select>
<select id="queryTadminById" parameterType="int"
resultType="Tadmin">
select * from tadmin where id=${value}
</select>
<insert id="insertTadmin" useGeneratedKeys="true" keyProperty="id"
parameterType="Tadmin">
insert into tadmin (uname,upwd,name,tel) values
(#{uname},#{upwd},#{name},#{tel});
</insert>
<update id="updateTadmin" parameterType="Tadmin">
update tadmin set
uname=#{uname},upwd=#{upwd},name=#{name},tel=#{tel} where
id=#{id}
</update>
<delete id="deleteTadmin" parameterType="int">
delete from tadmin where id=${value}
</delete>
</mapper>

@ -0,0 +1,51 @@
<?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.mapper.UserinfoMapper">
<sql id="Where_Clause">
<where>
<if test="id!=null and id!=0">
and id= #{id}
</if>
<if test="tel!=null and tel!=''">
and tel=#{tel}
</if>
<if test="pwd!=null and pwd!=''">
and pwd=#{pwd}
</if>
<if test="nickname!=null and nickname!=''">
and nickname like concat('%',#{nickname},'%')
</if>
</where>
</sql>
<select id="query" parameterType="java.util.Map" resultType="Userinfo">
select * from userinfo
<include refid="Where_Clause"/>
<if test="page">
limit #{offset} ,#{pageSize}
</if>
</select>
<select id="getCount" parameterType="java.util.Map" resultType="Int">
select count(0) from userinfo
<include refid="Where_Clause"/>
</select>
<select id="queryUserinfoById" parameterType="int" resultType="Userinfo">
select * from userinfo where id=${value}
</select>
<insert id="insertUserinfo" useGeneratedKeys="true" keyProperty="id" parameterType="Userinfo">
insert into userinfo
(tel,pwd,nickname,birthday,sex,headurl)
values
(#{tel},#{pwd},#{nickname},#{birthday},#{sex},#{headurl});
</insert>
<update id="updateUserinfo" parameterType="Userinfo">
update userinfo set
tel=#{tel},pwd=#{pwd},nickname=#{nickname},birthday=#{birthday},sex=#{sex},headurl=#{headurl}
where
id=#{id}
</update>
<delete id="deleteUserinfo" parameterType="int">
delete from userinfo where id=${value}
</delete>
</mapper>

@ -0,0 +1,4 @@
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/novelweb?characterEncoding=UTF-8&&serverTimezone=GMT
jdbc.username=root
jdbc.password=8164032

@ -0,0 +1,12 @@
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### direct messages to file mylog.log ###
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=c:/mylog.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### set log levels - for more verbose logging change 'info' to 'debug' ###
log4j.rootLogger=debug, stdout

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 全局setting配置,根据需要添加 -->
<!-- 配置别名 -->
<typeAliases>
<!-- 批量扫描设置别名 -->
<package name="com.model"/>
</typeAliases>
<!-- 配置Mapper
备注:由于使用Spring整合mybtais的整合包进行mapper扫描,这里不需要配置了
必须遵循:mapper.xml和mapper.java文件同名且在同一目录下
<mappers></mappers>
-->
</configuration>

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
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-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd">
<!-- 数据库连接池 -->
<!-- 加载配置文件 -->
<context:property-placeholder location="classpath:db.properties"/>
<!-- 数据库连接池 -->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
destroy-method="close">
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="maxActive" value="10"/>
<property name="minIdle" value="5"/>
</bean>
<!-- 让spring管理sqlsessionfactory 使用mybatis和spring整合包中的 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 数据库连接池 -->
<property name="dataSource" ref="dataSource"/>
<!-- 加载mybatis的全局配置文件 -->
<property name="configLocation" value="classpath:mybatis/SqlMapConfig.xml"/>
</bean>
<!-- 配置Mapper扫描器 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 扫描包路径,如果需要扫描多个包中间用半角逗号隔开 -->
<property name="basePackage" value="com.mapper"/>
<!-- 这边不能使用ref="sqlSessionFactory"原因是因为上面加载配置文件导致这边引用会报错 -->
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean>
<bean name="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="UTF-8"></property>
</bean>
</beans>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
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-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd">
<!-- 扫描标注@Service注解的service -->
<context:component-scan base-package="com.service"/>
</beans>

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
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-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd">
<!-- 事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<!-- 数据源 -->
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- 通知 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- 传播行为 -->
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="insert*" propagation="REQUIRED"/>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="create*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="select*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="get*" propagation="SUPPORTS" read-only="true"/>
</tx:attributes>
</tx:advice>
<!-- 切面 -->
<aop:config>
<aop:advisor advice-ref="txAdvice" pointcut="execution(* com.service..*.*(..))"/>
</aop:config>
</beans>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd">
<!--组件扫描器扫描这一层组要扫描处理器 -->
<context:component-scan base-package="com.controller"></context:component-scan>
<!-- 配置注解的映射器和适配器以及其他配置 -->
<mvc:annotation-driven></mvc:annotation-driven>
<!-- 处理静态资源问题 -->
<mvc:default-servlet-handler/>
</beans>

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

Loading…
Cancel
Save