封装接口,erp定时任务,调用缓存map替换list

This commit is contained in:
liss
2025-09-23 15:52:48 +08:00
parent b3e65d4732
commit db4d708978
37 changed files with 893 additions and 427 deletions

View File

@@ -9,14 +9,61 @@
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<update id="updateBatch">
<foreach collection="toUpdate" item="item" separator=";">
UPDATE sply_erp_fact
<set>
<if test="item.name != null">NAME = #{item.name},</if>
<if test="item.number != null">CPN_ID = #{item.companyId},</if>
</set>
WHERE NUM = #{item.number}
<update id="updateBatchByNumber">
UPDATE sply_erp_cctr
SET
NAME = CASE NUM
<foreach collection="list" item="item">
<if test="item.name != null and item.name != ''">
WHEN #{item.number} THEN #{item.name}
</if>
</foreach>
ELSE NAME
END,
IS_USE = CASE NUM
<foreach collection="list" item="item">
<if test="item.isUse != null and item.isUse != ''">
WHEN #{item.number} THEN #{item.isUse}
</if>
</foreach>
ELSE IS_USE
END,
SCO_NUM = CASE NUM
<foreach collection="list" item="item">
<if test="item.scopeNumber != null and item.scopeNumber != ''">
WHEN #{item.number} THEN #{item.scopeNumber}
</if>
</foreach>
ELSE SCO_NUM
END,
STRT_DT = CASE NUM
<foreach collection="list" item="item">
<if test="item.startDate != null">
WHEN #{item.number} THEN #{item.startDate}
</if>
</foreach>
ELSE STRT_DT
END,
END_DT = CASE NUM
<foreach collection="list" item="item">
<if test="item.endDate != null">
WHEN #{item.number} THEN #{item.endDate}
</if>
</foreach>
ELSE END_DT
END,
SCO_NAME = CASE NUM
<foreach collection="list" item="item">
<if test="item.scopeName != null and item.scopeName != ''">
WHEN #{item.number} THEN #{item.scopeName}
</if>
</foreach>
ELSE SCO_NAME
END
WHERE NUM IN
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item.number}
</foreach>
</update>
</mapper>

View File

@@ -9,14 +9,28 @@
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<update id="updateBatch">
<foreach collection="toUpdate" item="item" separator=";">
UPDATE sply_erp_fact
<set>
<if test="item.name != null">NAME = #{item.name},</if>
<if test="item.number != null">CPN_ID = #{item.companyId},</if>
</set>
WHERE NUM = #{item.number}
</foreach>
</update>
</mapper>
<update id="updateBatchByNumber">
<foreach collection="toUpdate" item="item" separator=";" open="BEGIN" close=";END;">
UPDATE SPLY_ERP_MTRL
<set>
<if test="item.downCtrNum != null">DOWN_CTR_NUM = #{item.downCtrNum},</if>
<if test="item.ctrNum != null">CTR_NUM = #{item.ctrNum},</if>
<if test="item.crtDt != null">CRT_DT = #{item.crtDt},</if>
<if test="item.mtrlTp != null">MTRL_TP = #{item.mtrlTp},</if>
<if test="item.mtrlGrpDt != null">MTRL_GRP_DT = #{item.mtrlGrpDt},</if>
<if test="item.extMtrlGrpDt != null">EXT_MTRL_GRP_DT = #{item.extMtrlGrpDt},</if>
<if test="item.unt != null">UNT = #{item.unt},</if>
<if test="item.untDsp != null">UNT_DSP = #{item.untDsp},</if>
<if test="item.mtrlTpDsp != null">MTRL_TP_DSP = #{item.mtrlTpDsp},</if>
<if test="item.mtrlGrpDsp != null">MTRL_GRP_DSP = #{item.mtrlGrpDsp},</if>
<if test="item.extMtrlGrpDsp != null">EXT_MTRL_GRP_DSP = #{item.extMtrlGrpDsp},</if>
<if test="item.mtrlName != null">MTRL_NAME = #{item.mtrlName},</if>
<if test="item.mtrlLenDsp != null">MTRL_LEN_DSP = #{item.mtrlLenDsp},</if>
<if test="item.tenantId != null">TENANT_ID = #{item.tenantId},</if>
</set>
WHERE DOWN_CTR_NUM = #{item.number}
</foreach>
</update>
</mapper>