- 博客(100)
- 收藏
- 关注
原创 CSS3属性justify-content
使用 justify-content首先需引入flex布局如display: flex;justify-content: space-between; //两边居中justify-content:属性定义了项目在主轴上的对齐方式。(也就是X轴)它可取5个值:flex-start(默认值):左对齐flex-end:右对齐center: 居中space-between:两端对齐,项目之间的间隔都相等。space-around:每个项目两侧的间隔相等。所以,项目之间的间隔比项目与边框的间隔
2022-03-26 12:08:39
741
原创 Oracle 函数 MINUS 和 UNION
MINUS--取A表中有且B表中无的SELECT * FROM table_a MINUS SELECT * FROM table_b; UNION--取A表中有或B表中有的SELECT * FROM table_a UNION SELECT * FROM table_b;
2022-03-02 10:58:44
1074
原创 mysql数据表中,如何判断某一条记录是否重复
检测foodname是否重复select foodname,count(*) as count from tablename group by foodname having count>1;
2022-02-28 09:38:49
614
原创 Java8中stream方式日期排序
升序users.sort(Comparator.comparing(User::getCreatedOn));降序users.sort(Comparator.comparing(User::getCreatedOn).reversed());
2022-01-26 11:17:42
1072
原创 Java 8中使用stream去重List对象集合(单个属性,多个属性)
单属性:List<Course> arrayList = courseThirds.stream().collect( Collectors.collectingAndThen(Collectors.toCollection( () -> new TreeSet<>(Comparator.comparing( Course::getBjmc))),ArrayList::new));多属性:List<Course> arrayList
2022-01-19 17:00:33
710
原创 Java 正则表达式对用户名、手机号、邮箱等验证
/** * 校验器:利用正则表达式校验邮箱、手机号等 */public class Validator { /** * 正则表达式:验证用户名 */ public static final String REGEX_USERNAME = "^[a-zA-Z0-9]{6,20}$"; /** * 正则表达式:验证密码(字母+数字) * <p> * ^ 匹配一行的开头位置 * (?![0-9]+$) 预测该
2021-12-16 10:30:14
2769
原创 mybatis批量分批插入 stream流方式
if (messageVariableList.size()>0){ //一次500条 int applyIdSelectSize = 500; int limit = (messageVariableList.size() + applyIdSelectSize - 1) / applyIdSelectSize; //分成limit次发请求到数据库,in...
2021-12-08 18:20:35
898
原创 Calendar获取日期
@Test public void testTime() throws ParseException { SimpleDateFormat sj = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.add(Calendar.DATE, -3);//获取前三天时间
2021-11-26 15:39:32
296
原创 获取指定工作日前后的日期
/** * * 根据开始日期 ,需要的工作日天数 ,计算工作截止日期,并返回截止日期 * @param startDate 开始日期 * @param workDay 工作日天数(周一到周五) */ public static String getWorkDay(Date startDate, int workDay) { Calendar c1 = Calendar.getInstance(); c1.se...
2021-11-22 16:09:38
142
原创 读取指定路径文件
String path = "src/test/resources/getPhysicalPortsResponse.json"public static String getFileFromPath(String path){ StringBuffer sb = new StringBuffer(); try { File file = new File(path); Reader reader = new InputStreamReader(new Fi
2021-11-21 20:20:03
260
原创 Date类型计算天数与比较大小
一、计算天数/*计算任务天数*/long startDateTime = topicTask.getTaskStartDate().getTime();long endDateTime = topicTask.getTaskEndDate().getTime();long dayTime = (endDateTime - startDateTime) / (1000 * 3600 * 24);二、比较大小int i = workHour.getStartDate().compareTo(wor
2021-11-08 10:43:59
688
原创 springBoot调用第三方接口编写配置文件
以下为举例一、在yml中指定要调用的接口或方法的名称及路径student: name: xxx age: xxx二、编写配置类import org.springframework.beans.factory.annotation.Value;import org.springframework.context.annotation.Configuration;@Configurationpublic class StudentConfig { @Value("${s
2021-11-06 00:27:04
715
原创 CloseableHttpClient发送get、post请求
maven依赖如下:<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient --><dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.12&
2021-10-27 23:30:48
1230
原创 HttpClient发送get 、post请求json
HTTP的三种超时说明1.connectionRequestTimout指从连接池获取连接的timeout2.connetionTimeout指客户端和服务器建立连接的timeout,就是http请求的三个阶段,一:建立连接;二:数据传送;三,断开连接。超时后会ConnectionTimeOutException3.socketTimeout指客户端和服务器建立连接后,客户端从服务器读取数据的timeout,超出后会抛出SocketTimeOutExceptionGet请求和Post请求其实
2021-10-27 22:59:42
5966
1
原创 Mybatis-plus分页插件
一、新建一个配置类二、标注@Configuration 注解说明这是一个配置类三、标注@MapperScan(“xxx”)指定要扫描的mapper四、引入分页插件老版分页插件方式@Configuration //标注这是一个配置类@EnableTransactionManagement //开启事务@MapperScan("com.atguigu.gulimall.product.dao")public class mybatisConfig {
2021-09-08 23:58:34
152
原创 Mybatis批量新增
<insert id="insertLabelPermissionAll" parameterType="java.util.List"> insert into t_label_permission (person_id,label_code,add_date,create_person,current_unit_code,province_code,current_unit_name,person_name, current_dept,curr
2021-09-07 17:26:23
122
原创 关于Spring Cloud Alibaba 中Nacos配置中心在2.2.1.RELEASE版本中过时的问题
spring.cloud.nacos.config.ext-config[0]已过时替换为:spring.cloud.nacos.config.extension-configs[0]
2021-08-22 23:56:52
1108
1
原创 mybatis 增删查改
一、定义出需要返回实体类的resultMap <resultMap type="TeamInfoShow" id="TeamInfoShowResult"> <id property="id" column="id" /> <result property="teamName" column="team_name" /> <result property="teamLevel" co
2021-07-09 14:28:24
95
原创 mybatis 一对多查询
一、实体类中//定义出需要查询出的对象 并设为集合/*能力因子级别标准*/ private List<AbilityFactorRank> factorRankList;二、xml中<resultMap type="com.ideal.ability.domain.web.AbilityMaterialWeb" id="AbilityMaterialWebResult"> <result property="id" column="id"
2021-07-09 14:16:32
79
原创 mybatis根据string批量查询
一、mapper中 /** * 根据ids查询多个文件 * * @param ids * @return */ public List<BaseFile> selectBaseFilesByIds(@Param("ids") String ids);二、xml中 <select id="selectBaseFilesByIds" resultMap="BaseFileResult"> select
2021-07-07 14:21:09
700
原创 mybatis中and和or
SQL中and的优先级要高于or所以使用时要用括号将or中的条件包上如:where tti.status = 1 <trim> <if test="keyWord != null and keyWord != ''"> and (tti.team_name like concat('%', #{keyWord}, '%') or tbp.person_name like con
2021-07-06 10:55:07
3811
原创 mybatis 查询当天、一周、几个月份的数据
<if test="dateFlag == 1"> //查询近一天的数据 and DATE_FORMAT(tsd.create_time,'%Y-%m-%d')>=DATE_FORMAT(date_sub(curdate(), interval 1 day),'%Y-%m-%d') </if> <if test="dateFlag == 2"> //查询近一个星期的数据 and DATE_FORMAT(tsd...
2021-07-05 14:25:49
2809
原创 谷粒商城nacos配置中心
一、引入nacos-config <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> </dependency>二、在资源路径下创建/src/main/resources/bootstrap.properties文件 sprin
2021-06-23 21:01:59
304
原创 mybatis中map遍历多种类型-批量更新
service层@Override public int operateOrder(Long ids[], Integer operation) { Map<String, Object> map=new HashMap<>(); map.put("ids",ids); map.put("operation",operation); return shoppingOrderMapper.allSubmitOrd
2021-05-17 18:33:30
245
原创 Vue脚手架创建项目出现 (Failed to download repo vuejs-templates/webpack: Response code 404)
搭建好(脚手架2.X版本)环境像往常一样使用vue init webpack xxxx 创建项目可以是没多久就开始报错了报错结果就是:vue-cli · Failed to download repo vuejs-templates/webpack: Response code 404。解决办法就只好自己本地放一个webpack。解决途径如下:1、在github上下载这个工具: https://github.com/vuejs-templates/webpack2、放入到文件夹中,在文件夹里打开c
2021-03-21 17:51:40
2760
原创 @Transient注解
@Transient注解作用:Java的serialization提供了一种持久化对象实例的机制。当持久化对象时,可能有一个特殊的对象数据成员,我们不想用serialization机制来保存它。为了在一个特定对象的一个域上关闭serialization,可以在这个域前加上关键字transient。当一个对象被序列化的时候,transient型变量的值不包括在序列化的表示中,然而非transient型的变量是被包括进去的。@Transient 注解实体类中使用了@Table注解后,想要添加表中不存在的字
2020-12-11 16:32:06
12054
原创 Spring Cloud Stream消息驱动
本文内容翻译自官方文档,spring-cloud-stream docs,对 Spring Cloud Stream的应用入门介绍。一、Spring Cloud Stream 简介官方定义 Spring Cloud Stream 是一个构建消息驱动微服务的框架。Spring Cloud Stream构建在SpringBoot之上,提供了Kafka,RabbitMQ等消息中间件的个性化配置,引入了发布订阅、消费组和分区的语义概念,有效的简化了上层研发人员对MQ使用的复杂度,让开发人员更多的精力投入到核
2020-10-06 09:49:36
384
原创 Spring Cloud Sleuth 请求链路跟踪
一. 基础解释Spring Cloud Sleuth请求链路跟踪,在微服务下,服务之间相互调用,可能为了实现某一个功能,执行某一个请求,会级联调用多个服务,为了更好的监控管理服务,提供Sleuth 链路跟踪在 Spring Cloud Sleuth 链路跟踪中分为两块,Sleuth 负责链路跟踪, zipkin 负责展现跟踪数据Spring Cloud 在 F 版起不用构建 Zipkin Server端,直接调用 jar 包即可zipkin 的使用下载启动 zipkin进入 zip
2020-10-05 21:30:34
134
原创 SpringCloud之Config
一.SpringCloud config是什么?简单来说,Spring Cloud Config就是能将各个 应用/系统/模块 的配置文件存放到统一的地方然后进行管理(Git 或者 SVN),客户端通过接口去获取这些配置文件。SpringCloud config 为微服务架构中的微服务提供集中化的外部配置支持,配置服务器为各个不同微服务应用的所有环境提供了一个中心化的外部配置二.SpringCloud config怎么用?SpringCloud config 分服务端(Server)和客户端(
2020-10-04 17:47:29
418
原创 Spring cloud Gateway网关
三大核心概念Route(路由)、Predicate(断言)、Filter(过滤);spring cloud Gateway 使用的web Flux中的reactor-netty响应式编程组件,底层使用了Netty通讯框架;GateWay 核心逻辑 :路由转发+执行过滤链;GateWay 网关路由两种方式:yml配置文件方式、编程方式 <!--gateway--> <dependency> <groupId&g..
2020-10-03 20:53:11
238
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人