Explorar o código

상품 like 관련 쿼리 수정

eskim %!s(int64=5) %!d(string=hai) anos
pai
achega
577cb5c28d

+ 2 - 2
src/main/java/com/style24/admin/biz/web/TsaGoodsController.java

@@ -1860,7 +1860,7 @@ public class TsaGoodsController extends TsaBaseController {
 	@PostMapping("/ep/skip/list")
 	@ResponseBody
 	public GagaMap goodsEpSkipList(@RequestBody GoodsSearch goodsSearch) {
-
+		log.info("[goodsEpSkipList] goodsSearch = {}", goodsSearch);
 		GagaMap result = new GagaMap();
 
 		// 입점업체담당자는 업체코드 설정
@@ -1896,7 +1896,7 @@ public class TsaGoodsController extends TsaBaseController {
 		goodsSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		goodsSearch.setPageable(new TscPageRequest(goodsSearch.getPageNo() - 1, goodsSearch.getPageSize()));
 		goodsSearch.getPageable().setTotalCount(goodsService.getGoodsEpSkipCount(goodsSearch));
-
+		log.info("[goodsEpSkipList] goodsSearch = {}", goodsSearch);
 		result.set("pageing", goodsSearch);
 		result.set("goodsEpSkipList", goodsService.getGoodsEpSkipList(goodsSearch));
 

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

@@ -575,8 +575,8 @@
 					FROM TB_SEARCH_DATA
 					WHERE REG_NO = #{regNo}
 					GROUP BY SEARCH_CD) D
-				WHERE C.GOODS_CD LIKE D.SEARCH_CD||'%'
-				OR C.SUPPLY_GOODS_CD LIKE D.SEARCH_CD||'%'
+				WHERE C.GOODS_CD LIKE CONCAT(D.SEARCH_CD,'%')
+				OR C.SUPPLY_GOODS_CD LIKE CONCAT(D.SEARCH_CD,'%')
 			) A
 			WHERE 1 = 1
 		</if>
@@ -635,8 +635,8 @@
 							WHERE REG_NO = #{regNo}
 							GROUP BY SEARCH_CD
 							) D
-						WHERE C.GOODS_CD LIKE D.SEARCH_CD||'%'
-						OR C.SUPPLY_GOODS_CD LIKE D.SEARCH_CD||'%'
+						WHERE C.GOODS_CD LIKE CONCAT(D.SEARCH_CD,'%')
+						OR C.SUPPLY_GOODS_CD LIKE CONCAT(D.SEARCH_CD,'%')
 					) G
 					JOIN ( SELECT @rownum := 0) R
 					WHERE 1 = 1
@@ -661,13 +661,13 @@
 
 	<sql id="getGoodsCategoryListCondition_sql">
 		<if test='goodsCd != null and goodsCd != ""'>
-			AND UPPER(G.GOODS_CD) LIKE CONCAT('%',UPPER(#{goodsCd}),'%')
+			AND UPPER(G.GOODS_CD) LIKE CONCAT(UPPER(#{goodsCd}),'%')
 		</if>
 		<if test='supplyGoodsCd != null and supplyGoodsCd != ""'>
 			AND G.SUPPLY_GOODS_CD = #{supplyGoodsCd}
 		</if>
 		<if test='goodsNm != null and goodsNm != ""'>
-			AND UPPER(G.GOODS_NM) LIKE CONCAT('%',UPPER(#{goodsNm}),'%')
+			AND UPPER(G.GOODS_NM) LIKE CONCAT(UPPER(#{goodsNm}),'%')
 		</if>
 		<if test='goodsStat != null and goodsStat != ""'>
 			AND G.GOODS_STAT = #{goodsStat}
@@ -884,8 +884,8 @@
 			WHERE REG_NO = #{regNo}
 			GROUP BY SEARCH_CD
 			) D
-			WHERE G.GOODS_CD LIKE D.SEARCH_CD||'%'
-			OR G.SUPPLY_GOODS_CD LIKE D.SEARCH_CD||'%'
+			WHERE G.GOODS_CD LIKE CONCAT(D.SEARCH_CD,'%')
+			OR G.SUPPLY_GOODS_CD LIKE CONCAT(D.SEARCH_CD,'%')
 			) G
 		</if>
 		WHERE A.GOODS_CD = G.GOODS_CD
@@ -961,8 +961,8 @@
 					WHERE REG_NO = #{regNo}
 					GROUP BY SEARCH_CD
 					) D
-					WHERE G.GOODS_CD LIKE D.SEARCH_CD||'%'
-					OR G.SUPPLY_GOODS_CD LIKE D.SEARCH_CD||'%'
+					WHERE G.GOODS_CD LIKE CONCAT(D.SEARCH_CD,'%')
+					OR G.SUPPLY_GOODS_CD LIKE CONCAT(D.SEARCH_CD,'%')
 					) G
 				</if>
 				JOIN ( SELECT @rownum := 0) R
@@ -1020,8 +1020,8 @@
 			WHERE REG_NO = #{regNo}
 			GROUP BY SEARCH_CD
 			) D
-			WHERE G.GOODS_CD LIKE D.SEARCH_CD||'%'
-			OR G.SUPPLY_GOODS_CD LIKE D.SEARCH_CD||'%'
+			WHERE G.GOODS_CD LIKE CONCAT(D.SEARCH_CD,'%')
+			OR G.SUPPLY_GOODS_CD LIKE CONCAT(D.SEARCH_CD,'%')
 			) G
 		</if>
 		WHERE A.GOODS_CD = G.GOODS_CD
@@ -1104,8 +1104,8 @@
 							WHERE REG_NO = #{regNo}
 							GROUP BY SEARCH_CD
 							) D
-							WHERE G.GOODS_CD LIKE D.SEARCH_CD||'%'
-							OR G.SUPPLY_GOODS_CD LIKE D.SEARCH_CD||'%'
+							WHERE G.GOODS_CD LIKE CONCAT(D.SEARCH_CD,'%')
+							OR G.SUPPLY_GOODS_CD LIKE CONCAT(D.SEARCH_CD,'%')
 							) G
 						</if>
 					   JOIN ( SELECT @rownum := 0) R

+ 28 - 28
src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml

@@ -534,28 +534,28 @@
 		              <when test='search != null and search == "searchGoodsCd"'>
 		        AND (
 		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               UPPER(G.GOODS_CD) LIKE CONCAT('%',UPPER(#{item}),'%') 
+		               UPPER(G.GOODS_CD) LIKE CONCAT(UPPER(#{item}),'%') 
 		              </foreach>
 		             )
 		              </when>
 		              <when test='search != null and search == "searchGoodsNm"'>
 		        AND (
 		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               UPPER(G.GOODS_NM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		               UPPER(G.GOODS_NM) LIKE CONCAT(UPPER(#{item}),'%') 
 		              </foreach>
 		             )
 		              </when>
 		               <when test='search != null and search == "searchGoodsNum"'>
 		        AND (
 		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               UPPER(G.GOODS_NUM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		               UPPER(G.GOODS_NUM) LIKE CONCAT(UPPER(#{item}),'%') 
 		              </foreach>
 		             )
 		              </when>
 		              <when test='search != null and search == "searchSupplyGoodsCd"'>
 		        AND (
 		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               UPPER(G.SUPPLY_GOODS_CD) LIKE CONCAT('%',UPPER(#{item}),'%')
+		               UPPER(G.SUPPLY_GOODS_CD) LIKE CONCAT(UPPER(#{item}),'%') 
 		              </foreach>
 		             )
 		              </when>
@@ -571,7 +571,7 @@
 		            </choose>
 		        </if>
 		        <if test="goodsCd != null and goodsCd != ''">
-		        AND UPPER(G.GOODS_CD) LIKE CONCAT('%',UPPER(#{goodsCd}),'%')
+		        AND UPPER(G.GOODS_CD) LIKE CONCAT(UPPER(#{goodsCd}),'%')
 		        </if>
 		        <if test="arrGoodsCd != null and arrGoodsCd.length>0">
 		        AND UPPER(G.GOODS_CD) IN
@@ -580,7 +580,7 @@
 		            </foreach>
 		        </if>
 		         <if test="goodsNm != null and goodsNm != ''">
-		        AND UPPER(G.GOODS_NM) LIKE CONCAT('%',UPPER(#{goodsNm}),'%')
+		        AND UPPER(G.GOODS_NM) LIKE CONCAT(UPPER(#{goodsNm}),'%')
 		        </if>
 		        <if test="goodsType != null and goodsType != ''">
 		        AND G.GOODS_TYPE = #{goodsType}
@@ -1988,7 +1988,7 @@
 		                               AND GR.APPLY_EDDT >= NOW() 
 		    </if>
 		    <if test="goodsTnmRes != null and goodsTnmRes != ''">
-		                               AND UPPER(GR.GOODS_TNM) LIKE CONCAT('%',UPPER(#{goodsTnmRes}),'%')
+		                               AND UPPER(GR.GOODS_TNM) LIKE CONCAT(UPPER(#{goodsTnmRes}),'%')
 		    </if>
 		</if>
 		<if test="searchGb != null and searchGb =='EXCEL'">
@@ -2063,7 +2063,7 @@
 		                                       AND GR.APPLY_EDDT >= NOW() 
 		            </if>
 		            <if test="goodsTnmRes != null and goodsTnmRes != ''">
-		                                       AND UPPER(GR.GOODS_TNM) LIKE CONCAT('%',UPPER(#{goodsTnmRes}),'%')
+		                                       AND UPPER(GR.GOODS_TNM) LIKE CONCAT(UPPER(#{goodsTnmRes}),'%')
 		            </if>
 		        </if>
 		        <if test="searchGb != null and searchGb =='EXCEL'">
@@ -2572,7 +2572,7 @@
 		AND A.USE_YN = #{useYn}
 		</if>
 		<if test="noticeTitle != null and noticeTitle !=''">
-		AND LOWER(A.NOTICE_TITLE) LIKE CONCAT('%',LOWER(#{noticeTitle}),'%')
+		AND LOWER(A.NOTICE_TITLE) LIKE CONCAT(LOWER(#{noticeTitle}),'%')
 		</if>
 		<if test='conditionList != null and conditionList.length>0'>
 		AND A.NOTICE_SQ IN (
@@ -2586,22 +2586,22 @@
 		    <choose>
 		      <when test='search != null and search == "searchGoodsCd"'>
 		          <foreach collection="conditionList" item="item" index="index" separator="or">
-		       UPPER(G.GOODS_CD) LIKE CONCAT('%',UPPER(#{item}),'%') 
+		       UPPER(G.GOODS_CD) LIKE CONCAT(UPPER(#{item}),'%') 
 		          </foreach>
 		      </when>
 		      <when test='search != null and search == "searchGoodsNm"'>
 		          <foreach collection="conditionList" item="item" index="index" separator="or">
-		       UPPER(G.GOODS_NM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		       UPPER(G.GOODS_NM) LIKE CONCAT(UPPER(#{item}),'%') 
 		          </foreach>
 		      </when>
 		      <when test='search != null and search == "searchGoodsNum"'>
 		          <foreach collection="conditionList" item="item" index="index" separator="or">
-		       UPPER(G.GOODS_NUM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		       UPPER(G.GOODS_NUM) LIKE CONCAT(UPPER(#{item}),'%') 
 		          </foreach>
 		      </when>
 		      <when test='search != null and search == "searchSupplyGoodsCd"'>
 		          <foreach collection="conditionList" item="item" index="index" separator="or">
-		       UPPER(G.SUPPLY_GOODS_CD) LIKE CONCAT('%',UPPER(#{item}),'%')
+		       UPPER(G.SUPPLY_GOODS_CD) LIKE CONCAT(UPPER(#{item}),'%') 
 		          </foreach>
 		      </when>
 		    </choose>
@@ -2921,9 +2921,9 @@
 		</if>
 		<if test='brandEnm != null and brandEnm != "" '>
 		AND (
-		     D.BRAND_ENM LIKE #{brandEnm}||'%'
+		     D.BRAND_ENM LIKE CONCAT(#{brandEnm},'%')
 		     OR
-		     D.BRAND_KNM LIKE #{brandEnm}||'%'
+		     D.BRAND_KNM LIKE CONCAT(#{brandEnm},'%')
 		    )
 		</if>
 		<if test='stDate != null and stDate != "" '>
@@ -3062,7 +3062,7 @@
 		    INNER JOIN TB_SUPPLY_COMPANY S ON G.SUPPLY_COMP_CD = S.SUPPLY_COMP_CD
 		    WHERE 1 = 1
 		    <if test="goodsCd != null and goodsCd != ''">
-		    AND UPPER(G.GOODS_CD) LIKE CONCAT('%',UPPER(#{goodsCd}),'%') 
+		    AND UPPER(G.GOODS_CD) LIKE CONCAT(UPPER(#{goodsCd}),'%') 
 		    </if>
 		    <if test="supplyCompCd != null and supplyCompCd != ''">
 		    AND G.SUPPLY_COMP_CD = #{supplyCompCd}
@@ -3399,7 +3399,7 @@
 		AND A.USE_YN = #{useYn}
 		</if>
 		<if test="adKeyword != null and adKeyword !=''">
-		AND LOWER(A.AD_KEYWORD) LIKE CONCAT('%',LOWER(#{adKeyword}),'%')
+		AND LOWER(A.AD_KEYWORD) LIKE CONCAT(LOWER(#{adKeyword}),'%')
 		</if>
 		<if test='goodsCd != null and goodsCd != "" '>
 		AND A.AD_KEYWORD_SQ IN (
@@ -3520,10 +3520,10 @@
 		<if test='condition != null and condition != "" '>
 		    <choose>
 		        <when test='search != null and search == "searchGoodsNm"'>
-		AND UPPER(G.GOODS_NM) LIKE  CONCAT('%',UPPER(#{condition}),'%')
+		AND UPPER(G.GOODS_NM) LIKE  CONCAT(UPPER(#{condition}),'%')
 		        </when>
 				<when test='search != null and search == "searchGoodsCd"'>
-		AND UPPER(G.GOODS_CD) LIKE  CONCAT('%',UPPER(#{condition}),'%')
+		AND UPPER(G.GOODS_CD) LIKE  CONCAT(UPPER(#{condition}),'%')
 				</when>
 		    </choose>
 		</if>
@@ -3609,10 +3609,10 @@
 		              <if test='condition != null and condition != "" '>
 		                  <choose>
 		                      <when test='search != null and search == "searchGoodsNm"'>
-		              AND UPPER(G.GOODS_NM) LIKE  CONCAT('%',UPPER(#{condition}),'%')
+		              AND UPPER(G.GOODS_NM) LIKE  CONCAT(UPPER(#{condition}),'%')
 		                      </when>
 		                      <when test='search != null and search == "searchGoodsCd"'>
-		              AND UPPER(G.GOODS_CD) LIKE  CONCAT('%',UPPER(#{condition}),'%')
+		              AND UPPER(G.GOODS_CD) LIKE  CONCAT(UPPER(#{condition}),'%')
 		                      </when>
 		                  </choose>
 		              </if>
@@ -3743,7 +3743,7 @@
 		      <when test='search != null and search == "searchGoodsNm"'>
 		AND (
 		      <foreach collection="conditionList" item="item" index="index" separator="or">
-		       UPPER(G.GOODS_NM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		       UPPER(G.GOODS_NM) LIKE CONCAT(UPPER(#{item}),'%')
 		      </foreach>
 		     )
 		      </when>
@@ -3797,7 +3797,7 @@
 		INNER JOIN TB_BRAND_SUPPLY S ON B.BRAND_CD = S.BRAND_CD
 		WHERE GOODS_REG_GB IS NULL                                     /* 온라인 미등록 상품 */
 		<if test="modelNo != null and modelNo != ''">
-		AND UPPER(A.MODEL_NO) LIKE CONCAT('%',UPPER(#{modelNo}),'%') 
+		AND UPPER(A.MODEL_NO) LIKE CONCAT(UPPER(#{modelNo}),'%') 
 		</if>
 		<if test="stDate != null and stDate != ''">
 		AND A.REG_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
@@ -3849,7 +3849,7 @@
 		INNER JOIN TB_BRAND_SUPPLY S ON B.BRAND_CD = S.BRAND_CD
 		WHERE GOODS_REG_GB IS NULL   /* 온라인 미등록 상품 */
 		<if test="modelNo != null and modelNo != ''">
-		AND UPPER(A.MODEL_NO) LIKE CONCAT('%',UPPER(#{modelNo}),'%') 
+		AND UPPER(A.MODEL_NO) LIKE CONCAT(UPPER(#{modelNo}),'%') 
 		</if>
 		<if test="stDate != null and stDate != ''">
 		AND A.REG_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
@@ -3938,7 +3938,7 @@
 		        <if test="goodsCds != null and goodsCds != ''">
 		        AND    (
 		                <foreach collection="goodsCds" item="item" index="index" separator="or">
-		                UPPER(GOODS_CD) LIKE CONCAT('%',UPPER(#{item}),'%') 
+		                UPPER(GOODS_CD) LIKE CONCAT(UPPER(#{item}),'%') 
 		                </foreach>
 		               )
 		        </if>
@@ -4419,11 +4419,11 @@
 		-- LEFT OUTER JOIN TB_GOODS B ON A.GOODS_CD = B.GOODS_CD
 		WHERE 1 = 1 
 		<if test='condition != null and condition != "" '>
-		AND (UPPER(A.GOODS_NUM) LIKE CONCAT('%',UPPER(#{condition}),'%')
+		AND (UPPER(A.GOODS_NUM) LIKE CONCAT(UPPER(#{condition}),'%')
 		     OR 
-		     UPPER(A.GOODS_CD) LIKE CONCAT('%',UPPER(#{condition}),'%')
+		     UPPER(A.GOODS_CD) LIKE CONCAT(UPPER(#{condition}),'%')
 		     OR 
-		     UPPER(A.SUPPLY_GOODS_CD) LIKE CONCAT('%',UPPER(#{condition}),'%')
+		     UPPER(A.SUPPLY_GOODS_CD) LIKE CONCAT(UPPER(#{condition}),'%')
 		    )
 		</if>
 		<if test='regSuccYn != null and regSuccYn != "" '>

+ 7 - 7
src/main/java/com/style24/persistence/mybatis/shop/TsaStock.xml

@@ -9,28 +9,28 @@
 		              <when test='search != null and search == "searchGoodsCd"'>
 		        AND (
 		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               UPPER(G.GOODS_CD) LIKE CONCAT('%',UPPER(#{item}),'%') 
+		               UPPER(G.GOODS_CD) LIKE CONCAT(#{item},'%') 
 		              </foreach>
 		             )
 		              </when>
 		              <when test='search != null and search == "searchGoodsNm"'>
 		        AND (
 		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               UPPER(G.GOODS_NM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		               UPPER(G.GOODS_NM) LIKE CONCAT(#{item},'%')
 		              </foreach>
 		             )
 		              </when>
 		              <when test='search != null and search == "searchGoodsNum"'>
 		        AND (
 		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               UPPER(G.GOODS_NUM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		               UPPER(G.GOODS_NUM) LIKE CONCAT(#{item},'%')
 		              </foreach>
 		             )
 		              </when>
 		              <when test='search != null and search == "searchSupplyGoodsCd"'>
 		        AND (
 		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               UPPER(G.SUPPLY_GOODS_CD) LIKE CONCAT('%',UPPER(#{item}),'%')
+		               UPPER(G.SUPPLY_GOODS_CD) LIKE CONCAT(#{item},'%')
 		              </foreach>
 		             )
 		              </when>
@@ -41,15 +41,15 @@
 		        AND 1 = 1
 		              </when>
 		              <otherwise>
-		        AND UPPER(G.REG_ID) LIKE CONCAT('%',UPPER(#{item}),'%')
+		        AND UPPER(G.REG_ID) LIKE CONCAT(#{item},'%')
 		              </otherwise>
 		            </choose>
 		        </if>
 		        <if test="goodsCd != null and goodsCd != ''">
-		        AND UPPER(G.GOODS_CD) LIKE CONCAT('%',UPPER(#{goodsCd}),'%')
+		        AND UPPER(G.GOODS_CD) LIKE CONCAT(#{goodsCd},'%')
 		        </if>
 		         <if test="goodsNm != null and goodsNm != ''">
-		        AND UPPER(G.GOODS_NM) LIKE CONCAT('%',UPPER(#{goodsNm}),'%')
+		        AND UPPER(G.GOODS_NM) LIKE CONCAT(#{goodsNm},'%')
 		        </if>
 		        <if test="goodsType != null and goodsType != ''">
 		        AND G.GOODS_TYPE = #{goodsType}