CREATE TABLE t_talent_hign_potential ( high_potential_id int(11) NOT NULL COMMENT 'id', employee_id int(100) NOT NULL COMMENT '员工id', final_job_level_id varchar(10) NOT NULL COMMENT '最终职级id', source char(1) DEFAULT NULL COMMENT '来源,字典HIGH_POTENIAL:0-导入,1-干部考察,2-高潜曝光', org_level varchar(10) DEFAULT NULL COMMENT '所属组织层级(允许有多个值,逗号隔开),字典AT_ORG_UNIT_TYPE:1-集团,2-一级组织,3-二级组织,4-分子公司', cadre_speciality text NOT NULL COMMENT '干部特质', main_weakness text NOT NULL COMMENT '主要短板', develop_advice text NOT NULL COMMENT '发展建议', next_plan text NOT NULL COMMENT '下一步计划', at_employee_id int(11) DEFAULT NULL COMMENT 'AT对接人id', current_process varchar(255) DEFAULT NULL COMMENT '当前进展', in_pool_date datetime DEFAULT NULL COMMENT '入池时间(冗余)', evaluation_source char(1) DEFAULT NULL COMMENT '来源,字典EVALUATION_SOURCE:0-导入,1-干部考察,2-高潜曝光', ref_id int(11) DEFAULT NULL COMMENT '关联id', create_by int(11) DEFAULT NULL COMMENT '创建人id', create_time datetime DEFAULT NULL COMMENT '创建时间', update_by int(11) DEFAULT NULL COMMENT '更新人id', last_update_by datetime DEFAULT NULL COMMENT '更新时间', hign_potential_status char(1) NOT NULL COMMENT '状态:是否在池,Y是N否', PRIMARY KEY (high_potential_id) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='高潜资源池表'帮我创建java代码
时间: 2023-12-05 12:05:53 浏览: 130
Sure, here's a sample Java code for creating a class representing the table "t_talent_hign_potential":
```java
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
public class HighPotential {
private int highPotentialId;
private int employeeId;
private String finalJobLevelId;
private String source;
private String orgLevel;
private String cadreSpeciality;
private String mainWeakness;
private String developAdvice;
private String nextPlan;
private int atEmployeeId;
private String currentProcess;
private Timestamp inPoolDate;
private String evaluationSource;
private int refId;
private int createBy;
private Timestamp createTime;
private int updateBy;
private Timestamp lastUpdateBy;
private String highPotentialStatus;
public HighPotential(int highPotentialId, int employeeId, String finalJobLevelId, String source, String orgLevel, String cadreSpeciality, String mainWeakness, String developAdvice, String nextPlan, int atEmployeeId, String currentProcess, Timestamp inPoolDate, String evaluationSource, int refId, int createBy, Timestamp createTime, int updateBy, Timestamp lastUpdateBy, String highPotentialStatus) {
this.highPotentialId = highPotentialId;
this.employeeId = employeeId;
this.finalJobLevelId = finalJobLevelId;
this.source = source;
this.orgLevel = orgLevel;
this.cadreSpeciality = cadreSpeciality;
this.mainWeakness = mainWeakness;
this.developAdvice = developAdvice;
this.nextPlan = nextPlan;
this.atEmployeeId = atEmployeeId;
this.currentProcess = currentProcess;
this.inPoolDate = inPoolDate;
this.evaluationSource = evaluationSource;
this.refId = refId;
this.createBy = createBy;
this.createTime = createTime;
this.updateBy = updateBy;
this.lastUpdateBy = lastUpdateBy;
this.highPotentialStatus = highPotentialStatus;
}
public int getHighPotentialId() {
return highPotentialId;
}
public void setHighPotentialId(int highPotentialId) {
this.highPotentialId = highPotentialId;
}
public int getEmployeeId() {
return employeeId;
}
public void setEmployeeId(int employeeId) {
this.employeeId = employeeId;
}
public String getFinalJobLevelId() {
return finalJobLevelId;
}
public void setFinalJobLevelId(String finalJobLevelId) {
this.finalJobLevelId = finalJobLevelId;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getOrgLevel() {
return orgLevel;
}
public void setOrgLevel(String orgLevel) {
this.orgLevel = orgLevel;
}
public String getCadreSpeciality() {
return cadreSpeciality;
}
public void setCadreSpeciality(String cadreSpeciality) {
this.cadreSpeciality = cadreSpeciality;
}
public String getMainWeakness() {
return mainWeakness;
}
public void setMainWeakness(String mainWeakness) {
this.mainWeakness = mainWeakness;
}
public String getDevelopAdvice() {
return developAdvice;
}
public void setDevelopAdvice(String developAdvice) {
this.developAdvice = developAdvice;
}
public String getNextPlan() {
return nextPlan;
}
public void setNextPlan(String nextPlan) {
this.nextPlan = nextPlan;
}
public int getAtEmployeeId() {
return atEmployeeId;
}
public void setAtEmployeeId(int atEmployeeId) {
this.atEmployeeId = atEmployeeId;
}
public String getCurrentProcess() {
return currentProcess;
}
public void setCurrentProcess(String currentProcess) {
this.currentProcess = currentProcess;
}
public Timestamp getInPoolDate() {
return inPoolDate;
}
public void setInPoolDate(Timestamp inPoolDate) {
this.inPoolDate = inPoolDate;
}
public String getEvaluationSource() {
return evaluationSource;
}
public void setEvaluationSource(String evaluationSource) {
this.evaluationSource = evaluationSource;
}
public int getRefId() {
return refId;
}
public void setRefId(int refId) {
this.refId = refId;
}
public int getCreateBy() {
return createBy;
}
public void setCreateBy(int createBy) {
this.createBy = createBy;
}
public Timestamp getCreateTime() {
return createTime;
}
public void setCreateTime(Timestamp createTime) {
this.createTime = createTime;
}
public int getUpdateBy() {
return updateBy;
}
public void setUpdateBy(int updateBy) {
this.updateBy = updateBy;
}
public Timestamp getLastUpdateBy() {
return lastUpdateBy;
}
public void setLastUpdateBy(Timestamp lastUpdateBy) {
this.lastUpdateBy = lastUpdateBy;
}
public String getHighPotentialStatus() {
return highPotentialStatus;
}
public void setHighPotentialStatus(String highPotentialStatus) {
this.highPotentialStatus = highPotentialStatus;
}
public static List<HighPotential> getAllHighPotentials(Connection conn) throws SQLException {
List<HighPotential> highPotentials = new ArrayList<>();
String sql = "SELECT * FROM t_talent_hign_potential";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
HighPotential hp = new HighPotential(
rs.getInt("high_potential_id"),
rs.getInt("employee_id"),
rs.getString("final_job_level_id"),
rs.getString("source"),
rs.getString("org_level"),
rs.getString("cadre_speciality"),
rs.getString("main_weakness"),
rs.getString("develop_advice"),
rs.getString("next_plan"),
rs.getInt("at_employee_id"),
rs.getString("current_process"),
rs.getTimestamp("in_pool_date"),
rs.getString("evaluation_source"),
rs.getInt("ref_id"),
rs.getInt("create_by"),
rs.getTimestamp("create_time"),
rs.getInt("update_by"),
rs.getTimestamp("last_update_by"),
rs.getString("hign_potential_status")
);
highPotentials.add(hp);
}
return highPotentials;
}
}
```
You can modify the code as per your requirements and use it to interact with the database table.
阅读全文