Merge branch 'web_backend_develope' of https://git.trustie.net/fhx569287825/aggregation-platform
Conflicts: build/classes/com/platform/controller/DataModelController.class build/classes/com/platform/controller/DefaultController.class build/classes/com/platform/entities/FolderNode.class build/classes/com/platform/service/OracleExtractService.class build/classes/com/platform/test/TestController.class build/classes/com/platform/test/TestEncodeInfoDao.class build/classes/com/platform/test/TestEncodeService.class build/classes/com/platform/utils/Configs.class build/classes/com/platform/utils/ConfigsLoader.class src/com/platform/controller/DataModelController.javaglusterfs-api
commit
9aa8e675ae
@ -1 +1 @@
|
||||
*.class
|
||||
build/
|
@ -1 +0,0 @@
|
||||
/com
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,64 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/tx
|
||||
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
|
||||
http://www.springframework.org/schema/aop
|
||||
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
<!-- 读取db.properties中的属性值 -->
|
||||
<bean
|
||||
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="location" value="/WebContent/WEB-INF/config/config.properties"></property>
|
||||
</bean>
|
||||
|
||||
<!-- 连接MySQL数据库 -->
|
||||
<bean id="mySQLDataSource"
|
||||
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
|
||||
<property name="driverClassName" value="${jdbc.mysql.driver}" />
|
||||
<property name="url" value="${jdbc.mysql.url}" />
|
||||
<property name="username" value="${jdbc.mysql.username}" />
|
||||
<property name="password" value="${jdbc.mysql.password}" />
|
||||
</bean>
|
||||
<bean id="mySQLSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
||||
<property name="configLocation" value="/WebContent/WEB-INF/config/mybatis-applicationConfig.xml" />
|
||||
<property name="dataSource" ref="mySQLDataSource" />
|
||||
</bean>
|
||||
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
||||
<property name="basePackage" value="com.platform.dao" />
|
||||
</bean>
|
||||
|
||||
<!-- 配置声明式事物 -->
|
||||
<bean id="mySQLTxManager"
|
||||
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
||||
<property name="dataSource" ref="mySQLDataSource" />
|
||||
</bean>
|
||||
<tx:advice id="txAdvice" transaction-manager="mySQLTxManager">
|
||||
<tx:attributes>
|
||||
<tx:method name="delete*" propagation="REQUIRED" />
|
||||
<tx:method name="insert*" propagation="REQUIRED" />
|
||||
<tx:method name="update*" propagation="REQUIRED" />
|
||||
<tx:method name="get*" read-only="true" />
|
||||
<tx:method name="select*" read-only="true" />
|
||||
</tx:attributes>
|
||||
</tx:advice>
|
||||
<aop:config>
|
||||
<aop:pointcut expression="execution(* com.platform.service.*.*(..))"
|
||||
id="pointcut" />
|
||||
<aop:advisor advice-ref="txAdvice" pointcut-ref="pointcut" />
|
||||
</aop:config>
|
||||
<bean id="user" class="com.platform.test.User">
|
||||
<property name="name" value="伍名" />
|
||||
<property name="id" value="1" />
|
||||
<property name="sex" value="男" />
|
||||
</bean>
|
||||
<context:component-scan base-package="com.platform.*">
|
||||
<context:exclude-filter type="annotation"
|
||||
expression="org.springframework.stereotype.Controller" />
|
||||
</context:component-scan>
|
||||
</beans>
|
@ -0,0 +1,146 @@
|
||||
<?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="com.platform.entities.GatherOracleInfo" id="getEntityBytext">
|
||||
<id property="id" column="id" javaType="int" jdbcType="INTEGER" />
|
||||
<result property="port" column="service_port" javaType="int" jdbcType="INTEGER"/>
|
||||
<result property="ip" column="service_ip" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="service_name" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="user" column="service_user" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="password" column="service_password" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="databaseName" column="service_database" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="tableName" column="service_table" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="suffix" column="service_suffix" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="service_status" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="remove" column="remove" jdbcType="CHAR"/>
|
||||
</resultMap>
|
||||
<sql id="baseOracleInfo">
|
||||
id id, service_port port, service_ip ip, service_name name, service_user user, service_password password, service_database databaseName, service_table tableName, service_suffix suffix, service_status status
|
||||
</sql>
|
||||
|
||||
<select id="selectAllOracle" resultType="com.platform.entities.GatherOracleInfo">
|
||||
SELECT
|
||||
<include refid="baseOracleInfo" />
|
||||
FROM services_info
|
||||
WHERE remove = "0"
|
||||
</select>
|
||||
|
||||
<insert id="insertOracle" parameterType="com.platform.entities.GatherOracleInfo">
|
||||
INSERT INTO
|
||||
services_info(
|
||||
<trim suffixOverrides=",">
|
||||
<if test="port > 0">
|
||||
service_port,
|
||||
</if>
|
||||
<if test="ip != null and ip != ''">
|
||||
service_ip,
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
service_name,
|
||||
</if>
|
||||
<if test="user != null and user != ''">
|
||||
service_user,
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
service_password,
|
||||
</if>
|
||||
<if test="databaseName != null and databaseName != ''">
|
||||
service_database,
|
||||
</if>
|
||||
<if test="tableName != null and tableName != ''">
|
||||
service_table,
|
||||
</if>
|
||||
<if test="suffix != null and suffix != ''">
|
||||
service_suffix,
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
service_status,
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
VALUES(
|
||||
<trim suffixOverrides=",">
|
||||
<if test="port > 0">
|
||||
#{port},
|
||||
</if>
|
||||
<if test="ip != null and ip != ''">
|
||||
#{ip},
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="user != null and user != ''">
|
||||
#{user},
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
#{password},
|
||||
</if>
|
||||
<if test="databaseName != null and databaseName != ''">
|
||||
#{databaseName},
|
||||
</if>
|
||||
<if test="tableName != null and tableName != ''">
|
||||
#{tableName},
|
||||
</if>
|
||||
<if test="suffix != null and suffix != ''">
|
||||
#{suffix},
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
#{status},
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteOracleById" parameterType="java.lang.Integer">
|
||||
DELETE FROM services_info
|
||||
<where>
|
||||
id =#{id}
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<update id="updateOracleById" parameterType="com.platform.entities.GatherOracleInfo">
|
||||
UPDATE
|
||||
services_info
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="name != null and name != ''">
|
||||
service_name = #{name},
|
||||
</if>
|
||||
<if test="ip != null and ip != ''">
|
||||
service_ip = #{ip},
|
||||
</if>
|
||||
<if test="port > 0">
|
||||
service_port= #{port},
|
||||
</if>
|
||||
<if test="user != null and user != ''">
|
||||
service_user= #{user},
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
service_password= #{password},
|
||||
</if>
|
||||
<if test="databaseName != null and databaseName != ''">
|
||||
service_database= #{databaseName},
|
||||
</if>
|
||||
<if test="tableName != null and tableName != ''">
|
||||
service_table= #{tableName},
|
||||
</if>
|
||||
<if test="suffix != null and suffix != ''">
|
||||
service_suffix= #{suffix},
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
service_status= #{status},
|
||||
</if>
|
||||
<if test="remove != null and remove != ''">
|
||||
remove= #{remove},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
id = #{id}
|
||||
</where>
|
||||
</update>
|
||||
|
||||
</mapper>
|
@ -1,108 +0,0 @@
|
||||
<?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.DataInfoDao">
|
||||
<resultMap id="getEntityByText" type="DataInfoEntity">
|
||||
<id property="id" column="id" javaType="int" jdbcType="INTEGER" />
|
||||
<result property="regionalismCode" column="regionalism_code"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="cityName" column="city_name" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="districtName" column="district_name"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="systemCode" column="system_code" javaType="int"
|
||||
jdbcType="INTEGER" />
|
||||
<result property="systemName" column="system_name" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="dataType" column="data_type" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="dataVersion" column="data_version" javaType="int"
|
||||
jdbcType="INTEGER" />
|
||||
<result property="submittedBatch" column="submitted_batch"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="dataPath" column="data_path" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="charset" column="data_charset" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
<result property="collectingTime" column="collection_time"
|
||||
javaType="string" jdbcType="DATE" />
|
||||
<result property="collectorContacts" column="collector_contacts"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="collectorName" column="collector_name"
|
||||
javaType="string" jdbcType="VARCHAR" />
|
||||
<result property="year" column="data_year" javaType="string"
|
||||
jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="conditionsFilters">
|
||||
<if test="PagerOptions.dataType!=null">
|
||||
and data_details.data_type=#{PagerOptions.dataType}
|
||||
</if>
|
||||
<if test="PagerOptions.submittedBatch!=null">
|
||||
and
|
||||
data_details.submitted_batch=#{PagerOptions.submittedBatch}
|
||||
</if>
|
||||
<if test="PagerOptions.cityName!=null">
|
||||
and data_details.city_name=#{PagerOptions.cityName}
|
||||
</if>
|
||||
<if test="PagerOptions.districtName!=null">
|
||||
and
|
||||
data_details.district_name=#{PagerOptions.districtName}
|
||||
</if>
|
||||
<if test="PagerOptions.dataVersion !=null">
|
||||
and data_details.data_version=#{PagerOptions.dataVersion}
|
||||
</if>
|
||||
<if test="PagerOptions.systemName !=null">
|
||||
and data_details=#{PagerOptions.systemName}
|
||||
</if>
|
||||
<if test="PagerOptions.dataYear !=null">
|
||||
and data_details.data_year=#{PagerOptions.dataYear}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<!-- 获取数据符合筛选条件的全部记录信息 -->
|
||||
<select id="getLimitedDataInfoEntities" parameterType="PagerOptions"
|
||||
resultMap="getEntityByText">
|
||||
SELECT
|
||||
id,regionalism_code,city_name,district_name,system_code,system_name,data_type,data_version,submitted_batch,data_path,data_charset,collection_time,collector_name,collector_contacts,data_year
|
||||
FROM data_details
|
||||
<if test="PagerOptions!=null">
|
||||
<where>
|
||||
<include refid="conditionsFilters" />
|
||||
<choose>
|
||||
<when test="PagerOptions.offset > 0">
|
||||
and data_details.id>= #{PagerOptions.offset}
|
||||
</when>
|
||||
<otherwise>
|
||||
and data_details.id>=0
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
ORDER BY data_details.id
|
||||
<if test="PagerOptions.limit > 0">
|
||||
LIMIT #{PagerOptions.limit}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 获取数据符合筛选条件的总记录条数 -->
|
||||
<select id="getLimitedDataCount" resultType="java.lang.Integer"
|
||||
parameterType="PagerOptions">
|
||||
SELECT COUNT(id) FROM data_details
|
||||
<if test="PagerOptions!=null">
|
||||
<where>
|
||||
<include refid="conditionsFilters" />
|
||||
</where>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 获取数据查询的起始di -->
|
||||
<select id="getLimitedBeginId" resultType="java.lang.Integer"
|
||||
parameterType="PagerOptions">
|
||||
SELECT MAX(idx) FROM (SELECT id idx FROM data_details
|
||||
ORDER BY id LIMIT 0,#{PagerOptions.totalLimit}) AS TEMP
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,39 @@
|
||||
package com.platform.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.platform.entities.GatherOracleInfo;
|
||||
|
||||
@Repository(value = "gatherOracleDao")
|
||||
public interface GatherOracleDao {
|
||||
|
||||
/**
|
||||
* @return 查询所有的oracle记录
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
public List<GatherOracleInfo> selectAllOracle() throws Exception;
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int deleteOracleById(int id) throws Exception;
|
||||
|
||||
/**
|
||||
* @param oracle
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int insertOracle(GatherOracleInfo oracle) throws Exception;
|
||||
|
||||
/**
|
||||
* @param oracle
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int updateOracleById(GatherOracleInfo oracle) throws Exception;
|
||||
|
||||
}
|
Loading…
Reference in new issue