Browse Source

업데이트 수정

dev001 10 months ago
parent
commit
abdf919f62

+ 16 - 0
src/main/java/sgc/portal/ei/ei0105/persistence/EI01050001UMapper.java

@@ -31,4 +31,20 @@ public interface EI01050001UMapper {
     int update6(EI01050001U eI01050001U);
     
     int update7(EI01050001U eI01050001U);
+    
+    
+    int insertOrUpdate1(EI01050001U eI01050001U);
+    
+    int insertOrUpdate2(EI01050001U eI01050001U);
+    
+    int insertOrUpdate3(EI01050001U eI01050001U);
+    
+    int insertOrUpdate4(EI01050001U eI01050001U);
+    
+    int insertOrUpdate5(EI01050001U eI01050001U);
+    
+    int insertOrUpdate6(EI01050001U eI01050001U);
+    
+    int insertOrUpdate7(EI01050001U eI01050001U);
+    
 }

+ 7 - 7
src/main/java/sgc/portal/ei/ei0105/service/EI01050001UService.java

@@ -77,30 +77,30 @@ public class EI01050001UService {
      * UPDATE
      */
     private void update1(EI01050001U eI01050001U) {
-        mapper.update1(eI01050001U);
+        mapper.insertOrUpdate1(eI01050001U);
     }
     
     private void update2(EI01050001U eI01050001U) {
-        mapper.update2(eI01050001U);
+        mapper.insertOrUpdate2(eI01050001U);
     }
     
     private void update3(EI01050001U eI01050001U) {
-        mapper.update3(eI01050001U);
+        mapper.insertOrUpdate3(eI01050001U);
     }
     
     private void update4(EI01050001U eI01050001U) {
-        mapper.update4(eI01050001U);
+        mapper.insertOrUpdate4(eI01050001U);
     }
     
     private void update5(EI01050001U eI01050001U) {
-        mapper.update5(eI01050001U);
+        mapper.insertOrUpdate5(eI01050001U);
     }
     
     private void update6(EI01050001U eI01050001U) {
-        mapper.update6(eI01050001U);
+        mapper.insertOrUpdate6(eI01050001U);
     }
     
     private void update7(EI01050001U eI01050001U) {
-        mapper.update7(eI01050001U);
+        mapper.insertOrUpdate7(eI01050001U);
     }
 }

+ 112 - 0
src/main/resources/sqlmap/mappers/ei/ei0105/EI01050001UMapper.xml

@@ -347,6 +347,22 @@
 		   AND GRPCOMP_GB_CD = #{grpcompGbCd}
     </update>
     
+    <update id="insertOrUpdate1">
+     MERGE 
+      INTO EIS_MI_FISTMT A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND GRPCOMP_GB_CD = #{grpcompGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET ASSET_CURR_AMT_RV = #{amtRv}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.GRPCOMP_GB_CD, A.ASSET_CURR_AMT_RV, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{grpcompGbCd},#{amtRv},#{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update2">
 		UPDATE EIS_MI_FISTMT
 		   SET ASSET_NCURR_AMT_RV = #{amtRv}
@@ -358,6 +374,22 @@
 		   AND GRPCOMP_GB_CD = #{grpcompGbCd}
     </update>
     
+    <update id="insertOrUpdate2">
+     MERGE 
+      INTO EIS_MI_FISTMT A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND GRPCOMP_GB_CD = #{grpcompGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET ASSET_NCURR_AMT_RV = #{amtRv}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.GRPCOMP_GB_CD, A.ASSET_NCURR_AMT_RV, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{grpcompGbCd},#{amtRv}, #{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update3">
 		UPDATE EIS_MI_FISTMT
 		   SET ASSET_CASH_AMT_RV = #{amtRv}
@@ -369,6 +401,22 @@
 		   AND GRPCOMP_GB_CD = #{grpcompGbCd}
     </update>
     
+    <update id="insertOrUpdate3">
+     MERGE 
+      INTO EIS_MI_FISTMT A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND GRPCOMP_GB_CD = #{grpcompGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET ASSET_CASH_AMT_RV = #{amtRv}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.GRPCOMP_GB_CD, A.ASSET_CASH_AMT_RV, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{grpcompGbCd}, #{amtRv}, #{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update4">
 		UPDATE EIS_MI_FISTMT
 		   SET LIAB_CURR_AMT_RV = #{amtRv}
@@ -380,6 +428,22 @@
 		   AND GRPCOMP_GB_CD = #{grpcompGbCd}
     </update>
     
+    <update id="insertOrUpdate4">
+     MERGE 
+      INTO EIS_MI_FISTMT A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND GRPCOMP_GB_CD = #{grpcompGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET LIAB_CURR_AMT_RV = #{amtRv}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.GRPCOMP_GB_CD, A.LIAB_CURR_AMT_RV, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{grpcompGbCd}, #{amtRv}, #{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update5">
 		UPDATE EIS_MI_FISTMT
 		   SET LIAB_NCURR_AMT_RV = #{amtRv}
@@ -391,6 +455,22 @@
 		   AND GRPCOMP_GB_CD = #{grpcompGbCd}
     </update>
     
+    <update id="insertOrUpdate5">
+     MERGE 
+      INTO EIS_MI_FISTMT A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND GRPCOMP_GB_CD = #{grpcompGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET LIAB_NCURR_AMT_RV = #{amtRv}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.GRPCOMP_GB_CD, A.LIAB_NCURR_AMT_RV, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{grpcompGbCd}, #{amtRv}, #{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update6">
 		UPDATE EIS_MI_FISTMT
 		   SET LIAB_BR_AMT_RV = #{amtRv}
@@ -402,6 +482,22 @@
 		   AND GRPCOMP_GB_CD = #{grpcompGbCd}
     </update>
     
+    <update id="insertOrUpdate6">
+     MERGE 
+      INTO EIS_MI_FISTMT A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND GRPCOMP_GB_CD = #{grpcompGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET LIAB_BR_AMT_RV = #{amtRv}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.GRPCOMP_GB_CD, A.LIAB_BR_AMT_RV, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{grpcompGbCd}, #{amtRv}, #{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update7">
 		UPDATE EIS_MI_FISTMT
 		   SET INTE_COST_AMT_RV = #{amtRv}
@@ -413,4 +509,20 @@
 		   AND GRPCOMP_GB_CD = #{grpcompGbCd}
     </update>
     
+    <update id="insertOrUpdate7">
+     MERGE 
+      INTO EIS_MI_FISTMT A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND GRPCOMP_GB_CD = #{grpcompGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET INTE_COST_AMT_RV = #{amtRv}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.GRPCOMP_GB_CD, A.INTE_COST_AMT_RV, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{grpcompGbCd}, #{amtRv}, #{wrteDt}, #{wrtePr})
+    </update>
+    
+    
 </mapper>