Pārlūkot izejas kodu

상품> 사은품관리 조회 및 화면 개선

tsit05 4 gadi atpakaļ
vecāks
revīzija
3c5cbe1fc6

+ 4 - 0
src/main/java/com/style24/persistence/domain/FreeGoods.java

@@ -26,4 +26,8 @@ public class FreeGoods extends TscBaseDomain {
 	private String searchTxt;		// 팝업 검색어
 	private String callbackFn;		// 팝업 리콜펑션명
 	private String brandEnm;		// 브랜드명
+	
+	private String skucode;  
+	private String skumodelno; 
+	
 }

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

@@ -3928,61 +3928,94 @@
 	<!-- 사은품 목록 -->
 	<select id="getFreeGoodsList" parameterType="GoodsSearch" resultType="FreeGoods">
 		/* TsaGoods.getFreeGoodsList */
-		SELECT G.PRODUCT_NO
-		     , G.PRODUCT_CODE
-		     , G.GOODS_NM
-		     , G.USE_YN
-		     , G.SYS_IMG_NM
-		     , G.BRAND_CD
-		     , B.BRAND_ENM
-		     , FN_GET_USER_NM(G.REG_NO) AS REG_NM
-		     , DATE_FORMAT(G.REG_DT,'%Y%m%d%H%i%S') AS REG_DT
-		     , FN_GET_USER_NM(G.UPD_NO) AS UPD_NM
-		     , DATE_FORMAT(G.UPD_DT,'%Y%m%d%H%i%S') AS UPD_DT
-		FROM TB_FREE_GOODS G
-		INNER JOIN TB_BRAND B ON G.BRAND_CD = B.BRAND_CD
-		INNER JOIN TB_BRAND_SUPPLY BS ON G.BRAND_CD = BS.BRAND_CD
-		WHERE 1 = 1
-		<if test='conditionList != null and conditionList.length>0'>
-		    <choose>
-		      <when test='search != null and search == "searchProductNo"'>
-		AND (
-		      <foreach collection="conditionList" item="item" index="index" separator="or">
-		       G.PRODUCT_NO = #{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}),'%')
-		      </foreach>
-		     )
-		      </when>
-		      <otherwise>
-		AND 1 = 1
-		      </otherwise>
-		    </choose>
-		</if>
-		<if test="supplyCompCd != null and supplyCompCd != ''">
-		AND BS.SUPPLY_COMP_CD = #{supplyCompCd}
-		</if>
-		<if test="multiBrand != null and multiBrand != ''">
-		AND B.BRAND_CD IN
-		    <foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
-		#{item}
-		    </foreach>
-		</if>
-		<if test='dateGbn != null and dateGbn == "R"'>
-		    <if test="stDate != null and stDate != ''">
-		AND G.REG_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
-		    </if>
-		    <if test="edDate != null and edDate != ''">
-		    <![CDATA[
-		AND G.REG_DT < DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
-		    ]]>
-		    </if>
-		</if>
+		SELECT G.* FROM (
+			SELECT G.PRODUCT_NO
+			     , G.PRODUCT_CODE
+			     , G.GOODS_NM
+			     , G.USE_YN
+			     , G.SYS_IMG_NM
+			     , G.BRAND_CD
+			     , B.BRAND_ENM
+			     , FN_GET_USER_NM(G.REG_NO) AS REG_NM
+			     , DATE_FORMAT(G.REG_DT,'%Y%m%d%H%i%S') AS REG_DT
+			     , FN_GET_USER_NM(G.UPD_NO) AS UPD_NM
+			     , DATE_FORMAT(G.UPD_DT,'%Y%m%d%H%i%S') AS UPD_DT
+			     , (SELECT MAX(SKUCODE) FROM TB_IF_INCOMELOTITEM INC WHERE INC.PRODUCTNO = G.PRODUCT_NO ) AS SKUCODE
+			     , (SELECT MAX(SKUMODELNO) FROM TB_IF_INCOMELOTITEM INC WHERE INC.PRODUCTNO = G.PRODUCT_NO ) AS SKUMODELNO
+			FROM TB_FREE_GOODS G
+			INNER JOIN TB_BRAND B ON G.BRAND_CD = B.BRAND_CD
+			INNER JOIN TB_BRAND_SUPPLY BS ON G.BRAND_CD = BS.BRAND_CD
+			WHERE 1 = 1
+			<if test='conditionList != null and conditionList.length>0'>
+			    <choose>
+			      <when test='search != null and search == "searchProductNo"'>
+			AND (
+			      <foreach collection="conditionList" item="item" index="index" separator="or">
+			       G.PRODUCT_NO = #{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}),'%')
+			      </foreach>
+			     )
+			      </when>
+			      <when test='search != null and search == "searchProductCode"'>
+			AND (
+			      <foreach collection="conditionList" item="item" index="index" separator="or">
+			       UPPER(G.PRODUCT_CODE) LIKE CONCAT(UPPER(#{item}),'%')
+			      </foreach>
+			     )
+			      </when>			      
+			      <otherwise>
+			AND 1 = 1
+			      </otherwise>
+			    </choose>
+			</if>
+			<if test="supplyCompCd != null and supplyCompCd != ''">
+			AND BS.SUPPLY_COMP_CD = #{supplyCompCd}
+			</if>
+			<if test="multiBrand != null and multiBrand != ''">
+			AND B.BRAND_CD IN
+			    <foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
+			#{item}
+			    </foreach>
+			</if>
+			<if test='dateGbn != null and dateGbn == "R"'>
+			    <if test="stDate != null and stDate != ''">
+			AND G.REG_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
+			    </if>
+			    <if test="edDate != null and edDate != ''">
+			    <![CDATA[
+			AND G.REG_DT < DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
+			    ]]>
+			    </if>
+			</if>
+		) G
+		WHERE 1=1
+			<if test='conditionList != null and conditionList.length>0'>
+			    <choose>
+			      <when test='search != null and search == "searchSkucode"'>
+			AND (
+			      <foreach collection="conditionList" item="item" index="index" separator="or">
+			       G.SKUCODE = #{item}
+			      </foreach>
+			     )
+			      </when>
+			      <when test='search != null and search == "searchSkumodelno"'>
+			AND (
+			      <foreach collection="conditionList" item="item" index="index" separator="or">
+			       UPPER(G.SKUMODELNO) LIKE CONCAT(UPPER(#{item}),'%')
+			      </foreach>
+			     )
+			      </when>
+			      <otherwise>
+			AND 1 = 1
+			      </otherwise>
+			    </choose>
+			</if>		
 		ORDER BY G.PRODUCT_NO DESC
 	</select>
 

+ 11 - 6
src/main/webapp/WEB-INF/views/goods/GoodsFreeGoodsForm.html

@@ -47,9 +47,11 @@
 						<th rowspan="2">키워드</th>
 						<td rowspan="2">
 							<select name="search" id="search">
-								<option value="searchProductNo">사은품번호</option>
+								<option value="searchProductNo">WMS상품번호</option>
 								<option value="searchGoodsNm">사은품명</option>
-								<option value="searchGoodsNum">품번</option>
+								<option value="searchProductCode">WMS상품코드</option>
+								<option value="searchSkucode">SKUCODE</option>
+								<option value="searchSkumodelno">SKUMODELNO</option>
 							</select>
 							<textarea class="textareaR2 w130" name="condition" id="condition"></textarea>
 						</td>
@@ -95,9 +97,9 @@
 						<td colspan='10'>사은품 상세</td>
 					</tr>
 					<tr>
-						<th>사은품번호</th>
+						<th>WMS상품번호</th>
 						<td>
-							<input class="w130" type="text"  name="productNo"  data-valid-name="사은품번호"  readonly="readonly"/>
+							<input class="w130" type="text"  name="productNo"  data-valid-name="wms상품번호"  readonly="readonly"/>
 						</td>
 						<th>품번</th>
 						<td>
@@ -155,13 +157,16 @@
 			}
 		},
 		{headerName: "브랜드", field: "brandEnm", width: 130, cellClass: 'text-center'},
-		{headerName: "사은품 상품번호", field: "productNo", width: 120, cellClass: 'text-center',
+		{headerName: "wms상품번호", field: "productNo", width: 120, cellClass: 'text-center',
 			cellRenderer: function(params) {
 				return '<a href="javascript:void(0);">' + params.value + '</a>';
 			}
 		},
-		{headerName: "사은품 품번", field: "goodsNum", width: 150, cellClass: 'text-center'},
+		{headerName: "WMS상품코드", field: "productCode", width: 100, cellClass: 'text-center'},
+		{headerName: "SKUCODE", field: "skucode", width: 90, cellClass: 'text-center'},		
  		{headerName: "사은품명", field: "goodsNm", width: 300, cellClass: 'text-left'},
+ 		{headerName: "SKUMODELNO", field: "skumodelno", width: 100, cellClass: 'text-left'},
+
 		{headerName: "사용여부", field: "useYn", width: 100, cellClass: 'text-center'},
 		{headerName: "등록일자", field: "regDt", width: 150, cellClass: 'text-center',
 			cellRenderer: function(params) {