Browse Source

update 수정

dev001 10 months ago
parent
commit
b2d7cd8345

+ 20 - 0
src/main/java/sgc/portal/ei/ei0103/persistence/EI01030001UMapper.java

@@ -35,4 +35,24 @@ public interface EI01030001UMapper {
     int update8(EI01030001U eI01030001U);
     int update8(EI01030001U eI01030001U);
     
     
     int update9(EI01030001U eI01030001U);
     int update9(EI01030001U eI01030001U);
+    
+    
+    int insertOrUpdate1(EI01030001U eI01030001U);
+    
+    int insertOrUpdate2(EI01030001U eI01030001U);
+    
+    int insertOrUpdate3(EI01030001U eI01030001U);
+    
+    int insertOrUpdate4(EI01030001U eI01030001U);
+    
+    int insertOrUpdate5(EI01030001U eI01030001U);
+    
+    int insertOrUpdate6(EI01030001U eI01030001U);
+    
+    int insertOrUpdate7(EI01030001U eI01030001U);
+    
+    int insertOrUpdate8(EI01030001U eI01030001U);
+    
+    int insertOrUpdate9(EI01030001U eI01030001U);
+    
 }
 }

+ 9 - 9
src/main/java/sgc/portal/ei/ei0103/service/EI01030001UService.java

@@ -83,39 +83,39 @@ public class EI01030001UService {
      * UPDATE
      * UPDATE
      */
      */
     private void update1(EI01030001U eI01030001U) {
     private void update1(EI01030001U eI01030001U) {
-        mapper.update1(eI01030001U);
+        mapper.insertOrUpdate1(eI01030001U);
     }
     }
     
     
     private void update2(EI01030001U eI01030001U) {
     private void update2(EI01030001U eI01030001U) {
-        mapper.update2(eI01030001U);
+        mapper.insertOrUpdate2(eI01030001U);
     }
     }
     
     
     private void update3(EI01030001U eI01030001U) {
     private void update3(EI01030001U eI01030001U) {
-        mapper.update3(eI01030001U);
+        mapper.insertOrUpdate3(eI01030001U);
     }
     }
     
     
     private void update4(EI01030001U eI01030001U) {
     private void update4(EI01030001U eI01030001U) {
-        mapper.update4(eI01030001U);
+        mapper.insertOrUpdate4(eI01030001U);
     }
     }
     
     
     private void update5(EI01030001U eI01030001U) {
     private void update5(EI01030001U eI01030001U) {
-        mapper.update5(eI01030001U);
+        mapper.insertOrUpdate5(eI01030001U);
     }
     }
     
     
     private void update6(EI01030001U eI01030001U) {
     private void update6(EI01030001U eI01030001U) {
-        mapper.update6(eI01030001U);
+        mapper.insertOrUpdate6(eI01030001U);
     }
     }
     
     
     private void update7(EI01030001U eI01030001U) {
     private void update7(EI01030001U eI01030001U) {
-        mapper.update7(eI01030001U);
+        mapper.insertOrUpdate7(eI01030001U);
     }
     }
     
     
     private void update8(EI01030001U eI01030001U) {
     private void update8(EI01030001U eI01030001U) {
-        mapper.update8(eI01030001U);
+        mapper.insertOrUpdate8(eI01030001U);
     }
     }
     
     
     private void update9(EI01030001U eI01030001U) {
     private void update9(EI01030001U eI01030001U) {
-        mapper.update9(eI01030001U);
+        mapper.insertOrUpdate9(eI01030001U);
     }
     }
     
     
 }
 }

+ 161 - 0
src/main/resources/sqlmap/mappers/ei/ei0103/EI01030001UMapper.xml

@@ -816,6 +816,24 @@
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
     </update>
     </update>
     
     
+    <update id="insertOrUpdate1">
+     MERGE 
+      INTO EIS_MI_PL_ETEC A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET SLAMT_PLAN = #{plan}
+		     , SLAMT_PFMC_RV = #{pfmcRv}
+		     , SLAMT_FCST = #{fcst}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.SLAMT_PLAN , A.SLAMT_PFMC_RV, A.SLAMT_FCST, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd},#{plan} ,#{pfmcRv}, #{fcst}, #{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update2">
     <update id="update2">
 		UPDATE EIS_MI_PL_ETEC
 		UPDATE EIS_MI_PL_ETEC
 		   SET SLPCOST_PLAN = #{plan}
 		   SET SLPCOST_PLAN = #{plan}
@@ -829,6 +847,24 @@
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
     </update>
     </update>
     
     
+    <update id="insertOrUpdate2">
+     MERGE 
+      INTO EIS_MI_PL_ETEC A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET SLPCOST_PLAN = #{plan}
+		     , SLPCOST_PFMC_RV = #{pfmcRv}
+		     , SLPCOST_FCST = #{fcst}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.SLPCOST_PLAN , A.SLPCOST_PFMC_RV, A.SLPCOST_FCST, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd},#{plan} ,#{pfmcRv}, #{fcst},#{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update3">
     <update id="update3">
 		UPDATE EIS_MI_PL_ETEC
 		UPDATE EIS_MI_PL_ETEC
 		   SET SLPROF_PLAN = #{plan}
 		   SET SLPROF_PLAN = #{plan}
@@ -842,6 +878,24 @@
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
     </update>
     </update>
 
 
+    <update id="insertOrUpdate3">
+     MERGE 
+      INTO EIS_MI_PL_ETEC A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET SLPROF_PLAN = #{plan}
+		     , SLPROF_PFMC_RV = #{pfmcRv}
+		     , SLPROF_FCST = #{fcst}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.SLPROF_PLAN , A.SLPROF_PFMC_RV, A.SLPROF_FCST, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd},#{plan} ,#{pfmcRv}, #{fcst},#{wrteDt}, #{wrtePr})
+    </update>
+
+
 	<update id="update4">
 	<update id="update4">
 		UPDATE EIS_MI_PL_ETEC
 		UPDATE EIS_MI_PL_ETEC
 		   SET SMCOST_PLAN = #{plan}
 		   SET SMCOST_PLAN = #{plan}
@@ -855,6 +909,24 @@
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
     </update>
     </update>
     
     
+    <update id="insertOrUpdate4">
+     MERGE 
+      INTO EIS_MI_PL_ETEC A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET SMCOST_PLAN = #{plan}
+		     , SMCOST_PFMC_RV = #{pfmcRv}
+		     , SMCOST_FCST = #{fcst}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.SMCOST_PLAN , A.SMCOST_PFMC_RV, A.SMCOST_FCST, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd},#{plan} ,#{pfmcRv}, #{fcst},#{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update5">
     <update id="update5">
 		UPDATE EIS_MI_PL_ETEC
 		UPDATE EIS_MI_PL_ETEC
 		   SET SMCOST_BZ_PLAN = #{plan}
 		   SET SMCOST_BZ_PLAN = #{plan}
@@ -868,6 +940,24 @@
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
     </update>
     </update>
     
     
+    <update id="insertOrUpdate5">
+     MERGE 
+      INTO EIS_MI_PL_ETEC A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET SMCOST_BZ_PLAN = #{plan}
+		     , SMCOST_BZ_PFMC_RV = #{pfmcRv}
+		     , SMCOST_BZ_FCST = #{fcst}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.SMCOST_BZ_PLAN, A.SMCOST_BZ_PFMC_RV, A.SMCOST_BZ_FCST, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd},#{plan} ,#{pfmcRv}, #{fcst},#{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update6">
     <update id="update6">
 		UPDATE EIS_MI_PL_ETEC
 		UPDATE EIS_MI_PL_ETEC
 		   SET SMCOST_SPT_PLAN = #{plan}
 		   SET SMCOST_SPT_PLAN = #{plan}
@@ -881,6 +971,24 @@
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
     </update>
     </update>
     
     
+    <update id="insertOrUpdate6">
+     MERGE 
+      INTO EIS_MI_PL_ETEC A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET SMCOST_SPT_PLAN = #{plan}
+		     , SMCOST_SPT_PFMC_RV = #{pfmcRv}
+		     , SMCOST_SPT_FCST = #{fcst}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.SMCOST_SPT_PLAN , A.SMCOST_SPT_PFMC_RV, A.SMCOST_SPT_FCST, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd},#{plan} ,#{pfmcRv}, #{fcst},#{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update7">
     <update id="update7">
 		UPDATE EIS_MI_PL_ETEC
 		UPDATE EIS_MI_PL_ETEC
 		   SET SMCOST_TMP_PLAN = #{plan}
 		   SET SMCOST_TMP_PLAN = #{plan}
@@ -894,6 +1002,24 @@
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
     </update>
     </update>
     
     
+    <update id="insertOrUpdate7">
+     MERGE 
+      INTO EIS_MI_PL_ETEC A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET SMCOST_TMP_PLAN = #{plan}
+		     , SMCOST_TMP_PFMC_RV = #{pfmcRv}
+		     , SMCOST_TMP_FCST = #{fcst}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.SMCOST_TMP_PLAN , A.SMCOST_TMP_PFMC_RV, A.SMCOST_TMP_FCST, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd},#{plan} ,#{pfmcRv}, #{fcst}, #{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update8">
     <update id="update8">
 		UPDATE EIS_MI_PL_ETEC
 		UPDATE EIS_MI_PL_ETEC
 		   SET SMCOST_ONSL_PLAN = #{plan}
 		   SET SMCOST_ONSL_PLAN = #{plan}
@@ -907,6 +1033,24 @@
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
     </update>
     </update>
     
     
+    <update id="insertOrUpdate8">
+     MERGE 
+      INTO EIS_MI_PL_ETEC A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET SMCOST_ONSL_PLAN = #{plan}
+		     , SMCOST_ONSL_PFMC_RV = #{pfmcRv}
+		     , SMCOST_ONSL_FCST = #{fcst}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.SMCOST_ONSL_PLAN , A.SMCOST_ONSL_PFMC_RV, A.SMCOST_ONSL_FCST, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd},#{plan} ,#{pfmcRv}, #{fcst},#{wrteDt}, #{wrtePr})
+    </update>
+    
+    
     <update id="update9">
     <update id="update9">
 		UPDATE EIS_MI_PL_ETEC
 		UPDATE EIS_MI_PL_ETEC
 		   SET BZPROF_PLAN = #{plan}
 		   SET BZPROF_PLAN = #{plan}
@@ -919,5 +1063,22 @@
 		   AND PMONTH = #{pmonth}
 		   AND PMONTH = #{pmonth}
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
 		   AND CCGRP_GB_CD = #{ccgrpGbCd}
     </update>
     </update>
+    
+    <update id="insertOrUpdate9">
+     MERGE 
+      INTO EIS_MI_PL_ETEC A
+     USING dual
+        ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
+      WHEN MATCHED THEN
+		UPDATE 
+		   SET BZPROF_PLAN = #{plan}
+		     , BZPROF_PFMC_RV = #{pfmcRv}
+		     , BZPROF_FCST = #{fcst}
+		     , MDFT_DT = #{mdftDt}
+		     , MDFT_PR = #{mdftPr}
+      WHEN NOT MATCHED THEN
+           INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.BZPROF_PLAN , A.BZPROF_PFMC_RV, A.BZPROF_FCST, A.WRTE_DT, A.WRTE_PR)
+           VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd},#{plan} ,#{pfmcRv}, #{fcst},#{wrteDt}, #{wrtePr})
+    </update>
 
 
 </mapper>
 </mapper>

+ 13 - 16
src/main/webapp/ux/ei/ei0103/EI01030001U.xml

@@ -572,22 +572,6 @@
     * 함 수 명 : scwin.grdData1_onviewchange
     * 함 수 명 : scwin.grdData1_onviewchange
     * 기   능 : 그리드 값 변경 이벤트 함수
     * 기   능 : 그리드 값 변경 이벤트 함수
     ***************************************************************************/
     ***************************************************************************/
-    /*
-	scwin.grdData1_onviewchange = function(info) {
-		// 조회결과 수정전 데이터
-		var oldVal = dcdataList1.getOriginalCellData(info.rowIndex, info.colIndex);
-		var str = dcdataList1.getColumnID(info.colIndex);
-		var num = str.substr(str.length - 2, 2);
-		
-		// 수정여부 데이터 설정
-		if(oldVal == info.newValue){  // 데이터 미변경
-			dcdataList1.setCellData(info.rowIndex , "udtYn" + num , "");
-		}
-		else {
-			dcdataList1.setCellData(info.rowIndex , "udtYn" + num , "Y");
-		}
-	};
-	*/
 	scwin.grdData1_onviewchange = function(info) {
 	scwin.grdData1_onviewchange = function(info) {
 		// 조회결과 수정전 데이터
 		// 조회결과 수정전 데이터
 		var oldVal = dcdataList1.getOriginalCellData(info.rowIndex, info.colIndex);
 		var oldVal = dcdataList1.getOriginalCellData(info.rowIndex, info.colIndex);
@@ -633,6 +617,19 @@
 			                + Number(dcdataList1.getCellData(smcostOnsf, str));
 			                + Number(dcdataList1.getCellData(smcostOnsf, str));
 			dcdataList1.setCellData(smcost, str, smcostVal);
 			dcdataList1.setCellData(smcost, str, smcostVal);
 			
 			
+			// [판매관리비 - 판매관리비] 저장 플래그
+			oldVal = dcdataList1.getOriginalCellData(smcost, info.colIndex);
+			// console.log("[판매관리비 - 판매관리비] oldVal : " + oldVal);
+			// console.log("[판매관리비 - 판매관리비] smcostVal : " + smcostVal);
+			
+			// 수정여부 데이터 설정 [판매관리비 - 판매관리비]
+			if(oldVal == smcostVal){  // 데이터 미변경 [판매관리비 - 판매관리비]
+				dcdataList1.setCellData(smcost , "udtYn" + num , "");
+			}
+			else {
+				dcdataList1.setCellData(smcost , "udtYn" + num , "Y");
+			}
+			
 			var dtlGbCd = dcdataList1.getCellData(info.rowIndex, "dtlGbCd");  
 			var dtlGbCd = dcdataList1.getCellData(info.rowIndex, "dtlGbCd");  
 			if(dtlGbCd == "SMCOST"){  // 구분코드(상세) - SMCOST 판매관리비
 			if(dtlGbCd == "SMCOST"){  // 구분코드(상세) - SMCOST 판매관리비
 				commLib.getAlertAfterProc("[판매관리비] 데이터는 변경되지 않습니다.","데이터확인","V","","");
 				commLib.getAlertAfterProc("[판매관리비] 데이터는 변경되지 않습니다.","데이터확인","V","","");