MongoDb配置

  • pom.xml中引入mongo依赖

    1
    2
    3
    4
    <dependency>
    <groupId> org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-mongodb</artifactId>
    </dependency>
  • application.properties 文件中添加配置

    1
    spring.data.mongodb.uri=mongodb://name:pass@localhost:27017/dbname

参考资料:

https://www.cnblogs.com/kylne/p/11193878.html

https://www.jianshu.com/p/99dfee1dbc26

JPA

https://www.jianshu.com/p/c14640b63653

https://segmentfault.com/a/1190000014269284?utm_source=index-hottest

https://blog.csdn.net/enthan809882/article/details/103741936

接收时间参数

日期参数为String类型,value用”2018-02-01”这种格式,日期参数为Date类型,value用”2018/2/01”这种格式,时间通用:”00:00:00”。

分页

https://www.jianshu.com/p/14cd90f32d4d

mysql

https://blog.csdn.net/Winter_chen001/article/details/77249029

https://www.jianshu.com/p/8061bceb4500

静态资源访问:

1
2
3
# web静态访问映射配置
spring.mvc.static-path-pattern=/**
spring.resources.static-locations=classpath:/static

报错:

1
nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc,image,url) values('test', 'test', 'test', 'test')' at line 1

注意SQL语句中是否存在sql关键字 字段名建议都时使用反引号包裹

mybatis 自动生成实体类