基于javaweb+jsp的实验室管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

基于javaweb+jsp的实验室管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可

开发工具:eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

                    <div style="padding:30px;">
                        <input type="submit" class="button button-block bg-main text-big input-big" value="登录">
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    //提交之前进行检查,如果return false,则不允许提交
    function check() {
        //根据ID获取值
        var username = document.getElementById("username").value;
        var password = document.getElementById("password").value;
        if (username == "") {
            alert("用户名不能为空");
            return false;
        }
        if (password == "") {
        vo.setNoticeText(Util.decode(request, "noticeText"));
        vo.setNoticeType(Util.decode(request, "noticeType"));
        vo.setCreateDate(Util.decode(request, "createDate"));
        //调用Service层的增加(insert)方法
        noticeService.insert(vo);
        this.redirectList(request, response);
    }

    /**
     * 删除公告
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("noticeDelete")
    public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Serializable id = Util.decode(request, "id");
        noticeService.delete(Arrays.asList(id));
        this.redirectList(request, response);
    }

    /**
     * 编辑公告
     *
     * @param response
            <div class="col-sm-5">
                <input type="text" class="form-control" id="weixiuYuanyin" name="weixiuYuanyin">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">状态:</label>
            <div class="col-sm-5">
                <input name="weixiuZhuangtai" type="radio" value="维修完成" checked="checked"/>&nbsp;&nbsp;&nbsp;维修完成&nbsp;&nbsp;&nbsp;&nbsp;
                <input name="weixiuZhuangtai" type="radio" value="待处理"/>&nbsp;&nbsp;&nbsp;待处理&nbsp;&nbsp;&nbsp;&nbsp;
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">报修时间:</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" id="weixiuBaoxiushjjian" name="weixiuBaoxiushjjian">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">维修人:</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" id="weixiuWeixiuren" name="weixiuWeixiuren">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">维修时间:</label>
            <div class="col-sm-5">
        </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">报修时间:</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="weixiuBaoxiushjjian" name="weixiuBaoxiushjjian" value="${vo.weixiuBaoxiushjjian}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">维修人:</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="weixiuWeixiuren" name="weixiuWeixiuren" value="${vo.weixiuWeixiuren}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">维修时间:</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="weixiuWeixiushijian" name="weixiuWeixiushijian" value="${vo.weixiuWeixiushijian}">
                </div>
            </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"></label>
<?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.demo.dao.NoticeMapper">

    <resultMap id="BaseResultMap" type="com.demo.vo.Notice" >
            <result column="id" property="id" />
            <result column="notice_name" property="noticeName" />
            <result column="notice_text" property="noticeText" />
            <result column="notice_type" property="noticeType" />
            <result column="create_date" property="createDate" />
    </resultMap>

    <sql id="Base_Column_List">
        `id`,`notice_name`,`notice_text`,`notice_type`,`create_date`
    </sql>

    <!--新增-->
    <insert id="doCreate" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.demo.vo.Notice">
        INSERT INTO `t_notice`
        <trim prefix="(" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>`id`,</if>
                    <if test ='noticeName != null'>`notice_name`,</if>
                    <if test ='noticeText != null'>`notice_text`,</if>
                    <if test ='noticeType != null'>`notice_type`,</if>
                    <if test ='createDate != null'>`create_date`</if>
        </trim>
        this.redirectList(request, response);
    }

    /**
     * 获取设备的详细信息(详情页面与编辑页面要显示该设备的详情)并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping({"shebeiGet", "shebeiEditPre"})
    public void get(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Serializable id = Util.decode(request, "id");//取出主键id
        Shebei vo = shebeiService.get(id);
        request.getSession().setAttribute("vo", vo);
        String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
        response.sendRedirect("shebei_" + to + ".jsp");
    }

    /**
     * 根据条件查询设备的列表并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
        </foreach>
    </delete>

    <!--修改-->
    <update id="doUpdate" parameterType="com.demo.vo.Shiyanshi">
        UPDATE `t_shiyanshi`
        <set>
                <if test ='id != null'>`id` = #{id},</if>
                <if test ='shiyanshiName != null'>`shiyanshi_name` = #{shiyanshiName},</if>
                <if test ='shiyanshiWeizhi != null'>`shiyanshi_weizhi` = #{shiyanshiWeizhi},</if>
                <if test ='shiyanshiZhuangtai != null'>`shiyanshi_zhuangtai` = #{shiyanshiZhuangtai},</if>
                <if test ='shiyanshiText != null'>`shiyanshi_text` = #{shiyanshiText}</if>
        </set>
        WHERE `id` = #{id}
    </update>

    <!--获取-->
    <select id="findById" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_shiyanshi` WHERE `id` = #{id}
    </select>
        Weixiu vo = weixiuService.get(id);
        request.getSession().setAttribute("vo", vo);
        String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
        response.sendRedirect("weixiu_" + to + ".jsp");
    }

    /**
     * 根据条件查询维修的列表并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("weixiuList")
    public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectList(request, response);
    }

    /**
     * 跳转到列表页面
     *
     * @param request
     * @param response
                    <if test ='userText != null'>`user_text`,</if>
                    <if test ='userType != null'>`user_type`</if>
        </trim>
        <trim prefix="values (" 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 ='userSex != null'>#{userSex},</if>
                    <if test ='userPhone != null'>#{userPhone},</if>
                    <if test ='userText != null'>#{userText},</if>
                    <if test ='userType != null'>#{userType}</if>
        </trim>
    </insert>

    <!--批量删除-->
    <delete id="doRemoveBatch" parameterType="java.util.Collection">
        DELETE FROM `t_user` WHERE `id` IN
        <foreach collection="list" item="id" separator="," open="(" close=")">
            #{id}

运行环境

Java≥6、Tomcat≥7.0、MySQL≥5.5

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

技术框架

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

登录、注册、退出、用户模块、公告模块、设备模块、实验室模块、维修模块的增删改查管理

20220319000952

20220319000953

20220319000954

20220319000955

20220319000956

20220319000957

20220319000958

20220319000959

20220319001000

20220319001001

20220319001002

20220319001003

document

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值