diff --git a/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapper.java b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapper.java index 67cbeff8..c5ce981b 100644 --- a/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapper.java +++ b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapper.java @@ -39,12 +39,12 @@ public interface SecSinopecConfigMapper extends SecSinopecConfigMapperExt { int deleteByPrimaryKey(Integer id); @Insert({ - "insert into sec_sinopec_config (app_id, app_secret, ", + "insert into sec_sinopec_config (`name`, app_secret, ", "code, create_time, ", - "SignKey)", - "values (#{appId,jdbcType=VARCHAR}, #{appSecret,jdbcType=VARCHAR}, ", + "SignKey, app_id)", + "values (#{name,jdbcType=VARCHAR}, #{appSecret,jdbcType=VARCHAR}, ", "#{code,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{signkey,jdbcType=VARCHAR})" + "#{signkey,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(SecSinopecConfig record); @@ -56,27 +56,29 @@ public interface SecSinopecConfigMapper extends SecSinopecConfigMapperExt { @SelectProvider(type=SecSinopecConfigSqlProvider.class, method="selectByExample") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true), - @Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR), + @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), @Result(column="app_secret", property="appSecret", jdbcType=JdbcType.VARCHAR), @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), - @Result(column="SignKey", property="signkey", jdbcType=JdbcType.VARCHAR) + @Result(column="SignKey", property="signkey", jdbcType=JdbcType.VARCHAR), + @Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR) }) List selectByExample(SecSinopecConfigExample example); @Select({ "select", - "id, app_id, app_secret, code, create_time, SignKey", + "id, `name`, app_secret, code, create_time, SignKey, app_id", "from sec_sinopec_config", "where id = #{id,jdbcType=INTEGER}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true), - @Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR), + @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), @Result(column="app_secret", property="appSecret", jdbcType=JdbcType.VARCHAR), @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), - @Result(column="SignKey", property="signkey", jdbcType=JdbcType.VARCHAR) + @Result(column="SignKey", property="signkey", jdbcType=JdbcType.VARCHAR), + @Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR) }) SecSinopecConfig selectByPrimaryKey(Integer id); @@ -91,11 +93,12 @@ public interface SecSinopecConfigMapper extends SecSinopecConfigMapperExt { @Update({ "update sec_sinopec_config", - "set app_id = #{appId,jdbcType=VARCHAR},", + "set `name` = #{name,jdbcType=VARCHAR},", "app_secret = #{appSecret,jdbcType=VARCHAR},", "code = #{code,jdbcType=VARCHAR},", "create_time = #{createTime,jdbcType=TIMESTAMP},", - "SignKey = #{signkey,jdbcType=VARCHAR}", + "SignKey = #{signkey,jdbcType=VARCHAR},", + "app_id = #{appId,jdbcType=VARCHAR}", "where id = #{id,jdbcType=INTEGER}" }) int updateByPrimaryKey(SecSinopecConfig record); diff --git a/hai-service/src/main/java/com/hai/dao/SecSinopecConfigSqlProvider.java b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigSqlProvider.java index 93a97a1a..4b2490b1 100644 --- a/hai-service/src/main/java/com/hai/dao/SecSinopecConfigSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigSqlProvider.java @@ -28,8 +28,8 @@ public class SecSinopecConfigSqlProvider { SQL sql = new SQL(); sql.INSERT_INTO("sec_sinopec_config"); - if (record.getAppId() != null) { - sql.VALUES("app_id", "#{appId,jdbcType=VARCHAR}"); + if (record.getName() != null) { + sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}"); } if (record.getAppSecret() != null) { @@ -48,6 +48,10 @@ public class SecSinopecConfigSqlProvider { sql.VALUES("SignKey", "#{signkey,jdbcType=VARCHAR}"); } + if (record.getAppId() != null) { + sql.VALUES("app_id", "#{appId,jdbcType=VARCHAR}"); + } + return sql.toString(); } @@ -58,11 +62,12 @@ public class SecSinopecConfigSqlProvider { } else { sql.SELECT("id"); } - sql.SELECT("app_id"); + sql.SELECT("`name`"); sql.SELECT("app_secret"); sql.SELECT("code"); sql.SELECT("create_time"); sql.SELECT("SignKey"); + sql.SELECT("app_id"); sql.FROM("sec_sinopec_config"); applyWhere(sql, example, false); @@ -84,8 +89,8 @@ public class SecSinopecConfigSqlProvider { sql.SET("id = #{record.id,jdbcType=INTEGER}"); } - if (record.getAppId() != null) { - sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}"); + if (record.getName() != null) { + sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); } if (record.getAppSecret() != null) { @@ -104,6 +109,10 @@ public class SecSinopecConfigSqlProvider { sql.SET("SignKey = #{record.signkey,jdbcType=VARCHAR}"); } + if (record.getAppId() != null) { + sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}"); + } + applyWhere(sql, example, true); return sql.toString(); } @@ -113,11 +122,12 @@ public class SecSinopecConfigSqlProvider { sql.UPDATE("sec_sinopec_config"); sql.SET("id = #{record.id,jdbcType=INTEGER}"); - sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}"); + sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); sql.SET("app_secret = #{record.appSecret,jdbcType=VARCHAR}"); sql.SET("code = #{record.code,jdbcType=VARCHAR}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("SignKey = #{record.signkey,jdbcType=VARCHAR}"); + sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}"); SecSinopecConfigExample example = (SecSinopecConfigExample) parameter.get("example"); applyWhere(sql, example, true); @@ -128,8 +138,8 @@ public class SecSinopecConfigSqlProvider { SQL sql = new SQL(); sql.UPDATE("sec_sinopec_config"); - if (record.getAppId() != null) { - sql.SET("app_id = #{appId,jdbcType=VARCHAR}"); + if (record.getName() != null) { + sql.SET("`name` = #{name,jdbcType=VARCHAR}"); } if (record.getAppSecret() != null) { @@ -148,6 +158,10 @@ public class SecSinopecConfigSqlProvider { sql.SET("SignKey = #{signkey,jdbcType=VARCHAR}"); } + if (record.getAppId() != null) { + sql.SET("app_id = #{appId,jdbcType=VARCHAR}"); + } + sql.WHERE("id = #{id,jdbcType=INTEGER}"); return sql.toString(); diff --git a/hai-service/src/main/java/com/hai/entity/SecSinopecConfig.java b/hai-service/src/main/java/com/hai/entity/SecSinopecConfig.java index 591fac0a..927aecd4 100644 --- a/hai-service/src/main/java/com/hai/entity/SecSinopecConfig.java +++ b/hai-service/src/main/java/com/hai/entity/SecSinopecConfig.java @@ -19,9 +19,9 @@ public class SecSinopecConfig implements Serializable { private Integer id; /** - * 客户AppId + * 中石化客户名称 */ - private String appId; + private String name; /** * 客户密码 @@ -43,6 +43,11 @@ public class SecSinopecConfig implements Serializable { */ private String signkey; + /** + * 客户AppId + */ + private String appId; + private static final long serialVersionUID = 1L; public Integer getId() { @@ -53,12 +58,12 @@ public class SecSinopecConfig implements Serializable { this.id = id; } - public String getAppId() { - return appId; + public String getName() { + return name; } - public void setAppId(String appId) { - this.appId = appId; + public void setName(String name) { + this.name = name; } public String getAppSecret() { @@ -93,6 +98,14 @@ public class SecSinopecConfig implements Serializable { this.signkey = signkey; } + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + @Override public boolean equals(Object that) { if (this == that) { @@ -106,11 +119,12 @@ public class SecSinopecConfig implements Serializable { } SecSinopecConfig other = (SecSinopecConfig) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) - && (this.getAppId() == null ? other.getAppId() == null : this.getAppId().equals(other.getAppId())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) && (this.getAppSecret() == null ? other.getAppSecret() == null : this.getAppSecret().equals(other.getAppSecret())) && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) - && (this.getSignkey() == null ? other.getSignkey() == null : this.getSignkey().equals(other.getSignkey())); + && (this.getSignkey() == null ? other.getSignkey() == null : this.getSignkey().equals(other.getSignkey())) + && (this.getAppId() == null ? other.getAppId() == null : this.getAppId().equals(other.getAppId())); } @Override @@ -118,11 +132,12 @@ public class SecSinopecConfig implements Serializable { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); - result = prime * result + ((getAppId() == null) ? 0 : getAppId().hashCode()); + result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); result = prime * result + ((getAppSecret() == null) ? 0 : getAppSecret().hashCode()); result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getSignkey() == null) ? 0 : getSignkey().hashCode()); + result = prime * result + ((getAppId() == null) ? 0 : getAppId().hashCode()); return result; } @@ -133,11 +148,12 @@ public class SecSinopecConfig implements Serializable { sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); - sb.append(", appId=").append(appId); + sb.append(", name=").append(name); sb.append(", appSecret=").append(appSecret); sb.append(", code=").append(code); sb.append(", createTime=").append(createTime); sb.append(", signkey=").append(signkey); + sb.append(", appId=").append(appId); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); diff --git a/hai-service/src/main/java/com/hai/entity/SecSinopecConfigExample.java b/hai-service/src/main/java/com/hai/entity/SecSinopecConfigExample.java index 10e1e0a2..a866b79c 100644 --- a/hai-service/src/main/java/com/hai/entity/SecSinopecConfigExample.java +++ b/hai-service/src/main/java/com/hai/entity/SecSinopecConfigExample.java @@ -185,73 +185,73 @@ public class SecSinopecConfigExample { return (Criteria) this; } - public Criteria andAppIdIsNull() { - addCriterion("app_id is null"); + public Criteria andNameIsNull() { + addCriterion("`name` is null"); return (Criteria) this; } - public Criteria andAppIdIsNotNull() { - addCriterion("app_id is not null"); + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); return (Criteria) this; } - public Criteria andAppIdEqualTo(String value) { - addCriterion("app_id =", value, "appId"); + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); return (Criteria) this; } - public Criteria andAppIdNotEqualTo(String value) { - addCriterion("app_id <>", value, "appId"); + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); return (Criteria) this; } - public Criteria andAppIdGreaterThan(String value) { - addCriterion("app_id >", value, "appId"); + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); return (Criteria) this; } - public Criteria andAppIdGreaterThanOrEqualTo(String value) { - addCriterion("app_id >=", value, "appId"); + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); return (Criteria) this; } - public Criteria andAppIdLessThan(String value) { - addCriterion("app_id <", value, "appId"); + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); return (Criteria) this; } - public Criteria andAppIdLessThanOrEqualTo(String value) { - addCriterion("app_id <=", value, "appId"); + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); return (Criteria) this; } - public Criteria andAppIdLike(String value) { - addCriterion("app_id like", value, "appId"); + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); return (Criteria) this; } - public Criteria andAppIdNotLike(String value) { - addCriterion("app_id not like", value, "appId"); + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); return (Criteria) this; } - public Criteria andAppIdIn(List values) { - addCriterion("app_id in", values, "appId"); + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); return (Criteria) this; } - public Criteria andAppIdNotIn(List values) { - addCriterion("app_id not in", values, "appId"); + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); return (Criteria) this; } - public Criteria andAppIdBetween(String value1, String value2) { - addCriterion("app_id between", value1, value2, "appId"); + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); return (Criteria) this; } - public Criteria andAppIdNotBetween(String value1, String value2) { - addCriterion("app_id not between", value1, value2, "appId"); + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); return (Criteria) this; } @@ -524,6 +524,76 @@ public class SecSinopecConfigExample { addCriterion("SignKey not between", value1, value2, "signkey"); return (Criteria) this; } + + public Criteria andAppIdIsNull() { + addCriterion("app_id is null"); + return (Criteria) this; + } + + public Criteria andAppIdIsNotNull() { + addCriterion("app_id is not null"); + return (Criteria) this; + } + + public Criteria andAppIdEqualTo(String value) { + addCriterion("app_id =", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdNotEqualTo(String value) { + addCriterion("app_id <>", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdGreaterThan(String value) { + addCriterion("app_id >", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdGreaterThanOrEqualTo(String value) { + addCriterion("app_id >=", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdLessThan(String value) { + addCriterion("app_id <", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdLessThanOrEqualTo(String value) { + addCriterion("app_id <=", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdLike(String value) { + addCriterion("app_id like", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdNotLike(String value) { + addCriterion("app_id not like", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdIn(List values) { + addCriterion("app_id in", values, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdNotIn(List values) { + addCriterion("app_id not in", values, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdBetween(String value1, String value2) { + addCriterion("app_id between", value1, value2, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdNotBetween(String value1, String value2) { + addCriterion("app_id not between", value1, value2, "appId"); + return (Criteria) this; + } } /**