parent
261bf0505e
commit
c5d54bab9e
@ -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>
|
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.
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>
|
Loading…
Reference in new issue