中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

JavaWeb開發基于ssm的校園服務系統是怎么樣的

發布時間:2021-10-15 16:46:03 來源:億速云 閱讀:107 作者:柒染 欄目:編程語言

今天就跟大家聊聊有關JavaWeb開發基于ssm的校園服務系統是怎么樣的,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結了以下內容,希望大家根據這篇文章可以有所收獲。

利用Javaweb開發的一個校園服務系統,通過發布自己的任務并設置懸賞金額,有些類似于賞金獵人。

<?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.ssm.mapper.UserMapper" > <resultMap id="BaseResultMap" type="com.ssm.po.User" > <id column="stuid" property="stuid" jdbcType="INTEGER" /> <result column="studentid" property="studentid" jdbcType="VARCHAR" /> <result column="password" property="password" jdbcType="VARCHAR" /> <result column="schoolid" property="schoolid" jdbcType="INTEGER" /> <result column="sex" property="sex" jdbcType="INTEGER" /> <result column="name" property="name" jdbcType="VARCHAR" /> <result column="registertime" property="registertime" jdbcType="TIMESTAMP" /> <result column="money" property="money" jdbcType="DOUBLE" /> <result column="state" property="state" jdbcType="INTEGER" /> </resultMap> <sql id="Base_Column_List" > stuid, studentid, password, schoolid, sex, name, registertime, money, state </sql> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > select  <include refid="Base_Column_List" /> from user where stuid = #{stuid,jdbcType=INTEGER} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > delete from user where stuid = #{stuid,jdbcType=INTEGER} </delete> <insert id="insert" parameterType="com.ssm.po.User" > insert into user (stuid, studentid, password,   schoolid, sex, name,   registertime, money, state  ) values (#{stuid,jdbcType=INTEGER}, #{studentid,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},   #{schoolid,jdbcType=INTEGER}, #{sex,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},   #{registertime,jdbcType=TIMESTAMP}, #{money,jdbcType=DOUBLE}, #{state,jdbcType=INTEGER}  ) </insert> <insert id="insertSelective" parameterType="com.ssm.po.User" > insert into user <trim prefix="(" suffix=")" suffixOverrides="," >  <if test="stuid != null" >  stuid,  </if>  <if test="studentid != null" >  studentid,  </if>  <if test="password != null" >  password,  </if>  <if test="schoolid != null" >  schoolid,  </if>  <if test="sex != null" >  sex,  </if>  <if test="name != null" >  name,  </if>  <if test="registertime != null" >  registertime,  </if>  <if test="money != null" >  money,  </if>  <if test="state != null" >  state,  </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides="," >  <if test="stuid != null" >  #{stuid,jdbcType=INTEGER},  </if>  <if test="studentid != null" >  #{studentid,jdbcType=VARCHAR},  </if>  <if test="password != null" >  #{password,jdbcType=VARCHAR},  </if>  <if test="schoolid != null" >  #{schoolid,jdbcType=INTEGER},  </if>  <if test="sex != null" >  #{sex,jdbcType=INTEGER},  </if>  <if test="name != null" >  #{name,jdbcType=VARCHAR},  </if>  <if test="registertime != null" >  #{registertime,jdbcType=TIMESTAMP},  </if>  <if test="money != null" >  #{money,jdbcType=DOUBLE},  </if>  <if test="state != null" >  #{state,jdbcType=INTEGER},  </if> </trim> </insert> <update id="updateByPrimaryKeySelective" parameterType="com.ssm.po.User" > update user <set >  <if test="studentid != null" >  studentid = #{studentid,jdbcType=VARCHAR},  </if>  <if test="password != null" >  password = #{password,jdbcType=VARCHAR},  </if>  <if test="schoolid != null" >  schoolid = #{schoolid,jdbcType=INTEGER},  </if>  <if test="sex != null" >  sex = #{sex,jdbcType=INTEGER},  </if>  <if test="name != null" >  name = #{name,jdbcType=VARCHAR},  </if>  <if test="registertime != null" >  registertime = #{registertime,jdbcType=TIMESTAMP},  </if>  <if test="money != null" >  money = #{money,jdbcType=DOUBLE},  </if>  <if test="state != null" >  state = #{state,jdbcType=INTEGER},  </if> </set> where stuid = #{stuid,jdbcType=INTEGER} </update> <update id="updateByPrimaryKey" parameterType="com.ssm.po.User" > update user set studentid = #{studentid,jdbcType=VARCHAR},  password = #{password,jdbcType=VARCHAR},  schoolid = #{schoolid,jdbcType=INTEGER},  sex = #{sex,jdbcType=INTEGER},  name = #{name,jdbcType=VARCHAR},  registertime = #{registertime,jdbcType=TIMESTAMP},  money = #{money,jdbcType=DOUBLE},  state = #{state,jdbcType=INTEGER} where stuid = #{stuid,jdbcType=INTEGER} </update> <!-- 根據賬號或昵稱查找返回user --> <select id="selectByLikeNameAccount" resultMap="BaseResultMap" > SELECT  <include refid="Base_Column_List" />  from `user` WHERE CONCAT(studentid,name) LIKE #{words,jdbcType=VARCHAR}  </select> <!-- 查找賬號個數 --> <select id="selectAccountCount" resultType="java.lang.Integer" > SELECT COUNT(*) FROM `user` WHERE studentid = #{account,jdbcType=VARCHAR}; </select> <!-- 根據賬號查找返回user --> <select id="selectUserByAccount" resultMap="BaseResultMap" > SELECT <include refid="Base_Column_List" /> FROM `user` WHERE studentid = #{account,jdbcType=VARCHAR}; </select></mapper>

注銷登錄界面

package com.ssm.controller;import java.io.IOException;import java.io.PrintWriter;import java.util.List;import javax.annotation.Resource;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.springframework.stereotype.Controller;import org.springframework.ui.Model;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.SessionAttributes;import com.ssm.util.JsonUtil;import com.ssm.po.School;import com.ssm.po.User;import com.ssm.service.SchoolService;import com.ssm.service.UserService;/** * 注銷登錄* * 異步讀取院校列表* * 讀取一個用戶信息* * @author  * */@Controller@SessionAttributes({ "nowuser","nowadmin"})@RequestMapping(value = "common/")public class CommonController { @Resource(name = "schoolService") public SchoolService schoolService;  @Resource(name = "userService") public UserService userService;  // 注銷 @RequestMapping("logout.do") public String logout(HttpServletRequest request, Model model) { model.addAttribute("msg", "已退出"); request.getSession(false).removeAttribute("nowuser"); request.getSession(false).removeAttribute("nowadmin"); return "login"; }  @RequestMapping("getallschools.do") public void getallschools(HttpServletResponse response) throws IOException{ System.out.println("000000000000000000000000000000000"); List<School> list = schoolService.getAllSchoolsNoState(); response.setCharacterEncoding("UTF-8"); response.setContentType("text/html"); String list_String = JsonUtil.list2json(list); PrintWriter out = response.getWriter(); out.println(list_String); out.flush(); out.close(); }  @RequestMapping("getuser.do") public String getuser(String stuidstr,HttpServletRequest request,Model model) { int stuid = 0; try { stuid = Integer.parseInt(stuidstr); } catch (Exception e) { model.addAttribute("msg", "出現錯誤"); return "userInfo"; } if (stuid==0) { model.addAttribute("msg", "出現錯誤"); return "userInfo"; } User user = userService.getByUid(stuid); model.addAttribute("theuser", user); return "userInfo"; }}

用戶界面

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";%><%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%><%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><base href="<%=basePath%>" rel="external nofollow" ><title>個人中心</title><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache"><meta http-equiv="expires" content="0"><meta http-equiv="keywords" content="keyword1,keyword2,keyword3"><meta http-equiv="description" content="This is my page"><link rel="stylesheet" href="<%=basePath%>layui/css/layui.css" rel="external nofollow" ><c:if test="${empty nowuser }"> <script type="text/javascript"> alert("請先登錄"); window.location.href="<%=basePath%>login.jsp" rel="external nofollow" ;  </script></c:if></head><body class="layui-layout-body"> <p class="layui-layout layui-layout-admin"> <p class="layui-header"> <p class="layui-logo">校園即時服務平臺</p> <!-- 頭部區域(可配合layui已有的水平導航) --> <ul class="layui-nav layui-layout-left"> <li class="layui-nav-item"><a href="">任務中心</a></li> <li class="layui-nav-item"><a href="userIndex.jsp" rel="external nofollow" rel="external nofollow" rel="external nofollow" >個人中心</a></li> </ul> <ul class="layui-nav layui-layout-right"> <li class="layui-nav-item"><a href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" >  ${nowuser.name } </a>  <dl class="layui-nav-child">  <dd>  <a href="userIndex.jsp" rel="external nofollow" rel="external nofollow" rel="external nofollow" >個人信息</a>  </dd>  <dd>  <a href="userUpdate.jsp" rel="external nofollow" rel="external nofollow" >資料修改</a>  </dd>  <dd>  <a href="userPassword.jsp" rel="external nofollow" rel="external nofollow" >安全設置</a>  </dd>  </dl></li> <li class="layui-nav-item"><a href="common/logout.do" rel="external nofollow" >退了</a></li> </ul> </p> <p class="layui-side layui-bg-black"> <p class="layui-side-scroll"> <!-- 左側導航區域(可配合layui已有的垂直導航) --> <ul class="layui-nav layui-nav-tree" lay-filter="test">  <li class="layui-nav-item"><a href="">校園即時服務平臺</a></li>  <li class="layui-nav-item layui-nav-itemed"><a  href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" >任務管理</a>  <dl class="layui-nav-child">  <dd>  <a href="task/getusertask.do" rel="external nofollow" >已發布任務</a>  </dd>  <dd>  <a href="task/getuseratask.do" rel="external nofollow" >已接受任務</a>  </dd>  <dd>  <a href="userNewtask.jsp" rel="external nofollow" >發布新任務</a>  </dd>  </dl></li>  <li class="layui-nav-item layui-nav-itemed"><a class=""  href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" >個人中心</a>  <dl class="layui-nav-child">  <dd class="layui-this">  <a href="userIndex.jsp" rel="external nofollow" rel="external nofollow" rel="external nofollow" >個人信息</a>  </dd>  <dd>  <a href="userUpdate.jsp" rel="external nofollow" rel="external nofollow" >資料修改</a>  </dd>  <dd>  <a href="userPassword.jsp" rel="external nofollow" rel="external nofollow" >安全設置</a>  </dd>  </dl></li> </ul> </p> </p> <!-- 內容主體區域--> <p class="layui-body"> <p  class="layui-fluid"> <p class="layui-row">  <p class="layui-col-md12">  <span class="layui-badge-dot"></span> <span  class="layui-badge-dot layui-bg-orange"></span> <span  class="layui-badge-dot layui-bg-green"></span> <span  class="layui-badge-dot layui-bg-cyan"></span> <span  class="layui-badge-dot layui-bg-blue"></span> <span  class="layui-badge-dot layui-bg-black"></span> <span  class="layui-badge-dot layui-bg-gray"></span>  <fieldset class="layui-elem-field layui-field-title"  >  <legend>個人信息</legend>  </fieldset>  </p> </p> <p class="layui-row">  <p class="layui-col-md1"></p>  <p class="layui-col-md10">  <fieldset class="layui-elem-field">  <legend>信息</legend>  <!-- <p class="layui-field-box">-->  <table class="layui-table" lay-size="lg" lay-skin="line"  >  <colgroup>   <col width="150">   <col width="200">   <col>  </colgroup>  <thead>   <tr>   <th></th>   <th></th>   </tr>  </thead>  <tbody>   <tr>   <td>用戶編號</td>   <td>${nowuser.stuid }</td>   </tr>   <tr>   <td>用戶學號</td>   <td>${nowuser.studentid }</td>   </tr>   <tr>   <td>用戶姓名</td>   <td>${nowuser.name }</td>   </tr>   <tr>   <td>學校編號</td>   <td>${nowuser.schoolid }</td>   </tr>   <tr>   <td>用戶性別</td>   <td><c:if test="${nowuser.sex==0 }">   男    </c:if> <c:if test="${nowuser.sex!=0 }">   女    </c:if></td>   </tr>   <tr>   <td>注冊時間</td>   <td><fmt:formatDate value="${nowuser.registertime }"   pattern=" yyyy-MM-dd HH:mm:ss" /></td>   </tr>   <tr>   <td>用戶余額</td>   <td>${nowuser.money }</td>   </tr>   <tr>   <td>用戶狀態</td>   <td><c:if test="${nowuser.state==0 }">   正常    </c:if> <c:if test="${nowuser.state!=0 }">   被限制    </c:if></td>   </tr>  </tbody>  </table>  <!--</p>-->  </fieldset>  </p>  <p class="layui-col-md1"></p> </p> </p> </p> <c:if test="${!empty msg }"> <script type="text/javascript"> alert("${msg }"); </script> </c:if> <p class="layui-footer"> <!-- 底部固定區域 --> &copy; - 校園即時服務平臺辦公電話:6666666 </p> </p> <script src="${pageContext.request.contextPath }/layui/layui.all.js"></script> <script> //JavaScript代碼區域 layui.use('element', function() { var element = layui.element; //監聽導航點擊 element.on('nav(test)', function(elem) { //console.log(elem) layer.msg(elem.text()); }); }); </script></body></html>

看完上述內容,你們對JavaWeb開發基于ssm的校園服務系統是怎么樣的有進一步的了解嗎?如果還想了解更多知識或者相關內容,請關注億速云行業資訊頻道,感謝大家的支持。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

确山县| 科尔| 望城县| 谢通门县| 略阳县| 广南县| 上林县| 准格尔旗| 平遥县| 江永县| 开鲁县| 渝北区| 兴化市| 理塘县| 阳曲县| 衢州市| 内江市| 黑水县| 都安| 汤原县| 兴国县| 连城县| 宝应县| 铁力市| 射阳县| 宣化县| 安多县| 陕西省| 峡江县| 磐安县| 安国市| 城口县| 彰武县| 华阴市| 北票市| 贡嘎县| 宜兴市| 伊宁市| 建湖县| 晴隆县| 崇文区|