SSM-CRUD员工管理项目

SSM-CRUD员工管理项目

一,项目环境

JDK-1.8

IDEA-2017

MySq-l5.7

Maven-3.5

Tomcat- 9.0

二,数据库设计

CREATE DATABASE `ssmstaff`;

USE `ssmstaff`;

DROP TABLE IF EXISTS `Staff`;

CREATE TABLE `Staff` (
`staffID` INT(10) NOT NULL AUTO_INCREMENT COMMENT '员工id',
`staffName` VARCHAR(100) NOT NULL COMMENT '员工名字',
`staffAge` INT(11) NOT NULL COMMENT '员工年龄',
`staffAddress` VARCHAR(200) NOT NULL COMMENT '员工地址',
KEY `staffID` (`staffID`)
) ENGINE=INNODB DEFAULT CHARSET=utf8

INSERT  INTO `Staff`(`staffID`,`staffName`,`staffAge`,`staffAddress`)VALUES 
(1,'张无忌',20,'上海'),
(2,'周芷若',18,'北京'),
(3,'赵敏',18,'香港');

三,基本环境搭建

3.1 新建一个maven项目
3.2 到pom.xml文件所需要的坐标

 <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.12</version>
      </dependency>

      <dependency>
          <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
        <version>5.1.38</version>
      </dependency>

    <dependency>
      <groupId>c3p0</groupId>
      <artifactId>c3p0</artifactId>
      <version>0.9.1.2</version>
    </dependency>

    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.2.8</version>
    </dependency>

    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis-spring</artifactId>
      <version>1.3.1</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>5.0.2.RELEASE</version>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
    </dependency>

    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.2</version>
    </dependency>

    <dependency>
      <groupId>jstl</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>

    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjweaver</artifactId>
      <version>1.8.6</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>5.0.2.RELEASE</version>
    </dependency>

3.3 资源过滤

<build>
<!--设置maven资源过滤-->
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
</build>

3.4 创建所需的文件夹在这里插入图片描述
每一个对应的内容为
controller---->StaffController:

package com.duan.controller;

import com.duan.domain.Staff;
import com.duan.service.staffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

//
@SuppressWarnings("all")
@Controller
@RequestMapping("/staff")
public class StaffController {
   

    @Autowired
    @Qualifier("staffServiceImpl")
    private staffService staffservice;

    @RequestMapping("
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值