팝업 조회 조건 수정

This commit is contained in:
bd091
2025-10-25 10:03:07 +09:00
parent 03aa2abd8a
commit 68c6196d21
4 changed files with 28 additions and 290 deletions

View File

@@ -48,12 +48,15 @@
<if test="webPopupSearchKeywordParam != null and webPopupSearchKeywordParam != ''">
AND MWP.TITLE LIKE CONCAT('%',TRIM(#{webPopupSearchKeywordParam}),'%')
</if>
<if test="homepageDivCd != null and homepageDivCd != ''">
AND MWP.HOMEPAGE_DIV_CD = #{homepageDivCd}
</if>
<choose>
<when test="webPopupSort != null and webPopupSort != ''">
ORDER BY ${webPopupSort}
</when>
<otherwise>
ORDER BY MWP.WRITE_DATE DESC
ORDER BY MWP.HOMEPAGE_DIV_CD, MWP.WRITE_DATE DESC
</otherwise>
</choose>
LIMIT 18446744073709551615

View File

@@ -1,5 +1,11 @@
.project_wrap {width:100%; min-width:1080px; margin:0 auto;}
#homepageDivCd{
float:left;
font-size:18px;
padding: 5px;
border-radius: 5px;
border-color: #ddd;
}
/*오른쪽영역*/
.project_wrap .content_section {margin-top:50px; width:100%; min-width:1080px; display:table;}
.project_wrap .content_section .hospital_wrap {width: calc(100% - 72px); min-width:calc(1080px - 72px); height:calc(100vh - 50px); float:left; position:relative;}
@@ -19,8 +25,8 @@
.project_wrap .content_section .hospital_wrap .center_box {width:calc(100% - 240px); height:calc(100vh - 50px); position:absolute; left:240px; padding:10px 10px 10px 0;}
.project_wrap .content_section .hospital_wrap .center_box .page_title {min-width:90px; padding-left:10px; font-size:18px; font-weight:700; line-height:50px; float:left;}
.project_wrap .content_section .hospital_wrap .center_box .filter_box {display:table; width:100%; padding:20px 0;}
.project_wrap .content_section .hospital_wrap .center_box .filter_box .form_box .select_box {width:140px; height:36px; margin-left:10px; border:1px solid #E9ECF0; border-radius:5px; background:url(/image/web/select_arrow.svg) no-repeat 95% 55%/20px auto #fff; float:left; }
.project_wrap .content_section .hospital_wrap .center_box .filter_box .form_box .select_box.first { width:100px; margin-left:0; float:left; }
.project_wrap .content_section .hospital_wrap .center_box .filter_box .form_box .select_box {width:120px; height:36px; margin-left:10px; border:1px solid #E9ECF0; border-radius:5px; background:url(/image/web/select_arrow.svg) no-repeat 95% 55%/20px auto #fff; float:left; }
.project_wrap .content_section .hospital_wrap .center_box .filter_box .form_box .select_box.first { margin-left:0; float:left; }
.project_wrap .content_section .hospital_wrap .center_box .filter_box .form_box .slash {width:6px; font-size:14px; font-weight:400; color:#000; line-height:36px; margin:0 12px; display:block; float:left;}
.project_wrap .content_section .hospital_wrap .center_box .filter_box .form_box .search_list_box { margin-left:10px; }
.project_wrap .content_section .hospital_wrap .center_box .filter_box .form_box .select_box.active {z-index:10;}

View File

@@ -7,189 +7,6 @@ let webPopupAgGridData = [];
let webPopupSelectId = "";
/****************************************************************************
* 검색 날짜 설정
//(A:오늘, B:3일, C:7일, D:최근30일, E:최근90일, F:이번달, G:올해, H:지난주, I:지난달)
****************************************************************************/
function fn_webPopupSetDate(param){
if("A"==param){
// 오늘
let toDate = new Date();
let year = toDate.getFullYear();
let month = toDate.getMonth() + 1;
let day = toDate.getDate();
if(month < 10) month = "0" + month;
if(day < 10) day = "0" + day;
webPopupSearchStartDate = year+'-'+month+'-'+day;
webPopupSearchEndDate = year+'-'+month+'-'+day;
}
else if("B"==param){
// 3일
// 검색 종료일자
let toDate = new Date();
let year = toDate.getFullYear();
let month = toDate.getMonth() + 1;
let day = toDate.getDate();
if(month < 10) month = "0" + month;
if(day < 10) day = "0" + day;
webPopupSearchEndDate = year+'-'+month+'-'+day;
// 검색 시작일자
toDate.setDate(toDate.getDate() - 3);
year = toDate.getFullYear();
month = toDate.getMonth() + 1;
day = toDate.getDate();
if(month < 10) month = "0" + month;
if(day < 10) day = "0" + day;
webPopupSearchStartDate = year+'-'+month+'-'+day;
}
else if("C"==param){
// 이번주
// 검색 종료일자
let toDate = new Date();
let year = toDate.getFullYear();
let month = toDate.getMonth() + 1;
let day = toDate.getDate();
if(month < 10) month = "0" + month;
if(day < 10) day = "0" + day;
webPopupSearchEndDate = year+'-'+month+'-'+day;
// 검색 시작일자
toDate.setDate(toDate.getDate() - 7);
year = toDate.getFullYear();
month = toDate.getMonth() + 1;
day = toDate.getDate();
if(month < 10) month = "0" + month;
if(day < 10) day = "0" + day;
webPopupSearchStartDate = year+'-'+month+'-'+day;
}
else if("D"==param){
// 최근30일
let toDate = new Date();
let year = toDate.getFullYear();
let month = toDate.getMonth() + 1;
let day = toDate.getDate();
if(month < 10) month = "0" + month;
if(day < 10) day = "0" + day;
//최근30일
toDate.setDate(toDate.getDate() - 30);
startYear = toDate.getFullYear();
startMonth = toDate.getMonth() + 1;
startDay = toDate.getDate();
if(startMonth < 10) startMonth = "0" + startMonth;
if(startDay < 10) startDay = "0" + startDay;
webPopupSearchStartDate = startYear+'-'+startMonth+'-'+startDay;
webPopupSearchEndDate = year+'-'+month+'-'+day;
}
else if("E"==param){
// 최근90일
// 검색 종료일자
let toDate = new Date();
let year = toDate.getFullYear();
let month = toDate.getMonth() + 1;
let day = toDate.getDate();
if(month < 10) month = "0" + month;
if(day < 10) day = "0" + day;
webPopupSearchEndDate = year+'-'+month+'-'+day;
// 검색 시작일자
toDate.setDate(toDate.getDate() - 90);
year = toDate.getFullYear();
month = toDate.getMonth() + 1;
day = toDate.getDate();
if(month < 10) month = "0" + month;
if(day < 10) day = "0" + day;
webPopupSearchStartDate = year+'-'+month+'-'+day;
}
else if("F"==param){
//F:이번달
// 검색 종료일자
let toDate = new Date();
let year = toDate.getFullYear();
let month = toDate.getMonth() + 1;
let day = toDate.getDate();
if(month < 10) month = "0" + month;
if(day < 10) day = "0" + day;
webPopupSearchEndDate = year+'-'+month+'-'+day;
// 검색 시작일자
webPopupSearchStartDate = year+'-'+month+'-01';
}
else if("G"==param){
// G:올해
// 검색 종료일자
let toDate = new Date();
let year = toDate.getFullYear();
let month = toDate.getMonth() + 1;
let day = toDate.getDate();
if(month < 10) month = "0" + month;
if(day < 10) day = "0" + day;
webPopupSearchEndDate = year+'-'+month+'-'+day;
// 검색 시작일자
webPopupSearchStartDate = year+'-01-01';
}
else if("H"==param){
// H:지난주, I:지난달
// 검색 종료일자
let toDate = new Date();
let year = toDate.getFullYear();
let month = toDate.getMonth() + 1;
let day = toDate.getDate();
if(month < 10) month = "0" + month;
if(day < 10) day = "0" + day;
webPopupSearchEndDate = year+'-'+month+'-'+day;
// 검색 시작일자
webPopupSearchStartDate = year+'-01-01';
}
else if("I"==param){
// I:지난달
// 검색 종료일자
let toDate = new Date();
let year = toDate.getFullYear();
let month = toDate.getMonth() + 1;
let day = toDate.getDate();
if(month < 10) month = "0" + month;
if(day < 10) day = "0" + day;
webPopupSearchEndDate = year+'-'+month+'-'+day;
// 검색 시작일자
webPopupSearchStartDate = year+'-01-01';
}
$("#webPopupSearchStartDate").val(webPopupSearchStartDate).trigger("change");
$("#webPopupSearchEndDate").val(webPopupSearchEndDate).trigger("change");
}
/****************************************************************************
* 콘텐츠 정보 리스트 조회
****************************************************************************/
@@ -202,9 +19,10 @@ function fn_selectListWebPopupJson(){
formData.append("webPopupDir", webPopupDir);
formData.append("webPopupStart", webPopupStart);
formData.append("webPopupLimit", webPopupLimit);
formData.append("webPopupSearchStartDate", webPopupSearchStartDate);
formData.append("webPopupSearchEndDate", webPopupSearchEndDate);
formData.append("webPopupSearchDateType", webPopupSearchDateType);
formData.append("homepageDivCd", $("#homepageDivCd").val());
//formData.append("webPopupSearchStartDate", webPopupSearchStartDate);
//formData.append("webPopupSearchEndDate", webPopupSearchEndDate);
//formData.append("webPopupSearchDateType", webPopupSearchDateType);
$.ajax({
url: encodeURI('/webpopup/selectListWebPopup.do'),
@@ -285,9 +103,9 @@ function fn_webPopupSearch(param){
webPopupCategoryName = $("#webPopupCategoryName").val();
webPopupSearchDateType = $("#webPopupSearchDateType").val();
webPopupSearchStartDate = $("#webPopupSearchStartDate").val();
webPopupSearchEndDate = $("#webPopupSearchEndDate").val();
//webPopupSearchDateType = $("#webPopupSearchDateType").val();
//webPopupSearchStartDate = $("#webPopupSearchStartDate").val();
//webPopupSearchEndDate = $("#webPopupSearchEndDate").val();
fn_selectListWebPopupJson();
}
@@ -297,9 +115,6 @@ function fn_webPopupSearch(param){
* 초기화하기
****************************************************************************/
function fn_webPopupReset(){
fn_webPopupSetDate('D');
$("#webPopupSearchDateType option:eq(0)").prop("selected", true);
$("#webPopupSearchKeyword").val("");
fn_webPopupSearch();
@@ -401,59 +216,6 @@ function fn_webPopupEnter(e){
}
}
/****************************************************************************
* 정렬 이벤트
****************************************************************************/
function fn_alignContent(param, param2){
let align = "";
if("A"==param){
align = "오늘";
fn_webPopupSetDate('A');
}
else if("B"==param){
align = "최근30일";
fn_webPopupSetDate('D');
}
else if("C"==param){
align = "최근90일";
fn_webPopupSetDate('E');
}
else if("D"==param){
align = "이번주";
fn_webPopupSetDate('C');
}
else if("E"==param){
align = "이번달";
fn_webPopupSetDate('F');
}
else if("F"==param){
align = "올해";
fn_webPopupSetDate('G');
}
else if("G"==param){
align = "지난주";
fn_webPopupSetDate('H');
}
else if("H"==param){
align = "지난달";
fn_webPopupSetDate('I');
}
else{
align = "";
}
$("#webPopupSearchDateType").val(param);
$("#webPopupSearchDateType").siblings("button").text(align);
}
/****************************************************************************
* 완료
****************************************************************************/
@@ -510,7 +272,6 @@ let webPopupColumnDefs = [
if (params.value === "02") return "쁘띠";
return params.value;
}},
// {field: "webPopupCategoryName", headerName:"카테고리", minWidth:200},
{field: "filePath", headerName:"이미지", minWidth:100, cellRenderer: thumbnailCellRenderer},
{field: "title", headerName:"제목", minWidth:250, cellStyle:{cursor: 'pointer', color:'#3985EA'}},
// {field: "content", headerName:"내용",minWidth:500},
@@ -526,7 +287,7 @@ let webPopupGridOptions = {
flex: 1,
sortable: true, //정렬 여부
resizable: true, //리사이즈
editable: true, // 그리드에서 데이터 수정
editable: false, // 그리드에서 데이터 수정
cellStyle:{textAlign:'left',fontSize:'14px',padding:'0'},
//suppressSizeToFit:true, //자동 맞춤
//enableRowGroup: true, // 그룹 묶음
@@ -608,16 +369,6 @@ new agGrid.Grid(webPopupGridDiv, webPopupGridOptions);
* 페이지 init
****************************************************************************/
function fn_pageInit(){
// 날짜 datepicker
fn_searchDatePicker("#divWebPopupSearchStartDate", "#divWebPopupSearchEndDate");
if(!webPopupSearchStartDate&&!webPopupSearchEndDate){
// 검색 오늘날짜 셋팅
fn_webPopupSetDate('D');
}else{
$("#webPopupSearchStartDate").val(webPopupSearchStartDate).trigger("change");
$("#webPopupSearchEndDate").val(webPopupSearchEndDate).trigger("change");
}
// 초기 페이징 처리
$("#webPopupSearchKeyword").val(webPopupSearchKeywordParam);
@@ -648,19 +399,6 @@ function fn_pageEvent(){
$("#btnDeleteWebPopup").click(function () {
fn_deleteWebPopup();
});
// 기간 선택 콤보 이벤트
const target = $("#webPopupSearchDateType").siblings("ul.select_option_list");
target.find("li.option_list_item").click(function () {
let selectIdArr = $(this).prop("id").split('_');
let selectId = selectIdArr[1];
let selectName = $(this).text();
$(this).parent().siblings("button").text(selectName);
$(this).parent().siblings("input").val(selectId);
fn_alignContent(selectId);
});
}
$(function(){

View File

@@ -40,23 +40,14 @@
<div class="filter_box">
<div class="form_box">
<div class="select_box first dropdown">
<button class="label" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">기간</button>
<input type="hidden" id="webPopupSearchDateType">
<ul class="select_option_list dropdown-menu">
<li id="li_A" class="option_list_item first" >오늘</li>
<li id="li_B" class="option_list_item">최근30일</li>
<li id="li_C" class="option_list_item">최근90일</li>
<li id="li_D" class="option_list_item">이번주</li>
<li id="li_E" class="option_list_item">이번달</li>
<li id="li_F" class="option_list_item">올해</li>
<li id="li_G" class="option_list_item">지난주</li>
<li id="li_H" class="option_list_item">지난달</li>
</ul>
</div>
<select id="homepageDivCd">
<option value="">홈페이지 구분</option>
<option value="01">다이어트센터</option>
<option value="02">쁘띠센터</option>
</select>
<!-- 캘린더input -->
<div class="calendar_box">
<!--<div class="calendar_box">
<div class="date_box date" id="divWebPopupSearchStartDate">
<img src="/image/web/calendar.svg" alt="calendar"/>
<input type="date" class="date_picker" id="webPopupSearchStartDate">
@@ -68,7 +59,7 @@
<img src="/image/web/calendar.svg" alt="calendar"/>
<input type="date" class="date_picker" id="webPopupSearchEndDate">
</div>
</div>
</div>-->
<!-- 이름input -->
<div class="search_list">