1、mail原始日志查询添加三个查询条件:
searchMailFrom(发件人)、searchMailTo(收件人)、searchSubject(主题); 2、clickhouse查询时使用StringEscapeUtils.unescapeHtml4对String类型的查询条件进行转义
This commit is contained in:
@@ -1,80 +1,106 @@
|
|||||||
package com.nis.domain.restful;
|
package com.nis.domain.restful;
|
||||||
|
|
||||||
import com.nis.domain.LogEntity;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
import com.nis.domain.LogEntity;
|
||||||
|
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||||
/**
|
|
||||||
* Created by darnell on 2018/6/11.
|
/**
|
||||||
*/
|
* Created by darnell on 2018/6/11.
|
||||||
public class NtcMailLog extends LogEntity{
|
*/
|
||||||
|
public class NtcMailLog extends LogEntity{
|
||||||
private static final long serialVersionUID = 2541894088824218908L;
|
|
||||||
|
private static final long serialVersionUID = 2541894088824218908L;
|
||||||
@ApiModelProperty(value="邮件协议类型", required=true)
|
|
||||||
protected String mailProto;
|
@ApiModelProperty(value="邮件协议类型", required=true)
|
||||||
@ApiModelProperty(value="发件人", required=true)
|
protected String mailProto;
|
||||||
protected String mailFrom;
|
@ApiModelProperty(value="发件人", required=true)
|
||||||
@ApiModelProperty(value="收件人", required=true)
|
protected String mailFrom;
|
||||||
protected String mailTo;
|
@ApiModelProperty(value="收件人", required=true)
|
||||||
@ApiModelProperty(value="主题", required=true)
|
protected String mailTo;
|
||||||
protected String subject;
|
@ApiModelProperty(value="主题", required=true)
|
||||||
@ApiModelProperty(value="EML文件KEY", required=true)
|
protected String subject;
|
||||||
protected String emlKey;
|
@ApiModelProperty(value="EML文件KEY", required=true)
|
||||||
@ApiModelProperty(value="EML文件转储路径", required=true)
|
protected String emlKey;
|
||||||
protected String emlFile;
|
@ApiModelProperty(value="EML文件转储路径", required=true)
|
||||||
|
protected String emlFile;
|
||||||
public String getMailProto() {
|
|
||||||
return mailProto;
|
protected String searchMailFrom; //发件人
|
||||||
}
|
protected String searchMailTo; //收件人
|
||||||
|
protected String searchSubject; //主题
|
||||||
public void setMailProto(String mailProto) {
|
|
||||||
this.mailProto = mailProto;
|
public String getMailProto() {
|
||||||
}
|
return mailProto;
|
||||||
|
}
|
||||||
public String getMailFrom() {
|
|
||||||
return mailFrom;
|
public void setMailProto(String mailProto) {
|
||||||
}
|
this.mailProto = mailProto;
|
||||||
|
}
|
||||||
public void setMailFrom(String mailFrom) {
|
|
||||||
this.mailFrom = mailFrom;
|
public String getMailFrom() {
|
||||||
}
|
return mailFrom;
|
||||||
|
}
|
||||||
public String getMailTo() {
|
|
||||||
return mailTo;
|
public void setMailFrom(String mailFrom) {
|
||||||
}
|
this.mailFrom = mailFrom;
|
||||||
|
}
|
||||||
public void setMailTo(String mailTo) {
|
|
||||||
this.mailTo = mailTo;
|
public String getMailTo() {
|
||||||
}
|
return mailTo;
|
||||||
|
}
|
||||||
public String getSubject() {
|
|
||||||
return subject;
|
public void setMailTo(String mailTo) {
|
||||||
}
|
this.mailTo = mailTo;
|
||||||
|
}
|
||||||
public void setSubject(String subject) {
|
|
||||||
this.subject = subject;
|
public String getSubject() {
|
||||||
}
|
return subject;
|
||||||
|
}
|
||||||
public String getEmlFile() {
|
|
||||||
return emlFile;
|
public void setSubject(String subject) {
|
||||||
}
|
this.subject = subject;
|
||||||
|
}
|
||||||
public void setEmlFile(String emlFile) {
|
|
||||||
this.emlFile = emlFile;
|
public String getEmlFile() {
|
||||||
}
|
return emlFile;
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return the emlKey
|
public void setEmlFile(String emlFile) {
|
||||||
*/
|
this.emlFile = emlFile;
|
||||||
public String getEmlKey() {
|
}
|
||||||
return emlKey;
|
|
||||||
}
|
/**
|
||||||
|
* @return the emlKey
|
||||||
/**
|
*/
|
||||||
* @param emlKey the emlKey to set
|
public String getEmlKey() {
|
||||||
*/
|
return emlKey;
|
||||||
public void setEmlKey(String emlKey) {
|
}
|
||||||
this.emlKey = emlKey;
|
|
||||||
}
|
/**
|
||||||
|
* @param emlKey the emlKey to set
|
||||||
}
|
*/
|
||||||
|
public void setEmlKey(String emlKey) {
|
||||||
|
this.emlKey = emlKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchMailFrom(String searchMailFrom) {
|
||||||
|
this.searchMailFrom = searchMailFrom;
|
||||||
|
}
|
||||||
|
@JsonIgnore
|
||||||
|
public String getSearchMailFrom() {
|
||||||
|
return searchMailFrom;
|
||||||
|
}
|
||||||
|
public void setSearchMailTo(String searchMailTo) {
|
||||||
|
this.searchMailTo = searchMailTo;
|
||||||
|
}
|
||||||
|
@JsonIgnore
|
||||||
|
public String getSearchMailTo() {
|
||||||
|
return searchMailTo;
|
||||||
|
}
|
||||||
|
public void setSearchSubject(String searchSubject) {
|
||||||
|
this.searchSubject = searchSubject;
|
||||||
|
}
|
||||||
|
@JsonIgnore
|
||||||
|
public String getSearchSubject() {
|
||||||
|
return searchSubject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringEscapeUtils;
|
||||||
import org.apache.ibatis.mapping.ResultMap;
|
import org.apache.ibatis.mapping.ResultMap;
|
||||||
import org.apache.ibatis.mapping.ResultMapping;
|
import org.apache.ibatis.mapping.ResultMapping;
|
||||||
import org.apache.ibatis.session.SqlSessionFactory;
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
@@ -168,7 +169,7 @@ public class LogDataService {
|
|||||||
if (field.equals("url")) {
|
if (field.equals("url")) {
|
||||||
whereSB.append(" and " + field + " like '" + value.toString().trim() + "%'");
|
whereSB.append(" and " + field + " like '" + value.toString().trim() + "%'");
|
||||||
} else {
|
} else {
|
||||||
whereSB.append(" and " + field + "='" + value.toString().trim() + "'");
|
whereSB.append(" and " + field + "='" + StringEscapeUtils.unescapeHtml4(value.toString().trim()) + "'");
|
||||||
}
|
}
|
||||||
} else if (type.equals("java.lang.Integer") || type.equals("int")
|
} else if (type.equals("java.lang.Integer") || type.equals("int")
|
||||||
|| type.equals("java.lang.Long") || type.equals("long")) {
|
|| type.equals("java.lang.Long") || type.equals("long")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user