0
点赞
收藏
分享

微信扫一扫

基于javaweb+jsp的设备维修管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

您好 2022-04-22 阅读 66
javamysql

基于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 class="container-fluid">
    <ul class="nav nav-tabs">
        <li><a href="weixiuList">维修列表</a></li>
        <li class="active"><a href="#">编辑</a></li>
    </ul>
    <br/>
    <form class="form-horizontal" role="form" action="weixiuEdit" method="post" onsubmit="return check()">
        <input type="hidden" class="form-control" id="id" name="id" value="${vo.id}"/>
        
            <div class="form-group">
                <label class="col-sm-3 control-label">设备编号:</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="weixiuNo" name="weixiuNo" value="${vo.weixiuNo}">
                </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="weixiuName" name="weixiuName" value="${vo.weixiuName}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">故障:</label>
                <div class="col-sm-5">
                <if test ='weixiuRen != null'>`weixiu_ren` = #{weixiuRen},</if>
                <if test ='weixiuPhone != null'>`weixiu_phone` = #{weixiuPhone},</if>
                <if test ='weixiuStatus != null'>`weixiu_status` = #{weixiuStatus},</if>
                <if test ='weixiuText != null'>`weixiu_text` = #{weixiuText}</if>
        </set>
        WHERE `id` = #{id}
    </update>

    <!--获取-->
    <select id="findById" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_weixiu` WHERE `id` = #{id}
    </select>

    <!--列表-->
    <select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>#{id},</if>
                    <if test ='shebeiName != null'>#{shebeiName},</if>
                    <if test ='shebeiNo != null'>#{shebeiNo},</if>
                    <if test ='shebeiType != null'>#{shebeiType},</if>
                    <if test ='shebeiCangjia != null'>#{shebeiCangjia},</if>
                    <if test ='shebeiIndate != null'>#{shebeiIndate},</if>
                    <if test ='shebeiInprice != null'>#{shebeiInprice},</if>
                    <if test ='shebeiDept != null'>#{shebeiDept},</if>
                    <if test ='shebeiStatus != null'>#{shebeiStatus}</if>
        </trim>
    </insert>

    <!--批量删除-->
    <delete id="doRemoveBatch" parameterType="java.util.Collection">
        DELETE FROM `t_shebei` WHERE `id` IN
        <foreach collection="list" item="id" separator="," open="(" close=")">
            #{id}
        </foreach>
    </delete>
     * @throws IOException
     */
    @RequestMapping("userList")
    public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectList(request, response);
    }

    /**
     * 跳转到列表页面
     *
     * @param request
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
        String searchColumn = Util.decode(request, "searchColumn");
        String keyword = Util.decode(request, "keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字
        Map<String, Object> map = userService.list(params);
        request.getSession().setAttribute("list", map.get("list"));

    function check() {
        //根据ID获取值
        if (document.getElementById("username").value.trim().length == 0) {
            alert("用户名不能为空!");
            return false;
        }
        if (document.getElementById("password").value.trim().length == 0) {
            alert("密码不能为空!");
            return false;
        }
        if (document.getElementById("realName").value.trim().length == 0) {
            alert("姓名不能为空!");
            return false;
        }
                <if test ='shebeiStatus != null'>`shebei_status` = #{shebeiStatus}</if>
        </set>
        WHERE `id` = #{id}
    </update>

    <!--获取-->
    <select id="findById" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_shebei` WHERE `id` = #{id}
    </select>

    <!--列表-->
    <select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_shebei`
        <where>
            <if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
                ${searchColumn} LIKE CONCAT('%',#{keyword},'%')  AND
            </if>
            1=1
        </where>
        ORDER BY id ASC
        <if test="startIndex != null and pageSize != null">
            LIMIT #{startIndex},#{pageSize};
@Controller
@RequestMapping
public class ShebeiController {

    @Autowired
    private ShebeiService shebeiService;

    /**
     * 增加设备
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("shebeiAdd")
        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
     */
    <select id="findById" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_user` WHERE `id` = #{id}
    </select>

    <!--列表-->
    <select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_user`
        <where>
            <if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
                ${searchColumn} LIKE CONCAT('%',#{keyword},'%')  AND
            </if>
            1=1
        </where>
        ORDER BY id ASC
        <if test="startIndex != null and pageSize != null">
     * @param request
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
        String searchColumn = Util.decode(request, "searchColumn");
        String keyword = Util.decode(request, "keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字
        Map<String, Object> map = noticeService.list(params);
        request.getSession().setAttribute("list", map.get("list"));

            <result column="weixiu_name" property="weixiuName" />
            <result column="weixiu_guzhang" property="weixiuGuzhang" />
            <result column="weixiu_feiyong" property="weixiuFeiyong" />
            <result column="weixiu_date" property="weixiuDate" />
            <result column="weixiu_ren" property="weixiuRen" />
            <result column="weixiu_phone" property="weixiuPhone" />
            <result column="weixiu_status" property="weixiuStatus" />
            <result column="weixiu_text" property="weixiuText" />
    </resultMap>

    <sql id="Base_Column_List">
        `id`,`weixiu_no`,`weixiu_name`,`weixiu_guzhang`,`weixiu_feiyong`,`weixiu_date`,`weixiu_ren`,`weixiu_phone`,`weixiu_status`,`weixiu_text`
    </sql>

    <!--新增-->
    <insert id="doCreate" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.demo.vo.Weixiu">
        INSERT INTO `t_weixiu`
        <trim prefix="(" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>`id`,</if>
                    <if test ='weixiuNo != null'>`weixiu_no`,</if>
                    <if test ='weixiuName != null'>`weixiu_name`,</if>
                    <if test ='weixiuGuzhang != null'>`weixiu_guzhang`,</if>
                    <if test ='weixiuFeiyong != null'>`weixiu_feiyong`,</if>
                    <if test ='weixiuDate != null'>`weixiu_date`,</if>
                    <if test ='weixiuRen != null'>`weixiu_ren`,</if>

运行环境

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…均可

适用

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

功能说明

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

20220319003424

20220319003425

20220319003426

20220319003427

20220319003428

20220319003429

20220319003430

20220319003431

20220319003432

20220319003433

20220319003434

20220319003435

20220319003436

document

举报

相关推荐

0 条评论