|
|
|
@ -4,7 +4,7 @@ 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">
|
|
|
|
|
<resultMap id="getEntityByText" type="com.platform.entities.DataInfoEntity">
|
|
|
|
|
<id property="id" column="id" javaType="int" jdbcType="INTEGER" />
|
|
|
|
|
<result property="regionalismCode" column="regionalism_code"
|
|
|
|
|
javaType="string" jdbcType="VARCHAR" />
|
|
|
|
@ -46,43 +46,47 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
|
|
|
|
|
jdbcType="VARCHAR" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
<sql id="conditionsFilters">
|
|
|
|
|
<if test="PagerOptions.dataType!=null">
|
|
|
|
|
and data_details.data_type=#{PagerOptions.dataType}
|
|
|
|
|
<if test="dataType!=null">
|
|
|
|
|
AND data_details.data_type=#{dataType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="PagerOptions.submittedBatch!=null">
|
|
|
|
|
and
|
|
|
|
|
data_details.submitted_batch=#{PagerOptions.submittedBatch}
|
|
|
|
|
<if test="submittedBatch!=null">
|
|
|
|
|
AND
|
|
|
|
|
data_details.submitted_batch=#{submittedBatch}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="PagerOptions.cityName!=null">
|
|
|
|
|
and data_details.city_name=#{PagerOptions.cityName}
|
|
|
|
|
<if test="cityName!=null">
|
|
|
|
|
AND data_details.city_name=#{cityName}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="PagerOptions.districtName!=null">
|
|
|
|
|
and
|
|
|
|
|
data_details.district_name=#{PagerOptions.districtName}
|
|
|
|
|
<if test="districtName!=null">
|
|
|
|
|
AND
|
|
|
|
|
data_details.district_name=#{districtName}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="PagerOptions.dataVersion !=null">
|
|
|
|
|
and data_details.data_version=#{PagerOptions.dataVersion}
|
|
|
|
|
<if test="dataVersion !=null">
|
|
|
|
|
AND data_details.data_version=#{dataVersion}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="PagerOptions.systemName !=null">
|
|
|
|
|
and data_details=#{PagerOptions.systemName}
|
|
|
|
|
<if test="systemName !=null">
|
|
|
|
|
AND data_details.system_name=#{systemName}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="PagerOptions.dataYear !=null">
|
|
|
|
|
and data_details.data_year=#{PagerOptions.dataYear}
|
|
|
|
|
<if test="dataYear !=null">
|
|
|
|
|
AND data_details.data_year=#{dataYear}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="array !=null and array.length > 0">
|
|
|
|
|
<foreach collection="array" item="item" index="index">
|
|
|
|
|
AND CONCAT(regionalism_code,system_code,city_name,district_name,system_name) LIKE CONCAT('%',CONCAT(#{item},'%'))
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<!-- 获取数据符合筛选条件的全部记录信息 -->
|
|
|
|
|
<select id="getLimitedDataInfoEntities" parameterType="PagerOptions"
|
|
|
|
|
<select id="getLimitedDataInfoEntities" parameterType="com.platform.entities.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,extract_status,data_year,start_year,end_year,volume_ip,volume_path
|
|
|
|
|
FROM data_details
|
|
|
|
|
<if test="PagerOptions!=null">
|
|
|
|
|
<where>
|
|
|
|
|
<include refid="conditionsFilters" />
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="PagerOptions.offset > 0">
|
|
|
|
|
and data_details.id>= #{PagerOptions.offset}
|
|
|
|
|
<when test="offset > 0">
|
|
|
|
|
and data_details.id>= #{offset}
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
and data_details.id>=0
|
|
|
|
@ -91,29 +95,26 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
|
|
ORDER BY data_details.id
|
|
|
|
|
<if test="PagerOptions.limit > 0">
|
|
|
|
|
LIMIT #{PagerOptions.limit}
|
|
|
|
|
<if test="limit > 0">
|
|
|
|
|
LIMIT #{limit}
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!-- 获取数据符合筛选条件的总记录条数 -->
|
|
|
|
|
<select id="getLimitedDataCount" resultType="java.lang.Integer"
|
|
|
|
|
parameterType="PagerOptions">
|
|
|
|
|
parameterType="com.platform.entities.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">
|
|
|
|
|
parameterType="com.platform.entities.PagerOptions">
|
|
|
|
|
SELECT MAX(idx) FROM (SELECT id idx FROM data_details
|
|
|
|
|
ORDER BY id LIMIT 0,#{PagerOptions.totalLimit}) AS TEMP
|
|
|
|
|
ORDER BY id LIMIT 0,#{totalLimit}) AS TEMP
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="save" parameterType="com.platform.entities.DataInfoEntity">
|
|
|
|
|