增加查询汇总库信息数据库操作

web_backend_develope
wu ming 8 years ago
parent c5d54bab9e
commit b91af86ede

@ -7,8 +7,10 @@
<typeAlias alias="EncodedInfoEntity" type="com.platform.entities.EncodedInfoEntity" />
<typeAlias alias="DataInfoEntity" type="com.platform.entities.DataInfoEntity" />
<typeAlias alias="PagerOptions" type="com.platform.entities.PagerOptions"/>
<typeAlias alias="GatherOracleDao" type="com.platform.entities.GatherOracleDao"/>
</typeAliases>
<mappers>
<mapper resource="com/dao/mapper/data-detaisl-mapper.xml" />
<mapper resource="com/dao/mapper/data-details-mapper.xml" />
<mapper resource="com/dao/mapper/config-details-mapper.xml"/>
</mappers>
</configuration>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
<mapper namespace="com.platform.dao.GatherOracleDao">
<resultMap type="GatherOracleInfo" id="getEntityBytext">
<id property="_id" column="id" javaType="int" jdbcType="INTEGER" />
<result property="port" column="" javaType="" jdbcType=""/>
<result property="ip" column="" javaType="" jdbcType=""/>
<result property="name" column="" javaType="" jdbcType=""/>
<result property="user" column="" javaType="" jdbcType=""/>
<result property="password" column="" javaType="" jdbcType=""/>
<result property="database" column="" javaType="" jdbcType=""/>
<result property="tableName" column="" javaType="" jdbcType=""/>
<result property="suffix" column="" javaType="" jdbcType=""/>
<result property="status" column="" javaType="" jdbcType=""/>
</resultMap>
</mapper>

@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.platform.entities.FolderNode;
import com.platform.entities.GatherOracleInfo;
import com.platform.entities.OracleConnectorParams;
import com.platform.entities.PagerOptions;
import com.platform.service.DataInfoService;
import com.platform.service.OracleStatusService;
@ -45,10 +47,10 @@ public class DataModelController {
StringBuffer sb = new StringBuffer().append("µ±Ç°µÄÇëÇó²ÎÊý:{");
for (String str : keySet) {
String value = paramMap.get(str)[0];
if (StringUtils.isNotEmpty(value)){
if (StringUtils.isNotEmpty(value)) {
params.put(str, value);
sb.append(str).append(":").append(value).append(",");
}else {
} else {
sb.append(str).append(":").append("null").append(",");
}
}
@ -108,8 +110,29 @@ public class DataModelController {
bricks.add(brick1);
bricks.add(brick2);
List<FolderNode> folderNodes = new ArrayList<>();
folderNodes.add(FolderReader.reader("C:\\Users\\wuming\\workspace\\data-aggregation-platform"));
Volume volume = new Volume("volume", 1555551024, 153561024, bricks, folderNodes);
folderNodes
.add(FolderReader
.reader("C:\\Users\\wuming\\workspace\\data-aggregation-platform"));
Volume volume = new Volume("volume", 1555551024, 153561024, bricks,
folderNodes);
return volume;
}
@RequestMapping("/oracle/list")
@ResponseBody
public List<OracleConnectorParams> getOracleInfo(HttpServletRequest res,
HttpServletResponse req) {
List<OracleConnectorParams> orpinfo = new ArrayList<OracleConnectorParams>();
//测试下--------------------
OracleConnectorParams oracleConnectorParams1 = new GatherOracleInfo("1530", "192.168.0.115", "汇总库1", "System", "oracle", "orcl", 0, "TS_JSSJBS","_20152016", 0);
OracleConnectorParams oracleConnectorParams2= new GatherOracleInfo("1521", "192.168.0.110", "汇总库2", "System", "oracle", "orcl", 1, "TS_JSSJBS","_20152016", 1);
OracleConnectorParams oracleConnectorParams3 = new GatherOracleInfo("1530", "192.168.0.123", "汇总库3", "System", "oracle", "orcl", 2, "TS_JSSJBS","_20152016", 2);
OracleConnectorParams oracleConnectorParams4= new GatherOracleInfo("1521", "192.168.0.120", "汇总库4", "System", "oracle", "orcl", 3, "TS_JSSJBS","_20152016", 3);
orpinfo.add(oracleConnectorParams1);
orpinfo.add(oracleConnectorParams2);
orpinfo.add(oracleConnectorParams3);
orpinfo.add(oracleConnectorParams4);
//---------------------------------
return orpinfo;
}
}

@ -0,0 +1,5 @@
package com.platform.dao;
public interface GatherOracleDao {
}

@ -0,0 +1,60 @@
package com.platform.entities;
public class GatherOracleInfo extends OracleConnectorParams {
public GatherOracleInfo(String port, String ip, String name, String user,
String password, String database) {
super(port, ip, name, user, password, database);
// TODO Auto-generated constructor stub
}
public GatherOracleInfo(String port, String ip, String name, String user,
String password, String database, int _id, String tableName, String suffix, int status) {
super(port, ip, name, user, password, database);
this.tableName = tableName;
this.suffix = suffix;
this._id=_id;
this.status = status;
}
private String tableName;
private String suffix;
private int _id;
private int status; //oracle连接状态 ; 0未连接; 1连接成功 ; 2使用中; 3连接失败.
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getSuffix() {
return suffix;
}
public void setSuffix(String suffix) {
this.suffix = suffix;
}
public int get_id() {
return _id;
}
public void set_id(int _id) {
this._id = _id;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
Loading…
Cancel
Save