随笔分类 - java
摘要://查询设置最大code值,没有设置默认值“YP0000001” String hbid = serviceApiMapper.selectCode(); System.out.println(hbid); String substr = hbid.substring(hbid.lastIndexO
阅读全文
摘要:String phone = "13100001111"; String phoneResult = phone.replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2"); System.out.println(phoneResult);
阅读全文
摘要:直接转换,把list集合替换就好if (CollectionUtils.isNotEmpty(list)) { list.forEach(item -> { Map<String, Object> map = null; try { map = (Map<String, Object>) Prope
阅读全文
摘要:List<Entity> accOutCaseHelpExamList= JSON.parseObject(JSON.toJSONString(list), new TypeReference<List<Entity>>() {});
阅读全文
摘要:private LoginResponse redisCacheResponse() { String sessionId = "LOGINRESPONSESESSIONID"; LoginResponse loginResponse = (LoginResponse) redisTemplate.
阅读全文
摘要:在连接数据库的配置url中要加入?allowMultiQueries=true这段 然后mapper层就如下写 最后mapper.xml就是正常的写法,解释一下,我的collection="list",为什么写list,因为传入的是一个list集合,这里必须写list, 如果传入一个数组比如Inte
阅读全文
摘要:Mybatis的mapper xml文件中的常用标签 一、SQL语句标签: 1、<!--查询语句--> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > selec
阅读全文
摘要:import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId;
阅读全文
摘要:首先大家都清楚,Mybatis里面传参方式分别有使用 #{} 和 ${}。 对于使用$符存在安全问题的,该篇不做分析和介绍(其实就是如果传参的话,使用$需要手动拼接‘ ' ,这就存在注入的风险) 接下来,进入正题,通过简单举例介绍, #{} 第一种情形,传入单个参数 userId: service层
阅读全文
摘要:抛弃之前的if判断,然后执行 前言 直白点,什么场景我们需要使用到设计模式- 策略模式。 在平常的springboot项目里面做CRUD,我们的习惯性基本是 一个mapper,一个service,一个serviceImpl。 但是有时候会出现一种情况,就是实现类impl里面虽然业务主线是归为一致的,
阅读全文
摘要:@Value("${配置文件的变量名}")Springboot 指定获取自己写的配置properties文件的值 https://blog.csdn.net/qq_35387940/article/details/90714123 现在补充多一篇,指定获取yml里面的配置值 。 内容:这里分别介绍两
阅读全文
摘要:原文: https://blog.csdn.net/qq_35387940/article/details/108843878
阅读全文
摘要:原文访问: https://blog.csdn.net/qq_35387940/article/details/100151992
阅读全文