mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-08-13 17:53:45 +08:00
优化pile_msg_record插入数据
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, pile_sn, frame_type, connector_code, pile_connector_code, original_msg, json_msg, create_time
|
||||
id, pile_sn, transaction_code, frame_type, connector_code, pile_connector_code, original_msg, json_msg, create_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--@mbg.generated-->
|
||||
@@ -154,6 +154,19 @@
|
||||
</select>
|
||||
|
||||
<select id="queryPileFeedList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from pile_msg_record
|
||||
where pile_sn = #{pileSn,jdbcType=VARCHAR}
|
||||
<if test="frameType != null and frameType != ''">
|
||||
and frame_type = #{frameType,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="transactionCode != null and transactionCode != ''" >
|
||||
and transaction_code = #{transactionCode,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="queryPileFeedListByJsonTransactionCode" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from pile_msg_record
|
||||
@@ -165,4 +178,23 @@
|
||||
and json_msg->>'$.transactionCode' LIKE CONCAT('%', #{transactionCode}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectRetentionCutoffId" resultType="java.lang.Long">
|
||||
select id
|
||||
from pile_msg_record
|
||||
where pile_sn = #{pileSn,jdbcType=VARCHAR}
|
||||
and frame_type = #{frameType,jdbcType=VARCHAR}
|
||||
and frame_type != '0x3B'
|
||||
order by id desc
|
||||
limit #{offset}, 1
|
||||
</select>
|
||||
|
||||
<delete id="deleteOldRecordsBeforeId">
|
||||
delete from pile_msg_record
|
||||
where pile_sn = #{pileSn,jdbcType=VARCHAR}
|
||||
and frame_type = #{frameType,jdbcType=VARCHAR}
|
||||
and frame_type != '0x3B'
|
||||
and id < #{cutoffId,jdbcType=BIGINT}
|
||||
limit #{limit}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user