- 博客(128)
- 资源 (16)
- 收藏
- 关注
原创 mybatisplus批量写入
2.新建sql注入器InsertBatchSqlInjector。5.service引入TestMapper就可以批量插入了。1.新建MybatisPlusConfig。3.新建MyBaseMapper。4.继承MyBaseMapper。
2023-08-22 16:31:35
403
原创 java8 date
public static void main(String[] args) { String date = "2021-36周"; date = date.substring(0,date.length()-1); System.out.println(date); int year = Integer.parseInt(date.split("-")[0]); int weekNo = Integer.parseInt(date.split("-")[1]);.
2022-07-07 17:28:32
358
原创 mongodb-聚合查询
db.units.aggregate( [ { $group: { _id: { unitNumber: "$unitNumber" }, total: { $sum: 1 } } }, { $match: { total: { $gt: 1 } } }] )相当于mysqlselect unitNumber, count(unitNumber) from units gro.
2021-08-25 10:12:50
175
原创 java8 LocalDate、LocalTime、LocalDateTime
LocalDate获取年月日LocalDate today = LocalDate.now(); System.out.println("今天的日期:" + today); System.out.println( "年月日是:" + today.getYear() + "年" + today.getMonthValue() + "月" + today.getDayOfMonth() + "日");LocalTime获取时分秒Loca.
2021-06-24 15:39:03
340
原创 mongodb-查询
1.查询子文档列表最后一条db.units_statistics_hourly.find({"unitNumber" : "F8N9P141"},{ "runDuration":{ $slice : [-1,1] } });
2021-03-26 10:25:24
135
原创 mongodb更新操作
1.普通更新sqldb.units.update({ "_id": ObjectId("605374c0966b648b2d99ef24")}, { $set: { 'userList': [ { userId: "6054098870b571137b9d430f", aliasNo: "F8N38P63", aliasName: "F8N38...
2021-03-25 15:33:48
818
1
原创 VUE学习(三)-VUE集成elementui
1.安装element-uicnpm i element-ui -S2.修改main.js// The Vue build version to load with the `import` command// (runtime-only or standalone) has been set in webpack.base.conf with an alias.import Vue from 'vue'import App from './App'import router fro
2020-11-22 13:46:15
498
原创 VUE学习(二)-VUE初始化加载流程
这里主要要讲述五个文件-index.html、main.js、App.vue、index.js(router目录下)、HelloWorld.vue本地项目启动后输入http://localhost:8080/#/,1.首先加载index.html文件2.然后main.js会渲染index.html中的id为app的div,并引入组件app和路由router3.app.vue中的<router-view/>会加载index.js中配置的路由页面4.index.js默认配置的是H
2020-11-21 19:29:12
1290
原创 VUE学习(一)-使用脚手架搭建
1.安装nodejs,查看npm版本E:\project\vue-test>npm -v6.14.82.升级npmcnpm install npm -g3.升级或安装cnpmm install cnpm -g4.全局安装vue-clicnpm install --global vue-cli5.新建基于webpack的项目vue init webpack my-project6.安装项目并运行$ cd my-project$ cn.
2020-11-21 18:51:39
146
原创 docker学习-docker容器
1.容器查看#已经启动的容器docker ps#所有的容器docker ps -a2.启动容器相关参数#交互式容器(退出时容器处于停止状态,无法使用)docker run -it --name=myNginx nginx /bin/bash#退出当前容器exit#守护式容器 端口88是宿主机的映射端口docker run -di -p 88:80 --name=myNginx2 nginx#进入容器docker exec -it myNginx2 /bin/bash#.
2020-09-20 21:44:27
120
原创 docker学习-镜像
1.docker查看镜像列表docker search centos72.拉取镜像(centos:7 版本号,如果不加,表示拉取最新版本)docker pull centos:73.查看镜像docker images4.删除镜像docker rmi 镜像名称或ID
2020-09-20 20:12:19
304
原创 docker学习-centos安裝docker
1.更新yum源yum update2.安装依赖yum install -y yum-utils device-mapper-persistent-data lvm23.设置yum源(使用ustc,也可以使用阿里云的)yum-config-manager --add-repo http://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo4.安装dockeryum install -y docker-ce
2020-09-20 20:06:43
101
原创 windows安装service bus explorer
service bus explorer是service bus的可视化工具,安装前要先安装Chocolatey1.安装Chocolatey参考https://chocolatey.org/install#install-step2(1)以管理员身份运行powershell(2)输入Get-ExecutionPolicy回车,若显示Restricted,则输入Set-ExecutionPolicy Bypass -Scope Process,回车,再输入Get-ExecutionPol.
2020-07-19 17:11:30
991
原创 js下载base64文件
$scope.base64ToBlob = function(code) { var parts = code.split(';base64,'); var contentType = parts[0].split(':')[1]; var raw = window.atob(parts[1]); var rawLength = raw.length; var uInt8Array = new Uint8Array(rawLe.
2020-06-17 15:12:49
5095
原创 多线程-wait,notify
wait和notify一般都是配对使用,wait等待时会释放锁给其他线程,通过notify唤醒后继续执行,经典案例就是生产者和消费者,下面来看下代码/** * @description: * 资源类,生产者和消费者会同时调用这个类,Resource相当于一个货架,最多可以存放10件产品, * 当货架有产品时,消费者就会调用remove()方法进行消费,没有时进入等待, * 当货架商品小于10件时,生产者就会往货架上生产产品,多于10件时,就会等待消费者来消费 * @author: kongw
2020-05-13 16:25:48
260
原创 多线程-ReentrantReadWriteLock读写锁
public class ReadWriteLockTest { ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock(); Lock readLock = readWriteLock.readLock(); Lock writeLock = readWriteLock.writeLock(); List<User> userList = new ArrayList<>().
2020-05-09 16:21:05
209
原创 多线程-Lock锁lockInterruptibly()
public class LockInterruptiblyTest { private Lock lock = new ReentrantLock(); public static void main(String[] args) { LockInterruptiblyTest test = new LockInterruptiblyTest(); MyThread thread1 = new MyThread(test); MyThre.
2020-05-09 16:19:05
329
原创 多线程-Lock锁tryLock()
public class TryLockTest { Lock lock = new ReentrantLock(); private ArrayList<Integer> arrayList = new ArrayList<Integer>(); public static void main(String[] args) { final TryLockTest test = new TryLockTest(); new.
2020-05-09 16:16:58
837
原创 多线程-Lock锁lock()
正常使用lock.lock()和lock.unlock(),Lock会发生死锁现象,所以要放在finally中public class LockTest { Lock lock = new ReentrantLock(); private ArrayList<Integer> arrayList = new ArrayList<Integer>(); public static void main(String[] args) { f.
2020-05-09 16:15:16
642
原创 java8 lambda表达式常用
package com.qingwei.springboot;import com.alibaba.fastjson.JSON;import com.qingwei.springboot.model.User;import org.assertj.core.util.Lists;import org.junit.Test;import java.util.Comparator;i...
2020-05-06 17:29:45
184
原创 多线程-ThreadPoolExecutor线程池
阿里开发文档推荐使用原生的api创建线程池,因为如果使用像CachedThreadPool这种预定义线程池,有可能会出现一些未知错误,如OOM,而且不利于理解线程的各参数的作用首先看下面的例子public class ThreadPoolExecutorDIY { public static void main(String[] args) throws InterruptedE...
2020-04-29 17:23:54
234
原创 spring5源码阅读-2.xml解析bean标签
前文中提到可以to通过ClassPathXmlApplicationContext appcationContext = new ClassPathXmlApplicationContext("spring.xml");Student student = (Student) appcationContext.getBean("student");<beans xmlns=...
2020-04-26 15:34:56
163
原创 java高并发解决方案
如果一个接口并发量比较高,正常的查询更新数据库肯定会有问题,比如我们有一个SynTest的接口 @GetMapping("SynTest") public Response synTest(){ boolean result = testService.queryAndUpdate("huawei", 1); return BaseUtil...
2020-04-11 16:58:40
1218
原创 windows右击打开cmd
在桌面新建文件youji.txt,复制以下内容到文件中Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\cmd_here] @="在此处打开命令行""Icon"="cmd.exe" [HKEY_LOCAL_MACHI...
2020-04-11 13:23:52
287
原创 十、angular6-配置开发环境、测试环境和生产环境,动态读取proxy.config.json
1.在environments文件夹中添加各环境的文件(st和uat为测试环境,名字可以随便取)2. 配置各文件的参数environment.prod.ts,production: true表示是生产环境export const environment = { production: true, url: 'api/pro'};environment.st.ts...
2020-04-03 16:56:01
1390
1
原创 九,angular6-路由
1.使用脚手架工具生成路由ng generate module app-routing --flat --module=app(1)--flat表示不生成文件夹,而是生成平级文件。(2)--module==app表示将改文件注入到app.module.ts中的import中,不用手动引用2 .修改生成的路由文件import {NgModule} from "@angular...
2020-04-03 15:00:52
203
原创 八、angular6-http get post请求及跨域
1.app.module.ts引入HttpClientModule imports: [ BrowserModule, FormsModule, HttpClientModule ]2.新建my-first-servce.service.tsng g s my-first-servce添加get和post接口请求import {Inject...
2020-04-03 11:58:54
1889
原创 七、angular6-pipe(过滤器)
1.使用已有的过滤器my-first-componnet.component.ts:添加today = new Date();页面my-first-componnet.component.html <span>当前时间是:{{today | date: 'yyyy-MM-dd HH:mm:ss'}}</span>2.自定义过滤器ng...
2020-04-02 11:32:19
281
原创 spring5源码阅读-1.环境准备
1.下载源码由于gitsh上直接下载很慢,我们从gitee上下载gitclone正在上传…重新上传取消https://gitee.com/mirrors/Spring-Framework2,打开下载的spring目录下的build.gradle文件,修改路径repositories { mavenCentral() maven { url "http://maven.al...
2020-03-29 21:55:36
255
原创 六、angular6-父子页面传值
1.父页面向子页面传值app.component.html页面添加<app-my-first-componnet [num]="100" [pHeros]="heros"></app-my-first-componnet>num表示传单个值的方式,pHeros表示传递对象方式, num和pHeros表示子页面接收的属性名页面完整代码<!-- To...
2020-03-27 10:01:44
1113
原创 五、angular6-获取dom元素
1.my-first-componnet.component.html<!-- index 索引 first是否第一个 last是否最后一个 odd是否奇数 even是否偶数 循环时可以去掉,用到的话就加上--><div class="container" style="margin-top: 10px;"> <div class="row" *n...
2020-03-25 18:57:19
1779
原创 四、angular6-ngFor、ngIf、事件、双向绑定
1,ngFor在my-first-componnet.component.ts中添加如下代码 heros : Array<{name: string, strength: number, agile:number, intelligence: number}> = [ {name:'猎魂人', strength : 120, agile : 66, intellige...
2020-03-25 09:10:08
900
原创 三、angular6-引入外部文件
1.如引入bootstrap4,先安装bootstrap4npm install bootstrap@latest2,打开Angular.json页面,在styles中引入css文件,js文件不用引用
2020-03-24 11:02:10
702
原创 二、angular6-组件
1.创建组件ng g c my-first-componet,默认生成以下四个文件此时selector中是app-my-first-componnet,前面多了个app,是因为在文件angular.json中设置了前缀2.引用组件在app.component.html添加标签<app-my-first-componnet></app-my-first-c...
2020-03-24 10:47:41
139
原创 一、angular6-基于 Angular CLI 新建项目
1.下载最新版nodejs并安装,配置环境变量 下载地址:https://nodejs.org/en/安装成功后,在终端工具输入 node -v 显示版本号,说明安装成功2.安装Angular CLI终端输入 npm install -g @angular/cli,输入ng version检查是否成功,注意ng 命令都没有'-'3.新建项目ng new my-app...
2020-03-24 09:32:44
445
原创 多线程-ThreadLocal
ThreadLocal<T>其实是与线程绑定的一个变量。ThreadLocal和Synchonized都用于解决多线程并发访问。但是ThreadLocal与synchronized有本质的区别。Synchronized用于线程间的数据共享,而ThreadLocal则用于线程间的数据隔离。Synchronized是利用锁的机制,使变量或代码块在某一时该只能被一个线程访问。而ThreadL...
2020-03-19 22:30:34
625
easyexcel-master.zip
2019-10-28
linux下nginx-tomcat集群及 memecached session共享
2016-04-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人