This commit is contained in:
xd 2024-07-09 15:06:25 +08:00
parent 93ee2e9cfb
commit 9ac5bfa311
2 changed files with 26 additions and 1 deletions

View File

@ -6,7 +6,10 @@ import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import sun.misc.BASE64Decoder;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@ -296,6 +299,27 @@ public final class Base64
return encode;
}
/**
* 将base64字符串转为文件
* @param base64
* @param filePath
* @return
*/
public File base64File(String base64, String filePath) {
File file = new File(filePath);
byte[] buffer;
try {
BASE64Decoder base64Decoder = new BASE64Decoder();
buffer = base64Decoder.decodeBuffer(base64);
FileOutputStream out = new FileOutputStream(filePath);
out.write(buffer);
out.close();
} catch (Exception e) {
return null;
}
return file;
}
/**
* remove WhiteSpace from MIME containing encoded Base64 data.
*

View File

@ -557,7 +557,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectZbInfo" resultType="QuotZb">
select quot_distinguish,100 * count / SUM(count) OVER() AS quot_percentage
select quot_distinguish,
CAST(count * 100.0 / SUM(count) OVER() AS DECIMAL(10, 2)) AS quot_percentage
from (
select quot_distinguish,count(1) count
from quot