zysnba
- 浏览: 161440 次
- 性别:
- 来自: 北京
最近访客
社区版块
- ( 0)
- ( 0)
- ( 0)
最新评论
文章列表
- 博客分类:
package com.utils;
import java.math.bigdecimal;
import java.util.random;
public class randomutil {
private static final string symbols = "0123456789"; // 数字
private static final string symbols_str = "0123456789abcdefghijklmnopqrstuvwxyz";
/*
* @description: 获取 ...
- 2023-08-24 13:13
- 浏览 97
- 分类:编程语言
- 博客分类:
select
*
from
demo
where
datediff(
cast(
concat(
year ('2023-12-27'),
date_format(birthday, '-%m-%d')
) as date
),
cast(
date_format('2023-12-27', '%y-%m-%d') as date
)
) between 0
and 10
or
datediff(
cast(
concat(
year ('2023-12-27') 1,
date_format(birthday, ...
- 2023-08-16 17:54
- 浏览 148
- 分类:编程语言
- 博客分类:
package com.exception;
import com.utils.result;
import lombok.extern.slf4j.slf4j;
import org.springframework.context.support.defaultmessagesourceresolvable;
import org.springframework.dao.duplicatekeyexception;
import org.springframework.validation.bindexception;
import org.springframework.validati ...
- 2023-08-16 16:24
- 浏览 231
- 分类:编程语言
- 博客分类:
select
*,
dayofyear(now()) 7,
dayofyear(birthday)
from
demo
where
birthday >= date_format('2023-08-10', '%y-%m-%d')
and
birthday <= date_format(
date_add('2023-08-10', interval 7 day),
'%y-%m-%d'
)
or dayofyear(birthday) 7 >= ...
- 2023-08-16 15:25
- 浏览 136
- 分类:数据库
- 博客分类:
public static void main(string[] args) {
listtestlist = new arraylist<>();
test test= new test ();
test.setid(1);
test.setcode("aasdf");
testlist.add(test);
test test2= new test ();
test2.setid(2);
test2.setcode("aasd ...
- 2023-08-03 16:07
- 浏览 144
- 分类:编程语言
- 博客分类:
package com.common;
import lombok.data;
import java.util.arraylist;
import java.util.list;
import java.util.stream.collectors;
/**
* @author zys
* @date 2023/08/2 14:12
*/
@data
public class demo {
private string name;
private int age;
public static list getdemo1() {
...
- 2023-08-03 16:01
- 浏览 441
- 分类:编程语言
- 博客分类:
package com.test.config;
import org.springframework.context.annotation.bean;
import org.springframework.context.annotation.configuration;
import springfox.documentation.builders.apiinfobuilder;
import springfox.documentation.builders.pathselectors;
import springfox.documentation.builders.requesthand ...
- 2023-08-02 15:34
- 浏览 243
- 分类:编程语言
- 博客分类:
使用 classloader.getresourceasstream() 方法
可以使用类加载器来获取资源文件的输入流。该方法接受一个资源文件路径参数,返回一个 inputstream 对象。
inputstream inputstream = getclass().getclassloader().getresourceasstream("file.txt");
注意,该方法返回的资源文件路径是相对于类加载器的根路径。因此,对于 resources 目录下的文件,需要在文件名前加上 "classpath:" 前缀。例如: "classpath ...
- 2023-04-06 09:28
- 浏览 525
- 分类:编程语言
- 博客分类:
第一步引入jar
implementation 'org.freemarker:freemarker:2.3.30'
第二步
新建word,标题和图片为例
插入--文档部件--域---选择autotextlist--新值输入${title}即可。
图片的要在文档里面插入一个图片,然后另存为xml格式即可。
找到编辑器找到图片的代码,替换${image}即可。
标题:${title}
图片:${image}
第三步
public static void main(string[] args) {
try {
configur ...
- 2023-03-07 18:11
- 浏览 140
- 分类:编程语言
- 博客分类:
public class calculateutil {
/**
* @param a 单数 33
* @param b 总数 222
* a / b 计算百分比22/222
* @return
*/
public static string calculateutil(bigdecimal a, bigdecimal b){
string percent =
b == null ? "-" :
b.co ...
- 2022-12-05 14:24
- 浏览 282
- 分类:编程语言
- 博客分类:
查看java进程的命令
1、查看进程
netstat -ntlp
2、杀掉进程
kill -9 xxxxx
3、启动项目
nohup java -jar demo.jar --server.port=8080 --spring.profiles.active=test & tail -f nohup.out
nohup java -jar demo.jar --server.port=8080 --spring.profiles.active=pro & tail -f nohup.out
4、查看启动日志动态100行
tail -f -n 100 internal ...
- 2022-11-16 17:18
- 浏览 849
- 分类:编程语言
- 博客分类:
list joincountlist = totaltlist.stream()
.filter(item -> testlist.stream().map(e -> e.getstudentid()).collect(collectors.tolist())
.contains(item.getstudentid())).collect(collectors.tolist());
- 2022-11-01 17:50
- 浏览 165
- 分类:编程语言
- 博客分类:
1,'org.hibernate.validator:hibernate-validator:6.0.17.final'导入检验包
2,
@notblank(message = "图片url不能为空")
private string picurl;
3,public result saveobject(@requestbody @valid demodto dto) {
4,建立全局捕获异常类
package com.exception;
import com.ka.common.api.resultjson;
import com.ka.common.er ...
- 2022-10-28 10:13
- 浏览 336
- 分类:编程语言
- 博客分类:
1,引入
// https://mvnrepository.com/artifact/org.aspectj/aspectjweaver
implementation group: 'org.aspectj', name: 'aspectjweaver', version: '1.9.6'
2
package com.etonkids.wonderhouse.interceptor;
import java.lang.annotation.*;
/**
* 系统日志注解
*
* @author zys
* @email xxx
* @date 2019年1月14日 ...
- 2022-10-21 13:05
- 浏览 113
- 分类:编程语言
« 上一页 1 …