diff --git a/src/main/java/cn/chjyj/szwh/bean/Cert.java b/src/main/java/cn/chjyj/szwh/bean/Cert.java new file mode 100644 index 0000000..497dcf7 --- /dev/null +++ b/src/main/java/cn/chjyj/szwh/bean/Cert.java @@ -0,0 +1,89 @@ +package cn.chjyj.szwh.bean; + +import java.io.Serializable; + +/** + * 证书实体 + * xy + */ +public class Cert implements Serializable { + /** + * cert + * id,public_key as publicKey,private_key as privateKey,token,`status`,`type` + */ + private Integer id; + /** + * 公钥地址 + */ + private String publicKey; + + /** + * 私钥地址 + */ + private String privateKey; + + /** + * 系统标识 + */ + private String token; + + /** + * 状态;0:启用;1:禁用 + */ + private Integer status; + + /** + * 类型 + */ + private String type; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getPublicKey() { + return publicKey; + } + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + public String getPrivateKey() { + return privateKey; + } + + public void setPrivateKey(String privateKey) { + this.privateKey = privateKey; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} \ No newline at end of file diff --git a/src/main/java/cn/chjyj/szwh/mapper/CertMapper.java b/src/main/java/cn/chjyj/szwh/mapper/CertMapper.java new file mode 100644 index 0000000..ea6633e --- /dev/null +++ b/src/main/java/cn/chjyj/szwh/mapper/CertMapper.java @@ -0,0 +1,24 @@ +package cn.chjyj.szwh.mapper; + +import cn.chjyj.szwh.bean.Cert; +import org.springframework.stereotype.Component; + +/** + * 证书mapper + */ +@Component +public interface CertMapper { + /** + * 根据编号查询 + * @param id + * @return + */ + Cert getCertByid(Integer id); + + /** + * 根据类型查询 + * @param stype + * @return + */ + Cert getCertByType(String stype); +} diff --git a/src/main/resources/mapper/szwh/CertMapper.xml b/src/main/resources/mapper/szwh/CertMapper.xml new file mode 100644 index 0000000..e9f5ad1 --- /dev/null +++ b/src/main/resources/mapper/szwh/CertMapper.xml @@ -0,0 +1,97 @@ + + + + + + id,public_key as publicKey,private_key as privateKey,token,`status`,`type` + + cert + + + + + + + + + + + + + + + + insert into + (uname,password,gender,urealname,ubirth,nickname,avatarurl,platfrom,sessionkey,openid) + values ( + #{uname}, + #{password}, + #{gender}, + #{urealname}, + #{ubirth}, + #{nickname}, + #{avatarurl}, + #{platfrom}, + #{sessionkey}, + #{openid} + ) + + + + update + set + + + password=#{password}, + + + urealname=#{urealname}, + + + ubirth =#{ubirth}, + + + gender=#{gender}, + + + nickname=#{nickName}, + + + avatarurl=#{avatarurl}, + + + nickname=#{nickname}, + + + platfrom=#{platfrom}, + + + sessionkey=#{sessionkey}, + + + openid=#{openid}, + + uname=#{uname} + where uid=#{uid}; + + + \ No newline at end of file