- 博客(81)
- 收藏
- 关注
原创 定时任务案例
@Componentpublic class DemoTask { @Scheduled(cron = "0 0,31 22 * * ?") //@Scheduled(fixedDelay = 3600000) //@PostConstruct public void syncTask() { System.out.println("定时任务我执行了!!!"); }}
2022-05-23 22:34:20 134
原创 SQL FILTER 关键字的应用
SELECT count(1) FILTER (WHERE flag_xiaofang = 1) AS xiaofang, count(1) FILTER (WHERE flag_weihua = 1) AS weihua, count(1) FILTER (WHERE flag_huanbao = 1) AS huanbao, count(1) FILTER (WHERE flag_sanchangsuo = 1) AS sancha
2022-05-13 10:59:57 1220
原创 @SuperBuilder注解的使用
//快速构建一个实体类HouseDeclare houseDeclare = HouseDeclare.builder() .id(checkRecord.getDeclareId()) .color(color) .build();
2022-05-07 15:11:23 622
原创 sql 对于阶段
select '无' AS label,count(*) AS value from tbl_person_employment_info where nsr is null union all select '2万以下的' AS label,count(*) AS value from tbl_person_employment_info where nsr = '1' union all select '2万-5万的'
2022-05-06 16:10:22 97
原创 统计表中数量你然后增加这一类的名称
//可用于统计表中数量你然后增加这一类的名称SELECT '健康小屋' as label , '汽车圈子' as quanzi FROM tbl_base_circle WHERE id = 5SELECT count(*) as "value" ,'体育' as label FROM "tbl_base_volunteer" WHERE service_type like '%体育%' union all SELECT count(*) as "value" ,'卫生' as label F
2022-04-22 17:58:52 108
原创 根据code值set地址,以及优化sql 减少查询次数
//统计用户失效列表 List<DeviceUserExtEntity> deviceUserExtEntities = deviceUserExtMapper.selectStatusPerson(orgcode, personType, formatter.parse(startTime), formatter.parse(endTime)); Set<String> codes = deviceUserExtEntities.stream()..
2022-04-22 15:53:42 62
原创 mybatis构造条件查询
//mybaitis构造条件查询器QueryWrapper<SysDept> sysDeptQueryWrapper = new QueryWrapper<>(); if (StrUtil.isNotEmpty(sysDeptAll.getRoot())) { sysDeptQueryWrapper.like("oid_path", "/" + sysDeptAll.getRoot() + "/"); } else if (SecurityUtils.getUser
2022-04-22 14:56:17 185
原创 实体类判空
if ((org.springframework.util.StringUtils.isEmpty(record.getTotal())) || (null != record.getTotal() && record.getTotal() == 0)) {}
2022-04-20 17:54:18 416
原创 pgsql创建id和uuid的生成
#uuid唯一键用于二维码生成gen_code()CREATE emnu_id_seq START 1;nextval('emnu_id_seq'::regclass)
2022-04-20 17:52:09 840
原创 pgsql创建id和uuid的生成
#uuid唯一键用于二维码生成gen_code()CREATE emnu_id_seq START 1;nextval('emnu_id_seq'::regclass)
2022-04-20 17:51:14 968
原创 pgsql创建id和uuid的生成
#uuid唯一键用于二维码生成gen_code()CREATE emnu_id_seq START 1;nextval('emnu_id_seq'::regclass)
2022-04-20 16:22:18 357
原创 【无标题】
List<DeviceUserExtEntity> deviceUserExtEntities = deviceUserExtMapper.selectStatusPerson(orgcode, personType, formatter.parse(startTime), formatter.parse(endTime)); Set<String> codes = deviceUserExtEntities.stream().filter(Objects::nonN
2022-04-11 16:07:01 215
原创 pgsql添加自动增长
CREATE SEQUENCE menu_id_seq START 1;nextval('menu_id_seq'::regclass)select setval('your_table_id_seq', 100, false);
2022-03-17 14:21:35 397
原创 sql创建账号授权该账号信息
pg创建只读账号1.创建一个用户名为readonly密码为ropass的用户CREATE USER readonly WITH ENCRYPTED PASSWORD 'ropass';2.用户只读事务alter user readonly set default_transaction_read_only=on;3.把所有库的语言的USAGE权限给到readonlyGRANT USAGE ON SCHEMA public to readonly; 4.授予select权限(这句
2022-03-17 14:15:38 68
原创 String.format()的用法
String str=null; str=String.format("Hi,%s", "小超"); System.out.println(str); str=String.format("Hi,%s %s %s", "小超","是个","大帅哥"); System.out.println(str); System.out.printf("字母c的大写是:%c %n", ...
2022-02-18 16:34:45 35
原创 idea端口占用异常
此异常为springboot启动异常,tomcat端口已经启动了,占用了,把后台tomcat关闭即可:在cmd命令窗口:1.输入 netstat -ano|findstr 8005,回车,显示在最后面的数字就是我们tomcat进程的端口号。2.输入 taskkill /pid xxxx /f xxxx就是我们的端口号,回车,终止!终止不了:则输入 tasklist | findstr 进程号 查看是哪个进程,在运行,在任务管理器把它关了即可。但是终止了端口号运行springboot启动还是
2022-02-11 10:39:01 101
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人