|
|
|
@ -44,121 +44,4 @@
|
|
|
|
|
data_ysp t1 where t1.id <![CDATA[>]]> #{maxid} limit 10000
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectUpload" resultMap="BaseResultMap">
|
|
|
|
|
<!-- select-->
|
|
|
|
|
<!-- <include refid="Base_Column_List"/>-->
|
|
|
|
|
<!-- from data_ysp-->
|
|
|
|
|
<!-- where isupload is null or isupload = #{isupload} order by id desc limit 1-->
|
|
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
|
t1.id, t1.eqmid, t1.acquisitionTime, t1.H2, t1.CH4, t1.C2H6, t1.C2H4, t1.C2H2,t1.CO, t1.CO2, t1.O2, t1.N2,
|
|
|
|
|
t1.TotalHydrocarbon,
|
|
|
|
|
t1.isupload, t1.create_time, t1.update_time
|
|
|
|
|
FROM
|
|
|
|
|
data_ysp t1
|
|
|
|
|
INNER JOIN ( SELECT MAX( id ) AS id FROM data_ysp where isupload is null or isupload = #{isupload} GROUP BY
|
|
|
|
|
eqmid ) t2 ON t1.id = t2.id
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Ysp">
|
|
|
|
|
update data_ysp
|
|
|
|
|
<set>
|
|
|
|
|
<if test="isupload != null">
|
|
|
|
|
isupload = #{isupload,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
where
|
|
|
|
|
id <![CDATA[<=]]> #{maxid}
|
|
|
|
|
<if test="idlist != null and idlist.size > 0">
|
|
|
|
|
and id not in
|
|
|
|
|
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateList">
|
|
|
|
|
update data_ysp
|
|
|
|
|
<set>
|
|
|
|
|
<if test="isupload != null">
|
|
|
|
|
isupload = #{isupload,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
where
|
|
|
|
|
id in
|
|
|
|
|
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateDataList">
|
|
|
|
|
update data_ysp
|
|
|
|
|
<set>
|
|
|
|
|
<if test="isupload != null">
|
|
|
|
|
isupload = #{isupload,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
where isupload is null
|
|
|
|
|
<if test="idlist != null and idlist.size > 0">
|
|
|
|
|
and (
|
|
|
|
|
<foreach collection="idlist" item="item" index="index" separator="or">
|
|
|
|
|
(
|
|
|
|
|
<if test="item.eqmid != null">
|
|
|
|
|
eqmid = #{item.eqmid}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="item.maxid != null">
|
|
|
|
|
and id <![CDATA[<=]]> #{item.maxid}
|
|
|
|
|
</if>
|
|
|
|
|
)
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateDataList2">
|
|
|
|
|
update data_ysp
|
|
|
|
|
<set>
|
|
|
|
|
<if test="isupload != null">
|
|
|
|
|
isupload = #{isupload,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
where isupload is null
|
|
|
|
|
and id <![CDATA[<=]]> #{maxid}
|
|
|
|
|
<if test="idlist != null and idlist.size > 0">
|
|
|
|
|
and eqmid in
|
|
|
|
|
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteData" >
|
|
|
|
|
delete
|
|
|
|
|
from data_ysp
|
|
|
|
|
where acquisitionTime <![CDATA[<]]> #{time}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
</mapper>
|