/**
* 工具-字符串-转换Sql查询IN中使用的格式
* 效果：a,b==>'a','b'
* @param str
* @return
*/
public String strToDbin(String str){
return String.format("'%s'", StringUtils.join(str.split(","),"','"));
}
/**
* 工具-字符串-转换为Sql查询分组IN格式
* 解决：Sql中in超过1000个报错问题
* @param field 列名，例如：ID
* @param strIns 待拆分的字符串 a,b,c
* @return field in('a') and field in('b') and field in('c')
*/
public String strToSqlGroupIn(String field,String strIns) {
int groupNum = 1;
String groupInArr = new String();
StringBuffer buffer=new StringBuffer();
if(StringUtils.isNoneBlank(strIns)){
String[] array=strIns.split(",");
//数组总长度
int len=array.length;
//分组数
int groupCount=len/groupNum;
for(int k=0;k<groupCount;k++){
groupInArr=new String();
for(int i=(k*groupNum);i<(k*groupNum+groupNum);i++){
if(i>k*groupNum){
groupInArr+=",";
}
groupInArr+=array[i].trim();
}
if(k>0){
buffer.append(" and ");
}
buffer.append(String.format(" %s in(%s)",field,strToDbin(groupInArr)));
}
if(len%groupNum != 0){
//未整除
groupInArr=new String();
//处理最后一组数据
for(int j=(groupCount*groupNum);j<len;j++){
if(j>groupCount*groupNum){
groupInArr+=",";
}
groupInArr+=array[j].trim();
}
if(buffer.length()>0){
buffer.append(" and ");
}
buffer.append(String.format(" %s in(%s)",field,strToDbin(groupInArr)));
}
}
return buffer.toString();
}
{"ft_lang_label":"__label__zh","ft_lang_prob":0.5067469,"math_prob":0.8819735,"size":2130,"snap":"2022-27-2022-33","text_gpt3_token_len":996,"char_repetition_ratio":0.13546567,"word_repetition_ratio":0.060913704,"special_character_ratio":0.27840376,"punctuation_ratio":0.1833811,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97202355,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-06-26T14:36:30Z\",\"WARC-Record-ID\":\"<urn:uuid:cabeb3e2-ca4b-4936-8d35-d3574a765b76>\",\"Content-Length\":\"112697\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:fa4ca7a0-da87-43a7-a8a4-f74551af2d80>\",\"WARC-Concurrent-To\":\"<urn:uuid:e5ec26b8-5073-4cad-8329-11c70c0919b8>\",\"WARC-IP-Address\":\"203.107.44.140\",\"WARC-Target-URI\":\"https://blog.51cto.com/zl0828/2507761\",\"WARC-Payload-Digest\":\"sha1:L4USEBSXQH5QQTW37ZVUDG4GSBYPURQ7\",\"WARC-Block-Digest\":\"sha1:U7ZFQ7FK2XEQTZG3K6Z6HRJYN4B6ZD3B\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-27/CC-MAIN-2022-27_segments_1656103269583.13_warc_CC-MAIN-20220626131545-20220626161545-00367.warc.gz\"}"}