diff --git a/script/table/table_create.sql b/script/table/table_create.sql index 41777dfae5c5121195cd69ff23a5be0a7eec4f42..db44309c278b2aea38a903c01d2ba84c46823f23 100644 --- a/script/table/table_create.sql +++ b/script/table/table_create.sql @@ -65,6 +65,7 @@ CREATE TABLE IF NOT EXISTS tb_cert_info( cert_state int(1) DEFAULT 0 COMMENT '证书上链状态(1-已上链;0-未上链);2-已发布', publish_state int(1) DEFAULT 0 COMMENT '发布状态', search_filed VARCHAR(64) DEFAULT '' COMMENT '搜索字段', + info_cert_hash varchar(2048) COMMENT '证书哈希所含信息', PRIMARY KEY (id), index ind_config_id (cert_config_id), index ind_search_filed (search_filed) diff --git a/src/main/java/com/certapp/dao/entity/TbCertInfo.java b/src/main/java/com/certapp/dao/entity/TbCertInfo.java index 4d958027634b9781aba56225c6144e42f45ee2b4..b1888ace2c232a968af4cfd1ca6c3bf50cce31d2 100644 --- a/src/main/java/com/certapp/dao/entity/TbCertInfo.java +++ b/src/main/java/com/certapp/dao/entity/TbCertInfo.java @@ -1,131 +1,140 @@ -package com.certapp.dao.entity; - -import java.io.Serializable; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.ToString; -import java.util.Date; - -@Data -@ToString -@NoArgsConstructor -@EqualsAndHashCode -public class TbCertInfo implements Serializable { - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_cert_info.id - * - * @mbg.generated - */ - private Integer id; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_cert_info.cert_config_id - * - * @mbg.generated - */ - private Integer certConfigId; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_cert_info.cert_id - * - * @mbg.generated - */ - private String certId; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_cert_info.filed_info - * - * @mbg.generated - */ - private String filedInfo; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_cert_info.cert_hash - * - * @mbg.generated - */ - private String certHash; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_cert_info.tx_hash - * - * @mbg.generated - */ - private String txHash; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_cert_info.cert_url - * - * @mbg.generated - */ - private String certUrl; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_cert_info.cert_state - * - * @mbg.generated - */ - private Integer certState; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_cert_info.publish_state - * - * @mbg.generated - */ - private Integer publishState; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_cert_info.cert_time - * - * @mbg.generated - */ - private Date certTime; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_cert_info.search_filed - * - * @mbg.generated - */ - private String searchFiled; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_cert_info.cert_pic - * - * @mbg.generated - */ - private String certPic; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - private static final long serialVersionUID = 1L; -} +package com.certapp.dao.entity; + +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.ToString; +import java.util.Date; + +@Data +@ToString +@NoArgsConstructor +@EqualsAndHashCode +public class TbCertInfo implements Serializable { + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.id + * + * @mbg.generated + */ + private Integer id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.cert_config_id + * + * @mbg.generated + */ + private Integer certConfigId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.cert_id + * + * @mbg.generated + */ + private String certId; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.filed_info + * + * @mbg.generated + */ + private String filedInfo; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.cert_hash + * + * @mbg.generated + */ + private String certHash; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.tx_hash + * + * @mbg.generated + */ + private String txHash; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.cert_url + * + * @mbg.generated + */ + private String certUrl; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.cert_time + * + * @mbg.generated + */ + private Date certTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.cert_state + * + * @mbg.generated + */ + private Integer certState; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.publish_state + * + * @mbg.generated + */ + private Integer publishState; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.search_filed + * + * @mbg.generated + */ + private String searchFiled; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.info_cert_hash + * + * @mbg.generated + */ + private String infoCertHash; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column tb_cert_info.cert_pic + * + * @mbg.generated + */ + private String certPic; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; +} diff --git a/src/main/java/com/certapp/dao/entity/TbCertInfoExample.java b/src/main/java/com/certapp/dao/entity/TbCertInfoExample.java index 6e131c5e29f6af74453847c0e63690bdca6758a6..b1d32c93d477f21e680bc6631a34320a9de957c2 100644 --- a/src/main/java/com/certapp/dao/entity/TbCertInfoExample.java +++ b/src/main/java/com/certapp/dao/entity/TbCertInfoExample.java @@ -1,1082 +1,1152 @@ -package com.certapp.dao.entity; - -import java.util.ArrayList; -import java.util.List; -import java.util.Date; - -public class TbCertInfoExample { - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - protected List oredCriteria; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - protected long start = -1; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - protected long count = -1; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public TbCertInfoExample() { - oredCriteria = new ArrayList<>(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public void setStart(long start) { - this.start = start; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public long getStart() { - return start; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public void setCount(long count) { - this.count = count; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public long getCount() { - return count; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - protected abstract static class GeneratedCriteria { - - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList<>(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Integer value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Integer value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Integer value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Integer value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Integer value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Integer value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Integer value1, Integer value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Integer value1, Integer value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andCertConfigIdIsNull() { - addCriterion("cert_config_id is null"); - return (Criteria) this; - } - - public Criteria andCertConfigIdIsNotNull() { - addCriterion("cert_config_id is not null"); - return (Criteria) this; - } - - public Criteria andCertConfigIdEqualTo(Integer value) { - addCriterion("cert_config_id =", value, "certConfigId"); - return (Criteria) this; - } - - public Criteria andCertConfigIdNotEqualTo(Integer value) { - addCriterion("cert_config_id <>", value, "certConfigId"); - return (Criteria) this; - } - - public Criteria andCertConfigIdGreaterThan(Integer value) { - addCriterion("cert_config_id >", value, "certConfigId"); - return (Criteria) this; - } - - public Criteria andCertConfigIdGreaterThanOrEqualTo(Integer value) { - addCriterion("cert_config_id >=", value, "certConfigId"); - return (Criteria) this; - } - - public Criteria andCertConfigIdLessThan(Integer value) { - addCriterion("cert_config_id <", value, "certConfigId"); - return (Criteria) this; - } - - public Criteria andCertConfigIdLessThanOrEqualTo(Integer value) { - addCriterion("cert_config_id <=", value, "certConfigId"); - return (Criteria) this; - } - - public Criteria andCertConfigIdIn(List values) { - addCriterion("cert_config_id in", values, "certConfigId"); - return (Criteria) this; - } - - public Criteria andCertConfigIdNotIn(List values) { - addCriterion("cert_config_id not in", values, "certConfigId"); - return (Criteria) this; - } - - public Criteria andCertConfigIdBetween(Integer value1, Integer value2) { - addCriterion("cert_config_id between", value1, value2, "certConfigId"); - return (Criteria) this; - } - - public Criteria andCertConfigIdNotBetween(Integer value1, Integer value2) { - addCriterion("cert_config_id not between", value1, value2, "certConfigId"); - return (Criteria) this; - } - - public Criteria andCertIdIsNull() { - addCriterion("cert_id is null"); - return (Criteria) this; - } - - public Criteria andCertIdIsNotNull() { - addCriterion("cert_id is not null"); - return (Criteria) this; - } - - public Criteria andCertIdEqualTo(String value) { - addCriterion("cert_id =", value, "certId"); - return (Criteria) this; - } - - public Criteria andCertIdNotEqualTo(String value) { - addCriterion("cert_id <>", value, "certId"); - return (Criteria) this; - } - - public Criteria andCertIdGreaterThan(String value) { - addCriterion("cert_id >", value, "certId"); - return (Criteria) this; - } - - public Criteria andCertIdGreaterThanOrEqualTo(String value) { - addCriterion("cert_id >=", value, "certId"); - return (Criteria) this; - } - - public Criteria andCertIdLessThan(String value) { - addCriterion("cert_id <", value, "certId"); - return (Criteria) this; - } - - public Criteria andCertIdLessThanOrEqualTo(String value) { - addCriterion("cert_id <=", value, "certId"); - return (Criteria) this; - } - - public Criteria andCertIdLike(String value) { - addCriterion("cert_id like", value, "certId"); - return (Criteria) this; - } - - public Criteria andCertIdNotLike(String value) { - addCriterion("cert_id not like", value, "certId"); - return (Criteria) this; - } - - public Criteria andCertIdIn(List values) { - addCriterion("cert_id in", values, "certId"); - return (Criteria) this; - } - - public Criteria andCertIdNotIn(List values) { - addCriterion("cert_id not in", values, "certId"); - return (Criteria) this; - } - - public Criteria andCertIdBetween(String value1, String value2) { - addCriterion("cert_id between", value1, value2, "certId"); - return (Criteria) this; - } - - public Criteria andCertIdNotBetween(String value1, String value2) { - addCriterion("cert_id not between", value1, value2, "certId"); - return (Criteria) this; - } - - public Criteria andFiledInfoIsNull() { - addCriterion("filed_info is null"); - return (Criteria) this; - } - - public Criteria andFiledInfoIsNotNull() { - addCriterion("filed_info is not null"); - return (Criteria) this; - } - - public Criteria andFiledInfoEqualTo(String value) { - addCriterion("filed_info =", value, "filedInfo"); - return (Criteria) this; - } - - public Criteria andFiledInfoNotEqualTo(String value) { - addCriterion("filed_info <>", value, "filedInfo"); - return (Criteria) this; - } - - public Criteria andFiledInfoGreaterThan(String value) { - addCriterion("filed_info >", value, "filedInfo"); - return (Criteria) this; - } - - public Criteria andFiledInfoGreaterThanOrEqualTo(String value) { - addCriterion("filed_info >=", value, "filedInfo"); - return (Criteria) this; - } - - public Criteria andFiledInfoLessThan(String value) { - addCriterion("filed_info <", value, "filedInfo"); - return (Criteria) this; - } - - public Criteria andFiledInfoLessThanOrEqualTo(String value) { - addCriterion("filed_info <=", value, "filedInfo"); - return (Criteria) this; - } - - public Criteria andFiledInfoLike(String value) { - addCriterion("filed_info like", value, "filedInfo"); - return (Criteria) this; - } - - public Criteria andFiledInfoNotLike(String value) { - addCriterion("filed_info not like", value, "filedInfo"); - return (Criteria) this; - } - - public Criteria andFiledInfoIn(List values) { - addCriterion("filed_info in", values, "filedInfo"); - return (Criteria) this; - } - - public Criteria andFiledInfoNotIn(List values) { - addCriterion("filed_info not in", values, "filedInfo"); - return (Criteria) this; - } - - public Criteria andFiledInfoBetween(String value1, String value2) { - addCriterion("filed_info between", value1, value2, "filedInfo"); - return (Criteria) this; - } - - public Criteria andFiledInfoNotBetween(String value1, String value2) { - addCriterion("filed_info not between", value1, value2, "filedInfo"); - return (Criteria) this; - } - - public Criteria andCertHashIsNull() { - addCriterion("cert_hash is null"); - return (Criteria) this; - } - - public Criteria andCertHashIsNotNull() { - addCriterion("cert_hash is not null"); - return (Criteria) this; - } - - public Criteria andCertHashEqualTo(String value) { - addCriterion("cert_hash =", value, "certHash"); - return (Criteria) this; - } - - public Criteria andCertHashNotEqualTo(String value) { - addCriterion("cert_hash <>", value, "certHash"); - return (Criteria) this; - } - - public Criteria andCertHashGreaterThan(String value) { - addCriterion("cert_hash >", value, "certHash"); - return (Criteria) this; - } - - public Criteria andCertHashGreaterThanOrEqualTo(String value) { - addCriterion("cert_hash >=", value, "certHash"); - return (Criteria) this; - } - - public Criteria andCertHashLessThan(String value) { - addCriterion("cert_hash <", value, "certHash"); - return (Criteria) this; - } - - public Criteria andCertHashLessThanOrEqualTo(String value) { - addCriterion("cert_hash <=", value, "certHash"); - return (Criteria) this; - } - - public Criteria andCertHashLike(String value) { - addCriterion("cert_hash like", value, "certHash"); - return (Criteria) this; - } - - public Criteria andCertHashNotLike(String value) { - addCriterion("cert_hash not like", value, "certHash"); - return (Criteria) this; - } - - public Criteria andCertHashIn(List values) { - addCriterion("cert_hash in", values, "certHash"); - return (Criteria) this; - } - - public Criteria andCertHashNotIn(List values) { - addCriterion("cert_hash not in", values, "certHash"); - return (Criteria) this; - } - - public Criteria andCertHashBetween(String value1, String value2) { - addCriterion("cert_hash between", value1, value2, "certHash"); - return (Criteria) this; - } - - public Criteria andCertHashNotBetween(String value1, String value2) { - addCriterion("cert_hash not between", value1, value2, "certHash"); - return (Criteria) this; - } - - public Criteria andTxHashIsNull() { - addCriterion("tx_hash is null"); - return (Criteria) this; - } - - public Criteria andTxHashIsNotNull() { - addCriterion("tx_hash is not null"); - return (Criteria) this; - } - - public Criteria andTxHashEqualTo(String value) { - addCriterion("tx_hash =", value, "txHash"); - return (Criteria) this; - } - - public Criteria andTxHashNotEqualTo(String value) { - addCriterion("tx_hash <>", value, "txHash"); - return (Criteria) this; - } - - public Criteria andTxHashGreaterThan(String value) { - addCriterion("tx_hash >", value, "txHash"); - return (Criteria) this; - } - - public Criteria andTxHashGreaterThanOrEqualTo(String value) { - addCriterion("tx_hash >=", value, "txHash"); - return (Criteria) this; - } - - public Criteria andTxHashLessThan(String value) { - addCriterion("tx_hash <", value, "txHash"); - return (Criteria) this; - } - - public Criteria andTxHashLessThanOrEqualTo(String value) { - addCriterion("tx_hash <=", value, "txHash"); - return (Criteria) this; - } - - public Criteria andTxHashLike(String value) { - addCriterion("tx_hash like", value, "txHash"); - return (Criteria) this; - } - - public Criteria andTxHashNotLike(String value) { - addCriterion("tx_hash not like", value, "txHash"); - return (Criteria) this; - } - - public Criteria andTxHashIn(List values) { - addCriterion("tx_hash in", values, "txHash"); - return (Criteria) this; - } - - public Criteria andTxHashNotIn(List values) { - addCriterion("tx_hash not in", values, "txHash"); - return (Criteria) this; - } - - public Criteria andTxHashBetween(String value1, String value2) { - addCriterion("tx_hash between", value1, value2, "txHash"); - return (Criteria) this; - } - - public Criteria andTxHashNotBetween(String value1, String value2) { - addCriterion("tx_hash not between", value1, value2, "txHash"); - return (Criteria) this; - } - - public Criteria andCertUrlIsNull() { - addCriterion("cert_url is null"); - return (Criteria) this; - } - - public Criteria andCertUrlIsNotNull() { - addCriterion("cert_url is not null"); - return (Criteria) this; - } - - public Criteria andCertUrlEqualTo(String value) { - addCriterion("cert_url =", value, "certUrl"); - return (Criteria) this; - } - - public Criteria andCertUrlNotEqualTo(String value) { - addCriterion("cert_url <>", value, "certUrl"); - return (Criteria) this; - } - - public Criteria andCertUrlGreaterThan(String value) { - addCriterion("cert_url >", value, "certUrl"); - return (Criteria) this; - } - - public Criteria andCertUrlGreaterThanOrEqualTo(String value) { - addCriterion("cert_url >=", value, "certUrl"); - return (Criteria) this; - } - - public Criteria andCertUrlLessThan(String value) { - addCriterion("cert_url <", value, "certUrl"); - return (Criteria) this; - } - - public Criteria andCertUrlLessThanOrEqualTo(String value) { - addCriterion("cert_url <=", value, "certUrl"); - return (Criteria) this; - } - - public Criteria andCertUrlLike(String value) { - addCriterion("cert_url like", value, "certUrl"); - return (Criteria) this; - } - - public Criteria andCertUrlNotLike(String value) { - addCriterion("cert_url not like", value, "certUrl"); - return (Criteria) this; - } - - public Criteria andCertUrlIn(List values) { - addCriterion("cert_url in", values, "certUrl"); - return (Criteria) this; - } - - public Criteria andCertUrlNotIn(List values) { - addCriterion("cert_url not in", values, "certUrl"); - return (Criteria) this; - } - - public Criteria andCertUrlBetween(String value1, String value2) { - addCriterion("cert_url between", value1, value2, "certUrl"); - return (Criteria) this; - } - - public Criteria andCertUrlNotBetween(String value1, String value2) { - addCriterion("cert_url not between", value1, value2, "certUrl"); - return (Criteria) this; - } - - public Criteria andCertStateIsNull() { - addCriterion("cert_state is null"); - return (Criteria) this; - } - - public Criteria andCertStateIsNotNull() { - addCriterion("cert_state is not null"); - return (Criteria) this; - } - - public Criteria andCertStateEqualTo(Integer value) { - addCriterion("cert_state =", value, "certState"); - return (Criteria) this; - } - - public Criteria andCertStateNotEqualTo(Integer value) { - addCriterion("cert_state <>", value, "certState"); - return (Criteria) this; - } - - public Criteria andCertStateGreaterThan(Integer value) { - addCriterion("cert_state >", value, "certState"); - return (Criteria) this; - } - - public Criteria andCertStateGreaterThanOrEqualTo(Integer value) { - addCriterion("cert_state >=", value, "certState"); - return (Criteria) this; - } - - public Criteria andCertStateLessThan(Integer value) { - addCriterion("cert_state <", value, "certState"); - return (Criteria) this; - } - - public Criteria andCertStateLessThanOrEqualTo(Integer value) { - addCriterion("cert_state <=", value, "certState"); - return (Criteria) this; - } - - public Criteria andCertStateIn(List values) { - addCriterion("cert_state in", values, "certState"); - return (Criteria) this; - } - - public Criteria andCertStateNotIn(List values) { - addCriterion("cert_state not in", values, "certState"); - return (Criteria) this; - } - - public Criteria andCertStateBetween(Integer value1, Integer value2) { - addCriterion("cert_state between", value1, value2, "certState"); - return (Criteria) this; - } - - public Criteria andCertStateNotBetween(Integer value1, Integer value2) { - addCriterion("cert_state not between", value1, value2, "certState"); - return (Criteria) this; - } - - public Criteria andPublishStateIsNull() { - addCriterion("publish_state is null"); - return (Criteria) this; - } - - public Criteria andPublishStateIsNotNull() { - addCriterion("publish_state is not null"); - return (Criteria) this; - } - - public Criteria andPublishStateEqualTo(Integer value) { - addCriterion("publish_state =", value, "publishState"); - return (Criteria) this; - } - - public Criteria andPublishStateNotEqualTo(Integer value) { - addCriterion("publish_state <>", value, "publishState"); - return (Criteria) this; - } - - public Criteria andPublishStateGreaterThan(Integer value) { - addCriterion("publish_state >", value, "publishState"); - return (Criteria) this; - } - - public Criteria andPublishStateGreaterThanOrEqualTo(Integer value) { - addCriterion("publish_state >=", value, "publishState"); - return (Criteria) this; - } - - public Criteria andPublishStateLessThan(Integer value) { - addCriterion("publish_state <", value, "publishState"); - return (Criteria) this; - } - - public Criteria andPublishStateLessThanOrEqualTo(Integer value) { - addCriterion("publish_state <=", value, "publishState"); - return (Criteria) this; - } - - public Criteria andPublishStateIn(List values) { - addCriterion("publish_state in", values, "publishState"); - return (Criteria) this; - } - - public Criteria andPublishStateNotIn(List values) { - addCriterion("publish_state not in", values, "publishState"); - return (Criteria) this; - } - - public Criteria andPublishStateBetween(Integer value1, Integer value2) { - addCriterion("publish_state between", value1, value2, "publishState"); - return (Criteria) this; - } - - public Criteria andPublishStateNotBetween(Integer value1, Integer value2) { - addCriterion("publish_state not between", value1, value2, "publishState"); - return (Criteria) this; - } - - public Criteria andCertTimeIsNull() { - addCriterion("cert_time is null"); - return (Criteria) this; - } - - public Criteria andCertTimeIsNotNull() { - addCriterion("cert_time is not null"); - return (Criteria) this; - } - - public Criteria andCertTimeEqualTo(Date value) { - addCriterion("cert_time =", value, "certTime"); - return (Criteria) this; - } - - public Criteria andCertTimeNotEqualTo(Date value) { - addCriterion("cert_time <>", value, "certTime"); - return (Criteria) this; - } - - public Criteria andCertTimeGreaterThan(Date value) { - addCriterion("cert_time >", value, "certTime"); - return (Criteria) this; - } - - public Criteria andCertTimeGreaterThanOrEqualTo(Date value) { - addCriterion("cert_time >=", value, "certTime"); - return (Criteria) this; - } - - public Criteria andCertTimeLessThan(Date value) { - addCriterion("cert_time <", value, "certTime"); - return (Criteria) this; - } - - public Criteria andCertTimeLessThanOrEqualTo(Date value) { - addCriterion("cert_time <=", value, "certTime"); - return (Criteria) this; - } - - public Criteria andCertTimeIn(List values) { - addCriterion("cert_time in", values, "certTime"); - return (Criteria) this; - } - - public Criteria andCertTimeNotIn(List values) { - addCriterion("cert_time not in", values, "certTime"); - return (Criteria) this; - } - - public Criteria andCertTimeBetween(Date value1, Date value2) { - addCriterion("cert_time between", value1, value2, "certTime"); - return (Criteria) this; - } - - public Criteria andCertTimeNotBetween(Date value1, Date value2) { - addCriterion("cert_time not between", value1, value2, "certTime"); - return (Criteria) this; - } - - public Criteria andSearchFiledIsNull() { - addCriterion("search_filed is null"); - return (Criteria) this; - } - - public Criteria andSearchFiledIsNotNull() { - addCriterion("search_filed is not null"); - return (Criteria) this; - } - - public Criteria andSearchFiledEqualTo(String value) { - addCriterion("search_filed =", value, "searchFiled"); - return (Criteria) this; - } - - public Criteria andSearchFiledNotEqualTo(String value) { - addCriterion("search_filed <>", value, "searchFiled"); - return (Criteria) this; - } - - public Criteria andSearchFiledGreaterThan(String value) { - addCriterion("search_filed >", value, "searchFiled"); - return (Criteria) this; - } - - public Criteria andSearchFiledGreaterThanOrEqualTo(String value) { - addCriterion("search_filed >=", value, "searchFiled"); - return (Criteria) this; - } - - public Criteria andSearchFiledLessThan(String value) { - addCriterion("search_filed <", value, "searchFiled"); - return (Criteria) this; - } - - public Criteria andSearchFiledLessThanOrEqualTo(String value) { - addCriterion("search_filed <=", value, "searchFiled"); - return (Criteria) this; - } - - public Criteria andSearchFiledLike(String value) { - addCriterion("search_filed like", value, "searchFiled"); - return (Criteria) this; - } - - public Criteria andSearchFiledNotLike(String value) { - addCriterion("search_filed not like", value, "searchFiled"); - return (Criteria) this; - } - - public Criteria andSearchFiledIn(List values) { - addCriterion("search_filed in", values, "searchFiled"); - return (Criteria) this; - } - - public Criteria andSearchFiledNotIn(List values) { - addCriterion("search_filed not in", values, "searchFiled"); - return (Criteria) this; - } - - public Criteria andSearchFiledBetween(String value1, String value2) { - addCriterion("search_filed between", value1, value2, "searchFiled"); - return (Criteria) this; - } - - public Criteria andSearchFiledNotBetween(String value1, String value2) { - addCriterion("search_filed not between", value1, value2, "searchFiled"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table tb_cert_info - * - * @mbg.generated do_not_delete_during_merge - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public static class Criterion { - - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} +package com.certapp.dao.entity; + +import java.util.ArrayList; +import java.util.List; +import java.util.Date; + +public class TbCertInfoExample { + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + protected long start = -1; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + protected long count = -1; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public TbCertInfoExample() { + oredCriteria = new ArrayList<>(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public void setStart(long start) { + this.start = start; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public long getStart() { + return start; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public void setCount(long count) { + this.count = count; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public long getCount() { + return count; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCertConfigIdIsNull() { + addCriterion("cert_config_id is null"); + return (Criteria) this; + } + + public Criteria andCertConfigIdIsNotNull() { + addCriterion("cert_config_id is not null"); + return (Criteria) this; + } + + public Criteria andCertConfigIdEqualTo(Integer value) { + addCriterion("cert_config_id =", value, "certConfigId"); + return (Criteria) this; + } + + public Criteria andCertConfigIdNotEqualTo(Integer value) { + addCriterion("cert_config_id <>", value, "certConfigId"); + return (Criteria) this; + } + + public Criteria andCertConfigIdGreaterThan(Integer value) { + addCriterion("cert_config_id >", value, "certConfigId"); + return (Criteria) this; + } + + public Criteria andCertConfigIdGreaterThanOrEqualTo(Integer value) { + addCriterion("cert_config_id >=", value, "certConfigId"); + return (Criteria) this; + } + + public Criteria andCertConfigIdLessThan(Integer value) { + addCriterion("cert_config_id <", value, "certConfigId"); + return (Criteria) this; + } + + public Criteria andCertConfigIdLessThanOrEqualTo(Integer value) { + addCriterion("cert_config_id <=", value, "certConfigId"); + return (Criteria) this; + } + + public Criteria andCertConfigIdIn(List values) { + addCriterion("cert_config_id in", values, "certConfigId"); + return (Criteria) this; + } + + public Criteria andCertConfigIdNotIn(List values) { + addCriterion("cert_config_id not in", values, "certConfigId"); + return (Criteria) this; + } + + public Criteria andCertConfigIdBetween(Integer value1, Integer value2) { + addCriterion("cert_config_id between", value1, value2, "certConfigId"); + return (Criteria) this; + } + + public Criteria andCertConfigIdNotBetween(Integer value1, Integer value2) { + addCriterion("cert_config_id not between", value1, value2, "certConfigId"); + return (Criteria) this; + } + + public Criteria andCertIdIsNull() { + addCriterion("cert_id is null"); + return (Criteria) this; + } + + public Criteria andCertIdIsNotNull() { + addCriterion("cert_id is not null"); + return (Criteria) this; + } + + public Criteria andCertIdEqualTo(String value) { + addCriterion("cert_id =", value, "certId"); + return (Criteria) this; + } + + public Criteria andCertIdNotEqualTo(String value) { + addCriterion("cert_id <>", value, "certId"); + return (Criteria) this; + } + + public Criteria andCertIdGreaterThan(String value) { + addCriterion("cert_id >", value, "certId"); + return (Criteria) this; + } + + public Criteria andCertIdGreaterThanOrEqualTo(String value) { + addCriterion("cert_id >=", value, "certId"); + return (Criteria) this; + } + + public Criteria andCertIdLessThan(String value) { + addCriterion("cert_id <", value, "certId"); + return (Criteria) this; + } + + public Criteria andCertIdLessThanOrEqualTo(String value) { + addCriterion("cert_id <=", value, "certId"); + return (Criteria) this; + } + + public Criteria andCertIdLike(String value) { + addCriterion("cert_id like", value, "certId"); + return (Criteria) this; + } + + public Criteria andCertIdNotLike(String value) { + addCriterion("cert_id not like", value, "certId"); + return (Criteria) this; + } + + public Criteria andCertIdIn(List values) { + addCriterion("cert_id in", values, "certId"); + return (Criteria) this; + } + + public Criteria andCertIdNotIn(List values) { + addCriterion("cert_id not in", values, "certId"); + return (Criteria) this; + } + + public Criteria andCertIdBetween(String value1, String value2) { + addCriterion("cert_id between", value1, value2, "certId"); + return (Criteria) this; + } + + public Criteria andCertIdNotBetween(String value1, String value2) { + addCriterion("cert_id not between", value1, value2, "certId"); + return (Criteria) this; + } + + public Criteria andFiledInfoIsNull() { + addCriterion("filed_info is null"); + return (Criteria) this; + } + + public Criteria andFiledInfoIsNotNull() { + addCriterion("filed_info is not null"); + return (Criteria) this; + } + + public Criteria andFiledInfoEqualTo(String value) { + addCriterion("filed_info =", value, "filedInfo"); + return (Criteria) this; + } + + public Criteria andFiledInfoNotEqualTo(String value) { + addCriterion("filed_info <>", value, "filedInfo"); + return (Criteria) this; + } + + public Criteria andFiledInfoGreaterThan(String value) { + addCriterion("filed_info >", value, "filedInfo"); + return (Criteria) this; + } + + public Criteria andFiledInfoGreaterThanOrEqualTo(String value) { + addCriterion("filed_info >=", value, "filedInfo"); + return (Criteria) this; + } + + public Criteria andFiledInfoLessThan(String value) { + addCriterion("filed_info <", value, "filedInfo"); + return (Criteria) this; + } + + public Criteria andFiledInfoLessThanOrEqualTo(String value) { + addCriterion("filed_info <=", value, "filedInfo"); + return (Criteria) this; + } + + public Criteria andFiledInfoLike(String value) { + addCriterion("filed_info like", value, "filedInfo"); + return (Criteria) this; + } + + public Criteria andFiledInfoNotLike(String value) { + addCriterion("filed_info not like", value, "filedInfo"); + return (Criteria) this; + } + + public Criteria andFiledInfoIn(List values) { + addCriterion("filed_info in", values, "filedInfo"); + return (Criteria) this; + } + + public Criteria andFiledInfoNotIn(List values) { + addCriterion("filed_info not in", values, "filedInfo"); + return (Criteria) this; + } + + public Criteria andFiledInfoBetween(String value1, String value2) { + addCriterion("filed_info between", value1, value2, "filedInfo"); + return (Criteria) this; + } + + public Criteria andFiledInfoNotBetween(String value1, String value2) { + addCriterion("filed_info not between", value1, value2, "filedInfo"); + return (Criteria) this; + } + + public Criteria andCertHashIsNull() { + addCriterion("cert_hash is null"); + return (Criteria) this; + } + + public Criteria andCertHashIsNotNull() { + addCriterion("cert_hash is not null"); + return (Criteria) this; + } + + public Criteria andCertHashEqualTo(String value) { + addCriterion("cert_hash =", value, "certHash"); + return (Criteria) this; + } + + public Criteria andCertHashNotEqualTo(String value) { + addCriterion("cert_hash <>", value, "certHash"); + return (Criteria) this; + } + + public Criteria andCertHashGreaterThan(String value) { + addCriterion("cert_hash >", value, "certHash"); + return (Criteria) this; + } + + public Criteria andCertHashGreaterThanOrEqualTo(String value) { + addCriterion("cert_hash >=", value, "certHash"); + return (Criteria) this; + } + + public Criteria andCertHashLessThan(String value) { + addCriterion("cert_hash <", value, "certHash"); + return (Criteria) this; + } + + public Criteria andCertHashLessThanOrEqualTo(String value) { + addCriterion("cert_hash <=", value, "certHash"); + return (Criteria) this; + } + + public Criteria andCertHashLike(String value) { + addCriterion("cert_hash like", value, "certHash"); + return (Criteria) this; + } + + public Criteria andCertHashNotLike(String value) { + addCriterion("cert_hash not like", value, "certHash"); + return (Criteria) this; + } + + public Criteria andCertHashIn(List values) { + addCriterion("cert_hash in", values, "certHash"); + return (Criteria) this; + } + + public Criteria andCertHashNotIn(List values) { + addCriterion("cert_hash not in", values, "certHash"); + return (Criteria) this; + } + + public Criteria andCertHashBetween(String value1, String value2) { + addCriterion("cert_hash between", value1, value2, "certHash"); + return (Criteria) this; + } + + public Criteria andCertHashNotBetween(String value1, String value2) { + addCriterion("cert_hash not between", value1, value2, "certHash"); + return (Criteria) this; + } + + public Criteria andTxHashIsNull() { + addCriterion("tx_hash is null"); + return (Criteria) this; + } + + public Criteria andTxHashIsNotNull() { + addCriterion("tx_hash is not null"); + return (Criteria) this; + } + + public Criteria andTxHashEqualTo(String value) { + addCriterion("tx_hash =", value, "txHash"); + return (Criteria) this; + } + + public Criteria andTxHashNotEqualTo(String value) { + addCriterion("tx_hash <>", value, "txHash"); + return (Criteria) this; + } + + public Criteria andTxHashGreaterThan(String value) { + addCriterion("tx_hash >", value, "txHash"); + return (Criteria) this; + } + + public Criteria andTxHashGreaterThanOrEqualTo(String value) { + addCriterion("tx_hash >=", value, "txHash"); + return (Criteria) this; + } + + public Criteria andTxHashLessThan(String value) { + addCriterion("tx_hash <", value, "txHash"); + return (Criteria) this; + } + + public Criteria andTxHashLessThanOrEqualTo(String value) { + addCriterion("tx_hash <=", value, "txHash"); + return (Criteria) this; + } + + public Criteria andTxHashLike(String value) { + addCriterion("tx_hash like", value, "txHash"); + return (Criteria) this; + } + + public Criteria andTxHashNotLike(String value) { + addCriterion("tx_hash not like", value, "txHash"); + return (Criteria) this; + } + + public Criteria andTxHashIn(List values) { + addCriterion("tx_hash in", values, "txHash"); + return (Criteria) this; + } + + public Criteria andTxHashNotIn(List values) { + addCriterion("tx_hash not in", values, "txHash"); + return (Criteria) this; + } + + public Criteria andTxHashBetween(String value1, String value2) { + addCriterion("tx_hash between", value1, value2, "txHash"); + return (Criteria) this; + } + + public Criteria andTxHashNotBetween(String value1, String value2) { + addCriterion("tx_hash not between", value1, value2, "txHash"); + return (Criteria) this; + } + + public Criteria andCertUrlIsNull() { + addCriterion("cert_url is null"); + return (Criteria) this; + } + + public Criteria andCertUrlIsNotNull() { + addCriterion("cert_url is not null"); + return (Criteria) this; + } + + public Criteria andCertUrlEqualTo(String value) { + addCriterion("cert_url =", value, "certUrl"); + return (Criteria) this; + } + + public Criteria andCertUrlNotEqualTo(String value) { + addCriterion("cert_url <>", value, "certUrl"); + return (Criteria) this; + } + + public Criteria andCertUrlGreaterThan(String value) { + addCriterion("cert_url >", value, "certUrl"); + return (Criteria) this; + } + + public Criteria andCertUrlGreaterThanOrEqualTo(String value) { + addCriterion("cert_url >=", value, "certUrl"); + return (Criteria) this; + } + + public Criteria andCertUrlLessThan(String value) { + addCriterion("cert_url <", value, "certUrl"); + return (Criteria) this; + } + + public Criteria andCertUrlLessThanOrEqualTo(String value) { + addCriterion("cert_url <=", value, "certUrl"); + return (Criteria) this; + } + + public Criteria andCertUrlLike(String value) { + addCriterion("cert_url like", value, "certUrl"); + return (Criteria) this; + } + + public Criteria andCertUrlNotLike(String value) { + addCriterion("cert_url not like", value, "certUrl"); + return (Criteria) this; + } + + public Criteria andCertUrlIn(List values) { + addCriterion("cert_url in", values, "certUrl"); + return (Criteria) this; + } + + public Criteria andCertUrlNotIn(List values) { + addCriterion("cert_url not in", values, "certUrl"); + return (Criteria) this; + } + + public Criteria andCertUrlBetween(String value1, String value2) { + addCriterion("cert_url between", value1, value2, "certUrl"); + return (Criteria) this; + } + + public Criteria andCertUrlNotBetween(String value1, String value2) { + addCriterion("cert_url not between", value1, value2, "certUrl"); + return (Criteria) this; + } + + public Criteria andCertTimeIsNull() { + addCriterion("cert_time is null"); + return (Criteria) this; + } + + public Criteria andCertTimeIsNotNull() { + addCriterion("cert_time is not null"); + return (Criteria) this; + } + + public Criteria andCertTimeEqualTo(Date value) { + addCriterion("cert_time =", value, "certTime"); + return (Criteria) this; + } + + public Criteria andCertTimeNotEqualTo(Date value) { + addCriterion("cert_time <>", value, "certTime"); + return (Criteria) this; + } + + public Criteria andCertTimeGreaterThan(Date value) { + addCriterion("cert_time >", value, "certTime"); + return (Criteria) this; + } + + public Criteria andCertTimeGreaterThanOrEqualTo(Date value) { + addCriterion("cert_time >=", value, "certTime"); + return (Criteria) this; + } + + public Criteria andCertTimeLessThan(Date value) { + addCriterion("cert_time <", value, "certTime"); + return (Criteria) this; + } + + public Criteria andCertTimeLessThanOrEqualTo(Date value) { + addCriterion("cert_time <=", value, "certTime"); + return (Criteria) this; + } + + public Criteria andCertTimeIn(List values) { + addCriterion("cert_time in", values, "certTime"); + return (Criteria) this; + } + + public Criteria andCertTimeNotIn(List values) { + addCriterion("cert_time not in", values, "certTime"); + return (Criteria) this; + } + + public Criteria andCertTimeBetween(Date value1, Date value2) { + addCriterion("cert_time between", value1, value2, "certTime"); + return (Criteria) this; + } + + public Criteria andCertTimeNotBetween(Date value1, Date value2) { + addCriterion("cert_time not between", value1, value2, "certTime"); + return (Criteria) this; + } + + public Criteria andCertStateIsNull() { + addCriterion("cert_state is null"); + return (Criteria) this; + } + + public Criteria andCertStateIsNotNull() { + addCriterion("cert_state is not null"); + return (Criteria) this; + } + + public Criteria andCertStateEqualTo(Integer value) { + addCriterion("cert_state =", value, "certState"); + return (Criteria) this; + } + + public Criteria andCertStateNotEqualTo(Integer value) { + addCriterion("cert_state <>", value, "certState"); + return (Criteria) this; + } + + public Criteria andCertStateGreaterThan(Integer value) { + addCriterion("cert_state >", value, "certState"); + return (Criteria) this; + } + + public Criteria andCertStateGreaterThanOrEqualTo(Integer value) { + addCriterion("cert_state >=", value, "certState"); + return (Criteria) this; + } + + public Criteria andCertStateLessThan(Integer value) { + addCriterion("cert_state <", value, "certState"); + return (Criteria) this; + } + + public Criteria andCertStateLessThanOrEqualTo(Integer value) { + addCriterion("cert_state <=", value, "certState"); + return (Criteria) this; + } + + public Criteria andCertStateIn(List values) { + addCriterion("cert_state in", values, "certState"); + return (Criteria) this; + } + + public Criteria andCertStateNotIn(List values) { + addCriterion("cert_state not in", values, "certState"); + return (Criteria) this; + } + + public Criteria andCertStateBetween(Integer value1, Integer value2) { + addCriterion("cert_state between", value1, value2, "certState"); + return (Criteria) this; + } + + public Criteria andCertStateNotBetween(Integer value1, Integer value2) { + addCriterion("cert_state not between", value1, value2, "certState"); + return (Criteria) this; + } + + public Criteria andPublishStateIsNull() { + addCriterion("publish_state is null"); + return (Criteria) this; + } + + public Criteria andPublishStateIsNotNull() { + addCriterion("publish_state is not null"); + return (Criteria) this; + } + + public Criteria andPublishStateEqualTo(Integer value) { + addCriterion("publish_state =", value, "publishState"); + return (Criteria) this; + } + + public Criteria andPublishStateNotEqualTo(Integer value) { + addCriterion("publish_state <>", value, "publishState"); + return (Criteria) this; + } + + public Criteria andPublishStateGreaterThan(Integer value) { + addCriterion("publish_state >", value, "publishState"); + return (Criteria) this; + } + + public Criteria andPublishStateGreaterThanOrEqualTo(Integer value) { + addCriterion("publish_state >=", value, "publishState"); + return (Criteria) this; + } + + public Criteria andPublishStateLessThan(Integer value) { + addCriterion("publish_state <", value, "publishState"); + return (Criteria) this; + } + + public Criteria andPublishStateLessThanOrEqualTo(Integer value) { + addCriterion("publish_state <=", value, "publishState"); + return (Criteria) this; + } + + public Criteria andPublishStateIn(List values) { + addCriterion("publish_state in", values, "publishState"); + return (Criteria) this; + } + + public Criteria andPublishStateNotIn(List values) { + addCriterion("publish_state not in", values, "publishState"); + return (Criteria) this; + } + + public Criteria andPublishStateBetween(Integer value1, Integer value2) { + addCriterion("publish_state between", value1, value2, "publishState"); + return (Criteria) this; + } + + public Criteria andPublishStateNotBetween(Integer value1, Integer value2) { + addCriterion("publish_state not between", value1, value2, "publishState"); + return (Criteria) this; + } + + public Criteria andSearchFiledIsNull() { + addCriterion("search_filed is null"); + return (Criteria) this; + } + + public Criteria andSearchFiledIsNotNull() { + addCriterion("search_filed is not null"); + return (Criteria) this; + } + + public Criteria andSearchFiledEqualTo(String value) { + addCriterion("search_filed =", value, "searchFiled"); + return (Criteria) this; + } + + public Criteria andSearchFiledNotEqualTo(String value) { + addCriterion("search_filed <>", value, "searchFiled"); + return (Criteria) this; + } + + public Criteria andSearchFiledGreaterThan(String value) { + addCriterion("search_filed >", value, "searchFiled"); + return (Criteria) this; + } + + public Criteria andSearchFiledGreaterThanOrEqualTo(String value) { + addCriterion("search_filed >=", value, "searchFiled"); + return (Criteria) this; + } + + public Criteria andSearchFiledLessThan(String value) { + addCriterion("search_filed <", value, "searchFiled"); + return (Criteria) this; + } + + public Criteria andSearchFiledLessThanOrEqualTo(String value) { + addCriterion("search_filed <=", value, "searchFiled"); + return (Criteria) this; + } + + public Criteria andSearchFiledLike(String value) { + addCriterion("search_filed like", value, "searchFiled"); + return (Criteria) this; + } + + public Criteria andSearchFiledNotLike(String value) { + addCriterion("search_filed not like", value, "searchFiled"); + return (Criteria) this; + } + + public Criteria andSearchFiledIn(List values) { + addCriterion("search_filed in", values, "searchFiled"); + return (Criteria) this; + } + + public Criteria andSearchFiledNotIn(List values) { + addCriterion("search_filed not in", values, "searchFiled"); + return (Criteria) this; + } + + public Criteria andSearchFiledBetween(String value1, String value2) { + addCriterion("search_filed between", value1, value2, "searchFiled"); + return (Criteria) this; + } + + public Criteria andSearchFiledNotBetween(String value1, String value2) { + addCriterion("search_filed not between", value1, value2, "searchFiled"); + return (Criteria) this; + } + + public Criteria andInfoCertHashIsNull() { + addCriterion("info_cert_hash is null"); + return (Criteria) this; + } + + public Criteria andInfoCertHashIsNotNull() { + addCriterion("info_cert_hash is not null"); + return (Criteria) this; + } + + public Criteria andInfoCertHashEqualTo(String value) { + addCriterion("info_cert_hash =", value, "infoCertHash"); + return (Criteria) this; + } + + public Criteria andInfoCertHashNotEqualTo(String value) { + addCriterion("info_cert_hash <>", value, "infoCertHash"); + return (Criteria) this; + } + + public Criteria andInfoCertHashGreaterThan(String value) { + addCriterion("info_cert_hash >", value, "infoCertHash"); + return (Criteria) this; + } + + public Criteria andInfoCertHashGreaterThanOrEqualTo(String value) { + addCriterion("info_cert_hash >=", value, "infoCertHash"); + return (Criteria) this; + } + + public Criteria andInfoCertHashLessThan(String value) { + addCriterion("info_cert_hash <", value, "infoCertHash"); + return (Criteria) this; + } + + public Criteria andInfoCertHashLessThanOrEqualTo(String value) { + addCriterion("info_cert_hash <=", value, "infoCertHash"); + return (Criteria) this; + } + + public Criteria andInfoCertHashLike(String value) { + addCriterion("info_cert_hash like", value, "infoCertHash"); + return (Criteria) this; + } + + public Criteria andInfoCertHashNotLike(String value) { + addCriterion("info_cert_hash not like", value, "infoCertHash"); + return (Criteria) this; + } + + public Criteria andInfoCertHashIn(List values) { + addCriterion("info_cert_hash in", values, "infoCertHash"); + return (Criteria) this; + } + + public Criteria andInfoCertHashNotIn(List values) { + addCriterion("info_cert_hash not in", values, "infoCertHash"); + return (Criteria) this; + } + + public Criteria andInfoCertHashBetween(String value1, String value2) { + addCriterion("info_cert_hash between", value1, value2, "infoCertHash"); + return (Criteria) this; + } + + public Criteria andInfoCertHashNotBetween(String value1, String value2) { + addCriterion("info_cert_hash not between", value1, value2, "infoCertHash"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table tb_cert_info + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public static class Criterion { + + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} diff --git a/src/main/java/com/certapp/dao/mapper/TbCertInfoMapper.java b/src/main/java/com/certapp/dao/mapper/TbCertInfoMapper.java index cb2b3e5bdc6a47defcda558b9e90bbd29dd3a2c6..ba02c95d450584dc789c7294980aa268c865a694 100644 --- a/src/main/java/com/certapp/dao/mapper/TbCertInfoMapper.java +++ b/src/main/java/com/certapp/dao/mapper/TbCertInfoMapper.java @@ -1,347 +1,208 @@ -package com.certapp.dao.mapper; - -import com.certapp.dao.entity.TbCertInfo; -import com.certapp.dao.entity.TbCertInfoExample; -import java.util.Date; -import java.util.List; -import java.util.Optional; -import org.apache.ibatis.annotations.Delete; -import org.apache.ibatis.annotations.DeleteProvider; -import org.apache.ibatis.annotations.Insert; -import org.apache.ibatis.annotations.InsertProvider; -import org.apache.ibatis.annotations.Options; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Result; -import org.apache.ibatis.annotations.Results; -import org.apache.ibatis.annotations.Select; -import org.apache.ibatis.annotations.SelectKey; -import org.apache.ibatis.annotations.SelectProvider; -import org.apache.ibatis.annotations.Update; -import org.apache.ibatis.annotations.UpdateProvider; -import org.apache.ibatis.type.JdbcType; - -public interface TbCertInfoMapper { - - @Select({"select", - "id, cert_config_id, cert_id, filed_info, cert_hash, tx_hash, cert_url, cert_state", - "from tb_cert_info", "where cert_config_id = #{certConfigId,jdbcType=INTEGER}"}) - @Results({@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), - @Result(column = "cert_config_id", property = "certConfigId", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), - @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER)}) - List selectByCertConfigId(@Param("certConfigId") Integer certConfigId); - - @Select({"select count(1) from tb_cert_info", - "where cert_config_id = #{certConfigId,jdbcType=INTEGER} and cert_pic is null"}) - int selectCntCertPicIsNull(@Param("certConfigId") Integer certConfigId); - - @Delete({"delete from tb_cert_info", "where cert_config_id = #{certConfigId,jdbcType=INTEGER}"}) - int deleteByCertConfigId(@Param("certConfigId") Integer certConfigId); - - @Update({"update tb_cert_info", "set cert_pic = #{certPic,jdbcType=LONGVARCHAR}", - "where id = #{id,jdbcType=INTEGER}"}) - int updateCertPicById(@Param("id") Integer id, @Param("certPic") String certPic); - - @Update({"update tb_cert_info", "set cert_id = #{certId,jdbcType=VARCHAR}", - "where id = #{id,jdbcType=INTEGER}"}) - int updateCertIdById(@Param("id") Integer id, @Param("certId") String certId); - - @Update({"update tb_cert_info", "set cert_state = #{certState,jdbcType=INTEGER}", - "where cert_config_id = #{certConfigId,jdbcType=INTEGER}"}) - int updateCertStateByConfigId(@Param("certConfigId") Integer certConfigI, - @Param("certState") Integer certState); - - @Update({"update tb_cert_info", "set tx_hash = #{txHash,jdbcType=VARCHAR},", - "cert_time = #{certTime,jdbcType=TIMESTAMP},", - "cert_state = #{certState,jdbcType=INTEGER}", "where id = #{id,jdbcType=INTEGER}"}) - int updateTxHashById(@Param("id") Integer id, @Param("txHash") String txHash, - @Param("certState") Integer certState, @Param("certTime") Date certTime); - - @Select({"select", TbCertInfoSqlProvider.ALL_COLUMN_FIELDS, "from tb_cert_info", - "where LOWER(filed_info) like LOWER('%' ", "#{filedInfo,jdbcType=VARCHAR}", "'%') "}) - @Results({@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), - @Result(column = "cert_config_id", property = "certConfigId", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), - @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER), - @Result(column = "publish_state", property = "publishState", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_time", property = "certTime", jdbcType = JdbcType.TIMESTAMP), - @Result(column = "search_filed", property = "searchFiled", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_pic", property = "certPic", jdbcType = JdbcType.LONGVARCHAR)}) - List selectByFuzzyFiledInfo(@Param("filedInfo") String filedInfo); - - @Select({"select", - "id, cert_config_id, cert_id, filed_info, cert_hash, tx_hash, cert_url, cert_state, ", - "publish_state, cert_time, search_filed, cert_pic", "from tb_cert_info", - "where search_filed = #{searchFiled,jdbcType=VARCHAR}"}) - @Results({@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), - @Result(column = "cert_config_id", property = "certConfigId", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), - @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER), - @Result(column = "publish_state", property = "publishState", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_time", property = "certTime", jdbcType = JdbcType.TIMESTAMP), - @Result(column = "search_filed", property = "searchFiled", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_pic", property = "certPic", jdbcType = JdbcType.LONGVARCHAR)}) - List selectBySearchFiled(@Param("searchFiled") String searchFiled); - - @Update({"update tb_cert_info", "set search_filed = #{searchFiled,jdbcType=LONGVARCHAR}", - "where id = #{id,jdbcType=INTEGER}"}) - int updateSearchFiledById(@Param("id") Integer id, @Param("searchFiled") String searchFiled); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @SelectProvider(type = TbCertInfoSqlProvider.class, method = "countByExample") - long countByExample(TbCertInfoExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @DeleteProvider(type = TbCertInfoSqlProvider.class, method = "deleteByExample") - int deleteByExample(TbCertInfoExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @Delete({"delete from tb_cert_info", "where id = #{id,jdbcType=INTEGER}"}) - int deleteByPrimaryKey(Integer id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @Insert({"insert into tb_cert_info (cert_config_id, cert_id, ", "filed_info, cert_hash, ", - "tx_hash, cert_url, ", "cert_state, publish_state, ", "cert_time, search_filed, ", - "cert_pic)", "values (#{certConfigId,jdbcType=INTEGER}, #{certId,jdbcType=VARCHAR}, ", - "#{filedInfo,jdbcType=VARCHAR}, #{certHash,jdbcType=VARCHAR}, ", - "#{txHash,jdbcType=VARCHAR}, #{certUrl,jdbcType=VARCHAR}, ", - "#{certState,jdbcType=INTEGER}, #{publishState,jdbcType=INTEGER}, ", - "#{certTime,jdbcType=TIMESTAMP}, #{searchFiled,jdbcType=VARCHAR}, ", - "#{certPic,jdbcType=LONGVARCHAR})"}) - @SelectKey(statement = "SELECT LAST_INSERT_ID()", keyProperty = "id", before = false, - resultType = Integer.class) - int insert(TbCertInfo record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @InsertProvider(type = TbCertInfoSqlProvider.class, method = "insertSelective") - @SelectKey(statement = "SELECT LAST_INSERT_ID()", keyProperty = "id", before = false, - resultType = Integer.class) - int insertSelective(TbCertInfo record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @SelectProvider(type = TbCertInfoSqlProvider.class, method = "selectByExampleWithBLOBs") - @Results({@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), - @Result(column = "cert_config_id", property = "certConfigId", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), - @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER), - @Result(column = "publish_state", property = "publishState", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_time", property = "certTime", jdbcType = JdbcType.TIMESTAMP), - @Result(column = "search_filed", property = "searchFiled", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_pic", property = "certPic", jdbcType = JdbcType.LONGVARCHAR)}) - List selectByExampleWithBLOBs(TbCertInfoExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @SelectProvider(type = TbCertInfoSqlProvider.class, method = "selectByExample") - @Results({@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), - @Result(column = "cert_config_id", property = "certConfigId", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), - @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER), - @Result(column = "publish_state", property = "publishState", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_time", property = "certTime", jdbcType = JdbcType.TIMESTAMP), - @Result(column = "search_filed", property = "searchFiled", - jdbcType = JdbcType.VARCHAR)}) - List selectByExample(TbCertInfoExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @Select({"select", - "id, cert_config_id, cert_id, filed_info, cert_hash, tx_hash, cert_url, cert_state, ", - "publish_state, cert_time, search_filed, cert_pic", "from tb_cert_info", - "where id = #{id,jdbcType=INTEGER}"}) - @Results({@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), - @Result(column = "cert_config_id", property = "certConfigId", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), - @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER), - @Result(column = "publish_state", property = "publishState", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_time", property = "certTime", jdbcType = JdbcType.TIMESTAMP), - @Result(column = "search_filed", property = "searchFiled", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_pic", property = "certPic", jdbcType = JdbcType.LONGVARCHAR)}) - TbCertInfo selectByPrimaryKey(Integer id); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @UpdateProvider(type = TbCertInfoSqlProvider.class, method = "updateByExampleSelective") - int updateByExampleSelective(@Param("record") TbCertInfo record, - @Param("example") TbCertInfoExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @UpdateProvider(type = TbCertInfoSqlProvider.class, method = "updateByExampleWithBLOBs") - int updateByExampleWithBLOBs(@Param("record") TbCertInfo record, - @Param("example") TbCertInfoExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @UpdateProvider(type = TbCertInfoSqlProvider.class, method = "updateByExample") - int updateByExample(@Param("record") TbCertInfo record, - @Param("example") TbCertInfoExample example); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @UpdateProvider(type = TbCertInfoSqlProvider.class, method = "updateByPrimaryKeySelective") - int updateByPrimaryKeySelective(TbCertInfo record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @Update({"update tb_cert_info", "set cert_config_id = #{certConfigId,jdbcType=INTEGER},", - "cert_id = #{certId,jdbcType=VARCHAR},", "filed_info = #{filedInfo,jdbcType=VARCHAR},", - "cert_hash = #{certHash,jdbcType=VARCHAR},", "tx_hash = #{txHash,jdbcType=VARCHAR},", - "cert_url = #{certUrl,jdbcType=VARCHAR},", - "cert_state = #{certState,jdbcType=INTEGER},", - "publish_state = #{publishState,jdbcType=INTEGER},", - "cert_time = #{certTime,jdbcType=TIMESTAMP},", - "search_filed = #{searchFiled,jdbcType=VARCHAR},", - "cert_pic = #{certPic,jdbcType=LONGVARCHAR}", "where id = #{id,jdbcType=INTEGER}"}) - int updateByPrimaryKeyWithBLOBs(TbCertInfo record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @Update({"update tb_cert_info", "set cert_config_id = #{certConfigId,jdbcType=INTEGER},", - "cert_id = #{certId,jdbcType=VARCHAR},", "filed_info = #{filedInfo,jdbcType=VARCHAR},", - "cert_hash = #{certHash,jdbcType=VARCHAR},", "tx_hash = #{txHash,jdbcType=VARCHAR},", - "cert_url = #{certUrl,jdbcType=VARCHAR},", - "cert_state = #{certState,jdbcType=INTEGER},", - "publish_state = #{publishState,jdbcType=INTEGER},", - "cert_time = #{certTime,jdbcType=TIMESTAMP},", - "search_filed = #{searchFiled,jdbcType=VARCHAR}", "where id = #{id,jdbcType=INTEGER}"}) - int updateByPrimaryKey(TbCertInfo record); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id") - @Insert({""}) - int batchInsert(List list); - - /** - * This method was generated by MyBatis Generator. This method corresponds to the database table - * tb_cert_info - * - * @mbg.generated - */ - @SelectProvider(type = TbCertInfoSqlProvider.class, method = "getOneByExample") - @Results({@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), - @Result(column = "cert_config_id", property = "certConfigId", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), - @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER), - @Result(column = "publish_state", property = "publishState", - jdbcType = JdbcType.INTEGER), - @Result(column = "cert_time", property = "certTime", jdbcType = JdbcType.TIMESTAMP), - @Result(column = "search_filed", property = "searchFiled", jdbcType = JdbcType.VARCHAR), - @Result(column = "cert_pic", property = "certPic", jdbcType = JdbcType.LONGVARCHAR)}) - Optional getOneByExample(TbCertInfoExample example); -} +package com.certapp.dao.mapper; + +import com.certapp.dao.entity.TbCertInfo; +import com.certapp.dao.entity.TbCertInfoExample; +import java.util.Date; +import java.util.List; +import java.util.Optional; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectKey; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; + +public interface TbCertInfoMapper { + + @Select({ "select", "id, cert_config_id, cert_id, filed_info, cert_hash, tx_hash, cert_url, cert_state", "from tb_cert_info", "where cert_config_id = #{certConfigId,jdbcType=INTEGER}" }) + @Results({ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "cert_config_id", property = "certConfigId", jdbcType = JdbcType.INTEGER), @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER) }) + List selectByCertConfigId(@Param("certConfigId") Integer certConfigId); + + @Select({ "select count(1) from tb_cert_info", "where cert_config_id = #{certConfigId,jdbcType=INTEGER} and cert_pic is null" }) + int selectCntCertPicIsNull(@Param("certConfigId") Integer certConfigId); + + @Delete({ "delete from tb_cert_info", "where cert_config_id = #{certConfigId,jdbcType=INTEGER}" }) + int deleteByCertConfigId(@Param("certConfigId") Integer certConfigId); + + @Update({ "update tb_cert_info", "set cert_pic = #{certPic,jdbcType=LONGVARCHAR}", "where id = #{id,jdbcType=INTEGER}" }) + int updateCertPicById(@Param("id") Integer id, @Param("certPic") String certPic); + + @Update({ "update tb_cert_info", "set cert_id = #{certId,jdbcType=VARCHAR}", "where id = #{id,jdbcType=INTEGER}" }) + int updateCertIdById(@Param("id") Integer id, @Param("certId") String certId); + + @Update({ "update tb_cert_info", "set cert_state = #{certState,jdbcType=INTEGER}", "where cert_config_id = #{certConfigId,jdbcType=INTEGER}" }) + int updateCertStateByConfigId(@Param("certConfigId") Integer certConfigI, @Param("certState") Integer certState); + + @Update({ "update tb_cert_info", "set tx_hash = #{txHash,jdbcType=VARCHAR},", "cert_time = #{certTime,jdbcType=TIMESTAMP},", "cert_state = #{certState,jdbcType=INTEGER}", "where id = #{id,jdbcType=INTEGER}" }) + int updateTxHashById(@Param("id") Integer id, @Param("txHash") String txHash, @Param("certState") Integer certState, @Param("certTime") Date certTime); + + @Select({ "select", TbCertInfoSqlProvider.ALL_COLUMN_FIELDS, "from tb_cert_info", "where LOWER(filed_info) like LOWER('%' ", "#{filedInfo,jdbcType=VARCHAR}", "'%') " }) + @Results({ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "cert_config_id", property = "certConfigId", jdbcType = JdbcType.INTEGER), @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_time", property = "certTime", jdbcType = JdbcType.TIMESTAMP), @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER), @Result(column = "publish_state", property = "publishState", jdbcType = JdbcType.INTEGER), @Result(column = "search_filed", property = "searchFiled", jdbcType = JdbcType.VARCHAR), @Result(column = "info_cert_hash", property = "infoCertHash", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_pic", property = "certPic", jdbcType = JdbcType.LONGVARCHAR) }) + List selectByFuzzyFiledInfo(@Param("filedInfo") String filedInfo); + + @Select({ "select", "id, cert_config_id, cert_id, filed_info, cert_hash, tx_hash, cert_url, cert_state, ", "publish_state, cert_time, search_filed, cert_pic", "from tb_cert_info", "where search_filed = #{searchFiled,jdbcType=VARCHAR}" }) + @Results({ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "cert_config_id", property = "certConfigId", jdbcType = JdbcType.INTEGER), @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER), @Result(column = "publish_state", property = "publishState", jdbcType = JdbcType.INTEGER), @Result(column = "cert_time", property = "certTime", jdbcType = JdbcType.TIMESTAMP), @Result(column = "search_filed", property = "searchFiled", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_pic", property = "certPic", jdbcType = JdbcType.LONGVARCHAR) }) + List selectBySearchFiled(@Param("searchFiled") String searchFiled); + + @Update({ "update tb_cert_info", "set search_filed = #{searchFiled,jdbcType=LONGVARCHAR}", "where id = #{id,jdbcType=INTEGER}" }) + int updateSearchFiledById(@Param("id") Integer id, @Param("searchFiled") String searchFiled); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @SelectProvider(type = TbCertInfoSqlProvider.class, method = "countByExample") + long countByExample(TbCertInfoExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @DeleteProvider(type = TbCertInfoSqlProvider.class, method = "deleteByExample") + int deleteByExample(TbCertInfoExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @Delete({ "delete from tb_cert_info", "where id = #{id,jdbcType=INTEGER}" }) + int deleteByPrimaryKey(Integer id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @Insert({ "insert into tb_cert_info (cert_config_id, cert_id, ", "filed_info, cert_hash, ", "tx_hash, cert_url, ", "cert_time, cert_state, ", "publish_state, search_filed, ", "info_cert_hash, cert_pic)", "values (#{certConfigId,jdbcType=INTEGER}, #{certId,jdbcType=VARCHAR}, ", "#{filedInfo,jdbcType=VARCHAR}, #{certHash,jdbcType=VARCHAR}, ", "#{txHash,jdbcType=VARCHAR}, #{certUrl,jdbcType=VARCHAR}, ", "#{certTime,jdbcType=TIMESTAMP}, #{certState,jdbcType=INTEGER}, ", "#{publishState,jdbcType=INTEGER}, #{searchFiled,jdbcType=VARCHAR}, ", "#{infoCertHash,jdbcType=VARCHAR}, #{certPic,jdbcType=LONGVARCHAR})" }) + @SelectKey(statement = "SELECT LAST_INSERT_ID()", keyProperty = "id", before = false, resultType = Integer.class) + int insert(TbCertInfo record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @InsertProvider(type = TbCertInfoSqlProvider.class, method = "insertSelective") + @SelectKey(statement = "SELECT LAST_INSERT_ID()", keyProperty = "id", before = false, resultType = Integer.class) + int insertSelective(TbCertInfo record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @SelectProvider(type = TbCertInfoSqlProvider.class, method = "selectByExampleWithBLOBs") + @Results({ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "cert_config_id", property = "certConfigId", jdbcType = JdbcType.INTEGER), @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_time", property = "certTime", jdbcType = JdbcType.TIMESTAMP), @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER), @Result(column = "publish_state", property = "publishState", jdbcType = JdbcType.INTEGER), @Result(column = "search_filed", property = "searchFiled", jdbcType = JdbcType.VARCHAR), @Result(column = "info_cert_hash", property = "infoCertHash", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_pic", property = "certPic", jdbcType = JdbcType.LONGVARCHAR) }) + List selectByExampleWithBLOBs(TbCertInfoExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @SelectProvider(type = TbCertInfoSqlProvider.class, method = "selectByExample") + @Results({ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "cert_config_id", property = "certConfigId", jdbcType = JdbcType.INTEGER), @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_time", property = "certTime", jdbcType = JdbcType.TIMESTAMP), @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER), @Result(column = "publish_state", property = "publishState", jdbcType = JdbcType.INTEGER), @Result(column = "search_filed", property = "searchFiled", jdbcType = JdbcType.VARCHAR), @Result(column = "info_cert_hash", property = "infoCertHash", jdbcType = JdbcType.VARCHAR) }) + List selectByExample(TbCertInfoExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @Select({ "select", "id, cert_config_id, cert_id, filed_info, cert_hash, tx_hash, cert_url, cert_time, ", "cert_state, publish_state, search_filed, info_cert_hash, cert_pic", "from tb_cert_info", "where id = #{id,jdbcType=INTEGER}" }) + @Results({ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "cert_config_id", property = "certConfigId", jdbcType = JdbcType.INTEGER), @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_time", property = "certTime", jdbcType = JdbcType.TIMESTAMP), @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER), @Result(column = "publish_state", property = "publishState", jdbcType = JdbcType.INTEGER), @Result(column = "search_filed", property = "searchFiled", jdbcType = JdbcType.VARCHAR), @Result(column = "info_cert_hash", property = "infoCertHash", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_pic", property = "certPic", jdbcType = JdbcType.LONGVARCHAR) }) + TbCertInfo selectByPrimaryKey(Integer id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @UpdateProvider(type = TbCertInfoSqlProvider.class, method = "updateByExampleSelective") + int updateByExampleSelective(@Param("record") TbCertInfo record, @Param("example") TbCertInfoExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @UpdateProvider(type = TbCertInfoSqlProvider.class, method = "updateByExampleWithBLOBs") + int updateByExampleWithBLOBs(@Param("record") TbCertInfo record, @Param("example") TbCertInfoExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @UpdateProvider(type = TbCertInfoSqlProvider.class, method = "updateByExample") + int updateByExample(@Param("record") TbCertInfo record, @Param("example") TbCertInfoExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @UpdateProvider(type = TbCertInfoSqlProvider.class, method = "updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(TbCertInfo record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @Update({ "update tb_cert_info", "set cert_config_id = #{certConfigId,jdbcType=INTEGER},", "cert_id = #{certId,jdbcType=VARCHAR},", "filed_info = #{filedInfo,jdbcType=VARCHAR},", "cert_hash = #{certHash,jdbcType=VARCHAR},", "tx_hash = #{txHash,jdbcType=VARCHAR},", "cert_url = #{certUrl,jdbcType=VARCHAR},", "cert_time = #{certTime,jdbcType=TIMESTAMP},", "cert_state = #{certState,jdbcType=INTEGER},", "publish_state = #{publishState,jdbcType=INTEGER},", "search_filed = #{searchFiled,jdbcType=VARCHAR},", "info_cert_hash = #{infoCertHash,jdbcType=VARCHAR},", "cert_pic = #{certPic,jdbcType=LONGVARCHAR}", "where id = #{id,jdbcType=INTEGER}" }) + int updateByPrimaryKeyWithBLOBs(TbCertInfo record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @Update({ "update tb_cert_info", "set cert_config_id = #{certConfigId,jdbcType=INTEGER},", "cert_id = #{certId,jdbcType=VARCHAR},", "filed_info = #{filedInfo,jdbcType=VARCHAR},", "cert_hash = #{certHash,jdbcType=VARCHAR},", "tx_hash = #{txHash,jdbcType=VARCHAR},", "cert_url = #{certUrl,jdbcType=VARCHAR},", "cert_time = #{certTime,jdbcType=TIMESTAMP},", "cert_state = #{certState,jdbcType=INTEGER},", "publish_state = #{publishState,jdbcType=INTEGER},", "search_filed = #{searchFiled,jdbcType=VARCHAR},", "info_cert_hash = #{infoCertHash,jdbcType=VARCHAR}", "where id = #{id,jdbcType=INTEGER}" }) + int updateByPrimaryKey(TbCertInfo record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id") + @Insert({ "" }) + int batchInsert(List list); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + @SelectProvider(type = TbCertInfoSqlProvider.class, method = "getOneByExample") + @Results({ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "cert_config_id", property = "certConfigId", jdbcType = JdbcType.INTEGER), @Result(column = "cert_id", property = "certId", jdbcType = JdbcType.VARCHAR), @Result(column = "filed_info", property = "filedInfo", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_hash", property = "certHash", jdbcType = JdbcType.VARCHAR), @Result(column = "tx_hash", property = "txHash", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_url", property = "certUrl", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_time", property = "certTime", jdbcType = JdbcType.TIMESTAMP), @Result(column = "cert_state", property = "certState", jdbcType = JdbcType.INTEGER), @Result(column = "publish_state", property = "publishState", jdbcType = JdbcType.INTEGER), @Result(column = "search_filed", property = "searchFiled", jdbcType = JdbcType.VARCHAR), @Result(column = "info_cert_hash", property = "infoCertHash", jdbcType = JdbcType.VARCHAR), @Result(column = "cert_pic", property = "certPic", jdbcType = JdbcType.LONGVARCHAR) }) + Optional getOneByExample(TbCertInfoExample example); +} diff --git a/src/main/java/com/certapp/dao/mapper/TbCertInfoSqlProvider.java b/src/main/java/com/certapp/dao/mapper/TbCertInfoSqlProvider.java index 804df3c38ab532a90497675cbf04b052422adbc6..e0f5cb6a486be559fdf416dc2c22985933396a18 100644 --- a/src/main/java/com/certapp/dao/mapper/TbCertInfoSqlProvider.java +++ b/src/main/java/com/certapp/dao/mapper/TbCertInfoSqlProvider.java @@ -1,454 +1,468 @@ -package com.certapp.dao.mapper; - -import com.certapp.dao.entity.TbCertInfo; -import com.certapp.dao.entity.TbCertInfoExample.Criteria; -import com.certapp.dao.entity.TbCertInfoExample.Criterion; -import com.certapp.dao.entity.TbCertInfoExample; -import java.util.List; -import java.util.Map; -import org.apache.ibatis.jdbc.SQL; - -public class TbCertInfoSqlProvider { - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public static final String ALL_COLUMN_FIELDS = "id,cert_config_id,cert_id,filed_info,cert_hash,tx_hash,cert_url,cert_state,publish_state,cert_time,search_filed,cert_pic"; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public String countByExample(TbCertInfoExample example) { - SQL sql = new SQL(); - sql.SELECT("count(*)").FROM("tb_cert_info"); - applyWhere(sql, example, false); - return sql.toString(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public String deleteByExample(TbCertInfoExample example) { - SQL sql = new SQL(); - sql.DELETE_FROM("tb_cert_info"); - applyWhere(sql, example, false); - return sql.toString(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public String insertSelective(TbCertInfo record) { - SQL sql = new SQL(); - sql.INSERT_INTO("tb_cert_info"); - if (record.getCertConfigId() != null) { - sql.VALUES("cert_config_id", "#{certConfigId,jdbcType=INTEGER}"); - } - if (record.getCertId() != null) { - sql.VALUES("cert_id", "#{certId,jdbcType=VARCHAR}"); - } - if (record.getFiledInfo() != null) { - sql.VALUES("filed_info", "#{filedInfo,jdbcType=VARCHAR}"); - } - if (record.getCertHash() != null) { - sql.VALUES("cert_hash", "#{certHash,jdbcType=VARCHAR}"); - } - if (record.getTxHash() != null) { - sql.VALUES("tx_hash", "#{txHash,jdbcType=VARCHAR}"); - } - if (record.getCertUrl() != null) { - sql.VALUES("cert_url", "#{certUrl,jdbcType=VARCHAR}"); - } - if (record.getCertState() != null) { - sql.VALUES("cert_state", "#{certState,jdbcType=INTEGER}"); - } - if (record.getPublishState() != null) { - sql.VALUES("publish_state", "#{publishState,jdbcType=INTEGER}"); - } - if (record.getCertTime() != null) { - sql.VALUES("cert_time", "#{certTime,jdbcType=TIMESTAMP}"); - } - if (record.getSearchFiled() != null) { - sql.VALUES("search_filed", "#{searchFiled,jdbcType=VARCHAR}"); - } - if (record.getCertPic() != null) { - sql.VALUES("cert_pic", "#{certPic,jdbcType=LONGVARCHAR}"); - } - return sql.toString(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public String selectByExampleWithBLOBs(TbCertInfoExample example) { - SQL sql = new SQL(); - if (example != null && example.isDistinct()) { - sql.SELECT_DISTINCT("id"); - } else { - sql.SELECT("id"); - } - sql.SELECT("cert_config_id"); - sql.SELECT("cert_id"); - sql.SELECT("filed_info"); - sql.SELECT("cert_hash"); - sql.SELECT("tx_hash"); - sql.SELECT("cert_url"); - sql.SELECT("cert_state"); - sql.SELECT("publish_state"); - sql.SELECT("cert_time"); - sql.SELECT("search_filed"); - sql.SELECT("cert_pic"); - sql.FROM("tb_cert_info"); - applyWhere(sql, example, false); - if (example != null && example.getOrderByClause() != null) { - sql.ORDER_BY(example.getOrderByClause()); - } - // add pagination for mysql with limit clause - StringBuilder sqlBuilder = new StringBuilder(sql.toString()); - if (example != null && (example.getStart() > -1 || example.getCount() > -1)) { - sqlBuilder.append(" limit "); - if (example.getStart() > -1 && example.getCount() > -1) { - sqlBuilder.append(example.getStart()).append(",").append(example.getCount()); - } else if (example.getStart() > -1) { - sqlBuilder.append(example.getStart()); - } else if (example.getCount() > -1) { - sqlBuilder.append(example.getCount()); - } - } - return sqlBuilder.toString(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public String selectByExample(TbCertInfoExample example) { - SQL sql = new SQL(); - if (example != null && example.isDistinct()) { - sql.SELECT_DISTINCT("id"); - } else { - sql.SELECT("id"); - } - sql.SELECT("cert_config_id"); - sql.SELECT("cert_id"); - sql.SELECT("filed_info"); - sql.SELECT("cert_hash"); - sql.SELECT("tx_hash"); - sql.SELECT("cert_url"); - sql.SELECT("cert_state"); - sql.SELECT("publish_state"); - sql.SELECT("cert_time"); - sql.SELECT("search_filed"); - sql.FROM("tb_cert_info"); - applyWhere(sql, example, false); - if (example != null && example.getOrderByClause() != null) { - sql.ORDER_BY(example.getOrderByClause()); - } - // add pagination for mysql with limit clause - StringBuilder sqlBuilder = new StringBuilder(sql.toString()); - if (example != null && (example.getStart() > -1 || example.getCount() > -1)) { - sqlBuilder.append(" limit "); - if (example.getStart() > -1 && example.getCount() > -1) { - sqlBuilder.append(example.getStart()).append(",").append(example.getCount()); - } else if (example.getStart() > -1) { - sqlBuilder.append(example.getStart()); - } else if (example.getCount() > -1) { - sqlBuilder.append(example.getCount()); - } - } - return sqlBuilder.toString(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public String updateByExampleSelective(Map parameter) { - TbCertInfo record = (TbCertInfo) parameter.get("record"); - TbCertInfoExample example = (TbCertInfoExample) parameter.get("example"); - SQL sql = new SQL(); - sql.UPDATE("tb_cert_info"); - if (record.getId() != null) { - sql.SET("id = #{record.id,jdbcType=INTEGER}"); - } - if (record.getCertConfigId() != null) { - sql.SET("cert_config_id = #{record.certConfigId,jdbcType=INTEGER}"); - } - if (record.getCertId() != null) { - sql.SET("cert_id = #{record.certId,jdbcType=VARCHAR}"); - } - if (record.getFiledInfo() != null) { - sql.SET("filed_info = #{record.filedInfo,jdbcType=VARCHAR}"); - } - if (record.getCertHash() != null) { - sql.SET("cert_hash = #{record.certHash,jdbcType=VARCHAR}"); - } - if (record.getTxHash() != null) { - sql.SET("tx_hash = #{record.txHash,jdbcType=VARCHAR}"); - } - if (record.getCertUrl() != null) { - sql.SET("cert_url = #{record.certUrl,jdbcType=VARCHAR}"); - } - if (record.getCertState() != null) { - sql.SET("cert_state = #{record.certState,jdbcType=INTEGER}"); - } - if (record.getPublishState() != null) { - sql.SET("publish_state = #{record.publishState,jdbcType=INTEGER}"); - } - if (record.getCertTime() != null) { - sql.SET("cert_time = #{record.certTime,jdbcType=TIMESTAMP}"); - } - if (record.getSearchFiled() != null) { - sql.SET("search_filed = #{record.searchFiled,jdbcType=VARCHAR}"); - } - if (record.getCertPic() != null) { - sql.SET("cert_pic = #{record.certPic,jdbcType=LONGVARCHAR}"); - } - applyWhere(sql, example, true); - return sql.toString(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public String updateByExampleWithBLOBs(Map parameter) { - SQL sql = new SQL(); - sql.UPDATE("tb_cert_info"); - sql.SET("id = #{record.id,jdbcType=INTEGER}"); - sql.SET("cert_config_id = #{record.certConfigId,jdbcType=INTEGER}"); - sql.SET("cert_id = #{record.certId,jdbcType=VARCHAR}"); - sql.SET("filed_info = #{record.filedInfo,jdbcType=VARCHAR}"); - sql.SET("cert_hash = #{record.certHash,jdbcType=VARCHAR}"); - sql.SET("tx_hash = #{record.txHash,jdbcType=VARCHAR}"); - sql.SET("cert_url = #{record.certUrl,jdbcType=VARCHAR}"); - sql.SET("cert_state = #{record.certState,jdbcType=INTEGER}"); - sql.SET("publish_state = #{record.publishState,jdbcType=INTEGER}"); - sql.SET("cert_time = #{record.certTime,jdbcType=TIMESTAMP}"); - sql.SET("search_filed = #{record.searchFiled,jdbcType=VARCHAR}"); - sql.SET("cert_pic = #{record.certPic,jdbcType=LONGVARCHAR}"); - TbCertInfoExample example = (TbCertInfoExample) parameter.get("example"); - applyWhere(sql, example, true); - return sql.toString(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public String updateByExample(Map parameter) { - SQL sql = new SQL(); - sql.UPDATE("tb_cert_info"); - sql.SET("id = #{record.id,jdbcType=INTEGER}"); - sql.SET("cert_config_id = #{record.certConfigId,jdbcType=INTEGER}"); - sql.SET("cert_id = #{record.certId,jdbcType=VARCHAR}"); - sql.SET("filed_info = #{record.filedInfo,jdbcType=VARCHAR}"); - sql.SET("cert_hash = #{record.certHash,jdbcType=VARCHAR}"); - sql.SET("tx_hash = #{record.txHash,jdbcType=VARCHAR}"); - sql.SET("cert_url = #{record.certUrl,jdbcType=VARCHAR}"); - sql.SET("cert_state = #{record.certState,jdbcType=INTEGER}"); - sql.SET("publish_state = #{record.publishState,jdbcType=INTEGER}"); - sql.SET("cert_time = #{record.certTime,jdbcType=TIMESTAMP}"); - sql.SET("search_filed = #{record.searchFiled,jdbcType=VARCHAR}"); - TbCertInfoExample example = (TbCertInfoExample) parameter.get("example"); - applyWhere(sql, example, true); - return sql.toString(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public String updateByPrimaryKeySelective(TbCertInfo record) { - SQL sql = new SQL(); - sql.UPDATE("tb_cert_info"); - if (record.getCertConfigId() != null) { - sql.SET("cert_config_id = #{certConfigId,jdbcType=INTEGER}"); - } - if (record.getCertId() != null) { - sql.SET("cert_id = #{certId,jdbcType=VARCHAR}"); - } - if (record.getFiledInfo() != null) { - sql.SET("filed_info = #{filedInfo,jdbcType=VARCHAR}"); - } - if (record.getCertHash() != null) { - sql.SET("cert_hash = #{certHash,jdbcType=VARCHAR}"); - } - if (record.getTxHash() != null) { - sql.SET("tx_hash = #{txHash,jdbcType=VARCHAR}"); - } - if (record.getCertUrl() != null) { - sql.SET("cert_url = #{certUrl,jdbcType=VARCHAR}"); - } - if (record.getCertState() != null) { - sql.SET("cert_state = #{certState,jdbcType=INTEGER}"); - } - if (record.getPublishState() != null) { - sql.SET("publish_state = #{publishState,jdbcType=INTEGER}"); - } - if (record.getCertTime() != null) { - sql.SET("cert_time = #{certTime,jdbcType=TIMESTAMP}"); - } - if (record.getSearchFiled() != null) { - sql.SET("search_filed = #{searchFiled,jdbcType=VARCHAR}"); - } - if (record.getCertPic() != null) { - sql.SET("cert_pic = #{certPic,jdbcType=LONGVARCHAR}"); - } - sql.WHERE("id = #{id,jdbcType=INTEGER}"); - return sql.toString(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - protected void applyWhere(SQL sql, TbCertInfoExample example, boolean includeExamplePhrase) { - if (example == null) { - return; - } - String parmPhrase1; - String parmPhrase1_th; - String parmPhrase2; - String parmPhrase2_th; - String parmPhrase3; - String parmPhrase3_th; - if (includeExamplePhrase) { - parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; - parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; - parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; - parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; - parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; - parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; - } else { - parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; - parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; - parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; - parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; - parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; - parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; - } - StringBuilder sb = new StringBuilder(); - List oredCriteria = example.getOredCriteria(); - boolean firstCriteria = true; - for (int i = 0; i < oredCriteria.size(); i++) { - Criteria criteria = oredCriteria.get(i); - if (criteria.isValid()) { - if (firstCriteria) { - firstCriteria = false; - } else { - sb.append(" or "); - } - sb.append('('); - List criterions = criteria.getAllCriteria(); - boolean firstCriterion = true; - for (int j = 0; j < criterions.size(); j++) { - Criterion criterion = criterions.get(j); - if (firstCriterion) { - firstCriterion = false; - } else { - sb.append(" and "); - } - if (criterion.isNoValue()) { - sb.append(criterion.getCondition()); - } else if (criterion.isSingleValue()) { - if (criterion.getTypeHandler() == null) { - sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); - } else { - sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j, criterion.getTypeHandler())); - } - } else if (criterion.isBetweenValue()) { - if (criterion.getTypeHandler() == null) { - sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); - } else { - sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); - } - } else if (criterion.isListValue()) { - sb.append(criterion.getCondition()); - sb.append(" ("); - List listItems = (List) criterion.getValue(); - boolean comma = false; - for (int k = 0; k < listItems.size(); k++) { - if (comma) { - sb.append(", "); - } else { - comma = true; - } - if (criterion.getTypeHandler() == null) { - sb.append(String.format(parmPhrase3, i, j, k)); - } else { - sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); - } - } - sb.append(')'); - } - } - sb.append(')'); - } - } - if (sb.length() > 0) { - sql.WHERE(sb.toString()); - } - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table tb_cert_info - * - * @mbg.generated - */ - public String getOneByExample(TbCertInfoExample example) { - SQL sql = new SQL(); - if (example != null && example.isDistinct()) { - sql.SELECT_DISTINCT("id"); - } else { - sql.SELECT("id"); - } - sql.SELECT("cert_config_id"); - sql.SELECT("cert_id"); - sql.SELECT("filed_info"); - sql.SELECT("cert_hash"); - sql.SELECT("tx_hash"); - sql.SELECT("cert_url"); - sql.SELECT("cert_state"); - sql.SELECT("publish_state"); - sql.SELECT("cert_time"); - sql.SELECT("search_filed"); - sql.SELECT("cert_pic"); - sql.FROM("tb_cert_info"); - applyWhere(sql, example, false); - if (example != null && example.getOrderByClause() != null) { - sql.ORDER_BY(example.getOrderByClause()); - } - StringBuilder sqlBuilder = new StringBuilder(sql.toString()); - sqlBuilder.append(" limit 1 "); - return sqlBuilder.toString(); - } -} +package com.certapp.dao.mapper; + +import com.certapp.dao.entity.TbCertInfo; +import com.certapp.dao.entity.TbCertInfoExample.Criteria; +import com.certapp.dao.entity.TbCertInfoExample.Criterion; +import com.certapp.dao.entity.TbCertInfoExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class TbCertInfoSqlProvider { + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public static final String ALL_COLUMN_FIELDS = "id,cert_config_id,cert_id,filed_info,cert_hash,tx_hash,cert_url,cert_time,cert_state,publish_state,search_filed,info_cert_hash,cert_pic"; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public String countByExample(TbCertInfoExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("tb_cert_info"); + applyWhere(sql, example, false); + return sql.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public String deleteByExample(TbCertInfoExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("tb_cert_info"); + applyWhere(sql, example, false); + return sql.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public String insertSelective(TbCertInfo record) { + SQL sql = new SQL(); + sql.INSERT_INTO("tb_cert_info"); + if (record.getCertConfigId() != null) { + sql.VALUES("cert_config_id", "#{certConfigId,jdbcType=INTEGER}"); + } + if (record.getCertId() != null) { + sql.VALUES("cert_id", "#{certId,jdbcType=VARCHAR}"); + } + if (record.getFiledInfo() != null) { + sql.VALUES("filed_info", "#{filedInfo,jdbcType=VARCHAR}"); + } + if (record.getCertHash() != null) { + sql.VALUES("cert_hash", "#{certHash,jdbcType=VARCHAR}"); + } + if (record.getTxHash() != null) { + sql.VALUES("tx_hash", "#{txHash,jdbcType=VARCHAR}"); + } + if (record.getCertUrl() != null) { + sql.VALUES("cert_url", "#{certUrl,jdbcType=VARCHAR}"); + } + if (record.getCertTime() != null) { + sql.VALUES("cert_time", "#{certTime,jdbcType=TIMESTAMP}"); + } + if (record.getCertState() != null) { + sql.VALUES("cert_state", "#{certState,jdbcType=INTEGER}"); + } + if (record.getPublishState() != null) { + sql.VALUES("publish_state", "#{publishState,jdbcType=INTEGER}"); + } + if (record.getSearchFiled() != null) { + sql.VALUES("search_filed", "#{searchFiled,jdbcType=VARCHAR}"); + } + if (record.getInfoCertHash() != null) { + sql.VALUES("info_cert_hash", "#{infoCertHash,jdbcType=VARCHAR}"); + } + if (record.getCertPic() != null) { + sql.VALUES("cert_pic", "#{certPic,jdbcType=LONGVARCHAR}"); + } + return sql.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public String selectByExampleWithBLOBs(TbCertInfoExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("cert_config_id"); + sql.SELECT("cert_id"); + sql.SELECT("filed_info"); + sql.SELECT("cert_hash"); + sql.SELECT("tx_hash"); + sql.SELECT("cert_url"); + sql.SELECT("cert_time"); + sql.SELECT("cert_state"); + sql.SELECT("publish_state"); + sql.SELECT("search_filed"); + sql.SELECT("info_cert_hash"); + sql.SELECT("cert_pic"); + sql.FROM("tb_cert_info"); + applyWhere(sql, example, false); + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + // add pagination for mysql with limit clause + StringBuilder sqlBuilder = new StringBuilder(sql.toString()); + if (example != null && (example.getStart() > -1 || example.getCount() > -1)) { + sqlBuilder.append(" limit "); + if (example.getStart() > -1 && example.getCount() > -1) { + sqlBuilder.append(example.getStart()).append(",").append(example.getCount()); + } else if (example.getStart() > -1) { + sqlBuilder.append(example.getStart()); + } else if (example.getCount() > -1) { + sqlBuilder.append(example.getCount()); + } + } + return sqlBuilder.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public String selectByExample(TbCertInfoExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("cert_config_id"); + sql.SELECT("cert_id"); + sql.SELECT("filed_info"); + sql.SELECT("cert_hash"); + sql.SELECT("tx_hash"); + sql.SELECT("cert_url"); + sql.SELECT("cert_time"); + sql.SELECT("cert_state"); + sql.SELECT("publish_state"); + sql.SELECT("search_filed"); + sql.SELECT("info_cert_hash"); + sql.FROM("tb_cert_info"); + applyWhere(sql, example, false); + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + // add pagination for mysql with limit clause + StringBuilder sqlBuilder = new StringBuilder(sql.toString()); + if (example != null && (example.getStart() > -1 || example.getCount() > -1)) { + sqlBuilder.append(" limit "); + if (example.getStart() > -1 && example.getCount() > -1) { + sqlBuilder.append(example.getStart()).append(",").append(example.getCount()); + } else if (example.getStart() > -1) { + sqlBuilder.append(example.getStart()); + } else if (example.getCount() > -1) { + sqlBuilder.append(example.getCount()); + } + } + return sqlBuilder.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public String updateByExampleSelective(Map parameter) { + TbCertInfo record = (TbCertInfo) parameter.get("record"); + TbCertInfoExample example = (TbCertInfoExample) parameter.get("example"); + SQL sql = new SQL(); + sql.UPDATE("tb_cert_info"); + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=INTEGER}"); + } + if (record.getCertConfigId() != null) { + sql.SET("cert_config_id = #{record.certConfigId,jdbcType=INTEGER}"); + } + if (record.getCertId() != null) { + sql.SET("cert_id = #{record.certId,jdbcType=VARCHAR}"); + } + if (record.getFiledInfo() != null) { + sql.SET("filed_info = #{record.filedInfo,jdbcType=VARCHAR}"); + } + if (record.getCertHash() != null) { + sql.SET("cert_hash = #{record.certHash,jdbcType=VARCHAR}"); + } + if (record.getTxHash() != null) { + sql.SET("tx_hash = #{record.txHash,jdbcType=VARCHAR}"); + } + if (record.getCertUrl() != null) { + sql.SET("cert_url = #{record.certUrl,jdbcType=VARCHAR}"); + } + if (record.getCertTime() != null) { + sql.SET("cert_time = #{record.certTime,jdbcType=TIMESTAMP}"); + } + if (record.getCertState() != null) { + sql.SET("cert_state = #{record.certState,jdbcType=INTEGER}"); + } + if (record.getPublishState() != null) { + sql.SET("publish_state = #{record.publishState,jdbcType=INTEGER}"); + } + if (record.getSearchFiled() != null) { + sql.SET("search_filed = #{record.searchFiled,jdbcType=VARCHAR}"); + } + if (record.getInfoCertHash() != null) { + sql.SET("info_cert_hash = #{record.infoCertHash,jdbcType=VARCHAR}"); + } + if (record.getCertPic() != null) { + sql.SET("cert_pic = #{record.certPic,jdbcType=LONGVARCHAR}"); + } + applyWhere(sql, example, true); + return sql.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public String updateByExampleWithBLOBs(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("tb_cert_info"); + sql.SET("id = #{record.id,jdbcType=INTEGER}"); + sql.SET("cert_config_id = #{record.certConfigId,jdbcType=INTEGER}"); + sql.SET("cert_id = #{record.certId,jdbcType=VARCHAR}"); + sql.SET("filed_info = #{record.filedInfo,jdbcType=VARCHAR}"); + sql.SET("cert_hash = #{record.certHash,jdbcType=VARCHAR}"); + sql.SET("tx_hash = #{record.txHash,jdbcType=VARCHAR}"); + sql.SET("cert_url = #{record.certUrl,jdbcType=VARCHAR}"); + sql.SET("cert_time = #{record.certTime,jdbcType=TIMESTAMP}"); + sql.SET("cert_state = #{record.certState,jdbcType=INTEGER}"); + sql.SET("publish_state = #{record.publishState,jdbcType=INTEGER}"); + sql.SET("search_filed = #{record.searchFiled,jdbcType=VARCHAR}"); + sql.SET("info_cert_hash = #{record.infoCertHash,jdbcType=VARCHAR}"); + sql.SET("cert_pic = #{record.certPic,jdbcType=LONGVARCHAR}"); + TbCertInfoExample example = (TbCertInfoExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("tb_cert_info"); + sql.SET("id = #{record.id,jdbcType=INTEGER}"); + sql.SET("cert_config_id = #{record.certConfigId,jdbcType=INTEGER}"); + sql.SET("cert_id = #{record.certId,jdbcType=VARCHAR}"); + sql.SET("filed_info = #{record.filedInfo,jdbcType=VARCHAR}"); + sql.SET("cert_hash = #{record.certHash,jdbcType=VARCHAR}"); + sql.SET("tx_hash = #{record.txHash,jdbcType=VARCHAR}"); + sql.SET("cert_url = #{record.certUrl,jdbcType=VARCHAR}"); + sql.SET("cert_time = #{record.certTime,jdbcType=TIMESTAMP}"); + sql.SET("cert_state = #{record.certState,jdbcType=INTEGER}"); + sql.SET("publish_state = #{record.publishState,jdbcType=INTEGER}"); + sql.SET("search_filed = #{record.searchFiled,jdbcType=VARCHAR}"); + sql.SET("info_cert_hash = #{record.infoCertHash,jdbcType=VARCHAR}"); + TbCertInfoExample example = (TbCertInfoExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public String updateByPrimaryKeySelective(TbCertInfo record) { + SQL sql = new SQL(); + sql.UPDATE("tb_cert_info"); + if (record.getCertConfigId() != null) { + sql.SET("cert_config_id = #{certConfigId,jdbcType=INTEGER}"); + } + if (record.getCertId() != null) { + sql.SET("cert_id = #{certId,jdbcType=VARCHAR}"); + } + if (record.getFiledInfo() != null) { + sql.SET("filed_info = #{filedInfo,jdbcType=VARCHAR}"); + } + if (record.getCertHash() != null) { + sql.SET("cert_hash = #{certHash,jdbcType=VARCHAR}"); + } + if (record.getTxHash() != null) { + sql.SET("tx_hash = #{txHash,jdbcType=VARCHAR}"); + } + if (record.getCertUrl() != null) { + sql.SET("cert_url = #{certUrl,jdbcType=VARCHAR}"); + } + if (record.getCertTime() != null) { + sql.SET("cert_time = #{certTime,jdbcType=TIMESTAMP}"); + } + if (record.getCertState() != null) { + sql.SET("cert_state = #{certState,jdbcType=INTEGER}"); + } + if (record.getPublishState() != null) { + sql.SET("publish_state = #{publishState,jdbcType=INTEGER}"); + } + if (record.getSearchFiled() != null) { + sql.SET("search_filed = #{searchFiled,jdbcType=VARCHAR}"); + } + if (record.getInfoCertHash() != null) { + sql.SET("info_cert_hash = #{infoCertHash,jdbcType=VARCHAR}"); + } + if (record.getCertPic() != null) { + sql.SET("cert_pic = #{certPic,jdbcType=LONGVARCHAR}"); + } + sql.WHERE("id = #{id,jdbcType=INTEGER}"); + return sql.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + protected void applyWhere(SQL sql, TbCertInfoExample example, boolean includeExamplePhrase) { + if (example == null) { + return; + } + String parmPhrase1; + String parmPhrase1_th; + String parmPhrase2; + String parmPhrase2_th; + String parmPhrase3; + String parmPhrase3_th; + if (includeExamplePhrase) { + parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } else { + parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } + StringBuilder sb = new StringBuilder(); + List oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table tb_cert_info + * + * @mbg.generated + */ + public String getOneByExample(TbCertInfoExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("cert_config_id"); + sql.SELECT("cert_id"); + sql.SELECT("filed_info"); + sql.SELECT("cert_hash"); + sql.SELECT("tx_hash"); + sql.SELECT("cert_url"); + sql.SELECT("cert_time"); + sql.SELECT("cert_state"); + sql.SELECT("publish_state"); + sql.SELECT("search_filed"); + sql.SELECT("info_cert_hash"); + sql.SELECT("cert_pic"); + sql.FROM("tb_cert_info"); + applyWhere(sql, example, false); + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + StringBuilder sqlBuilder = new StringBuilder(sql.toString()); + sqlBuilder.append(" limit 1 "); + return sqlBuilder.toString(); + } +} diff --git a/src/main/java/com/certapp/entity/CertInfo.java b/src/main/java/com/certapp/entity/CertHashInfo.java similarity index 81% rename from src/main/java/com/certapp/entity/CertInfo.java rename to src/main/java/com/certapp/entity/CertHashInfo.java index 431af0cc831a780e4a16afdd4eac88286b01139e..780970067d24d57d35e3ced2a1b44a39c1a888c9 100644 --- a/src/main/java/com/certapp/entity/CertInfo.java +++ b/src/main/java/com/certapp/entity/CertHashInfo.java @@ -18,12 +18,7 @@ package com.certapp.entity; import lombok.Data; @Data -public class CertInfo { +public class CertHashInfo { private Integer certConfigId; - private String certId; private String filedInfo; - private String certHash; - private String txHash; - private String certUrl; - private Integer certState; } diff --git a/src/main/java/com/certapp/service/CertificateService.java b/src/main/java/com/certapp/service/CertificateService.java index 2c9dbe15e3b473fb0cd5a4a0cf30f983522f2342..e54ac15fe6d8b3f6da6fb46c54b685e4ce356763 100644 --- a/src/main/java/com/certapp/service/CertificateService.java +++ b/src/main/java/com/certapp/service/CertificateService.java @@ -72,7 +72,7 @@ import com.certapp.dao.mapper.TbFiledInfoMapper; import com.certapp.dao.mapper.TbQueryPageMapper; import com.certapp.dao.mapper.TbQueryResultPageMapper; import com.certapp.entity.CertFiledInfo; -import com.certapp.entity.CertInfo; +import com.certapp.entity.CertHashInfo; import com.certapp.entity.FiledInfo; import com.certapp.entity.FiledInfoVo; import com.certapp.entity.FiledLocal; @@ -812,27 +812,28 @@ public class CertificateService { int i = 1; while (sheetAt.getRow(i) != null) { XSSFRow row = sheetAt.getRow(i); - CertInfo certInfo = new CertInfo(); + CertHashInfo certHashInfo = new CertHashInfo(); if (StringUtils.isBlank(row.getCell(0).toString())) { break; } // 获取最大列数 int columnNum = row.getPhysicalNumberOfCells(); - certInfo.setCertConfigId(certConfigId); + certHashInfo.setCertConfigId(certConfigId); StringBuffer sb = new StringBuffer(); for (int j = 0; j < columnNum; j++) { sb.append(StringUtils.isNotEmpty(row.getCell(j).toString()) ? row.getCell(j).toString() + ";" : null + ";"); } sb.deleteCharAt(sb.length() - 1); - certInfo.setFiledInfo(sb.toString()); + certHashInfo.setFiledInfo(sb.toString()); // 计算hash - String certHash = getHash(certInfo.toString()); - certInfo.setCertHash(certHash); - log.info("readExcel certInfo:{}", JacksonUtils.toJSONString(certInfo)); + String certHash = getHash(JacksonUtils.toJSONString(certHashInfo)); + log.info("readExcel certInfo:{}", JacksonUtils.toJSONString(certHashInfo)); // 存储DB TbCertInfo tbCertInfo = new TbCertInfo(); - BeanUtils.copyProperties(certInfo, tbCertInfo); + BeanUtils.copyProperties(certHashInfo, tbCertInfo); + tbCertInfo.setCertHash(certHash); + tbCertInfo.setInfoCertHash(JacksonUtils.toJSONString(certHashInfo)); tbCertInfoMapper.insertSelective(tbCertInfo); // 设置证书编号(md5) String certId = CommonUtils.md5Encrypt(tbCertInfo.getId().toString()); diff --git a/src/main/resources/prd/application.yml b/src/main/resources/prd/application.yml index 33545e1a6ebcd350c857b5eeba9bd8c0c8c9efc8..580520618138ec040cc055edce43fcf7b60170b5 100644 --- a/src/main/resources/prd/application.yml +++ b/src/main/resources/prd/application.yml @@ -65,7 +65,7 @@ logging: com.certapp: info swagger: - enabled: true + enabled: false dappsdk: appid: 'appIdTemp'