- 博客(226)
- 收藏
- 关注
原创 mysql 如果某一个字段相同那么取创建时间最新的那条数据的sql语句
SELECTt1.id,t1.value,SELECT',',1) AS idFROMGROUP BYWHERE。
2024-05-23 11:08:06
270
1
原创 java 返回文件的二进制字符串给前端
@RequestMapping(value = "/fileToStream", method = RequestMethod.GET) @ApiOperation("将文件转成流传给前端") public WebResponse fileToStream(HttpServletResponse response, HttpServletRequest request){// // 自动判断下载文件类型// response.setContentType("multipart/form-dat.
2022-04-22 13:17:23
3356
原创 java实现文件在线预览
@RequestMapping("/preview1")public void er(HttpServletResponse response){ File file = new File("G:\\桌面\\Thymeleaf3.0中文翻译文档@www.java1234.com.pdf"); if (file.exists()){ byte[] data = null; try { FileInputStream input = n.
2022-04-15 13:17:52
600
原创 文件上传工具类
package com.scgk.mall.restfulapi.common.util;import cn.hutool.core.util.ObjectUtil;import com.alibaba.excel.EasyExcel;import com.alibaba.excel.ExcelWriter;import com.alibaba.excel.write.metadata.WriteSheet;import com.aliyun.oss.OSSClient;import com.
2022-03-15 09:26:48
295
原创 ftp工具类
package com.hyit.appdev.tzszzs.util;import java.io.ByteArrayOutputStream;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.util.Arrays;import jav...
2021-09-17 18:33:58
248
原创 mysql 生成自增长序列
select ttt.*,(@i:=@i+1) as i from (SELECT t2.country, t1.org, count(DISTINCT t2.village) as villageNum, SUM(t1.desk_area_low_voltage_users) as accountNum FROM dc_cumulative_outage_list_detail t1 INNER JOIN dc_desk_area...
2021-08-10 19:46:55
108
原创 复杂的统计语句
select ttt.country,sum(ttt.townNum),sum(ttt.villageNum),sum(ttt.accountNum),sum(ttt.deskAreaNum),sum(ttt.orgNum) from (SELECT tt.country, count(DISTINCT tt.town) AS townNum, count(DISTINCT tt.village) AS villageNum, 0 as accountNum, 0 as d
2021-08-09 16:17:30
60
原创 mysql 同一个id取创建时间最大的数据
SELECT t1.item_code AS itemCode, t1.rate, t1.rate_time AS rateTimeFROM t_item_main t1INNER JOIN ( SELECT SUBSTRING_INDEX( group_concat(id ORDER BY created DESC), ',', 1 ) AS id FROM t_item_main GROUP BY item_code) t2 ON t1.id = t
2021-04-25 17:40:02
1095
原创 java 递归20210416
package com.orcas.iso.user.service.impl;import com.orcas.common.enums.OrcasProductType;import com.orcas.common.enums.ProductStateType;import com.orcas.common.enums.YesOrNo;import com.orcas.common.menu.entity.MenuEntity;import com.orcas.common.menu.en
2021-04-16 17:04:14
86
原创 java 递归20210408-3
private void insertCityInfo() { JSONArray jsonArray = GetCityCodeHttpUtil.getDistrictData1(COUNTRY); List<Map<?, ?>> list = this.convertJsonToMap(jsonArray, new ArrayList<Map<?, ?>>()); for (Map<?, ?> map : list) { t.
2021-04-08 19:27:29
65
原创 java 递归20210408-2
package com.hnzhny.mall.restfulapi.modular.sys.controller.utils;import java.util.List;import java.util.Map;import com.google.common.collect.Lists;import com.google.common.collect.Maps;import com.hnzhny.mall.modular.sys.model.SysMenu;import com.hnzh
2021-04-08 19:21:08
62
1
原创 java 递归-20210408-1
@Override public List<Integer> selectListByPid(Integer pid) { List<Integer> deptIds = Lists.newArrayList(); deptIds.add(pid); List<SysDept> sysDeptList = this.selectList(new EntityWrapper<SysDept>().eq("is_deleted", HttpConst
2021-04-08 19:17:25
55
原创 java递归树方法
@Override public List<MenuTreeList> menuTreeList() { // 查出没有父级角色信息 List<MenuTreeList> parentRoleList = sysMenuMapper.getParentRoleList("0"); // 获取子级角色信息 parentRoleList = treeMenuList(parentRoleList); // 使用递归方法获取 return parentRoleL.
2021-04-08 19:10:56
140
原创 nginx.conf文件内容详解
######Nginx配置文件nginx.conf中文详解######定义Nginx运行的用户和用户组user www www;#nginx进程数,建议设置为等于CPU总核心数。worker_processes 8;#全局错误日志定义类型,[ debug | info | notice | warn | error | crit ]error_log /usr/local/nginx/logs/error.log info;#进程pid文件pid /usr/local/nginx/logs/
2020-10-28 18:07:52
196
原创 windows node.js安装以及启动过程
npm install -g cnpm --registry=https://registry.npm.taobao.orgcnpm install node-sasscnpm install启动 cnpm run dev
2020-08-13 15:08:52
96
原创 Java遍历Map的4种方式
public static void main(String[] args) { // 循环遍历Map的4中方法 Map<Integer, Integer> map = new HashMap<Integer, Integer>(); map.put(1, 2); // 1. entrySet遍历,在键和值都需要时使用(最常用) for (Map.Entry<Integer, Integer>.
2020-08-06 11:50:32
116
原创 路人甲java
https://mp.weixin.qq.com/s?__biz=MzA5MTkxMDQ4MQ%3D%3D&chksm=88621e0abf15971c796248e35100c043dac0f5173a870c1d952d4d88a336fa4b76db6885a70c&idx=1&lang=zh_CN&mid=2648933940&scene=21&sn=6c8c6dc1d8f955663a9874c9f94de88e&token=33928702
2020-08-04 18:22:28
185
转载 解决Mysql5.7以上版本, 使用group by抛出Expression #1 of SELECT list is not in GROUP BY clause and contains no异常
出现原因:MySQL 5.7.5和up实现了对功能依赖的检测。如果启用了only_full_group_by SQL模式(在默认情况下是这样),那么MySQL就会拒绝选择列表、条件或顺序列表引用的查询,这些查询将引用组中未命名的非聚合列,而不是在功能上依赖于它们。(在5.7.5之前,MySQL没有检测到功能依赖项,only_full_group_by在默认情况下是不启用的解决方法:查看sql_modeselect @@sql_mode;不重启设置sql_modeset sql_mode=‘STR
2020-07-22 15:35:47
199
原创 java删除list元素的几种方式
方式一:使用Iterator的remove()方法public class Test { public static void main(String[] args) { List<String> list = new ArrayList<>(); list.add("aa"); list.add("bb"); list.add("cc"); Iterator<String> it
2020-07-15 13:47:22
228
原创 ueditor百度富文本编辑器linux下报错: class path resource [config.json] cannot be resolved to absolute file path
https://www.cnblogs.com/findtasy/p/10043273.html
2020-05-22 16:36:04
220
原创 ResourceUtils和FileUtils的组合使用
package com.awj.mall.ueditor.main;import java.io.BufferedReader;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import java.io.InputStreamReader;import java.io.UnsupportedEncodingEx
2020-05-22 16:33:09
429
原创 获取【请求体】数据的3种方式 request.getInputStream() request.getInputStream() request.getReader()
https://www.cnblogs.com/cs-lcy/p/10431105.html
2020-05-14 11:48:17
473
原创 图片从oss下载
package com.zjxnjz.mall.modular.download.controller;import java.io.BufferedInputStream;import java.io.InputStream;import java.io.OutputStream;import java.net.URLEncoder;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServ
2020-05-13 11:25:46
753
1
原创 Spring RestTemplate restful风格接口调用方式
package com.zjdfwl.mall;import java.nio.charset.Charset;import java.util.Iterator;import java.util.List;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.boot.S...
2020-04-17 22:38:04
329
2
原创 jwt的续期功能
JWT的TOKEN续期功能2019-02-13阅读 3.1K0JWT里有一个关键的东东,就是续期TOKEN,即TOKEN快过期时,刷新一个新的TOKEN给客户端.办法如下:1.后端生成TOKENimport com.starmark.core.shiro.model.SecurityUser;import com.starmark.core.shiro.model.UserLoginT...
2020-04-16 10:17:56
1623
1
原创 spring AOP 之一:spring AOP功能介绍
https://www.cnblogs.com/duanxz/p/6754606.html
2020-04-01 17:37:13
68
原创 使用SpringBoot AOP 记录操作日志、异常日志
https://www.cnblogs.com/wm-dv/p/11735828.html
2020-04-01 11:09:43
520
原创 java 时间戳全局格式化返回给前端
package com.zjdfwl.mall.restfulapi.config;import java.util.Arrays;import org.springframework.boot.autoconfigure.web.HttpMessageConverters;import org.springframework.context.annotation.Bean;impor...
2020-03-26 14:55:23
1602
原创 fastjson SerializerFeature详解
https://www.cnblogs.com/zf29506564/p/6669870.html
2020-03-26 14:49:42
102
原创 java 8 List转Map
private String getTagsNameStr(String tags) { if (StringUtils.isEmpty(tags)) { return ""; } StringBuffer sb = new StringBuffer(); List<DataNode> tagsDataNodeList = BaseUtil.getTagsNode...
2020-03-25 14:15:24
56
原创 java excel 转pdf
https://www.e-iceblue.cn/spirexlsjavaconversion/convert-excel-to-pdf-using-java.html#
2020-03-17 17:08:04
161
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人