Browse Source

멀티검색어 trim 처리

eskim 5 years ago
parent
commit
418ebda929

+ 18 - 11
src/main/java/com/style24/persistence/mybatis/shop/TssGoods.xml

@@ -682,9 +682,11 @@
 		 WHERE 1 = 1
 		 AND N.NI_CLSF_CD = #{niClsfCd}
 		 AND N.SUPPLY_COMP_CD =  CASE G.SUPPLY_COMP_CD
-		                                WHEN '1003' THEN '1003'
-		                                WHEN '1004' THEN '1004'
-		                                WHEN '1005' THEN '1005'
+		                                WHEN '1' THEN '1'
+		                                WHEN '2' THEN '2'
+		                                WHEN '3' THEN '3'
+		                                WHEN '4' THEN '4'
+		                                WHEN '5' THEN '5'
 		                                ELSE 'E' 
 		                           END 
 		 ORDER BY  G.GOODS_CD , N.NI_CLSF_CD, N.DISP_ORD
@@ -1941,11 +1943,14 @@
 		     , #{goodsCd} AS GOODS_CD
 		FROM TB_ITEMKIND A
 		INNER JOIN TB_NOTI_INFO B ON A.NI_CLSF_CD = B.NI_CLSF_CD
-		                          AND B.SUPPLY_COMP_CD = (CASE #{supplyCompCd} WHEN '1003' THEN '1003' 
-		                                                                       WHEN '1004' THEN '1004'
-		                                                                       WHEN '1005' THEN '1005'
-		                                                                       ELSE 'E' 
-		                                                    END)             
+		                          AND B.SUPPLY_COMP_CD = (CASE #{supplyCompCd} 
+		                                                  WHEN '1' THEN '1'
+		                                                  WHEN '2' THEN '2'
+		                                                  WHEN '3' THEN '3'
+		                                                  WHEN '4' THEN '4'
+		                                                  WHEN '5' THEN '5'
+		                                                  ELSE 'E' 
+		                                                  END)             
 		WHERE A.ITEMKIND_CD = #{itemkindCd}
 		ORDER BY  B.NI_CLSF_CD, B.DISP_ORD
 	</select>
@@ -2511,9 +2516,11 @@
 		     , B.DISP_ORD
 		FROM TB_NOTI_INFO B
 		WHERE B.SUPPLY_COMP_CD = CASE #{supplyCompCd} 
-		                         WHEN '1003' THEN '1003'
-		                         WHEN '1004' THEN '1004'
-		                         WHEN '1005' THEN '1005'
+		                         WHEN '1' THEN '1'
+		                         WHEN '2' THEN '2'
+		                         WHEN '3' THEN '3'
+		                         WHEN '4' THEN '4'
+		                         WHEN '5' THEN '5'
 		                         ELSE 'E' END 
 		<if test="niClsfCd != null and niClsfCd != ''">
 		AND B.NI_CLSF_CD = #{niClsfCd}

+ 5 - 5
src/main/java/com/style24/scm/biz/web/TssGoodsController.java

@@ -164,7 +164,7 @@ public class TssGoodsController extends TssBaseController {
 
 		// multi row 검색관련 처리
 		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
-			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
+			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").trim().split("\n"));
 
 			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
 				goodsSearch.setSearchGb("EXTEND");
@@ -205,7 +205,7 @@ public class TssGoodsController extends TssBaseController {
 
 		// multi row 검색관련 처리
 		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
-			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
+			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").trim().split("\n"));
 
 			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
 				goodsSearch.setSearchGb("EXTEND");
@@ -1055,7 +1055,7 @@ public class TssGoodsController extends TssBaseController {
 
 		// multi row 검색관련 처리
 		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
-			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
+			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").trim().split("\n"));
 		}
 
 		return goodsService.getNoticeList(goodsSearch);
@@ -1178,7 +1178,7 @@ public class TssGoodsController extends TssBaseController {
 
 		// multi row 검색관련 처리
 		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
-			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
+			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").trim().split("\n"));
 
 			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
 				goodsSearch.setSearchGb("EXTEND");
@@ -1250,7 +1250,7 @@ public class TssGoodsController extends TssBaseController {
 
 		// multi row 검색관련 처리
 		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
-			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
+			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").trim().split("\n"));
 		}
 
 		return goodsService.getFreeGoodsList(goodsSearch);