使用springboot、mybatisplus、bootstrap一步一步实现库存管理系统

1、创建 application.properties 文件配置 MyBatisPlus

代码(注意修改数据库的名称,数据库用户名和数据库密码,以及mysql的版本,mysql5版本使用com.mysql.jdbc.Driver否则为com.mysql.cj.jdbc.Driver)

#??JSP?????????
spring.mvc.view.prefix=/

#??JSP?????????
spring.mvc.view.suffix=.jsp

#spring.mvc.static-path-pattern=/docs/**


### ?????
#?????URL??
spring.datasource.url=jdbc:mysql://localhost:3306/stock_control?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
#???????????????????
spring.datasource.username=xx
#?????????????????
spring.datasource.password=xx
#?????????? mysql ???? 5.x ????? com.mysql.jdbc.Driver?
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

### mybatisPlus??
#??????????
mybatis-plus.type-aliases-package=com.example.model
#??SQL?????????
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
#????????
mybatis-plus.configuration.map-underscore-to-camel-case=true

spring.mvc.format.date=yyyy-MM-dd hh:mm

2、编写启动类

代码示例

package com.example;


import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@MapperScan("com.example.mapper")
public class stockControlApplication {
    public static void main(String[] args) {
        SpringApplication.run(stockControlApplication.class, args);
    }
}

3、编写mapper接口(其中有小鸟的是mybatisplus里面的方法不够用,自己创建的接口)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值