![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
IDEA
1819834602
有问题可以关注我,或者加我QQ1819834602,在线解答问题
展开
-
Spring Boot项目在多环境下调用不同配置文件方式,进行打包测试
首先,先配置好多个环境(开发,测试,正式等)的配置文件,如:然后在到该工程的pom目录下配置: <!--配置环境--> <profiles> <profile> <id>dev</id> <properties> <!-- 环境标识,需要与配置文件的名称相对应 --> <...原创 2019-11-20 09:01:33 · 211 阅读 · 0 评论 -
main方法调用spring注入的service类问题,@PostConstruct的运行代码
问题1:为什么只有在Junit类中才能运行@Autowired @Autowired private FeignDeviceService feignDeviceService; @Test public void test4() { feignDeviceService.queryAll(); }然后发现你用main方法,注入Service,结果报错:得到结论:静态...原创 2019-11-15 15:10:38 · 5120 阅读 · 2 评论 -
SpringBoot多条件查询
多条件查询首先,在sqlProvide写sql语句和条件判断(mybatisGenerator自动生成文件) public String selectDeviceBrandBo(DeviceByCodeBo deviceByCodeBo){ /* * 1. 给出一个sql语句前半部 */ Str...原创 2019-10-22 09:14:24 · 3436 阅读 · 0 评论 -
一个对象进行添加之后能调用它的id吗?
答案是不加东西当然不能的,返回值直接返回一个null @Autowired private PriceRuleMapper priceRuleMapper; @Test public void contextLoads() { PriceRule priceRule=new PriceRule(); priceRule.setName("abc"); priceRuleMap...原创 2019-09-25 13:54:35 · 158 阅读 · 0 评论 -
pom所有依赖version红色但是不影响运行
idea中pom所有依赖version报红但是不影响运行maven不报错,但是pom一直红色,看着心烦:直接按alt+enter键,选择箭头所示:一下就舒服多了:原创 2019-09-29 16:13:41 · 4782 阅读 · 0 评论