forked from p4fmevgyr/XYSH
Compare commits
26 Commits
Author | SHA1 | Date |
---|---|---|
p4fmevgyr | f17b613e9b | 2 years ago |
p4fmevgyr | 36a9e65f79 | 2 years ago |
p4fmevgyr | 4fa6203ef9 | 2 years ago |
p4fmevgyr | 4086f9d458 | 2 years ago |
pzkue6pt2 | b65420a415 | 2 years ago |
pzkue6pt2 | 914159fc04 | 2 years ago |
pzkue6pt2 | a3ebddb019 | 2 years ago |
pzkue6pt2 | f1ed90aa10 | 2 years ago |
pzkue6pt2 | 9374ecf726 | 2 years ago |
pzkue6pt2 | 2fda730972 | 2 years ago |
pzkue6pt2 | 02af8fc01c | 2 years ago |
pzkue6pt2 | a2fe5bf7bc | 2 years ago |
pzkue6pt2 | e541827314 | 2 years ago |
pzkue6pt2 | c9ac63f7b9 | 2 years ago |
pzkue6pt2 | bc89b261d7 | 2 years ago |
pzkue6pt2 | 2c9fed236e | 2 years ago |
pvr7eh5nm | 2b76373e1b | 2 years ago |
pkratnch4 | ac2c42e4c1 | 2 years ago |
pkratnch4 | f20f6b6166 | 2 years ago |
pkratnch4 | bb1f608e18 | 2 years ago |
pkratnch4 | e46b5ab04b | 2 years ago |
pkratnch4 | 71af896289 | 2 years ago |
pkratnch4 | 89f58dfe90 | 2 years ago |
pkratnch4 | f1ae4450a7 | 2 years ago |
pkratnch4 | 5dce8cb59e | 2 years ago |
pkratnch4 | 8c953cd34e | 2 years ago |
@ -0,0 +1,53 @@
|
||||
<?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.forum.dao.CommentDao">
|
||||
|
||||
|
||||
<resultMap id="comment" type="Comment">
|
||||
<id property="id" column="cid"/>
|
||||
<result property="username" column="username"/>
|
||||
<result property="email" column="email"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="userComment" column="usercomment"/>
|
||||
<result property="avatar" column="avatar"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="forumId" column="forum_id"/>
|
||||
<association property="forum" javaType="Forum">
|
||||
<id property="id" column="id"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
<delete id="delById">
|
||||
delete from comment where id=#{id}
|
||||
</delete>
|
||||
|
||||
<select id="findByForumIdAndParentCommentNull" resultMap="comment">
|
||||
select c.id cid,c.username,c.email,c.content,c.avatar,
|
||||
c.create_time,c.forum_id,c.parent_comment_id
|
||||
from comment c, forum b
|
||||
where c.forum_id = b.id and c.forum_id = #{forumId}
|
||||
order by c.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="saveComment" parameterType="Comment">
|
||||
insert into comment (username,email,content,avatar,
|
||||
create_time,forum_id,parent_comment_id, usercomment)
|
||||
values (#{username},#{email},#{content},#{avatar},
|
||||
#{createTime},#{forumId},#{parentCommentId}, #{userComment});
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="findByParentCommentId" resultMap="comment">
|
||||
select c.id cid, c.username, c.email, c.content, c.avatar,
|
||||
c.create_time, c.forum_id, c.parent_comment_id
|
||||
from comment c
|
||||
where c.parent_comment_id = #{parentCommentId}
|
||||
</select>
|
||||
|
||||
<select id="getAllComment" resultType="com.forum.entity.Comment">
|
||||
select id,username,email,content,create_time from comment
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,27 @@
|
||||
<?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.forum.dao.LinkDao">
|
||||
|
||||
|
||||
|
||||
|
||||
<insert id="saveLink" parameterType="Link">
|
||||
insert into link(name ,address,create_time) values (#{name},#{address},#{createTime});
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
<delete id="deleteLink">
|
||||
delete from link where id = #{id}
|
||||
</delete>
|
||||
<select id="getAllLink" resultType="Link">
|
||||
select id,name,address,create_time from link
|
||||
</select>
|
||||
<select id="countLink" resultType="java.lang.Integer">
|
||||
select count(*) from link
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,66 @@
|
||||
<?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.forum.dao.MessageDao">
|
||||
|
||||
|
||||
|
||||
<resultMap id="messages" type="message">
|
||||
<id property="id" column="id"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="msg_avatar" column="msg_avatar"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
|
||||
<collection property="replies" ofType="reply">
|
||||
<id property="id" column="rid"/>
|
||||
<result property="content" column="con"/>
|
||||
<!-- <result property="reply_name" column="reply_name"/>-->
|
||||
<result property="names" column="names"/>
|
||||
<result property="createTime" column="ctime"/>
|
||||
<result property="avatar" column="avatar"/>
|
||||
<result property="mes_id" column="mes_id"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<delete id="deleteById">
|
||||
delete from message where id=#{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="findAllMessage" resultMap="messages">
|
||||
select m.*,
|
||||
r.id rid,
|
||||
r.content con,
|
||||
r.names names,
|
||||
r.create_time ctime,
|
||||
r.avatar,
|
||||
r.mes_id
|
||||
from message m left join reply r on r.mes_id=m.id
|
||||
order by m.create_time desc
|
||||
</select>
|
||||
<select id="getIndexMessage" resultMap="messages">
|
||||
select m.*
|
||||
from message m
|
||||
order by m.create_time desc
|
||||
limit 0,6
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
<select id="findAll" resultType="com.forum.entity.Message">
|
||||
select id,content,name, create_time from message
|
||||
</select>
|
||||
|
||||
<insert id="saveMessage" parameterType="message">
|
||||
insert into message (content,name,create_time,msg_avatar)
|
||||
values (#{content},#{name},#{createTime},#{msg_avatar})
|
||||
</insert>
|
||||
|
||||
<insert id="saveReplyMessage" parameterType="reply">
|
||||
insert into reply (content,names,create_time,mes_id,avatar)
|
||||
values (#{content},#{names},#{createTime},#{mes_id},#{avatar})
|
||||
</insert>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,21 @@
|
||||
<?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.forum.dao.NoticeDao">
|
||||
<select id="findAllNotice" resultType="notice">
|
||||
select * from notice
|
||||
</select>
|
||||
<select id="countNotice" resultType="java.lang.Integer">
|
||||
select count(*) from notice
|
||||
</select>
|
||||
|
||||
<insert id="addNotices" parameterType="notice">
|
||||
insert into notice(content) values(#{content})
|
||||
</insert>
|
||||
|
||||
<delete id="deleteNotice" parameterType="int">
|
||||
delete from notice where id=#{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,14 @@
|
||||
<?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.forum.dao.ReplyDao">
|
||||
<delete id="del">
|
||||
delete from reply where id=#{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="findAll" resultType="com.forum.entity.Reply">
|
||||
select id,content,names ,create_time from reply
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,28 @@
|
||||
<?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.forum.dao.UserDao">
|
||||
<update id="update">
|
||||
update user set password=#{password} where username=#{username}
|
||||
</update>
|
||||
|
||||
<select id="queryByUsernameAndPassword" resultType="com.forum.entity.User">
|
||||
select * from user
|
||||
where username = #{username} and password = #{password};
|
||||
</select>
|
||||
|
||||
<insert id="addUser" parameterType="user">
|
||||
insert into user(username,password,email,create_time,update_time,type,school,avatar)
|
||||
values(#{username},#{password},#{email},#{createTime},#{updateTime},#{type},#{school},#{avatar})
|
||||
</insert>
|
||||
<select id="getAllUser" resultType="com.forum.entity.User">
|
||||
select id,username,password,email,create_time,type from user
|
||||
</select>
|
||||
<delete id="deleteUser" >
|
||||
delete from user where id = #{id}
|
||||
</delete>
|
||||
<select id="count" resultType="Integer" >
|
||||
select count(*) from user where type = 0
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,71 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>后台登录</title>
|
||||
<style type="text/css">
|
||||
table{
|
||||
text-align: center;
|
||||
}
|
||||
.textSize{
|
||||
width: 120px;
|
||||
height: 25px;
|
||||
}
|
||||
* {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
margin: 10px 10px auto;
|
||||
background-image: url(images/bb.jpg);
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//确定按钮
|
||||
function gogo(){
|
||||
document.forms[0].submit();
|
||||
}
|
||||
//取消按钮
|
||||
function cancel(){
|
||||
document.forms[0].action = "";
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form:form action="admin/login" modelAttribute="auser" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2"><img src="images/login.gif"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>姓名:</td>
|
||||
<td>
|
||||
<form:input path="aname" cssClass="textSize"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>密码:</td>
|
||||
<td>
|
||||
<form:password path="apwd" cssClass="textSize" maxlength="20"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="image" src="images/ok.gif" onclick="gogo()" >
|
||||
<input type="image" src="images/cancel.gif" onclick="cancel()" >
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form:form>
|
||||
${msg }
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue