فهرست منبع

사은품상품 쿼리 수정

eskim 5 سال پیش
والد
کامیت
82e5d0488b

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

@@ -2446,7 +2446,7 @@ public class TsaGoodsController extends TsaBaseController {
 	}
 
 	/**
-	 * 사은품 화면
+	 * 사은품 상품 화면
 	 * @return
 	 * @author eskim
 	 * @since 2020. 12. 28
@@ -2486,7 +2486,7 @@ public class TsaGoodsController extends TsaBaseController {
 	}
 
 	/**
-	 * 사은품 목록
+	 * 사은품 상품 목록
 	 * @param adKeywordSq
 	 * @return
 	 * @author eskim
@@ -2505,7 +2505,7 @@ public class TsaGoodsController extends TsaBaseController {
 	}
 
 	/**
-	 * 광고 키워드 상품 삭제
+	 *  사은품 상품 저장
 	 *
 	 * @param freeGoods
 	 * @return

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

@@ -3662,11 +3662,29 @@
 		      </otherwise>
 		    </choose>
 		</if>
-		<include refid="getGoodsListCondition_sql"/>
+		<if test="brandCd != null and brandCd != ''">
+		AND B.BRAND_CD = #{brandCd}
+		</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>
 		ORDER BY G.PRODUCT_NO DESC
 	</select>
 	
-	<!-- 상품이미지 삭제 -->
+	<!-- 상품이미지 변경 -->
 	<update id="updateFreeGoods" parameterType="FreeGoods">
 		/* TsaGoods.updateFreeGoods */
 		UPDATE TB_FREE_GOODS

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

@@ -40,8 +40,6 @@
 					<tr>
 						<th>업체/브랜드<em class="required" title="필수"></em></th>
 						<td colspan="3">
-							<label class="rdoBtn"><input type="radio" name="selfYn" id="selfYnY" value="Y"  checked/>자사</label>
-							<label class="rdoBtn"><input type="radio" name="selfYn" id="selfYnN" value="N"/>입점</label>
 							<select name="supplyCompCd" id="supplyCompCd">
 								<option value="" th:if="${sessionInfo.roleCd} != 'G001_B000'">[전체]</option>
 								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
@@ -150,6 +148,7 @@
 
 <script th:inline="javascript">
 /*<![CDATA[*/
+	var sessRoleCd = [[${sessionInfo.roleCd}]];
 	// specify the columns
 	var columnDefs = [
 		{headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
@@ -256,7 +255,11 @@
 			mcxDialog.alert("검색조건을 입력하세요.");
 			return false;
 		}
-		
+		if($("#searchForm input[name=multiBrand]:checked").length == 0) {
+			mcxDialog.alert("브랜드까지 조회해주세요.");
+			return false;
+		}
+	
 		// 기간 값 체크
 		if (!fnCalendarDateValidation('#sellTerms', 'stDate', 'edDate')){
 			return false;