完成人员信息查询功能

This commit is contained in:
Kane Wang 2022-12-16 17:59:13 +08:00
parent 3b648e5640
commit 53093875eb
1 changed files with 67 additions and 10 deletions

View File

@ -2,7 +2,7 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-15 14:08:28 * @Date: 2022-12-15 14:08:28
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2022-12-16 16:15:24 * @LastEditTime: 2022-12-16 17:57:06
* @FilePath: \AdminSys\src\main\java\com\cpic\xim\myutils\account\CpicXIMStaffInfo.java * @FilePath: \AdminSys\src\main\java\com\cpic\xim\myutils\account\CpicXIMStaffInfo.java
* @Description: 产险厦门分公司员工信息对象 * @Description: 产险厦门分公司员工信息对象
* *
@ -17,12 +17,21 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/*****************************************************
* 厦门太保员工信息
* 使用工厂函数创建
*****************************************************/
public class CpicXIMStaffInfo public class CpicXIMStaffInfo
{ {
/*****************************************************
* 查询员工信息
* @param uidOrCode p13账号或p09账号
* @return 员工信息对象
*****************************************************/
public static CpicXIMStaffInfo getStaffInfo( String uidOrCode ) public static CpicXIMStaffInfo getStaffInfo( String uidOrCode )
throws SQLException, ClassNotFoundException throws SQLException, ClassNotFoundException
{ {
CpicXIMStaffInfo info = new CpicXIMStaffInfo(); CpicXIMStaffInfo info = null;
Connection connection = null; Connection connection = null;
PreparedStatement stmt = null; PreparedStatement stmt = null;
@ -30,16 +39,38 @@ public class CpicXIMStaffInfo
String jdbcURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1"; String jdbcURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1";
String userName = "dataex"; String userName = "dataex";
String password = "Cpic123456"; String password = "cpic123456";
String querySQL = "SELECT ry.staff_code, ry.staff_name, ry.p13uid " String querySQL = "SELECT ry.staff_code,ry.staff_name,ry.p13uid,"
+ " FROM idst0.rydm_t ry WHERE ry.account_status = 0" + " ry.department_code, bm.department_name,"
+ " AND (ry.staff_code = ? OR ry.p13uid = ?)"; + " ry.section_office_code,ks.section_office_name "
+ " FROM idst0.rydm_t ry,idst0.ks_t ks,idst0.bm_t bm "
+ " WHERE ry.account_status = 0 AND (ry.staff_code = ? OR ry.p13uid = ?) "
+ " and ry.section_office_code = ks.section_office_code "
+ " and ry.department_code = bm.department_code ";
try try
{ {
Class.forName( "oracle.jdbc.driver.OracleDriver" ); Class.forName( "oracle.jdbc.driver.OracleDriver" );
connection = DriverManager.getConnection( jdbcURL, userName, password ); connection = DriverManager.getConnection( jdbcURL, userName, password );
stmt = connection.prepareStatement( querySQL );
stmt.setString( 1, uidOrCode );
stmt.setString( 2, uidOrCode );
result = stmt.executeQuery();
if ( result.next())
{
info = new CpicXIMStaffInfo();
info.code = result.getString( 1 );
info.name = result.getString( 2 );
info.p13UID = result.getString( 3 );
info.departmentCode = result.getString( 4 );
info.departmentName = result.getString( 5 );
info.sectionOfficeCode = result.getString( 6 );
info.setctionOfficeName = result.getString( 7 );
}
} }
finally finally
{ {
@ -136,18 +167,44 @@ public class CpicXIMStaffInfo
this.departmentName = departmentName; this.departmentName = departmentName;
} }
public String getSectionOfficeCode()
{
return sectionOfficeCode;
}
public void setSectionOfficeCode( String sectionOfficeCode )
{
this.sectionOfficeCode = sectionOfficeCode;
}
public String getSetctionOfficeName()
{
return setctionOfficeName;
}
public void setSetctionOfficeName( String setctionOfficeName )
{
this.setctionOfficeName = setctionOfficeName;
}
@JsonProperty( "name") @JsonProperty( "name")
private String name; private String name;
@JsonProperty( "name") @JsonProperty( "code")
private String code; private String code;
@JsonProperty( "name") @JsonProperty( "p13uid")
private String p13UID; private String p13UID;
@JsonProperty( "name") @JsonProperty( "department_code")
private String departmentCode; private String departmentCode;
@JsonProperty( "name") @JsonProperty( "department_name")
private String departmentName; private String departmentName;
@JsonProperty( "section_office_code")
private String sectionOfficeCode;
@JsonProperty( "section_office_name")
private String setctionOfficeName;
} }