
springboot
asfsdggg
打工人在做笔记
展开
-
jQuery+MultipartFile上传文件
<input type="file" name="filename" id="filename" required ><button type="button" onclick="saveAddControl();">提交</button>function saveAddControl() { var prodName = $("#prodName").val(); var conName = $("#conName").val(); var version原创 2020-12-25 11:33:56 · 802 阅读 · 0 评论 -
springboot 下载图片
<div onclick="downMap(\''+ info.fileName+ '\')">下载地图</div>// 下载地图function downMap(fileName) { window.location.href = "/map/download?fileName=" + fileName;}/** * @Title: * @Description: 下载地图 * @param * @return * @throws */.原创 2020-12-25 10:54:59 · 1555 阅读 · 0 评论 -
Mybatis查询部分字段,不映射到bean中
当我们只需要查询表中的某些字段,又不想用相应的实体类在映射结果的时候,可以使用下面的方法来封装结果。首先是mapper中的接口需要用 List<Map<String, Object>>接收 public List<Map<String, Object>> getVersion(@Param("id") int id);column是数据库查询出来的字段名,jdbcType你要存在Map中的Key值,你可以自己取名字<resultMap id="原创 2020-11-30 09:45:32 · 2411 阅读 · 0 评论 -
txt文件保存到服务器/读取服务器文件
import java.io.BufferedReader;import java.io.File;import java.io.FileReader;import java.io.IOException;import java.nio.charset.Charset;import org.apache.commons.io.FileUtils;import org.springframework.boot.SpringApplication;import org.springframewo.原创 2020-11-27 15:08:20 · 622 阅读 · 0 评论 -
java存取本地文件txt
import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.FileReader;import java.io.FileWriter;import java.io.IOException;import java.util.ArrayList;import java.util.List;import org.springframework.boot.SpringApplication;import o.原创 2020-11-27 14:59:53 · 223 阅读 · 0 评论 -
springboot导入Excel表格数据时日期格式数据解析错误的问题
平时我们写日期格式的时候是这样2020-12-20 23:30:23当你写进excel表格时候会自动变成这样2019/10/1 15:57:45后台接收的时候打印出来是这样的,并且本来值为1的变成1.0解决: /** * 解析POI导入Excel中日期格式数据 * @param currentCell * @return currentCellValue */ public static String importByExcelForDate(Cell currentCell原创 2020-11-27 14:17:01 · 3205 阅读 · 0 评论 -
springboot导出带图片excel文件,(.xls格式)
这里是上传excel保存数据库添加依赖 <!-- 导出excel --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.13</version> </dependency> <dependency> <groupI原创 2020-11-27 11:50:01 · 2715 阅读 · 3 评论 -
springboot上传excel文件保存数据库(.xls)
import java.io.InputStream;import java.text.DateFormat;import java.text.SimpleDateFormat;import java.util.ArrayList;import java.util.Date;import java.util.List;import org.apache.poi.hssf.usermodel.HSSFWorkbook;import org.apache.poi.ss.usermodel.Ce.原创 2020-11-07 16:24:35 · 1397 阅读 · 0 评论 -
html用ajax获取数据后分页,非常简单!pagehelper分页插件+html+springboot
这是第三篇分页,之前的两种分页在数据越来越多并且功能需求上已经不能够满足。themleaf结合mybatis的pagehelper分页插件分页纯js分页下面是先分析一下原因,如果不想看可以直接往下看代码themleaf结合mybatis的pagehelper分页插件分页优点:使用非常的简单,mybatis的pagehelper分页插件都封装好了,只需要传入要查询的页码,就可以了。查询数据是每次只查询一页的内容。查询快。如果分页是不带查询功能的,推荐使用这个。不足:但是通过themleaf的原创 2020-11-07 11:27:01 · 3627 阅读 · 0 评论 -
logback.xml报错
Problem parsing XML document. See previously reported errors.在第二行出现错误。原因是xml文件中有多余的行原创 2020-11-03 11:21:42 · 3389 阅读 · 0 评论 -
纯js分页,javascript
之前做的分页用的是原创 2020-08-12 19:00:06 · 193 阅读 · 0 评论 -
themleaf+html+springboot实现分页/mybatis的pagehelper分页插件
这里实现的功能是页面上带关键字查询的分页分页和查询是同一个接口相关依赖 <!-- mybatis分页功能 --> <!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper --> <dependency> <groupId>com.github.pagehelper</groupId&g.原创 2020-08-12 17:40:40 · 5909 阅读 · 0 评论 -
mybatis注解的方式映射字段名,可复用
在使用mybatis做查询的时候,我的数据库字段和实体类的字段名称并不一样,但是不知道为什么一样可以查询成功并对应去映射存值,但是这几天项目做其他功能的时候,突然间项目的字段映射又不成功了,没找到原因,但是为了防止错误,还是自己把映射加上了import java.util.List;import org.apache.ibatis.annotations.Delete;import org.apache.ibatis.annotations.Insert;import org.apache.ib原创 2020-08-11 17:07:41 · 4439 阅读 · 0 评论 -
java解压本地zip文件到本地电脑
java解压本地zip文件到本地欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Markdown编辑器你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如原创 2020-08-07 18:26:30 · 503 阅读 · 0 评论