Merge remote-tracking branch 'origin/main'
commit
17c925244f
@ -0,0 +1,95 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="kr.xit.core.biz.batch.mapper.IBatchCmmMapper">
|
||||||
|
<select id="selectBatchLockByInstanceId" resultType="kr.xit.core.biz.batch.model.BatchCmmDTO$BatchLock">
|
||||||
|
/** batch-cmm-oracle-mapper|findById-배치실행상태조회|julim */
|
||||||
|
SELECT instance_id
|
||||||
|
, use_yn
|
||||||
|
FROM tb_cmm_batch_lock
|
||||||
|
WHERE instance_id = #{instanceId}
|
||||||
|
-- FOR UPDATE
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertBatchLock">
|
||||||
|
/** batch-cmm-oracle-mapper|insertBatchLock-배치락 데이타 생성|julim */
|
||||||
|
INSERT INTO tb_cmm_batch_lock (
|
||||||
|
instance_id,
|
||||||
|
regist_dt,
|
||||||
|
use_yn
|
||||||
|
) VALUES (
|
||||||
|
#{instanceId},
|
||||||
|
sysdate,
|
||||||
|
#{useYn}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="updateBatchLock">
|
||||||
|
/** batch-cmm-oracle-mapper|updateBatchLock-배치 실행 상태 및 결과 반영|julim */
|
||||||
|
UPDATE tb_cmm_batch_lock
|
||||||
|
SET result = #{result}
|
||||||
|
, message = SUBSTR(#{message}, 1, 500)
|
||||||
|
, use_yn = #{useYn}
|
||||||
|
, updt_dt = sysdate
|
||||||
|
WHERE instance_id = #{instanceId}
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertBatchLog">
|
||||||
|
/** batch-cmm-oracle-mapper|insertBatchLog-배치 로그 데이타 생성|julim */
|
||||||
|
<selectKey keyProperty="batchLogId" resultType="string" order="BEFORE">
|
||||||
|
SELECT LPAD(tb_cmm_batch_log_seq.nextval, 20, '0') FROM dual
|
||||||
|
</selectKey>
|
||||||
|
INSERT INTO tb_cmm_batch_log (
|
||||||
|
batch_log_id,
|
||||||
|
instance_id,
|
||||||
|
trace_id,
|
||||||
|
result,
|
||||||
|
message,
|
||||||
|
regist_dt
|
||||||
|
) VALUES (
|
||||||
|
#{batchLogId},
|
||||||
|
#{instanceId},
|
||||||
|
#{traceId},
|
||||||
|
#{result},
|
||||||
|
#{message},
|
||||||
|
sysdate
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="updateBatchLog">
|
||||||
|
/** batch-cmm-oracle-mapper|updateBatchLog-배치 결과 반영|julim */
|
||||||
|
UPDATE tb_cmm_batch_log
|
||||||
|
SET trace_id = NVL(#{traceId}, trace_id)
|
||||||
|
, result = NVL(#{result}, result)
|
||||||
|
, message = NVL(SUBSTR(#{message}, 1, 500), message)
|
||||||
|
, updt_dt = sysdate
|
||||||
|
WHERE batch_log_id = #{batchLogId}
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 배치 관리 -->
|
||||||
|
<sql id="sqlBatchLock">
|
||||||
|
SELECT instance_id
|
||||||
|
, instance_name
|
||||||
|
, instance_url
|
||||||
|
, instance_param
|
||||||
|
, result
|
||||||
|
, use_yn
|
||||||
|
, regist_dt
|
||||||
|
, updt_dt
|
||||||
|
FROM tb_cmm_batch_lock
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectBatchLocks" resultType="kr.xit.core.biz.batch.model.BatchCmmDTO$BatchLock">
|
||||||
|
/** batch-cmm-oracle-mapper|selectBatchLocks-배치 목록 조회|julim */
|
||||||
|
<include refid="sqlBatchLock"/>
|
||||||
|
-- ORDER BY instance_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBatchLock" resultType="kr.xit.core.biz.batch.model.BatchCmmDTO$BatchLock">
|
||||||
|
/** batch-cmm-oracle-mapper|selectBatchLocks-배치 목록 조회|julim */
|
||||||
|
<include refid="sqlBatchLock"/>
|
||||||
|
WHERE instance_id = #{instanceId}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue