Browse Source

관리자 다다익선 등록 오류 수정

jsh77b 4 năm trước cách đây
mục cha
commit
c026b6ab32

+ 14 - 10
src/main/java/com/style24/persistence/mybatis/shop/TsaMorebetter.xml

@@ -644,25 +644,29 @@
 			SELECT T.GOODS_CD
 			     , T.GOODS_GB
 			FROM (
-				<if test="multiSupplyCompCd!= null and multiSupplyCompCd.length>0">
-					SELECT GOODS_CD
-					     , 'G800_10' AS GOODS_GB
-					FROM   TB_GOODS
-					WHERE  SUPPLY_COMP_CD IN
+				
+				SELECT GOODS_CD
+				     , 'G800_10' AS GOODS_GB
+				FROM   TB_GOODS
+				WHERE  1=1
+				<if test="multiSupplyCompCd != null and multiSupplyCompCd.length > 0">
+				AND    SUPPLY_COMP_CD IN
 					<foreach collection="multiSupplyCompCd" item="item" open="(" separator="," close=")">
 					       #{item}
 					</foreach>
-					AND    BRAND_CD IN
+				</if>
+				<if test="multiBrand != null and multiBrand.length > 0">
+				AND    BRAND_CD IN
 					<foreach collection="multiBrand" item="item" open="(" separator="," close=")">
 						   #{item}
 					</foreach>
-					<if test="multiDefaultGoods != null and multiDefaultGoods.length>0">
-					AND    GOODS_CD NOT IN ( ${applySql} )
-					</if>
+				</if>
+				<if test="multiDefaultGoods != null and multiDefaultGoods.length > 0">
+				AND    GOODS_CD IN ( ${applySql} )
 				</if>
 			) T
 			WHERE	1=1
-			<if test="multiExceptGoods!= null and multiExceptGoods.length>0">
+			<if test="multiExceptGoods != null and multiExceptGoods.length >0">
 			AND 	T.GOODS_CD NOT IN ( ${exceptSql} )
 			</if>
 		) Z

+ 5 - 4
src/main/webapp/WEB-INF/views/marketing/MorebetterPopupForm.html

@@ -946,7 +946,7 @@
 	};
 
 	// 브랜드 설정 / 브랜드 추가 콜백함수 (단수로 가져오므로 복수일 경우에 수정 확인 필요)
-	var fnSetPopupBrandInfo = function(result) {
+	var fnSetPopupBrandInfoM = function(result) {
 		
 		var brandCdArr = [];
 		
@@ -1016,7 +1016,7 @@
 	};
 
 	// 분담업체율 설정 / 업체 추가 콜백함수
-	var fnSetPopupApplyBurdenInfo = function(result) {
+	var fnSetPopupApplyBurdenInfoM = function(result) {
 		// 기존 리스트 데이터 for
 		for(let i = 0 ; i < result.length ; i++) {
 			//console.log('old i::'+i+"::"+result[i].supplyCompCd);
@@ -1096,13 +1096,14 @@
 
 	// 공급업체 설정 업체 추가 버튼 클릭시
 	$('#moreBetterForm #btnAddCompany').on('click', function() {
-		cfnOpenCompanyListPopup("fnSetPopupComapnyInfo", "M");
+		cfnOpenCompanyListPopup("fnSetPopupComapnyInfoM", "M");
 	});
 
 	// 브랜드 추가 버튼 클릭시 (복수 브랜드때 수정 필요)
 	$('#moreBetterForm #btnAddBrand').on('click', function() {
-		cfnOpenBrandListPopup("fnSetPopupBrandInfo", "M");
+		cfnOpenBrandListPopup("fnSetPopupBrandInfoM", "M");
 	});
+	
 	// 기준 상품 추가 버튼 클릭시
 	$('#moreBetterForm #btnAddDefaultGoods').on('click', function() {
 		cfnOpenGoodsPopup("fnSetPopupDefaultGoodsInfo");