You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aggregation-platform/src/com/dao/mapper/data-details-mapper.xml

357 lines
12 KiB

<?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="com.platform.entities.DataInfoEntity">
<id property="id" column="id"/>
<result property="regionalismCode" column="regionalism_code"/>
<result property="cityName" column="city_name"/>
<result property="districtName" column="district_name"/>
<result property="systemCode" column="system_code"/>
<result property="systemName" column="system_name"/>
<result property="dataType" column="data_type"/>
<result property="dataVersion" column="data_version"/>
<result property="submittedBatch" column="submitted_batch"/>
<result property="dataPath" column="data_path"/>
<result property="charset" column="data_charset"/>
<result property="collectingTime" column="collection_time"/>
<result property="collectorContacts" column="collector_contacts"/>
<result property="collectorName" column="collector_name"/>
<result property="extractStatus" column="extract_status"/>
<result property="year" column="data_year"/>
<result property="startYear" column="start_year"/>
<result property="endYear" column="end_year"/>
<result property="volumeIp" column="volume_ip"/>
<result property="volumePath" column="volume_path"/>
<result property="mark" column="mark"/>
<result property="volumePath" column="volume_path"/>
<result property="dataBaseType" column="data_base_type"/>
<result property="execResultLast" column="checkout_indicate_last"/>
<result property="payResultLast" column="checkout_pay_last"/>
<result property="standardExtractStatus" column="standard_extract_status"/>
<result property="checkoutFlag" column="checkout_flag"/>
<result property="mark" column="mark"/>
</resultMap>
<sql id="conditionsFilters">
<if test="dataType!=null">
AND data_details.data_type=#{dataType}
</if>
<if test="mark!=null and mark != ''">
AND data_details.mark=#{mark}
</if>
<if test="submittedBatch!=null">
AND
data_details.submitted_batch=#{submittedBatch}
</if>
<if test="cityName!=null">
AND data_details.city_name=#{cityName}
</if>
<if test="districtName!=null">
AND
data_details.district_name=#{districtName}
</if>
<if test="dataVersion !=null">
AND data_details.data_version=#{dataVersion}
</if>
<if test="systemName !=null">
AND data_details.system_name=#{systemName}
</if>
<if test="dataYear !=null">
AND data_details.data_year=#{dataYear}
</if>
<if test="dataBaseType !=null and dataBaseType !=''">
AND data_details.data_base_type=#{dataBaseType}
</if>
<if test="array !=null and array.size() != 0">
<foreach collection="array" item="item" index="index">
AND CONCAT(regionalism_code,system_code,city_name,district_name,system_name,data_year) LIKE CONCAT('%',CONCAT('${item}','%'))
</foreach>
</if>
</sql>
<!-- 获取数据符合筛选条件的全部记录信息 -->
<select id="getLimitedDataInfoEntities" parameterType="com.platform.form.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,data_base_type,standard_extract_status,checkout_flag,mark
FROM data_details
<where>
<include refid="conditionsFilters" />
<choose>
<when test="offset > 0">
and data_details.id>= #{offset}
</when>
<otherwise>
and data_details.id>=0
</otherwise>
</choose>
</where>
ORDER BY data_details.id
<if test="limit > 0">
LIMIT #{limit}
</if>
</select>
<!-- 获取数据符合筛选条件的全部记录信息 -->
<select id="getLimitedDataInfoByPage" parameterType="com.platform.form.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,data_base_type,standard_extract_status,checkout_flag,mark
FROM data_details
<where>
<include refid="conditionsFilters" />
</where>
ORDER BY data_details.id
</select>
<!-- 获取数据符合筛选条件的全部记录信息 -->
<select id="findAll" 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,data_base_type,standard_extract_status,checkout_flag,mark
FROM data_details
ORDER BY data_details.id
</select>
<select id="countByDataPath" resultType="java.lang.Integer" parameterType="com.platform.entities.DataInfoEntity">
SELECT count(id)
FROM data_info
where data_path=#{dataPath} and remove='0'
</select>
<!-- 获取数据符合筛选条件的全部记录信息 -->
<select id="findById" resultMap="getEntityByText" parameterType="java.lang.Integer">
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,data_base_type,standard_extract_status,checkout_indicate_last,checkout_pay_last,checkout_flag,mark
FROM data_details
WHERE id =#{id}
</select>
<!-- 获取数据 条件:采集时间 -->
<select id="findByParam" resultType="com.platform.entities.DataInfoEntity" parameterType="com.platform.entities.DataInfoEntity">
SELECT
regionalism_code regionalismCode,system_code systemCode,checkout_indicate execResult,checkout_pay payResult
FROM data_details
WHERE
collection_time > #{collectingTime}
ORDER BY data_details.id
</select>
<!-- 获取数据符合筛选条件的总记录条数 -->
<select id="getLimitedDataCount" resultType="java.lang.Integer"
parameterType="com.platform.form.PagerOptions">
SELECT COUNT(id) FROM data_details
<where>
<include refid="conditionsFilters" />
</where>
</select>
<!-- 获取数据查询的起始di -->
<select id="getLimitedBeginId" resultType="java.lang.Integer"
parameterType="com.platform.form.PagerOptions">
SELECT MAX(idx) FROM (SELECT id idx FROM data_details
ORDER BY id LIMIT 0,#{totalLimit}) AS TEMP
</select>
<insert id="save" parameterType="com.platform.entities.DataInfoEntity">
INSERT INTO
data_info(
<trim suffixOverrides=",">
<if test="regionalismCode != null and regionalismCode != ''">
regionalism_code,
</if>
<if test="systemCode != null">
system_code,
</if>
<if test="dataType != null and dataType != ''">
data_type,
</if>
<if test="dataVersion != null">
data_version,
</if>
<if test="submittedBatch != null and submittedBatch != ''">
submitted_batch,
</if>
<if test="dataPath != null and dataPath != ''">
data_path,
</if>
<if test="collectingTime != null">
collection_time,
</if>
<if test="collectorName != null and collectorName != ''">
collector_name,
</if>
<if test="collectorContacts != null and collectorContacts != ''">
collector_contacts,
</if>
<if test="charset != null and charset != ''">
data_charset,
</if>
<if test="year != null and year != ''">
data_year,
</if>
<if test="startYear != null and startYear != ''">
start_year,
</if>
<if test="endYear != null and endYear != ''">
end_year,
</if>
<if test="volumeIp != null and volumeIp != ''">
volume_ip,
</if>
<if test="volumePath != null and volumePath != ''">
volume_path,
</if>
<if test="extractStatus > 0">
extract_status,
</if>
<if test="payResult != null and payResult != ''">
checkout_pay,
</if>
<if test="execResult != null and execResult != ''">
checkout_indicate,
</if>
<if test="startMonth != null and startMonth != ''">
start_month,
</if>
<if test="endMonth != null and endMonth != ''">
end_month,
</if>
<if test="dataBaseType != null and dataBaseType != ''">
data_base_type,
</if>
</trim>
)
VALUES(
<trim suffixOverrides=",">
<if test="regionalismCode != null and regionalismCode != ''">
#{regionalismCode},
</if>
<if test="systemCode != null">
#{systemCode},
</if>
<if test="dataType != null and dataType != ''">
#{dataType},
</if>
<if test="dataVersion != null">
#{dataVersion},
</if>
<if test="submittedBatch != null and submittedBatch != ''">
#{submittedBatch},
</if>
<if test="dataPath != null and dataPath != ''">
#{dataPath},
</if>
<if test="collectingTime != null">
#{collectingTime},
</if>
<if test="collectorName != null and collectorName != ''">
#{collectorName},
</if>
<if test="collectorContacts != null and collectorContacts != ''">
#{collectorContacts},
</if>
<if test="charset != null and charset != ''">
#{charset},
</if>
<if test="year != null and year != ''">
#{year},
</if>
<if test="startYear != null and startYear != ''">
#{startYear},
</if>
<if test="endYear != null and endYear != ''">
#{endYear},
</if>
<if test="volumeIp != null and volumeIp != ''">
#{volumeIp},
</if>
<if test="volumePath != null and volumePath != ''">
#{volumePath},
</if>
<if test="extractStatus > 0">
#{extractStatus},
</if>
<if test="payResult != null and payResult != ''">
#{payResult},
</if>
<if test="execResult != null and execResult != ''">
#{execResult},
</if>
<if test="startMonth != null and startMonth != ''">
#{startMonth},
</if>
<if test="endMonth != null and endMonth != ''">
#{endMonth},
</if>
<if test="dataBaseType != null and dataBaseType != ''">
#{dataBaseType},
</if>
</trim>
)
</insert>
<select id="getIdIsExist" parameterType="java.util.List" resultType="java.lang.String">
select data_path
from data_info
where id in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
and remove ='0'
</select>
<update id="removes" parameterType="java.util.List">
UPDATE
data_info
set remove = '1'
where id in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
and remove ='0'
</update>
<update id="updateExtract" parameterType="com.platform.entities.DataInfoEntity">
UPDATE
data_info
set extract_status = #{extractStatus}
<where>
id = #{id}
AND remove ='0'
</where>
</update>
<update id="update" parameterType="com.platform.entities.DataInfoEntity">
UPDATE
data_info
<set>
<trim suffixOverrides=",">
<if test="dataPath != null and dataPath != ''">
data_path= #{dataPath},
</if>
<if test="extractStatus != null and extractStatus != ''">
extract_status= #{extractStatus},
</if>
<if test="payResultLast != null and payResultLast != ''">
checkout_pay_last= #{payResultLast},
</if>
<if test="execResultLast != null and execResultLast != ''">
checkout_indicate_last= #{execResultLast},
</if>
<if test="checkoutFlag != null and checkoutFlag != ''">
checkout_flag= #{checkoutFlag},
</if>
</trim>
</set>
<where>
id = #{id}
AND remove ='0'
</where>
</update>
</mapper>