在数据清洗中会遇到偏移量去拿数据,但有时怎么记录清洗到哪里了吗?
还有清洗过程中你是否感到困惑加字段???
答案如下直接上代码
核心逻辑
@Override
public void handleHistoryFlipTask(String orgId) {
Long startIndex = DefaultValue.Numbers.LONG_1;
log.debug("ulcd handleHistoryFlipTask is start...");
while (true) {
log.debug("ulcd handleHistoryFlipTask startIndex: [{}]", startIndex);
List<BizDraftArrange> bizDraftArrangeList = bizDraftArrangeMapper.selectHistoryFlipTaskData(orgId, startIndex);
log.debug("ulcd handleHistoryFlipTask bizDraftArrangeList is:{}", BeanHelper.bean2Json(bizDraftArrangeList));
this.handleHistoryFlipTask(bizDraftArrangeList);
startIndex = bizDraftArrangeList.get(bizDraftArrangeList.size() - 1).getId();
log.debug("ulcd handleHistoryFlipTask is handle...");
}
}
查询数据
<select id="selectHistoryFlipTaskData" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List">
</include>
FROM ulcd_biz_draft_arrange
WHERE
deleted = 0
<if test="orgId != null">
AND org_id = #{orgId}
</if>
AND (draft_data -> '$.type' = 9 OR draft_data -> '$.type' = 1)
AND id > #{startIndex}
ORDER BY id DESC
LIMIT 5000 ;
</select>
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/101292.html