Explorar o código

Merge remote-tracking branch 'origin/develop' into eskim

eskim %!s(int64=4) %!d(string=hai) anos
pai
achega
3a257758ef
Modificáronse 33 ficheiros con 4567 adicións e 116 borrados
  1. 44 0
      src/main/java/com/style24/admin/biz/dao/TsaBusinessDao.java
  2. 22 0
      src/main/java/com/style24/admin/biz/dao/TsaDeliveryDao.java
  3. 60 0
      src/main/java/com/style24/admin/biz/dao/TsaStatisticsDao.java
  4. 45 0
      src/main/java/com/style24/admin/biz/service/TsaBusinessService.java
  5. 97 0
      src/main/java/com/style24/admin/biz/service/TsaDeliveryService.java
  6. 75 0
      src/main/java/com/style24/admin/biz/service/TsaStatisticsService.java
  7. 81 0
      src/main/java/com/style24/admin/biz/web/TsaBusinessController.java
  8. 67 0
      src/main/java/com/style24/admin/biz/web/TsaDeliveryController.java
  9. 203 1
      src/main/java/com/style24/admin/biz/web/TsaStatisticsController.java
  10. 23 0
      src/main/java/com/style24/persistence/domain/Card.java
  11. 1 0
      src/main/java/com/style24/persistence/domain/Delivery.java
  12. 49 0
      src/main/java/com/style24/persistence/domain/Statistics.java
  13. 174 1
      src/main/java/com/style24/persistence/mybatis/shop/TsaBusiness.xml
  14. 372 0
      src/main/java/com/style24/persistence/mybatis/shop/TsaDelivery.xml
  15. 2 2
      src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml
  16. 15 3
      src/main/java/com/style24/persistence/mybatis/shop/TsaPlan.xml
  17. 821 86
      src/main/java/com/style24/persistence/mybatis/shop/TsaStatistics.xml
  18. 152 0
      src/main/webapp/WEB-INF/views/business/Bizday2Form.html
  19. 152 0
      src/main/webapp/WEB-INF/views/business/SupplyCompanyPopupForm2.html
  20. 612 0
      src/main/webapp/WEB-INF/views/delivery/DeliveryListScmForm.html
  21. 4 0
      src/main/webapp/WEB-INF/views/goods/GoodsTitleReserveForm.html
  22. 5 3
      src/main/webapp/WEB-INF/views/statistics/BestTradingForm.html
  23. 15 7
      src/main/webapp/WEB-INF/views/statistics/BrandTradingForm.html
  24. 127 0
      src/main/webapp/WEB-INF/views/statistics/CardSearchForm.html
  25. 8 3
      src/main/webapp/WEB-INF/views/statistics/ChannelTradingForm.html
  26. 342 0
      src/main/webapp/WEB-INF/views/statistics/CouponTradingForm.html
  27. 2 2
      src/main/webapp/WEB-INF/views/statistics/DailyOrderForm.html
  28. 8 3
      src/main/webapp/WEB-INF/views/statistics/ExtmallTradingForm.html
  29. 8 5
      src/main/webapp/WEB-INF/views/statistics/HourlyTradingForm.html
  30. 304 0
      src/main/webapp/WEB-INF/views/statistics/PaymentForm.html
  31. 314 0
      src/main/webapp/WEB-INF/views/statistics/PlanTradingForm.html
  32. 318 0
      src/main/webapp/WEB-INF/views/statistics/TmtbTradingForm.html
  33. 45 0
      src/main/webapp/ux/js/admin.popup.js

+ 44 - 0
src/main/java/com/style24/admin/biz/dao/TsaBusinessDao.java

@@ -359,6 +359,40 @@ public interface TsaBusinessDao {
 	 */
 	 */
 	void updateBizday(Bizday bizday);
 	void updateBizday(Bizday bizday);
 
 
+	/**
+	 * 총알배송 휴무일 목록
+	 * @param bizday - 영업일 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 9. 29
+	 */
+	Collection<Bizday> getHoliday2List(Bizday bizday);
+
+	/**
+	 * 총알배송 영업일여부 조회
+	 * @param bizday - 영업일
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 9. 29
+	 */
+	String getBizday2Yn(String bizday);
+
+	/**
+	 * 총알배송 영업일 생성
+	 * @param bizday - 영업일 정보
+	 * @author gagamel
+	 * @since 2021. 9. 29
+	 */
+	void createBizday2(Bizday bizday);
+
+	/**
+	 * 총알배송 영업일 수정 처리
+	 * @param bizday - 영업일 정보
+	 * @author gagamel
+	 * @since 2021. 9. 29
+	 */
+	void updateBizday2(Bizday bizday);
+
 	/**
 	/**
 	 * 총알배송 브랜드 등록
 	 * 총알배송 브랜드 등록
 	 * @param brand - 브랜드 정보
 	 * @param brand - 브랜드 정보
@@ -374,4 +408,14 @@ public interface TsaBusinessDao {
 	 * @since 2021. 07. 29
 	 * @since 2021. 07. 29
 	 */
 	 */
 	void createBrandGroupMainLayout(BrandGroup brandGroup);
 	void createBrandGroupMainLayout(BrandGroup brandGroup);
+	
+	/**
+	 * 공급업체 목록
+	 * @param supplyComp - 공급업체 정보
+	 * @return
+	 * @author moon
+	 * @since 2021. 09. 29
+	 */
+	Collection<SupplyCompany> getSupplyCompanyList2(SupplyCompany supplyComp);
+	
 }
 }

+ 22 - 0
src/main/java/com/style24/admin/biz/dao/TsaDeliveryDao.java

@@ -359,5 +359,27 @@ public interface TsaDeliveryDao {
 	 * @since 2021. 06. 08
 	 * @since 2021. 06. 08
 	 */
 	 */
 	int updateSoldOut(Delivery delivery);
 	int updateSoldOut(Delivery delivery);
+
+	/**
+	 * 배송 목록 (입점)건수
+	 *
+	 * @param Delivery
+	 * @return
+	 * @author moon
+	 * @since 2021. 09. 15
+	 */
+	int getDeliveryListScmCount(Delivery delivery);
+
+	
+	/**
+	 * 배송 목록(입점)
+	 *
+	 * @param delivery - 배송정보
+	 * @return Collection<Delivery>
+	 * @author moon
+	 * @since 2021. 09. 15
+	 */
+	Collection<Delivery> getDeliveryScmList(Delivery delivery);
+
 	
 	
 }
 }

+ 60 - 0
src/main/java/com/style24/admin/biz/dao/TsaStatisticsDao.java

@@ -4,6 +4,7 @@ import java.util.Collection;
 
 
 import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.parameter.GagaMap;
 import com.style24.core.support.annotation.ShopDs;
 import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.Card;
 import com.style24.persistence.domain.Statistics;
 import com.style24.persistence.domain.Statistics;
 
 
 /**
 /**
@@ -107,4 +108,63 @@ public interface TsaStatisticsDao {
 	Collection<Statistics> getBestOrderList(Statistics statistics);
 	Collection<Statistics> getBestOrderList(Statistics statistics);
 	Collection<GagaMap> getBestOrderListMap(Statistics statistics);
 	Collection<GagaMap> getBestOrderListMap(Statistics statistics);
 
 
+	/**
+	 * 쿠폰 사용 통계 조회
+	 * author: 이명철
+	 * return: Collection<GagaMap>
+	 * since: 2021. 9. 28.
+	 */
+	Collection<Statistics> getCouponOrderList(Statistics statistics);
+
+	/**
+	 * 쿠폰 사용 통계 상세조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	Collection<Statistics> getCouponOrderDetailList(Statistics statistics);
+
+	/**
+	 * 다다익선 주문 조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	Collection<Statistics> getTmtbOrderList(Statistics statistics);
+
+	/**
+	 * 다다익선 주문 상세조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	Collection<Statistics> getTmtbOrderDetailList(Statistics statistics);
+
+	/**
+	 * 사은품 주문 조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	Collection<Statistics> getPlanOrderList(Statistics statistics);
+
+	/**
+	 * 사은품 주문 상세조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	Collection<Statistics> getPlanOrderDetailList(Statistics statistics);
+
+	/**
+	 * 카드목록 조회
+	 * @param
+	 * @return
+	 * @author swkim
+	 * @since 2021. 9. 28
+	 */
+	Collection<Card> getCardList();
+
+	Collection<Statistics> getPaymentList(Statistics statistics);
+
 }
 }

+ 45 - 0
src/main/java/com/style24/admin/biz/service/TsaBusinessService.java

@@ -576,4 +576,49 @@ public class TsaBusinessService {
 		}
 		}
 	}
 	}
 
 
+	/**
+	 * 총알배송 휴무일 목록
+	 * @param bizday - 영업일 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 9. 29
+	 */
+	public Collection<Bizday> getHoliday2List(Bizday bizday) {
+		return businessDao.getHoliday2List(bizday);
+	}
+
+	/**
+	 * 총알배송 영업일 저장 처리
+	 * @param
+	 * @return
+	 * @author jaewonHo
+	 * @since 2019. 12. 13
+	 */
+	@Transactional("shopTxnManager")
+	public void saveBizday2(Bizday bizday) {
+		bizday.setRegNo(TsaSession.getInfo().getUserNo());
+		bizday.setUpdNo(TsaSession.getInfo().getUserNo());
+
+		String bizdayYn = businessDao.getBizday2Yn(bizday.getBizday());
+
+		if (StringUtils.isEmpty(bizdayYn)) {
+			// 영업일여부 값이 없으면 신규로 등록
+			businessDao.createBizday2(bizday);
+		} else {
+			bizday.setBizdayYn(bizdayYn);
+			businessDao.updateBizday2(bizday);
+		}
+	}
+
+	/**
+	 * 공급업체 목록
+	 * @param supplyComp - 공급업체 정보
+	 * @return
+	 * @author moon
+	 * @since 2021. 09. 29
+	 */
+	public Collection<SupplyCompany> getSupplyCompanyList2(SupplyCompany supplyComp) {
+		return businessDao.getSupplyCompanyList2(supplyComp);
+	}	
+	
 }
 }

+ 97 - 0
src/main/java/com/style24/admin/biz/service/TsaDeliveryService.java

@@ -641,4 +641,101 @@ public class TsaDeliveryService {
 		return deliveryDao.getExchangeDelvFailList(delivery);
 		return deliveryDao.getExchangeDelvFailList(delivery);
 	}
 	}
 	
 	
+	
+	/**
+	 * 배송 목록(입점) 건수
+	 *
+	 * @param Delivery
+	 * @return
+	 * @author moon
+	 * @since 2021. 09. 15
+	 */
+	public int getDeliveryListScmCount(Delivery delivery) {
+		
+		if (StringUtils.isNotBlank(delivery.getCondition())) {
+			delivery.setConditions(delivery.getCondition().replaceAll("\r", "").split("\n"));
+		}
+		
+		// 외부몰권한일 때 외부몰벤더ID 설정
+		if (TsaSession.getInfo().getRoleCd().startsWith("G001_C")) {
+			delivery.setMallGb(TsaConstants.MallGb.EXTMALL.value());
+			delivery.setVendorId(TsaSession.getInfo().getVendorId());
+		}
+		
+		if (!StringUtils.isBlank(delivery.getBrandList())) {
+			try {
+				String [] arrBrandCd = mapper.readValue(delivery.getBrandList(), String[].class);
+				delivery.setMultiBrand(arrBrandCd);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("브랜드코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}
+
+		if (!StringUtils.isBlank(delivery.getSupplyCompList())) {
+			try {
+				String [] arrSupplyComp = mapper.readValue(delivery.getSupplyCompList(), String[].class);
+				delivery.setMultiSupplyCompCd(arrSupplyComp);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("업체코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}		
+		return deliveryDao.getDeliveryListScmCount(delivery);
+	}
+	
+	/**
+	 * 배송 목록(입점)
+	 *
+	 * @param -Delivery
+	 * @return Collection<Delivery>
+	 * @author moon
+	 * @since 2021. 09. 15
+	 */
+	public Collection<Delivery> getDeliveryScmList(Delivery delivery) {
+		// multi row 검색관련 처리
+		
+		if (StringUtils.isNotBlank(delivery.getCondition())) {
+			delivery.setConditions(delivery.getCondition().replaceAll("\r", "").split("\n"));
+		}
+
+		// 외부몰권한일 때 외부몰벤더ID 설정
+		if (TsaSession.getInfo().getRoleCd().startsWith("G001_C")) {
+			delivery.setMallGb(TsaConstants.MallGb.EXTMALL.value());
+			delivery.setVendorId(TsaSession.getInfo().getVendorId());
+		}
+		
+		if (!StringUtils.isBlank(delivery.getBrandList())) {
+			try {
+				String [] arrBrandCd = mapper.readValue(delivery.getBrandList(), String[].class);
+				delivery.setMultiBrand(arrBrandCd);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("브랜드코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}
+
+		if (!StringUtils.isBlank(delivery.getSupplyCompList())) {
+			try {
+				String [] arrSupplyComp = mapper.readValue(delivery.getSupplyCompList(), String[].class);
+				delivery.setMultiSupplyCompCd(arrSupplyComp);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("업체코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}
+		
+		if (!StringUtils.isBlank(delivery.getSupplyCompList())) {
+			try {
+				String[] arrSupplyComp = mapper.readValue(delivery.getSupplyCompList(), String[].class);
+				delivery.setMultiSupplyCompCd(arrSupplyComp);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("업체코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}		
+		
+		return deliveryDao.getDeliveryScmList(delivery);
+	}
+	
 }
 }

+ 75 - 0
src/main/java/com/style24/admin/biz/service/TsaStatisticsService.java

@@ -19,6 +19,7 @@ import com.gagaframework.web.parameter.GagaMap;
 import com.style24.admin.biz.dao.TsaStatisticsDao;
 import com.style24.admin.biz.dao.TsaStatisticsDao;
 import com.style24.admin.support.env.TsaConstants;
 import com.style24.admin.support.env.TsaConstants;
 import com.style24.persistence.domain.Statistics;
 import com.style24.persistence.domain.Statistics;
+import com.style24.persistence.domain.Card;
 
 
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 
 
@@ -211,4 +212,78 @@ public class TsaStatisticsService {
 
 
 	}
 	}
 
 
+	/**
+	 * 쿠폰 사용 통계 조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	public Collection<Statistics> getCouponOrderList(Statistics statistics) {
+		return statisticsDao.getCouponOrderList(statistics);
+	}
+
+	/**
+	 * 쿠폰 사용 통계 상세조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	public Collection<Statistics> getCouponOrderDetailList(Statistics statistics) {
+		return statisticsDao.getCouponOrderDetailList(statistics);
+	}
+
+	/**
+	 * 다다익선 통계 조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	public Collection<Statistics> getTmtbOrderList(Statistics statistics) {
+		return statisticsDao.getTmtbOrderList(statistics);
+	}
+
+	/**
+	 * 다다익선 주문상세조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	public Collection<Statistics> getTmtbOrderDetailList(Statistics statistics) {
+		return statisticsDao.getTmtbOrderDetailList(statistics);
+	}
+
+	/**
+	 * 사은품 주문 조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	public Collection<Statistics> getPlanOrderList(Statistics statistics) {
+		return statisticsDao.getPlanOrderList(statistics);
+	}
+
+	/**
+	 * 사은품 주문 상세조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	public Collection<Statistics> getPlanOrderDetailList(Statistics statistics) {
+		return statisticsDao.getPlanOrderDetailList(statistics);
+	}
+
+	/**
+	 * 카드목록 조회
+	 * author: swkim
+	 * return: Collection<Card>
+	 * since: 2021. 9. 28.
+	 */
+	public Collection<Card> getCardList() {
+		return statisticsDao.getCardList();
+	}
+
+	public Collection<Statistics> getPaymentList(Statistics statistics) {
+		return statisticsDao.getPaymentList(statistics);
+	}
+
 }
 }

+ 81 - 0
src/main/java/com/style24/admin/biz/web/TsaBusinessController.java

@@ -890,6 +890,48 @@ public class TsaBusinessController extends TsaBaseController {
 		return super.ok(message.getMessage("SUCC_0009"));
 		return super.ok(message.getMessage("SUCC_0009"));
 	}
 	}
 
 
+	/**
+	 * 총알배송 영업일관리 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 9. 29
+	 */
+	@GetMapping("/bizday2/form")
+	public ModelAndView bizday2Form() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("business/Bizday2Form");
+
+		return mav;
+	}
+
+	/**
+	 * 총알배송 휴무일 목록
+	 * @param bizday - 영업일 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 9. 29
+	 */
+	@GetMapping("/holiday2/list")
+	@ResponseBody
+	public Collection<Bizday> getHoliday2List(Bizday bizday) {
+		return businessService.getHoliday2List(bizday);
+	}
+
+	/**
+	 * 총알배송영업일 저장
+	 * @param bizday - 영업일 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 9. 29
+	 */
+	@PostMapping("/bizday2/save")
+	@ResponseBody
+	public GagaResponse saveBizday2(@RequestBody Bizday bizday) {
+		businessService.saveBizday2(bizday);
+		return super.ok(message.getMessage("SUCC_0009"));
+	}
+
 	/**
 	/**
 	 * 계좌인증
 	 * 계좌인증
 	 *
 	 *
@@ -911,4 +953,43 @@ public class TsaBusinessController extends TsaBaseController {
 		result.setBoolean("isValid", isValid);
 		result.setBoolean("isValid", isValid);
 		return result;
 		return result;
 	}
 	}
+	
+	/**
+	 * 공급업체 목록 화면(팝업)
+	 * @param brandMd - 담당MD 정보
+	 * @return
+	 * @author moon
+	 * @since 2021. 09. 29
+	 */
+	@GetMapping("/comapny/search/scm/form")
+	public ModelAndView companySearchForm2(SupplyCompany company) {
+		ModelAndView mav = new ModelAndView();
+		log.info("company={}", company);
+		mav.addObject("params", company);
+		mav.setViewName("business/SupplyCompanyPopupForm2");
+		return mav;
+	}
+	
+	/**
+	 * 공급업체 목록
+	 * @param supplyComp - 공급업체 정보
+	 * @return
+	 * @author moon
+	 * @since 2021. 09. 29
+	 */
+	@PostMapping("/supply/company/scm/list")
+	@ResponseBody
+	public Collection<SupplyCompany> getSupplyCompanyList2(@RequestBody SupplyCompany supplyComp) {
+		// multi row 검색관련 처리
+		if (!StringUtils.isBlank(supplyComp.getSearchSupplyCompCd())) {
+			supplyComp.setMultiSupplyCompCd(supplyComp.getSearchSupplyCompCd().replaceAll("\r", "").trim().split("\n"));
+		}
+		if (!StringUtils.isBlank(supplyComp.getSearchSupplyCompNm())) {
+			supplyComp.setMultiSupplyCompNm(supplyComp.getSearchSupplyCompNm().replaceAll("\r", "").trim().split("\n"));
+		}
+		supplyComp.setSelfYn("N");
+		//log.info("supplyComp  {}", supplyComp);
+		return businessService.getSupplyCompanyList2(supplyComp);
+	}
+	
 }
 }

+ 67 - 0
src/main/java/com/style24/admin/biz/web/TsaDeliveryController.java

@@ -573,4 +573,71 @@ public class TsaDeliveryController extends TsaBaseController {
 		return dataList;
 		return dataList;
 	}
 	}
 	
 	
+	
+	/**
+	 * 배송 목록 화면(입점)
+	 * @return
+	 * @author moon
+	 * @since 2021. 09. 14
+	 */
+	@GetMapping("/scm/list/form")
+	public ModelAndView deliveryListScmForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 몰구분
+		//mav.addObject("mallGbList", rendererService.getMallGbCommonCodeList(TsaSession.getInfo().getRoleCd()));
+		mav.addObject("mallGbList", rendererService.getAvailCommonCodeList("G011"));
+		// 주문상세상태코드
+		mav.addObject("ordDtlStatList", rendererService.getAvailCommonCodeList("G013"));
+		// 출고처
+		mav.addObject("deliveryLocList", rendererService.getDeliveryLocAllList());
+		// 사이트구분
+		mav.addObject("siteCdList", rendererService.getAvailCommonCodeList("G000"));
+		// 택배사명 목록
+		mav.addObject("shipCompanyList", rendererService.getShipCompanyList());
+		// 출고처분류
+		// mav.addObject("delvTypeList", rendererService.getAvailCommonCodeList("G024"));
+		
+		String supplyCompCd = "";
+		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
+			supplyCompCd = TsaSession.getInfo().getSupplyCompCd();
+		}
+		
+		// 공급업체
+		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList("","Y"));
+        //mav.addObject("vendorList", rendererService.getVendorCommonCodeList(TsaSession.getInfo().getRoleCd()));
+
+		mav.setViewName("delivery/DeliveryListScmForm");
+
+		return mav;
+	}
+
+	/**
+	 * 배송 목록 화면(입점) - 배송 목록(입점)
+	 *
+	 * @param
+	 * @return
+	 * @throws Exception
+	 * @author moon
+	 * @since 2021. 09. 14
+	 */
+	@PostMapping("/scm/list")
+	@ResponseBody
+	public GagaMap getDeliveryScmList(@RequestBody Delivery delivery) throws Exception {
+		
+		GagaMap result = new GagaMap();
+		delivery.setPageable(new TscPageRequest(delivery.getPageNo() - 1, delivery.getPageSize()));
+		delivery.getPageable().setTotalCount(deliveryService.getDeliveryListScmCount(delivery));
+		TscSession.setAttribute("maskingYn", TsaSession.getInfo().getMaskingYn());
+
+		if ("N".equals(delivery.getPageingYn())) {
+			delivery.setPageable(null);
+		}		
+		
+		result.set("pageing", delivery);
+		result.set("deliveryList", deliveryService.getDeliveryScmList(delivery));
+		
+		return result;
+	}
+	
 }
 }

+ 203 - 1
src/main/java/com/style24/admin/biz/web/TsaStatisticsController.java

@@ -4,11 +4,14 @@ import java.util.Collection;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 
 
+import com.style24.persistence.domain.Card;
+import com.style24.persistence.domain.Extmall;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.core.env.Environment;
 import org.springframework.core.io.InputStreamResource;
 import org.springframework.core.io.InputStreamResource;
 import org.springframework.http.ResponseEntity;
 import org.springframework.http.ResponseEntity;
+import org.springframework.security.web.jaasapi.JaasApiIntegrationFilter;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -161,7 +164,6 @@ public class TsaStatisticsController extends TsaBaseController {
 
 
 	/**
 	/**
 	  * 상품별 주문 화면
 	  * 상품별 주문 화면
-	  * @param 없음
 	  * @return ModelAndView
 	  * @return ModelAndView
 	  * @author lmc
 	  * @author lmc
 	  * @since 2021. 9. 14.
 	  * @since 2021. 9. 14.
@@ -626,4 +628,204 @@ public class TsaStatisticsController extends TsaBaseController {
 		return GagaFileUtil.writeFile(request, excelFilenameWithPath);
 		return GagaFileUtil.writeFile(request, excelFilenameWithPath);
 	}
 	}
 
 
+	/**
+	 * 쿠폰 사용 통계
+	 * author: 이명철
+	 * return: ModelAndView
+	 * since: 2021. 9. 28.
+	 */
+	@GetMapping("/coupon/trading/form")
+	public ModelAndView couponTradingForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 쿠폰유형
+		mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230", "Y"));
+
+		mav.setViewName("statistics/CouponTradingForm");
+
+		return mav;
+	}
+
+	/**
+	 * 결제수단별통계 화면
+	 * @return
+	 * @author swkim
+	 * @since 2021. 9. 28
+	 */
+	@GetMapping("/payment/main/form")
+	public ModelAndView paymentForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("statistics/PaymentForm");
+
+		return mav;
+	}
+
+	/**
+	 * 쿠폰 사용 통계 조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	@PostMapping("/coupon/order/list")
+	@ResponseBody
+	public Collection<Statistics> getCouponOrderList(@RequestBody Statistics statistics) {
+
+		if (!StringUtils.isBlank(statistics.getCpnId())) {
+			statistics.setMultiCpnId(statistics.getCpnId().split(System.lineSeparator()));
+		}
+
+		return statisticsService.getCouponOrderList(statistics);
+	}
+
+	/**
+	 * 쿠폰 사용 통계 상세조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	@PostMapping("/coupon/order/detail/list")
+	@ResponseBody
+	public Collection<Statistics> getCouponOrderDetailList(@RequestBody Statistics statistics) {
+		return statisticsService.getCouponOrderDetailList(statistics);
+	}
+
+	/**
+	 * 다다익선 통게 화면
+	 * author: 이명철
+	 * return: ModelAndView
+	 * since: 2021. 9. 28.
+	 */
+	@GetMapping("/tmtb/trading/form")
+	public ModelAndView tmtbTradingForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 프로모션유형
+		mav.addObject("applyGbList", rendererService.getCommonCodeList("G810", "Y"));
+
+		mav.setViewName("statistics/TmtbTradingForm");
+		return mav;
+	}
+
+	/**
+	 * 결제수단별통계 조회
+	 * author: swkim
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	@PostMapping("/payment/main/list")
+	@ResponseBody
+	public Collection<Statistics> getPaymentList(@RequestBody Statistics statistics) {
+
+		if (!StringUtils.isBlank(statistics.getCardIdList())) {
+			try {
+				String[] arrCardId = mapper.readValue(statistics.getCardIdList(), String[].class);
+				statistics.setMultiCardId(arrCardId);
+			} catch (Exception e) {
+				throw new IllegalStateException("카드 검색조건 오류로 인해 조회되지 않았습니다.");
+			}
+		}
+
+		return statisticsService.getPaymentList(statistics);
+	}
+
+	/**
+	 * 카드 목록 화면(팝업)
+	 * @param
+	 * @return
+	 * @author swkim
+	 * @since 2021. 09. 28
+	 */
+	@GetMapping("/card/search/form")
+	public ModelAndView cardSearchForm(Card card) {
+		ModelAndView mav = new ModelAndView();
+
+		mav.addObject("params", card);
+		mav.setViewName("statistics/CardSearchForm");
+
+		return mav;
+	}
+
+	/**
+	 * 다다익선 통계 조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	@PostMapping("/tmtb/order/list")
+	@ResponseBody
+	public Collection<Statistics> getTmtbOrderList(@RequestBody Statistics statistics) {
+
+		if (!StringUtils.isBlank(statistics.getTmtbSq())) {
+			statistics.setMultiTmtbSq(statistics.getTmtbSq().split(System.lineSeparator()));
+		}
+
+		return statisticsService.getTmtbOrderList(statistics);
+	}
+
+	/**
+	 * 다다익선 주문 상세조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	@PostMapping("/tmtb/order/detail/list")
+	@ResponseBody
+	public Collection<Statistics> getTmtbOrderDetailList(@RequestBody Statistics statistics) {
+		return statisticsService.getTmtbOrderDetailList(statistics);
+	}
+
+	/**
+	 * 기획전 통게 화면
+	 * author: 이명철
+	 * return: ModelAndView
+	 * since: 2021. 9. 28.
+	 */
+	@GetMapping("/plan/trading/form")
+	public ModelAndView planTradingForm() {
+		ModelAndView mav = new ModelAndView();
+		mav.setViewName("statistics/PlanTradingForm");
+		return mav;
+	}
+
+	/**
+	 * 기획전 통계 조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	@PostMapping("/plan/order/list")
+	@ResponseBody
+	public Collection<Statistics> getPlanOrderList(@RequestBody Statistics statistics) {
+		if (!StringUtils.isBlank(statistics.getPlanSq())) {
+			statistics.setMultiPlanSq(statistics.getPlanSq().split(System.lineSeparator()));
+		}
+		return statisticsService.getPlanOrderList(statistics);
+	}
+
+	/**
+	 * 기획전 주문 상세조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 28.
+	 */
+	@PostMapping("/plan/order/detail/list")
+	@ResponseBody
+	public Collection<Statistics> getPlanOrderDetailList(@RequestBody Statistics statistics) {
+		return statisticsService.getPlanOrderDetailList(statistics);
+	}
+
+	/**
+	 * 카드 목록
+	 * @param
+	 * @return
+	 * @author swkim
+	 * @since 2021. 09. 29
+	 */
+	@PostMapping("/card/list")
+	@ResponseBody
+	public Collection<Card> getCardList() {
+		return statisticsService.getCardList();
+	}
+
 }
 }

+ 23 - 0
src/main/java/com/style24/persistence/domain/Card.java

@@ -0,0 +1,23 @@
+package com.style24.persistence.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TscPageRequest;
+import lombok.Data;
+
+import java.util.Collection;
+
+/**
+ * 카드 Domain
+ *
+ * @author swkim
+ * @since 2021. 09. 28
+ */
+@SuppressWarnings("serial")
+@Data
+public class Card extends TscBaseDomain {
+
+	private String cardNm;	// 카드명
+	private String cardCd;	// 카드코드
+	private String callbackFn;		// 콜백함수
+}

+ 1 - 0
src/main/java/com/style24/persistence/domain/Delivery.java

@@ -119,6 +119,7 @@ public class Delivery extends TscBaseDomain {
 	private String soldoutMemo;
 	private String soldoutMemo;
 	private String soldoutRegNo;
 	private String soldoutRegNo;
 	private String custId;
 	private String custId;
+	private String supplyCompSearchTxt;
 	
 	
 	private Integer ordDtlNo;
 	private Integer ordDtlNo;
 	private Integer ordNo;
 	private Integer ordNo;

+ 49 - 0
src/main/java/com/style24/persistence/domain/Statistics.java

@@ -97,6 +97,9 @@ public class Statistics extends TscBaseDomain {
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] multiAgeGb;	// 나이구분
 	private String[] multiAgeGb;	// 나이구분
 
 
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] cpnTypeArr;	// 쿠폰유형
+
 	// 일일거래내역
 	// 일일거래내역
 	private Integer ordNo;				// 주문번호
 	private Integer ordNo;				// 주문번호
 	private Integer ordDtlNo;			// 주문상세번호
 	private Integer ordDtlNo;			// 주문상세번호
@@ -177,6 +180,52 @@ public class Statistics extends TscBaseDomain {
 	private String sysImgNm;
 	private String sysImgNm;
 	private boolean isMap;
 	private boolean isMap;
 
 
+	private String cpnType;
+	private String cpnTypeNm;
+	private String cpnId;
+	private String cpnNm;
+	private int burden;
+	private int downCnt;
+	private int useRate;
+	private int useCnt;
+	private int cpnAmt;
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiCpnId;	// 쿠폰번호
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiTmtbSq;	//  프로모션번호
 
 
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiPlanSq;	//  기획전번호
 
 
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] applyGbArr;	//  프로모션유형
+
+	private int ordQty;
+	private int custCnt;
+	private int custCpnCnt;
+	private int ordRate;
+
+	private String planSq;
+	private String planNm;
+	private String tmtbSq;
+	private String tmtbNm;
+	private String applyGb;
+	private int dcAmt;
+	private String simpleGbC;
+	private String simpleGbB;
+	private long cdAmt;
+	private long acAmt;
+	private long vaAmt;
+	private long hpAmt;
+	private long cpAmt;
+	private long npayAmt;
+	private long paycoAmt;
+	private long kakaoAmt;
+
+	String cardIdList;
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiCardId;
 }
 }

+ 174 - 1
src/main/java/com/style24/persistence/mybatis/shop/TsaBusiness.xml

@@ -1187,7 +1187,7 @@
 
 
 	<!-- 영업일 생성 -->
 	<!-- 영업일 생성 -->
 	<insert id="createBizday" parameterType="Bizday">
 	<insert id="createBizday" parameterType="Bizday">
-		/*  TsaBusiness.saveBizday */
+		/*  TsaBusiness.createBizday */
 		INSERT INTO TB_BIZDAY (
 		INSERT INTO TB_BIZDAY (
 		       BIZDAY
 		       BIZDAY
 		     , WEEK_DAY
 		     , WEEK_DAY
@@ -1245,6 +1245,88 @@
 		WHERE  BIZDAY = #{bizday}
 		WHERE  BIZDAY = #{bizday}
 	</insert>
 	</insert>
 	
 	
+	<!-- 총알배송 휴무일 목록 -->
+	<select id="getHoliday2List" parameterType="Bizday" resultType="Bizday">
+		/* TsaBusiness.getHoliday2List */
+		SELECT DATE_FORMAT(BIZDAY,'%Y-%m-%d') AS BIZDAY /*영업일*/
+		     , WEEK_DAY                                 /*요일*/
+		     , BIZDAY_YN                                /*영업일여부*/
+		     , RESTDAY_DESC                             /*휴무일설명*/
+		FROM   TB_BIZDAY2
+		WHERE  1= 1
+		AND    BIZDAY <![CDATA[>=]]> #{startDt}
+		AND    BIZDAY <![CDATA[<]]> #{endDt}
+		AND    BIZDAY_YN = 'N' /*영업일이 아닌 넘만*/
+	</select>
+	
+	<!-- 총알배송 영업일여부 조회 -->
+	<select id="getBizday2Yn" parameterType="String" resultType="String">
+		/* TsaBusiness.getBizday2Yn */
+		SELECT BIZDAY_YN
+		FROM   TB_BIZDAY2
+		WHERE  BIZDAY = #{bizday}
+	</select>
+
+	<!-- 총알배송 영업일 생성 -->
+	<insert id="createBizday2" parameterType="Bizday">
+		/*  TsaBusiness.createBizday2 */
+		INSERT INTO TB_BIZDAY2 (
+		       BIZDAY
+		     , WEEK_DAY
+		     , BIZDAY_YN
+		     , RESTDAY_DESC
+		     , REG_NO
+		     , REG_DT
+		     , UPD_NO
+		     , UPD_DT
+		)
+		VALUES (
+		       #{bizday}
+		     , CASE DAYOFWEEK(#{bizday})
+		            WHEN 1 THEN '일'
+		            WHEN 2 THEN '월'
+		            WHEN 3 THEN '화'
+		            WHEN 4 THEN '수'
+		            WHEN 5 THEN '목'
+		            WHEN 6 THEN '금'
+		            WHEN 7 THEN '토'
+		       END
+		     , CASE DAYOFWEEK(#{bizday})
+		            WHEN 1 THEN 'N'
+		            WHEN 2 THEN 'Y'
+		            WHEN 3 THEN 'Y'
+		            WHEN 4 THEN 'Y'
+		            WHEN 5 THEN 'Y'
+		            WHEN 6 THEN 'Y'
+		            WHEN 7 THEN 'N'
+		       END
+		     , CASE DAYOFWEEK(#{bizday})
+		            WHEN 1 THEN '휴일'
+		            WHEN 2 THEN NULL
+		            WHEN 3 THEN NULL
+		            WHEN 4 THEN NULL
+		            WHEN 5 THEN NULL
+		            WHEN 6 THEN NULL
+		            WHEN 7 THEN '휴일'
+		       END
+		     , #{regNo}
+		     , NOW()
+		     , #{updNo}
+		     , NOW()
+		)
+	</insert>
+	
+	<!-- 총알배송 영업일 수정 -->
+	<insert id="updateBizday2" parameterType="Bizday">
+		/*  TsaBusiness.updateBizday2 */
+		UPDATE TB_BIZDAY2
+		SET    BIZDAY_YN = (CASE WHEN #{bizdayYn} = 'Y' THEN 'N' ELSE 'Y' END)
+		     , RESTDAY_DESC = (CASE WHEN #{bizdayYn} = 'Y' THEN '휴일' ELSE NULL END)
+		     , UPD_NO = #{updNo}
+		     , UPD_DT = NOW()
+		WHERE  BIZDAY = #{bizday}
+	</insert>
+	
 	<!-- 총알배송 브랜드 등록 -->
 	<!-- 총알배송 브랜드 등록 -->
 	<insert id="createShotDelvBrand" parameterType="Brand">
 	<insert id="createShotDelvBrand" parameterType="Brand">
 		/*  TsaBusiness.createShotDelvBrand */
 		/*  TsaBusiness.createShotDelvBrand */
@@ -1304,4 +1386,95 @@
 		  AND CD NOT IN ('SBM014','SBM015','SBM016','SBM017','SBM018','SBM019')
 		  AND CD NOT IN ('SBM014','SBM015','SBM016','SBM017','SBM018','SBM019')
 		ORDER BY DISP_ORD
 		ORDER BY DISP_ORD
 	</insert>
 	</insert>
+	
+	<!-- 공급업체 목록 -->
+	<select id="getSupplyCompanyList2" parameterType="SupplyCompany" resultType="SupplyCompany">
+		/* TsaBusiness.getSupplyCompanyList2 */
+		SELECT SC.SUPPLY_COMP_CD                                       /*공급업체코드*/
+		     , SC.SUPPLY_COMP_NM                                       /*공급업체명*/
+		     , SC.SUPPLY_VENDOR_CD                                     /*공급벤더코드*/
+		     , SV.SUPPLY_VENDOR_NM                                     /*공급벤더명*/
+		     , SV.BIZ_GB                                               /*사업자구분*/
+		     , SV.BIZ_NO                                               /*사업자등록번호*/
+		     , SV.BIZ_KIND                                             /*업종*/
+		     , SV.BIZ_TYPE                                             /*업태*/
+		     , SV.OWNER_NM                                             /*대표자명*/
+		     , SV.BIZ_ZIPCODE                                          /*사업장우편번호*/
+		     , SV.BIZ_BASE_ADDR                                        /*사업장기본주소*/
+		     , SV.BIZ_DTL_ADDR                                         /*사업장상세주소*/
+		     , SV.MAIN_TELNO                                           /*대표전화번호*/
+		     , SV.MAIN_FAXNO                                           /*대표팩스번호*/
+		     , SV.HOMEPAGE_URL                                         /*홈페이지URL*/
+		     , SC.DISTRIBUTION_GB                                      /*유통구분*/
+		     , SC.SHOT_DELV_YN                                         /*총알배송여부*/
+		     , SC.SUPPLY_STAT                                          /*입점상태*/
+		     , FN_GET_CODE_NM('G010',SC.SUPPLY_STAT) AS SUPPLY_STAT_NM /*입점상태명*/
+		     , SC.SELL_FEE_RATE                                        /*판매수수료율*/
+		     , SC.SETTLE_DAY                                           /*정산일*/
+		     , SC.BANK_CD                                              /*은행코드*/
+		     , SC.ACCOUNT_NO                                           /*계좌번호*/
+		     , SC.DEPOSITOR_NM                                         /*예금주명*/
+		     , SC.CS_CHARGE_NM                                         /*CS담당자명*/
+		     , SC.CS_CHARGE_TELNO                                      /*CS담당자전화번호*/
+		     , SC.SETTLE_CHARGE_NM                                     /*정산담당자명*/
+		     , SC.SETTLE_CHARGE_TELNO                                  /*정산담당자전화번호*/
+		     , SC.SETTLE_CHARGE_EMAIL                                  /*정산담당자이메일*/
+		     , SC.BILL_EMAIL                                           /*계산서이메일*/
+		     , SC.ECONTRACT_YN                                         /*전자계약여부*/
+		     , SC.REMARKS                                              /*비고*/
+		     , SC.USE_YN                                               /*사용여부*/
+		     , SC.NOTE                                                 /*배송안내*/
+		FROM   TB_SUPPLY_COMPANY SC
+		     , TB_SUPPLY_VENDOR SV
+		WHERE  SC.SUPPLY_VENDOR_CD = SV.SUPPLY_VENDOR_CD
+		<if test="useYn != null and useYn != ''">
+		AND SC.USE_YN = #{useYn}
+		</if>
+		
+		<if test="supplyStat != null and supplyStat != ''">
+		AND    SC.SUPPLY_STAT = #{supplyStat}
+		</if>
+		<if test="searchTxt != null and searchTxt != ''">
+		    <if test='searchGb == "NAME"'>
+		AND    (
+		        UPPER(SC.SUPPLY_COMP_NM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
+		        OR
+		        UPPER(SV.SUPPLY_VENDOR_NM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
+		       )
+		    </if>
+		    <if test='searchGb == "OWNER"'>
+		AND    UPPER(SV.OWNER_NM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
+		    </if>
+		</if>
+		<if test="econtractYn != null and econtractYn != ''">
+		AND    SC.ECONTRACT_YN = #{econtractYn}
+		</if>
+		<if test="supplyCompCd != null and supplyCompCd != ''"> <!-- 브랜드관리 화면에서 사용 -->
+		AND    SC.SUPPLY_COMP_CD = #{supplyCompCd}
+		</if>
+		<if test="multiSupplyCompCd != null and multiSupplyCompCd.length > 0">
+		AND    SC.SUPPLY_COMP_CD IN
+		    <foreach collection="multiSupplyCompCd" item="item" index="index"  open="(" close=")" separator=",">
+		UPPER(#{item})
+		    </foreach>
+		</if>
+		<if test="multiSupplyCompNm != null and multiSupplyCompNm.length > 0">
+		AND (
+		    <foreach collection="multiSupplyCompNm" item="item" index="index" separator="or">
+		    UPPER(SC.SUPPLY_COMP_NM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		    </foreach>
+		 )
+		</if>
+		<if test='selfYn != null and (selfYn == "Y" or selfYn == "N")'>
+		<choose>
+		    <when test='selfYn  == "Y"'>
+		AND    SC.DISTRIBUTION_GB IN ('G065_10','G065_11','G065_12') 
+		    </when>
+		    <otherwise>
+		AND    SC.DISTRIBUTION_GB IN ('G065_20')
+		    </otherwise>
+		</choose>
+		</if>
+	</select>
+		
 </mapper>
 </mapper>

+ 372 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaDelivery.xml

@@ -1264,4 +1264,376 @@
 	</update>
 	</update>
 
 
 
 
+	<!-- 배송목록 건수 -->
+	<select id="getDeliveryListScmCount" parameterType="Delivery" resultType="int">
+		/* TsaDelivery.getDeliveryListScmCount */
+		SELECT COUNT(*) AS TOTCNT
+		  FROM (
+				SELECT A.*
+				  FROM (
+					SELECT
+							  CASE WHEN ORD_DTL_STAT IN('G013_20','G013_30','G013_35','G013_40')
+							       THEN FN_GET_BIZDAYS(IF(A.ORD_EXCH_GB='O',DATE_FORMAT(A.PAY_DT,'%Y%m%d'),DATE_FORMAT(A.WD_EDDT,'%Y%m%d')),DATE_FORMAT(NOW(),'%Y%m%d')) - 1
+							       ELSE NULL END AS DELV_DELAY_DAYS
+							, FN_GET_CODE_NM('G024', (SELECT B.DELV_LOC_CLSF FROM TB_DELIVERY_LOC B WHERE  A.DELV_LOC_CD = B.DELV_LOC_CD AND A.SUPPLY_COMP_CD = B.SUPPLY_COMP_CD ) ) AS DELV_LOC_CLSF  -- 출고처 분류 G024  물류창고, 일반매장, 직송매장, 입점업체
+							, SUPPLY_COMP_NM
+					  FROM (
+							SELECT
+								  A.PAY_DT         -- 결제일시
+								, B.SUPPLY_COMP_CD -- 공급업체
+								, B.ORD_DTL_STAT  -- 주문상세상태
+								, B.DELV_LOC_CD   -- 출고처
+								, (SELECT MAX(CH.WD_EDDT) FROM TB_ORDER_CHANGE CH INNER JOIN TB_ORDER_CHANGE_DETAIL CHD ON CH.ORD_CHG_SQ = CHD.ORD_CHG_SQ WHERE CHD.ORD_DTL_NO =  B.ORG_ORD_DTL_NO) AS WD_EDDT
+					            , B.ORD_EXCH_GB
+					            , (SELECT SUPPLY_COMP_NM FROM TB_SUPPLY_COMPANY S WHERE S.SUPPLY_COMP_CD = B.SUPPLY_COMP_CD) AS SUPPLY_COMP_NM
+							FROM  TB_ORDER A
+							      INNER JOIN TB_ORDER_DETAIL B        ON A.ORD_NO       = B.ORD_NO
+							      INNER JOIN TB_GOODS C               ON B.GOODS_CD     = C.GOODS_CD
+							      INNER JOIN TB_DELIVERY_ADDR D       ON B.DELV_ADDR_SQ = D.DELV_ADDR_SQ
+							      INNER JOIN TB_CUSTOMER CUST         ON A.CUST_NO      = CUST.CUST_NO
+							WHERE 1=1
+							  AND C.SELF_GOODS_YN = 'N'
+							<include refid="getDeliveryListCondition_sql"/>
+					) A
+				) A
+				WHERE 1=1
+				<if test='delvDelayDays != null and delvDelayDays != ""'>
+				<![CDATA[
+				AND A.DELV_DELAY_DAYS >= #{delvDelayDays}
+				]]>
+				</if>
+				<if test='delvLocClsf != null and delvLocClsf != ""'>
+				AND   A.DELV_LOC_CLSF = #{delvLocClsf}
+				</if>
+				<if test='supplyCompSearchTxt != null and supplyCompSearchTxt != ""'>
+				AND   A.SUPPLY_COMP_NM like concat(#{supplyCompSearchTxt},'%') 
+				</if>				
+			) A
+
+	</select>
+
+	<!-- 배송목록 -->
+	<select id="getDeliveryScmList" parameterType="Delivery" resultType="Delivery">
+		/* TsaDelivery.getDeliveryScmList */
+		SELECT Z.*
+		    , FN_GET_CODE_NM('G000', Z.SITE_CD) AS SITE_NM
+			, ( SELECT SELL_STORE_NM
+		      FROM   TB_SELL_STORE
+		      WHERE  SUPPLY_COMP_CD = Z.SUPPLY_COMP_CD
+		      AND    SELL_STORE_CD = Z.SELL_STORE_CD
+		     ) AS SELL_STORE_NM
+		    , FN_GET_CODE_NM('G011', Z.MALL_GB) AS MALL_GB_NM
+		    , CASE WHEN Z.ORD_DTL_STAT = 'G013_99' AND (SELECT MAX(OC.CHG_REASON) FROM TB_ORDER_CHANGE OC JOIN TB_ORDER_CHANGE_DETAIL OCD ON OC.ORD_CHG_SQ = OCD.ORD_CHG_SQ AND OCD.ORD_DTL_NO = Z.ORD_DTL_NO AND OC.CHG_REASON = 'G686_30') IS NOT NULL
+		           THEN '품절취소' ELSE FN_GET_CODE_NM('G013', Z.ORD_DTL_STAT) END  AS ORD_DTL_STAT_NM
+		    , (SELECT B.DELV_LOC_NM FROM TB_DELIVERY_LOC B WHERE  Z.DELV_LOC_CD = B.DELV_LOC_CD AND Z.SUPPLY_COMP_CD = B.SUPPLY_COMP_CD ) AS DELV_LOC_NM   -- 출고처명
+		    , (SELECT BD.BRAND_KNM FROM TB_BRAND BD WHERE BD.BRAND_CD = Z.BRAND_CD ) AS BRAND_NM
+		    , FN_GET_CODE_NM('G056', Z.GOODS_TYPE ) AS GOODS_TYPE_NM
+		    
+		    , IFNULL((SELECT  MAX(SWT_TRC_SEND_YN) FROM TB_ORDER_DETAIL_INVOICE V WHERE V.ORD_NO = Z.ORD_NO AND V.ORD_DTL_NO = Z.ORD_DTL_NO AND V.INVOICE_NO = Z.INVOICE_NO  ),'N') AS INVC_TRACKING
+
+		FROM (
+		    SELECT A.*, ROW_NUMBER() OVER(ORDER BY  A.ORD_NO DESC, A.ORD_DTL_NO) RNUM
+		    FROM (
+				SELECT A.*
+
+				  FROM (
+					SELECT
+							  CASE WHEN ORD_DTL_STAT IN('G013_20','G013_30','G013_35','G013_40')
+							       THEN FN_GET_BIZDAYS(IF(A.ORD_EXCH_GB='O',DATE_FORMAT(A.PAY_DT,'%Y%m%d'),DATE_FORMAT(A.WD_EDDT,'%Y%m%d')),DATE_FORMAT(NOW(),'%Y%m%d')) - 1
+							       ELSE NULL END AS DELV_DELAY_DAYS
+							, (SELECT CUST_ID FROM TB_CUSTOMER CT WHERE CT.CUST_NO= A.CUST_NO ) AS CUST_ID
+							, (SELECT SUPPLY_COMP_NM FROM TB_SUPPLY_COMPANY S WHERE S.SUPPLY_COMP_CD = A.SUPPLY_COMP_CD) AS SUPPLY_COMP_NM
+							, A.ORD_NO     -- 주문번호
+							, A.ORD_DTL_NO -- 주문상세번호
+							, A.SITE_CD    -- 사이트
+							, A.SELL_STORE_CD -- 판매몰
+							, A.EXTMALL_NM  -- 판매몰명
+							, A.ORD_DT         -- 주문일시
+							, A.PAY_DT         -- 결제일시
+							, A.MALL_GB        -- 몰구분
+							, A.ORD_NM         -- 주문자
+							, A.RECIP_NM       -- 수령인
+							, A.SUPPLY_COMP_CD -- 공급업체
+							, A.GOODS_CD       -- 상품코드
+							, A.GOODS_TYPE     -- 구성유형
+							, A.GOODS_NM       -- 상품명
+							, A.OPT_CD1        -- 옵션1
+							, A.OPT_CD2        -- 옵션2
+							, A.OPT_CD         -- SKU
+							, A.SKU_MODEL_NO
+							, A.PRODUCT_NO
+							, A.PRODUCT_CODE
+							, A.ORD_QTY        -- 주문수량
+							, A.CNCL_RTN_QTY   -- 취소수량
+							, A.SALE_QTY       -- 판매수량
+							, A.SALE_AMT       -- 판매금액
+							, A.REAL_ORD_AMT   -- 실결제금액
+							, A.ORD_DTL_STAT   -- 주문상세상태
+							, A.DELV_LOC_CD
+							, A.SHIP_COMP_CD  -- 출고택배사
+							, A.INVOICE_NO    -- 출고송장
+							-- 송장등록수정
+							-- 배송완료처리
+							, A.EXTMALL_ORDER_ID -- 외부몰주문번호
+							, A.AGENT_ORDER_ID   -- 에이전트주문번호
+							, A.SOLDOUT_YN    -- 결품여부
+							, A.DELV_MEMO     -- 배송메모
+							, CASE WHEN A.ORD_EXCH_GB ='E' THEN 'Y' ELSE 'N' END AS ORD_EXCH_GB   -- 교환여부
+							, A.DELV_STDT     -- 배송시작일
+							, A.BRAND_CD      -- 브랜드
+                            , A.CUST_NO
+                            , CASE WHEN A.SHOT_DELV_YN = 'Y' THEN '총알배송' ELSE '일반배송' END AS SHOT_DELV_YN
+				  			, A.PG_GB
+						    , A.PAY_MEANS
+						    , A.BANK_CD
+						    , A.ACCOUNT_NO
+						    , A.ACCOUNT_NM
+						    , A.ORD_PHNNO
+							, A.RECIP_ZIPCODE
+							, A.RECIP_BASE_ADDR
+							, A.RECIP_DTL_ADDR
+					  FROM (
+							SELECT
+								  A.ORD_NO     -- 주문번호
+								, B.ORD_DTL_NO -- 주문상세번호
+								, A.SITE_CD    -- 사이트
+								, B.SELL_STORE_CD -- 판매몰
+								, IFNULL((SELECT MAX(EXTMALL_NM) FROM TB_EXTMALL WHERE VENDOR_ID = B.VENDOR_ID
+								          AND  EXTMALL_ID = B.EXTMALL_ID), '아이스타일24')  AS EXTMALL_NM  -- 판매몰명
+								, A.ORD_DT         -- 주문일시
+								, A.PAY_DT         -- 결제일시
+								, A.MALL_GB        -- 몰구분
+								, A.ORD_NM         -- 주문자
+								, D.RECIP_NM       -- 수령인
+								, B.SUPPLY_COMP_CD -- 공급업체
+								, B.GOODS_CD       -- 상품코드
+								, B.GOODS_TYPE     -- 구성유형
+								, C.GOODS_NM       -- 상품명
+								, ODI.OPT_CD1      -- 옵션1
+								, ODI.OPT_CD2      -- 옵션2
+								, ODI.OPT_CD       -- SKU
+								, ODI.SKU_MODEL_NO
+								, ODI.PRODUCT_NO
+								, ODI.PRODUCT_CODE
+								, ODI.ITEM_QTY * B.ORD_QTY      AS ORD_QTY      -- 주문수량
+								, ODI.ITEM_QTY * B.CNCL_RTN_QTY AS CNCL_RTN_QTY -- 취소수량
+								, (ODI.ITEM_QTY * B.ORD_QTY  - ODI.ITEM_QTY * B.CNCL_RTN_QTY) SALE_QTY -- 판매수량
+								, B.ORD_AMT - B.CNCL_RTN_AMT  AS SALE_AMT       -- 판매금액
+								, B.REAL_ORD_AMT  -- 실결제금액
+								, B.ORD_DTL_STAT  -- 주문상세상태
+								, B.DELV_LOC_CD   -- 출고처
+								, B.SHIP_COMP_CD  -- 출고택배사
+								, B.INVOICE_NO    -- 출고송장
+								, B.EXTMALL_ORDER_ID -- 외부몰주문번호
+								, B.AGENT_ORDER_ID
+								, B.SOLDOUT_YN    -- 결품여부
+								, D.DELV_MEMO     -- 배송메모
+								, B.ORD_EXCH_GB   -- 교환여부
+								, B.DELV_STDT     -- 배송시작일
+								, (SELECT MAX(CH.WD_EDDT) FROM TB_ORDER_CHANGE CH INNER JOIN TB_ORDER_CHANGE_DETAIL CHD ON CH.ORD_CHG_SQ = CHD.ORD_CHG_SQ WHERE CHD.ORD_DTL_NO =  B.ORG_ORD_DTL_NO) AS WD_EDDT
+							    , C.BRAND_CD
+							    , A.CUST_NO
+							    , B.SHOT_DELV_YN
+							    , P.PG_GB
+							    , P.PAY_MEANS
+							    , T.BANK_CD
+							    , T.ACCOUNT_NO
+							    , T.ACCOUNT_NM
+							    , A.ORD_PHNNO
+							    , D.RECIP_ZIPCODE
+							    , D.RECIP_BASE_ADDR
+							    , D.RECIP_DTL_ADDR
+							FROM  TB_ORDER A
+							      INNER JOIN TB_ORDER_DETAIL B        ON A.ORD_NO       = B.ORD_NO
+								  INNER JOIN TB_ORDER_DETAIL_ITEM ODI ON B.ORD_DTL_NO   = ODI.ORD_DTL_NO
+							      INNER JOIN TB_GOODS C               ON ODI.ITEM_CD    = C.GOODS_CD
+							      INNER JOIN TB_DELIVERY_ADDR D       ON B.DELV_ADDR_SQ = D.DELV_ADDR_SQ
+								  INNER JOIN TB_PAYMENT       P       ON A.ORD_NO       = P.ORD_NO  AND P.PAY_STAT = 'G016_30' AND P.PAY_GB = 'O'
+							 LEFT OUTER JOIN TB_CUST_ACCOUNT  T       ON A.CUST_NO      = T.CUST_NO AND T.DEL_YN = 'N' AND T.CUST_NO NOT IN(0)
+							      INNER JOIN TB_CUSTOMER CUST         ON A.CUST_NO      = CUST.CUST_NO
+							WHERE 1=1
+							  AND B.GOODS_TYPE NOT IN ('G056_S')
+							  AND C.SELF_GOODS_YN = 'N'
+					        <include refid="getDeliveryListScmCondition_sql"/>
+
+							UNION ALL
+
+							SELECT
+								  A.ORD_NO     -- 주문번호
+								, B.ORD_DTL_NO -- 주문상세번호
+								, A.SITE_CD    -- 사이트
+								, B.SELL_STORE_CD -- 판매몰
+								, IFNULL((SELECT MAX(EXTMALL_NM) FROM TB_EXTMALL WHERE VENDOR_ID = B.VENDOR_ID
+								          AND  EXTMALL_ID = B.EXTMALL_ID), '아이스타일24')  AS EXTMALL_NM  -- 판매몰명
+								, A.ORD_DT         -- 주문일시
+								, A.PAY_DT         -- 결제일시
+								, A.MALL_GB        -- 몰구분
+								, A.ORD_NM         -- 주문자
+								, D.RECIP_NM       -- 수령인
+								, B.SUPPLY_COMP_CD -- 공급업체
+								, B.GOODS_CD       -- 상품코드
+								, B.GOODS_TYPE     -- 구성유형
+								, C.GOODS_NM       -- 상품명
+								, '-' AS OPT_CD1   -- 옵션1
+								, '-' AS OPT_CD2   -- 옵션2
+								, '-' AS OPT_CD    -- SKU
+								, '-' AS SKU_MODEL_NO
+								, NULL  AS PRODUCT_NO
+								, '-'  AS PRODUCT_CODE
+								, B.ORD_QTY      AS ORD_QTY      -- 주문수량
+								, B.CNCL_RTN_QTY AS CNCL_RTN_QTY -- 취소수량
+								, B.ORD_QTY  - B.CNCL_RTN_QTY   AS SALE_QTY   -- 판매수량
+								, B.ORD_AMT - B.CNCL_RTN_AMT    AS SALE_AMT   -- 판매금액
+								, B.REAL_ORD_AMT  -- 실결제금액
+								, B.ORD_DTL_STAT  -- 주문상세상태
+								, B.DELV_LOC_CD   -- 출고처
+								, B.SHIP_COMP_CD  -- 출고택배사
+								, B.INVOICE_NO    -- 출고송장
+								, B.EXTMALL_ORDER_ID -- 외부몰주문번호
+								, B.AGENT_ORDER_ID
+								, B.SOLDOUT_YN    -- 결품여부
+								, D.DELV_MEMO     -- 배송메모
+								, B.ORD_EXCH_GB   -- 교환여부
+								, B.DELV_STDT     -- 배송시작일
+								, (SELECT MAX(CH.WD_EDDT) FROM TB_ORDER_CHANGE CH INNER JOIN TB_ORDER_CHANGE_DETAIL CHD ON CH.ORD_CHG_SQ = CHD.ORD_CHG_SQ WHERE CHD.ORD_DTL_NO =  B.ORG_ORD_DTL_NO) AS WD_EDDT
+							    , C.BRAND_CD
+							    , A.CUST_NO
+							    , B.SHOT_DELV_YN
+							    , P.PG_GB
+							    , P.PAY_MEANS
+							    , T.BANK_CD
+							    , T.ACCOUNT_NO
+							    , T.ACCOUNT_NM
+							    , A.ORD_PHNNO
+							    , D.RECIP_ZIPCODE
+							    , D.RECIP_BASE_ADDR
+							    , D.RECIP_DTL_ADDR
+							FROM  TB_ORDER A
+							      INNER JOIN TB_ORDER_DETAIL B        ON A.ORD_NO       = B.ORD_NO
+							      INNER JOIN TB_GOODS C               ON B.GOODS_CD     = C.GOODS_CD
+							      INNER JOIN TB_DELIVERY_ADDR D       ON B.DELV_ADDR_SQ = D.DELV_ADDR_SQ
+								  INNER JOIN TB_PAYMENT       P       ON A.ORD_NO       = P.ORD_NO  AND P.PAY_STAT = 'G016_30' AND P.PAY_GB ='O'
+							 LEFT OUTER JOIN TB_CUST_ACCOUNT  T       ON A.CUST_NO      = T.CUST_NO AND T.DEL_YN = 'N' AND T.CUST_NO NOT IN(0)
+							      INNER JOIN TB_CUSTOMER CUST         ON A.CUST_NO      = CUST.CUST_NO
+							WHERE 1=1
+							  AND B.GOODS_TYPE IN ('G056_S')
+							  AND C.SELF_GOODS_YN = 'N'
+							<include refid="getDeliveryListScmCondition_sql"/>
+					) A
+				) A
+				WHERE 1=1
+				<if test='delvDelayDays != null and delvDelayDays != ""'>
+				<![CDATA[
+				AND A.DELV_DELAY_DAYS >= #{delvDelayDays}
+				]]>
+				</if>
+				<if test='supplyCompSearchTxt != null and supplyCompSearchTxt != ""'>
+				AND   A.SUPPLY_COMP_NM like concat(#{supplyCompSearchTxt},'%') 
+				</if>
+				ORDER BY A.ORD_NO DESC, A.ORD_DTL_NO
+	<include refid="getListPagingCondition_sql"/>
+	</select>
+
+    <!-- 배송목록 조회 조건  -->
+	<sql id="getDeliveryListScmCondition_sql">
+		AND  A.MALL_GB = 'G011_10'
+		<if test='supplyCompCd != null and supplyCompCd != ""'>
+		AND B.SUPPLY_COMP_CD = #{supplyCompCd}
+		</if>
+        <if test="multiBrand != null and multiBrand != ''">
+        AND C.BRAND_CD IN
+            <foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
+        	#{item}
+            </foreach>
+        </if>
+		<if test='orderNm != null and orderNm != ""'>
+		AND   A.ORD_NM = #{orderNm}
+		</if>
+
+		<if test='orderPhnno != null and orderPhnno != ""'>
+		AND   REPLACE(A.ORD_PHNNO, '-', '') = REPLACE(#{orderPhnno}, '-', '')
+		</if>
+		<if test='ordDtlNo != null and ordDtlNo != ""'>
+		AND   B.ORD_DTL_NO = #{ordDtlNo}
+		</if>
+		<if test='conditions != null and conditions != "" '>
+		AND (
+		<choose>
+		     <when test='search != null and search == "searchOrdNo"'>
+		         A.ORD_NO IN
+		          <foreach collection="conditions" item="item" index="index"  open="(" close=")" separator=",">
+		      		#{item}
+		         </foreach>
+
+		     </when>
+		     <when test='search != null and search == "searchExtmallOrderId"'>
+		         B.EXTMALL_ORDER_ID IN
+		         <foreach collection="conditions" item="item" index="index"  open="(" close=")" separator=",">
+		      		#{item}
+		         </foreach>
+		      </when>
+		     <when test='search != null and search == "searchCustId"'>
+		         CUST.CUST_ID IN
+		         <foreach collection="conditions" item="item" index="index"  open="(" close=")" separator=",">
+		      		#{item}
+		         </foreach>
+		      </when>
+		</choose>
+		      )
+		</if>
+		
+		<if test="multiSupplyCompCd != null and multiSupplyCompCd != ''">
+		       AND B.SUPPLY_COMP_CD IN
+			<foreach collection="multiSupplyCompCd" item="item" index="index"  open="(" close=")" separator=",">
+		           #{item}
+			</foreach>
+		</if>
+				
+		<if test='recipNm != null and recipNm != ""'>
+		AND   D.RECIP_NM = #{recipNm}
+		</if>
+		<if test='invoiceNo != null and invoiceNo != ""'>
+		AND   B.INVOICE_NO = #{invoiceNo}
+		</if>
+		<if test='goodsCd != null and goodsCd != ""'>
+		AND   C.GOODS_CD = #{goodsCd}
+		</if>
+
+		<if test="multiOrdDtlStat != null and multiOrdDtlStat !=''">
+		AND  B.ORD_DTL_STAT IN
+		    <foreach collection="multiOrdDtlStat" item="item" index="index"  open="(" close=")" separator=",">
+		     #{item}
+		    </foreach>
+		</if>
+		<if test='termGb == "ordDt"'>
+		    <if test='stDate != null and stDate != ""'>
+		AND   A.ORD_DT >= STR_TO_DATE(REPLACE(#{stDate},'-',''), '%Y%m%d%H%i%s')
+		    </if>
+		    <if test='edDate != null and edDate != ""'>
+		AND   A.ORD_DT <![CDATA[<]]> DATE_ADD(STR_TO_DATE(REPLACE(#{edDate},'-',''), '%Y%m%d%H%i%s'), INTERVAL 1 DAY)
+		    </if>
+		</if>
+		<if test='termGb == "delvDt"'>
+		    <if test='stDate != null and stDate != ""'>
+		AND   B.DELV_EDDT >= STR_TO_DATE(REPLACE(#{stDate},'-',''), '%Y%m%d%H%i%s')
+		    </if>
+		    <if test='edDate != null and edDate != ""'>
+		AND   B.DELV_EDDT <![CDATA[<]]> DATE_ADD(STR_TO_DATE(REPLACE(#{edDate},'-',''), '%Y%m%d%H%i%s'), INTERVAL 1 DAY)
+		    </if>
+		</if>
+		<if test='termGb == "delvStDt"'>
+		    <if test='stDate != null and stDate != ""'>
+		AND   B.DELV_STDT >= STR_TO_DATE(REPLACE(#{stDate},'-',''), '%Y%m%d%H%i%s')
+		    </if>
+		    <if test='edDate != null and edDate != ""'>
+		AND   B.DELV_STDT <![CDATA[<]]> DATE_ADD(STR_TO_DATE(REPLACE(#{edDate},'-','') , '%Y%m%d%H%i%s'), INTERVAL 1 DAY)
+		    </if>
+		</if>
+		<if test='custId != null and custId != ""'>
+		AND   CUST.CUST_ID = #{custId}
+		</if>
+		AND B.ORD_DTL_STAT != 'G013_00'
+	</sql>
+
+
 </mapper>
 </mapper>

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

@@ -2237,13 +2237,13 @@
 		        FROM (
 		        FROM (
 		              SELECT GT.GOODS_CD
 		              SELECT GT.GOODS_CD
 		                   , GT.GOODS_TNM
 		                   , GT.GOODS_TNM
-		                   , RANK() OVER(PARTITION BY GT.GOODS_CD ORDER BY GT.GOODS_TNM_RES_SQ DESC) RANK
+		                   , RANK() OVER(PARTITION BY GT.GOODS_CD ORDER BY GT.GOODS_TNM_RES_SQ DESC) RNK
 		              FROM TB_GOODS_TNM_RES GT
 		              FROM TB_GOODS_TNM_RES GT
 		              WHERE GT.APPLY_YN = 'N'
 		              WHERE GT.APPLY_YN = 'N'
 		              AND NOW() BETWEEN GT.APPLY_STDT AND GT.APPLY_EDDT
 		              AND NOW() BETWEEN GT.APPLY_STDT AND GT.APPLY_EDDT
 		              AND GT.GOODS_CD  = #{goodsCd}
 		              AND GT.GOODS_CD  = #{goodsCd}
 		             ) S
 		             ) S
-		        WHERE S.RANK = 1
+		        WHERE S.RNK = 1
 		        ) AS GOOD_TNM_INIT
 		        ) AS GOOD_TNM_INIT
 		FROM TB_GOODS
 		FROM TB_GOODS
 		WHERE GOODS_CD = #{goodsCd}
 		WHERE GOODS_CD = #{goodsCd}

+ 15 - 3
src/main/java/com/style24/persistence/mybatis/shop/TsaPlan.xml

@@ -45,14 +45,20 @@
 		     , REG_DT                
 		     , REG_DT                
 		     , UPD_NO                
 		     , UPD_NO                
 		     , UPD_DT                
 		     , UPD_DT                
-		   ) VALUES (
+		) VALUES (
 		       #{planSq}
 		       #{planSq}
 		     , #{planNm}
 		     , #{planNm}
 		     , #{planGb}
 		     , #{planGb}
 		     , #{siteCd}
 		     , #{siteCd}
 		     , #{frontGb}
 		     , #{frontGb}
+		<if test='planGb == "C"'>
+		     , DATE_FORMAT(#{startSearchDate} , '%Y-%m-01 %H:%i:%s')
+		     , DATE_FORMAT(LAST_DAY(#{startSearchDate}) , '%Y-%m-%d 23:59:59')
+		</if>
+		<if test='planGb != "C"'>
 		     , DATE_FORMAT(#{dispStdt} , '%Y-%m-%d %H:%i:%s')
 		     , DATE_FORMAT(#{dispStdt} , '%Y-%m-%d %H:%i:%s')
 		     , DATE_FORMAT(#{dispEddt} , '%Y-%m-%d %H:%i:%s')
 		     , DATE_FORMAT(#{dispEddt} , '%Y-%m-%d %H:%i:%s')
+		</if>
 		     , #{mainPimg}
 		     , #{mainPimg}
 		     , #{mainMimg}
 		     , #{mainMimg}
 		     , #{dtlPimg}
 		     , #{dtlPimg}
@@ -79,9 +85,9 @@
 		     , #{badgeFcolor}
 		     , #{badgeFcolor}
 		     , #{badgeBcolor}
 		     , #{badgeBcolor}
 		     , #{regNo}
 		     , #{regNo}
-		     , now() 
+		     , NOW()
 		     , #{updNo}
 		     , #{updNo}
-		     , now()
+		     , NOW()
 		)
 		)
 	</insert>
 	</insert>
 	
 	
@@ -298,8 +304,14 @@
 		   SET PLAN_GB = #{planGb}
 		   SET PLAN_GB = #{planGb}
 		     , FRONT_GB = #{frontGb}
 		     , FRONT_GB = #{frontGb}
 		     , PLAN_NM = #{planNm}
 		     , PLAN_NM = #{planNm}
+		    <if test='planGb == "C"'>
+		     , DISP_STDT = DATE_FORMAT(#{startSearchDate} , '%Y-%m-01 %H:%i:%s')
+		     , DISP_EDDT =DATE_FORMAT(LAST_DAY(#{startSearchDate}) , '%Y-%m-%d 23:59:59')
+		    </if>
+		    <if test='planGb != "C"'>
 		     , DISP_STDT = DATE_FORMAT(#{dispStdt} , '%Y-%m-%d %H:%i:%s')
 		     , DISP_STDT = DATE_FORMAT(#{dispStdt} , '%Y-%m-%d %H:%i:%s')
 		     , DISP_EDDT = DATE_FORMAT(#{dispEddt} , '%Y-%m-%d %H:%i:%s')
 		     , DISP_EDDT = DATE_FORMAT(#{dispEddt} , '%Y-%m-%d %H:%i:%s')
+		     </if>
 		     , CORNER_NM_DISP_YN = #{cornerNmDispYn}
 		     , CORNER_NM_DISP_YN = #{cornerNmDispYn}
 		     , OPEN_YN = #{openYn}
 		     , OPEN_YN = #{openYn}
 		     , SITE_CD = #{siteCd}
 		     , SITE_CD = #{siteCd}

+ 821 - 86
src/main/java/com/style24/persistence/mybatis/shop/TsaStatistics.xml

@@ -376,7 +376,7 @@
 		    AND B.GOODS_CD = C.GOODS_CD
 		    AND B.GOODS_CD = C.GOODS_CD
 		<![CDATA[
 		<![CDATA[
 		    AND A.DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
 		    AND A.DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
-		    AND A.DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
+		    AND A.DAY < DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
 		]]>
 		]]>
 		<if test="multiFrontGb != null">
 		<if test="multiFrontGb != null">
 			/* 디바이스 */
 			/* 디바이스 */
@@ -421,45 +421,6 @@
 	<!-- 제휴몰 주문 목록 조회 -->
 	<!-- 제휴몰 주문 목록 조회 -->
 	<select id="getExtmallOrderList" parameterType="Statistics" resultType="Statistics">
 	<select id="getExtmallOrderList" parameterType="Statistics" resultType="Statistics">
 		/* TsaStatistics.getExtmallOrderList */
 		/* TsaStatistics.getExtmallOrderList */
-		WITH YOY AS (
-			SELECT X.EXTMALL_ID
-			     , SUM(X.EXTMALL_AMT - X.CNCL_AMT - X.RTN_AMT) AS YOY_TOT_ORD_AMT
-               FROM   TB_STAT_ORD_DAY X
-               WHERE  1 = 1
-				 <![CDATA[
-			     AND X.DAY >= DATE_ADD(STR_TO_DATE(#{startDt},'%Y-%m-%d'), INTERVAL -1 YEAR)
-			     AND X.DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL -1 YEAR)
-				 ]]>
-				<if test="multiBrandCd != null">
-					/* 브랜드 */
-					<foreach collection="multiBrandCd" item="item" index="index"  open="AND X.BRAND_CD IN (" close=")" separator=",">#{item}</foreach>
-				</if>
-				<if test="multiFormalGb != null">
-					/* 정상/이월구분 */
-					<foreach collection="multiFormalGb" item="item" index="index"  open="AND X.FORMAL_GB IN (" close=")" separator=",">#{item}</foreach>
-				</if>
-				<if test="multiSupplyCompCd != null">
-					/* 공급처 */
-					<foreach collection="multiSupplyCompCd" item="item" index="index"  open="AND X.SUPPLY_COMP_CD IN (" close=")" separator=",">#{item}</foreach>
-				</if>
-				<if test="multiAfLinkCd != null">
-					/* 채널 */
-					<foreach collection="multiAfLinkCd" item="item" index="index"  open="AND X.AF_LINK_CD IN (" close=")" separator=",">#{item}</foreach>
-				</if>
-				<if test="multiItemkindCd != null">
-					/* 품목 */
-					<foreach collection="multiItemkindCd" item="item" index="index"  open="AND X.ITEMKIND_CD IN (" close=")" separator=",">#{item}</foreach>
-				</if>
-				<if test="multiFrontGb != null">
-					/* 디바이스 */
-					<foreach collection="multiFrontGb" item="item" index="index"  open="AND X.FRONT_GB IN (" close=")" separator=",">#{item}</foreach>
-				</if>
-				<if test="multiDistributionGb != null">
-					/* 물류구분 */
-					<foreach collection="multiDistributionGb" item="item" index="index"  open="AND X.DISTRIBUTION_GB IN (" close=")" separator=",">#{item}</foreach>
-				</if>
-			GROUP BY X.EXTMALL_ID
-		)
 		SELECT EXTMALL_NM
 		SELECT EXTMALL_NM
 		     , TOT_AMT
 		     , TOT_AMT
 		     , SELL_QTY
 		     , SELL_QTY
@@ -470,7 +431,7 @@
 		     , SELL_FEE_RATE
 		     , SELL_FEE_RATE
 		     , EX_USAC_AMT
 		     , EX_USAC_AMT
 		     , YOY_TOT_ORD_AMT
 		     , YOY_TOT_ORD_AMT
-		     , ROUND(TOT_AMT / YOY_TOT_ORD_AMT * 100 - 100,1) AS YOY_RATE
+			 , ROUND(TOT_AMT / (CASE WHEN TOT_AMT > 0 AND YOY_TOT_ORD_AMT = 0 THEN 1 ELSE YOY_TOT_ORD_AMT END) * 100 - 100,1) AS YOY_RATE /*증가율*/
 		  FROM (
 		  FROM (
 				SELECT
 				SELECT
 				    (SELECT EXTMALL_NM FROM TB_EXTMALL X WHERE X.EXTMALL_ID = A.EXTMALL_ID LIMIT 1) AS EXTMALL_NM
 				    (SELECT EXTMALL_NM FROM TB_EXTMALL X WHERE X.EXTMALL_ID = A.EXTMALL_ID LIMIT 1) AS EXTMALL_NM
@@ -488,7 +449,7 @@
 				                 AND X.EXTMALL_ID = A.EXTMALL_ID
 				                 AND X.EXTMALL_ID = A.EXTMALL_ID
 							<![CDATA[
 							<![CDATA[
 							    AND X.DAY >= DATE_ADD(STR_TO_DATE(#{startDt},'%Y-%m-%d'), INTERVAL -1 YEAR)
 							    AND X.DAY >= DATE_ADD(STR_TO_DATE(#{startDt},'%Y-%m-%d'), INTERVAL -1 YEAR)
-							    AND X.DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL -1 YEAR)
+							    AND X.DAY < DATE_ADD(DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY), INTERVAL -1 YEAR)
 							]]>
 							]]>
 								<if test="multiBrandCd != null">
 								<if test="multiBrandCd != null">
 									/* 브랜드 */
 									/* 브랜드 */
@@ -520,12 +481,11 @@
 								</if>
 								</if>
 				              ),0)                                           AS YOY_TOT_ORD_AMT /*전년동기대비매출액*/
 				              ),0)                                           AS YOY_TOT_ORD_AMT /*전년동기대비매출액*/
 				FROM TB_STAT_ORD_DAY A
 				FROM TB_STAT_ORD_DAY A
-				LEFT OUTER JOIN YOY AS B ON A.EXTMALL_ID = B.EXTMALL_ID
 				WHERE 1=1
 				WHERE 1=1
 				    AND A.EXTMALL_ID IS NOT NULL
 				    AND A.EXTMALL_ID IS NOT NULL
 				<![CDATA[
 				<![CDATA[
 				    AND A.DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
 				    AND A.DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
-				    AND A.DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
+				    AND A.DAY < DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
 				]]>
 				]]>
 				<if test="multiBrandCd != null">
 				<if test="multiBrandCd != null">
 					/* 브랜드 */
 					/* 브랜드 */
@@ -563,37 +523,6 @@
 	<!-- 채널 주문목록 조회 -->
 	<!-- 채널 주문목록 조회 -->
 	<select id="getChannelOrderList" parameterType="Statistics" resultType="Statistics">
 	<select id="getChannelOrderList" parameterType="Statistics" resultType="Statistics">
 		/* TsaStatistics.getChannelOrderList */
 		/* TsaStatistics.getChannelOrderList */
-		WITH YOY AS (
-		  SELECT X.AF_LINK_CD
-		       , SUM(X.CHANNEL_AMT - X.CNCL_AMT - X.RTN_AMT) AS YOY_TOT_ORD_AMT
-		    FROM TB_STAT_ORD_DAY X
-		   WHERE 1=1
-			<![CDATA[
-			     AND X.DAY >= DATE_ADD(STR_TO_DATE(#{startDt},'%Y-%m-%d'), INTERVAL -1 YEAR)
-			     AND X.DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL -1 YEAR)
-			]]>
-			<if test="multiFrontGb != null">
-				/* 디바이스 */
-				<foreach collection="multiFrontGb" item="item" index="index"  open="AND X.FRONT_GB IN (" close=")" separator=",">#{item}</foreach>
-			</if>
-			<if test="multiFormalGb != null">
-				/* 정상/이월구분 */
-				<foreach collection="multiFormalGb" item="item" index="index"  open="AND X.FORMAL_GB IN (" close=")" separator=",">#{item}</foreach>
-			</if>
-			<if test="multiDistributionGb != null">
-				/* 물류구분 */
-				<foreach collection="multiDistributionGb" item="item" index="index"  open="AND X.DISTRIBUTION_GB IN (" close=")" separator=",">#{item}</foreach>
-			</if>
-			<if test="multiSupplyCompCd != null">
-				/* 공급처 */
-				<foreach collection="multiSupplyCompCd" item="item" index="index"  open="AND X.SUPPLY_COMP_CD IN (" close=")" separator=",">#{item}</foreach>
-			</if>
-			<if test="multiItemkindCd != null">
-				/* 품목 */
-				<foreach collection="multiItemkindCd" item="item" index="index"  open="AND X.ITEMKIND_CD IN (" close=")" separator=",">#{item}</foreach>
-			</if>
-		  GROUP BY X.AF_LINK_CD
-		)
 		SELECT AF_LINK_CD
 		SELECT AF_LINK_CD
 		     , AF_LINK_NM
 		     , AF_LINK_NM
 		     , CHANNEL_AMT
 		     , CHANNEL_AMT
@@ -605,7 +534,7 @@
 		     , SELL_FEE_RATE
 		     , SELL_FEE_RATE
 		     , EX_USAC_AMT
 		     , EX_USAC_AMT
 		     , YOY_TOT_ORD_AMT
 		     , YOY_TOT_ORD_AMT
-		     , ROUND(TOT_AMT / YOY_TOT_ORD_AMT * 100 - 100,1) AS YOY_RATE
+	   		 , ROUND(TOT_AMT / (CASE WHEN TOT_AMT >0 AND YOY_TOT_ORD_AMT = 0 THEN 1 ELSE YOY_TOT_ORD_AMT END) * 100 - 100,1) AS YOY_RATE /*증가율*/
 		  FROM (
 		  FROM (
 				SELECT
 				SELECT
 				    A.AF_LINK_CD
 				    A.AF_LINK_CD
@@ -618,14 +547,39 @@
 				    , SUM(A.REAL_ORD_AMT) AS REAL_ORD_AMT /* 실결제금액 */
 				    , SUM(A.REAL_ORD_AMT) AS REAL_ORD_AMT /* 실결제금액 */
 				    , (SELECT FEE_RATE FROM TB_AF_LINK X WHERE X.AF_LINK_CD = A.AF_LINK_CD) AS SELL_FEE_RATE
 				    , (SELECT FEE_RATE FROM TB_AF_LINK X WHERE X.AF_LINK_CD = A.AF_LINK_CD) AS SELL_FEE_RATE
 				    , (SUM(A.REAL_ORD_AMT) * (1 - (SELECT FEE_RATE FROM TB_AF_LINK X WHERE X.AF_LINK_CD = A.AF_LINK_CD) / 100)) AS EX_USAC_AMT
 				    , (SUM(A.REAL_ORD_AMT) * (1 - (SELECT FEE_RATE FROM TB_AF_LINK X WHERE X.AF_LINK_CD = A.AF_LINK_CD) / 100)) AS EX_USAC_AMT
-				    , SUM(IFNULL(C.YOY_TOT_ORD_AMT,0)) AS YOY_TOT_ORD_AMT
+				    , IFNULL((SELECT SUM(X.CHANNEL_AMT - X.CNCL_AMT - X.RTN_AMT) AS YOY_TOT_ORD_AMT
+						FROM TB_STAT_ORD_DAY X
+						WHERE X.AF_LINK_CD = A.AF_LINK_CD
+						<![CDATA[
+								 AND X.DAY >= DATE_ADD(STR_TO_DATE(#{startDt},'%Y-%m-%d'), INTERVAL -1 YEAR)
+								 AND X.DAY < DATE_ADD(DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY), INTERVAL -1 YEAR)
+							]]>
+						<if test="multiFrontGb != null">
+							/* 디바이스 */
+							<foreach collection="multiFrontGb" item="item" index="index"  open="AND X.FRONT_GB IN (" close=")" separator=",">#{item}</foreach>
+						</if>
+						<if test="multiFormalGb != null">
+							/* 정상/이월구분 */
+							<foreach collection="multiFormalGb" item="item" index="index"  open="AND X.FORMAL_GB IN (" close=")" separator=",">#{item}</foreach>
+						</if>
+						<if test="multiDistributionGb != null">
+							/* 물류구분 */
+							<foreach collection="multiDistributionGb" item="item" index="index"  open="AND X.DISTRIBUTION_GB IN (" close=")" separator=",">#{item}</foreach>
+						</if>
+						<if test="multiSupplyCompCd != null">
+							/* 공급처 */
+							<foreach collection="multiSupplyCompCd" item="item" index="index"  open="AND X.SUPPLY_COMP_CD IN (" close=")" separator=",">#{item}</foreach>
+						</if>
+						<if test="multiItemkindCd != null">
+							/* 품목 */
+							<foreach collection="multiItemkindCd" item="item" index="index"  open="AND X.ITEMKIND_CD IN (" close=")" separator=",">#{item}</foreach>
+						</if>), 0) AS YOY_TOT_ORD_AMT
 				FROM TB_STAT_ORD_DAY A
 				FROM TB_STAT_ORD_DAY A
 				INNER JOIN TB_AF_LINK B ON A.AF_LINK_CD = B.AF_LINK_CD
 				INNER JOIN TB_AF_LINK B ON A.AF_LINK_CD = B.AF_LINK_CD
-				LEFT OUTER JOIN YOY   C ON A.AF_LINK_CD = C.AF_LINK_CD
 				WHERE B.AF_CHANNEL != 'G053_01'
 				WHERE B.AF_CHANNEL != 'G053_01'
 				<![CDATA[
 				<![CDATA[
 				    AND A.DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
 				    AND A.DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
-				    AND A.DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
+				    AND A.DAY < DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
 				]]>
 				]]>
 				<if test="multiFrontGb != null">
 				<if test="multiFrontGb != null">
 					/* 디바이스 */
 					/* 디바이스 */
@@ -660,8 +614,8 @@
 		    FROM TB_STAT_ORD_DAY X
 		    FROM TB_STAT_ORD_DAY X
 		   WHERE 1=1
 		   WHERE 1=1
 			<![CDATA[
 			<![CDATA[
-		     AND X.DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
-		     AND X.DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
+		     AND X.DAY >= DATE_ADD(STR_TO_DATE(#{startDt},'%Y-%m-%d'), INTERVAL -1 YEAR)
+			 AND X.DAY < DATE_ADD(DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY), INTERVAL -1 YEAR)
 			]]>
 			]]>
 			<if test="multiFrontGb != null">
 			<if test="multiFrontGb != null">
 				/* 디바이스 */
 				/* 디바이스 */
@@ -708,7 +662,7 @@
 		    , TOT_AMT_10 /*정상매출*/
 		    , TOT_AMT_10 /*정상매출*/
 		    , TOT_AMT_20 /*이월매출*/
 		    , TOT_AMT_20 /*이월매출*/
 		    , ROUND( ((FLOOR(TOT_AMT_10 / TOT_AMT * 10000 / 10)) / 10), 1) AS AMT_RATE_10 /*정상비*/
 		    , ROUND( ((FLOOR(TOT_AMT_10 / TOT_AMT * 10000 / 10)) / 10), 1) AS AMT_RATE_10 /*정상비*/
-		    , ROUND(TOT_AMT / YOY_TOT_ORD_AMT * 100 - 100,1) AS YOY_RATE /*증가율*/
+		    , ROUND(TOT_AMT / (CASE WHEN TOT_AMT >0 AND (YOY_TOT_ORD_AMT IS NULL OR YOY_TOT_ORD_AMT = 0) THEN 1 ELSE YOY_TOT_ORD_AMT END) * 100 - 100,1) AS YOY_RATE /*증가율*/
 		    , YOY_TOT_ORD_AMT
 		    , YOY_TOT_ORD_AMT
 		FROM (
 		FROM (
 		    SELECT
 		    SELECT
@@ -735,12 +689,11 @@
 		            , SUM(A.EXTMALL_AMT) AS EXTMALL_AMT -- 제휴몰매출
 		            , SUM(A.EXTMALL_AMT) AS EXTMALL_AMT -- 제휴몰매출
 		            , SUM(A.CNCL_AMT + A.RTN_AMT) AS CNCL_AMT -- 취/반품액
 		            , SUM(A.CNCL_AMT + A.RTN_AMT) AS CNCL_AMT -- 취/반품액
 		            , C.YOY_TOT_ORD_AMT
 		            , C.YOY_TOT_ORD_AMT
-		        FROM TB_STAT_ORD_DAY A, TB_BRAND B, YOY C
+		        FROM TB_STAT_ORD_DAY A LEFT OUTER JOIN YOY C ON A.BRAND_CD = C.BRAND_CD, TB_BRAND B
 		        WHERE A.BRAND_CD = B.BRAND_CD
 		        WHERE A.BRAND_CD = B.BRAND_CD
-		          AND A.BRAND_CD = C.BRAND_CD
 				<![CDATA[
 				<![CDATA[
 			      AND DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
 			      AND DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
-			      AND DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
+			      AND DAY < DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
 				]]>
 				]]>
 				<if test="multiFrontGb != null">
 				<if test="multiFrontGb != null">
 					/* 디바이스 */
 					/* 디바이스 */
@@ -801,7 +754,7 @@
 						<if test="item == 'COMPARE_TERMS'">
 						<if test="item == 'COMPARE_TERMS'">
 					        <![CDATA[
 					        <![CDATA[
 					        /* 직전동기간 */
 					        /* 직전동기간 */
-					        AND A.DAY_TIME >= DATE_ADD(DATE_FORMAT(#{startDt},'%Y-%m-%d'), INTERVAL (DATE_FORMAT(#{startDt}, '%Y%m%d') - DATE_FORMAT(#{endDt}, '%Y%m%d')) DAY)
+					        AND A.DAY_TIME >= DATE_ADD(DATE_FORMAT(#{startDt},'%Y-%m-%d'), INTERVAL (DATE_FORMAT(#{startDt}, '%Y%m%d') - DATE_FORMAT(#{endDt}, '%Y%m%d')) - 1 DAY)
 					        AND A.DAY_TIME < DATE_FORMAT(#{startDt}, '%Y%m%d')
 					        AND A.DAY_TIME < DATE_FORMAT(#{startDt}, '%Y%m%d')
 					        ]]>
 					        ]]>
 						</if>
 						</if>
@@ -1147,4 +1100,786 @@
 		<include refid="getBestOrderListSql"></include>
 		<include refid="getBestOrderListSql"></include>
 	</select>
 	</select>
 
 
+	<!-- 쿠폰사용통계조회 -->
+	<select id="getCouponOrderList" parameterType="Statistics" resultType="Statistics">
+	   /* TsaStatistics.getCouponOrderList */
+		WITH TAB AS (
+		     SELECT
+		        A.ORD_NO
+		        , B.ORD_DTL_NO
+		        , B.ORD_QTY
+		        , B.CNCL_RTN_QTY
+		        , B.ORD_AMT
+		        , B.CURR_PRICE
+		        , B.CNCL_RTN_AMT
+		        , B.ORD_DTL_STAT
+		        , A.PAY_DT
+		        , C.GOODS_CD
+		        , CPN1_DC_AMT
+		        , CPN1_CPN_SQ
+		        , GOODS_CPN_DC_AMT
+		        , GOODS_CPN_SQ
+		        , CART_CPN_DC_AMT
+		        , CART_CPN_SQ
+		    FROM TB_ORDER A, TB_ORDER_DETAIL B, TB_GOODS C, TB_CUSTOMER D
+		    WHERE A.ORD_NO = B.ORD_NO
+		        AND B.GOODS_CD = C.GOODS_CD
+		        AND A.CUST_NO = D.CUST_NO
+	            <![CDATA[
+		        AND A.PAY_DT >= DATE_FORMAT(#{startDt}, '%Y%m%d')                         -- 시작일변수
+		        AND A.PAY_DT <= DATE_FORMAT(CONCAT(#{endDt}, ' 23:59:59'), '%Y-%m-%d %H:%i:%s') -- 종료일변수
+                ]]>
+		        AND B.ORD_DTL_STAT NOT IN ('G013_00', 'G013_10', 'G013_98') -- 주문접수,입금대기,입금전취소 제외
+		        AND B.ORD_QTY > B.CNCL_RTN_QTY
+		)
+		, TAB_CPN_STAT AS (
+		    SELECT CPN_TYPE, A.CPN_ID, A.CPN_NM
+		        , 100 - IFNULL((SELECT MAX(BURDEN_RATE) FROM TB_COUPON_BURDEN X WHERE X.CPN_ID = A.CPN_ID), 0) AS BURDEN
+		        , COUNT(1) AS USE_CNT
+		        , SUM((C.CURR_PRICE + (SELECT SUM(OPT_ADD_PRICE * ITEM_QTY) FROM TB_ORDER_DETAIL_ITEM X WHERE X.ORD_DTL_NO = C.ORD_DTL_NO)) * (C.ORD_QTY - C.CNCL_RTN_QTY)) AS ORD_AMT
+		        , SUM(C.CPN1_DC_AMT) AS CPN_AMT
+		    FROM TB_COUPON A, TB_CUST_COUPON B, TAB C
+		    WHERE A.CPN_ID = B.CPN_ID
+		        AND B.CUST_CPN_SQ = C.CPN1_CPN_SQ
+		        AND A.CPN_TYPE = 'G230_10'-- 즉시할인쿠폰
+		        AND C.CPN1_DC_AMT > 0
+		    -- 쿠폰번호조건 (CPN_ID)
+		    GROUP BY CPN_TYPE, A.CPN_ID, A.CPN_NM
+		    UNION ALL
+		    SELECT CPN_TYPE, A.CPN_ID, A.CPN_NM
+		        , 100 - IFNULL((SELECT MAX(BURDEN_RATE) FROM TB_COUPON_BURDEN X WHERE X.CPN_ID = A.CPN_ID), 0) AS BURDEN
+		        , COUNT(1) AS USE_CNT
+		        , SUM((C.CURR_PRICE + (SELECT SUM(OPT_ADD_PRICE * ITEM_QTY) FROM TB_ORDER_DETAIL_ITEM X WHERE X.ORD_DTL_NO = C.ORD_DTL_NO)) * (C.ORD_QTY - C.CNCL_RTN_QTY)) AS ORD_AMT
+		        , SUM(C.GOODS_CPN_DC_AMT) AS CPN_AMT
+		    FROM TB_COUPON A, TB_CUST_COUPON B, TAB C
+		    WHERE A.CPN_ID = B.CPN_ID
+		        AND B.CUST_CPN_SQ = C.GOODS_CPN_SQ
+		        AND A.CPN_TYPE = 'G230_11'-- 상품쿠푼
+		        AND C.GOODS_CPN_DC_AMT > 0
+		    -- 쿠폰번호조건 (CPN_ID)
+		    GROUP BY CPN_TYPE, A.CPN_ID, A.CPN_NM
+		    UNION ALL
+		    SELECT CPN_TYPE, A.CPN_ID, A.CPN_NM
+		        , 100 - IFNULL((SELECT MAX(BURDEN_RATE) FROM TB_COUPON_BURDEN X WHERE X.CPN_ID = A.CPN_ID), 0) AS BURDEN
+		        , COUNT(1) AS USE_CNT
+		        , SUM((C.CURR_PRICE + (SELECT SUM(OPT_ADD_PRICE * ITEM_QTY) FROM TB_ORDER_DETAIL_ITEM X WHERE X.ORD_DTL_NO = C.ORD_DTL_NO)) * (C.ORD_QTY - C.CNCL_RTN_QTY)) AS ORD_AMT
+		        , SUM(C.CART_CPN_DC_AMT) AS CPN_AMT
+		    FROM TB_COUPON A, TB_CUST_COUPON B, TAB C
+		    WHERE A.CPN_ID = B.CPN_ID
+		        AND B.CUST_CPN_SQ = C.CART_CPN_SQ
+		        AND A.CPN_TYPE = 'G230_20'-- 장바구니쿠푼
+		        AND C.CART_CPN_DC_AMT > 0
+		    -- 쿠폰번호조건 (CPN_ID)
+		    GROUP BY CPN_TYPE, A.CPN_ID, A.CPN_NM
+		    UNION ALL
+		    SELECT CPN_TYPE, A.CPN_ID, A.CPN_NM
+		        , 100 - IFNULL((SELECT MAX(BURDEN_RATE) FROM TB_COUPON_BURDEN X WHERE X.CPN_ID = A.CPN_ID), 0) AS BURDEN
+		        , COUNT(1) AS USE_CNT
+		        , SUM((C.CURR_PRICE + (SELECT SUM(OPT_ADD_PRICE * ITEM_QTY) FROM TB_ORDER_DETAIL_ITEM X WHERE X.ORD_DTL_NO = C.ORD_DTL_NO)) * (C.ORD_QTY - C.CNCL_RTN_QTY)) AS ORD_AMT
+		        , SUM(D.DELV_CPN_DC_AMT) AS CPN_AMT
+		    FROM TB_COUPON A, TB_CUST_COUPON B, TAB C, TB_DELIVERY_FEE D
+		    WHERE A.CPN_ID = B.CPN_ID
+		        AND B.CUST_CPN_SQ = C.CART_CPN_SQ
+		        AND C.ORD_NO = D.ORD_NO
+		        AND B.CUST_CPN_SQ = D.DELV_CPN_SQ
+		        AND A.CPN_TYPE = 'G230_30'-- 배송비쿠푼
+		        AND D.DELV_CPN_DC_AMT > 0
+		    -- 쿠폰번호조건 (CPN_ID)
+		    GROUP BY CPN_TYPE, A.CPN_ID, A.CPN_NM
+		)
+		SELECT CPN_TYPE -- 쿠폰타입
+		    , FN_GET_CODE_NM('G230', CPN_TYPE) AS CPN_TYPE_NM -- 쿠폰타입명
+		    , CPN_ID -- 쿠폰번호
+		    , CPN_NM -- 쿠폰명
+		    , BURDEN -- 자사분담율
+		    , DOWN_CNT
+		    , FLOOR(USE_CNT / DOWN_CNT * 100 * 10) / 10 AS USE_RATE -- 사용율
+		    , USE_CNT -- 사용수
+		    , ORD_AMT -- 주문금액
+		    , CPN_AMT -- 쿠폰비용
+		FROM (
+		    SELECT CPN_TYPE -- 쿠폰타입
+		        , FN_GET_CODE_NM('G230', CPN_TYPE) AS CPN_TYPE_NM -- 쿠폰타입명
+		        , CPN_ID -- 쿠폰번호
+		        , CPN_NM -- 쿠폰명
+		        , BURDEN -- 자사분담율
+		        , (SELECT COUNT(1) FROM TB_CUST_COUPON X WHERE X.CPN_ID = A.CPN_ID) AS DOWN_CNT
+		        , USE_CNT -- 사용수
+		        , ORD_AMT -- 주문금액
+		        , CPN_AMT -- 쿠폰비용
+		    FROM TAB_CPN_STAT A
+		    WHERE 1=1
+            <if test="multiCpnId != null">
+                /* 쿠폰번호 */
+                <foreach collection="multiCpnId" item="item" index="index"  open="AND A.CPN_ID IN (" close=")" separator=",">#{item}</foreach>
+            </if>
+            <if test="cpnTypeArr != null">
+                /* 쿠폰유형조건 (G230_10  즉시할인쿠폰, G230_11 상품쿠폰, G230_20   주문서쿠폰,  G230_30 배송비쿠폰 */
+                <foreach collection="cpnTypeArr" item="item" index="index"  open="AND A.CPN_TYPE IN (" close=")" separator=",">#{item}</foreach>
+            </if>
+		) A
+	</select>
+
+	<!-- 쿠폰사용통계상세조회 -->
+	<select id="getCouponOrderDetailList" parameterType="Statistics" resultType="Statistics">
+	   /* TsaStatistics.getCouponOrderDetailList */
+		SELECT Z.BRAND_CD
+		    , Z.BRAND_ENM
+		    , Z.GOODS_CD
+		    , Z.GOODS_NM
+		    , Z.ORD_AMT
+		    , Z.ORD_QTY
+		    , Z.CUST_CNT
+		    , X.CUST_CPN_CNT
+		    , FLOOR((X.CUST_CPN_CNT / Z.CUST_CNT * 100) / 10) * 10 AS ORD_RATE
+		FROM (
+		     SELECT
+		        A.BRAND_CD
+		        , B.BRAND_ENM
+		        , A.GOODS_CD
+		        , A.GOODS_NM
+		        , SUM(ORD_AMT) AS ORD_AMT
+		        , SUM(ORD_QTY) AS ORD_QTY
+		        , SUM(CUST_CNT) AS CUST_CNT
+		    FROM (
+		         SELECT
+		            C.BRAND_CD
+		            , C.GOODS_CD
+		            , C.GOODS_NM
+		            , SUM((B.CURR_PRICE + (SELECT SUM(OPT_ADD_PRICE * ITEM_QTY) FROM TB_ORDER_DETAIL_ITEM X WHERE X.ORD_DTL_NO = B.ORD_DTL_NO)) * (B.ORD_QTY - B.CNCL_RTN_QTY)) AS ORD_AMT
+		            , SUM(B.ORD_QTY - B.CNCL_RTN_QTY) AS ORD_QTY
+		            , COUNT(1) OVER(PARTITION BY C.BRAND_CD, C.GOODS_CD, A.CUST_NO) AS CUST_CNT
+		        FROM TB_ORDER A, TB_ORDER_DETAIL B, TB_GOODS C, TB_CUSTOMER D
+		        WHERE A.ORD_NO = B.ORD_NO
+		        AND B.GOODS_CD = C.GOODS_CD
+		        AND A.CUST_NO = D.CUST_NO
+	            <![CDATA[
+		        AND A.PAY_DT >= DATE_FORMAT(#{startDt}, '%Y-%m-%d')                         -- 시작일변수
+		        AND A.PAY_DT <= DATE_FORMAT(CONCAT(#{endDt}, ' 23:59:59'), '%Y-%m-%d %H:%i:%s') -- 종료일변수
+	            ]]>
+		        AND B.ORD_DTL_STAT NOT IN ('G013_00', 'G013_10', 'G013_98') -- 주문접수,입금대기,입금전취소 제외
+		        AND B.ORD_QTY > B.CNCL_RTN_QTY
+		        GROUP BY C.BRAND_CD, C.GOODS_CD, C.GOODS_NM, A.CUST_NO
+		    ) A, TB_BRAND B
+		    WHERE A.BRAND_CD = B.BRAND_CD
+		    GROUP BY A.BRAND_CD, B.BRAND_ENM, A.GOODS_CD
+		) Z
+		, (
+		    SELECT
+		        X.BRAND_CD
+		        , X.BRAND_ENM
+		        , X.GOODS_CD
+		        , X.CUST_CPN_CNT
+		    FROM (
+		        SELECT
+		            A.BRAND_CD
+		            , B.BRAND_ENM
+		            , A.GOODS_CD
+		            , SUM(A.CUST_CPN_CNT) AS CUST_CPN_CNT
+		        FROM (
+		            SELECT
+		                C.BRAND_CD
+		                , C.GOODS_CD
+		                , COUNT(1) OVER(PARTITION BY C.BRAND_CD, C.GOODS_CD, A.CUST_NO) AS CUST_CPN_CNT
+		            FROM TB_ORDER A, TB_ORDER_DETAIL B, TB_GOODS C, TB_CUSTOMER D
+		            WHERE A.ORD_NO = B.ORD_NO
+		            AND B.GOODS_CD = C.GOODS_CD
+		            AND A.CUST_NO = D.CUST_NO
+		            <![CDATA[
+		            AND A.PAY_DT >= DATE_FORMAT(#{startDt}, '%Y-%m-%d')                         -- 시작일변수
+		            AND A.PAY_DT <= DATE_FORMAT(CONCAT(#{endDt}, ' 23:59:59'), '%Y-%m-%d %H:%i:%s') -- 종료일변수
+		            ]]>
+		            AND B.ORD_DTL_STAT NOT IN ('G013_00', 'G013_10', 'G013_98') -- 주문접수,입금대기,입금전취소 제외
+		            AND B.ORD_QTY > B.CNCL_RTN_QTY
+		            AND EXISTS(
+		                SELECT 1
+		                FROM TB_COUPON X, TB_CUST_COUPON Y
+		                WHERE X.CPN_ID = Y.CPN_ID
+		                    AND Y.CUST_CPN_SQ = B.GOODS_CPN_SQ -- B.CPN1_CPN_SQ, B.CART_CPN_SQ (쿠폰종류에따라 설정)
+		                    AND X.CPN_ID = #{cpnId} -- 쿠폰번호변수
+		            )
+		            GROUP BY C.BRAND_CD, C.GOODS_CD, A.CUST_NO
+		        ) A, TB_BRAND B
+		        WHERE A.BRAND_CD = B.BRAND_CD
+		        GROUP BY A.BRAND_CD, B.BRAND_ENM, A.GOODS_CD
+		    ) X
+		) X
+		WHERE Z.BRAND_CD = X.BRAND_CD
+		    AND Z.GOODS_CD = X.GOODS_CD
+	</select>
+
+	<!-- 다다익선 주문 통계 조회 -->
+	<select id="getTmtbOrderList" parameterType="Statistics" resultType="Statistics">
+	   /* TsaStatistics.getTmtbOrderList */
+		WITH TAB AS (
+		    SELECT A.ORD_NO
+		         , B.ORD_DTL_NO
+		         , B.ORD_QTY
+		         , B.CNCL_RTN_QTY
+		         , B.ORD_AMT
+		         , B.CURR_PRICE
+		         , B.CNCL_RTN_AMT
+		         , B.ORD_DTL_STAT
+		         , A.PAY_DT
+		         , C.GOODS_CD
+		         , B.TMTB1_SQ
+		         , B.TMTB1_DC_AMT
+		         , B.TMTB2_SQ
+		         , B.TMTB2_DC_AMT
+		    FROM TB_ORDER A,
+		         TB_ORDER_DETAIL B,
+		         TB_GOODS C,
+		         TB_CUSTOMER D
+		    WHERE A.ORD_NO = B.ORD_NO
+		      AND B.GOODS_CD = C.GOODS_CD
+		      AND A.CUST_NO = D.CUST_NO
+		      <![CDATA[
+		      AND A.PAY_DT >= DATE_FORMAT(#{startDt}, '%Y-%m-%d')                         -- 시작일변수
+		      AND A.PAY_DT <= DATE_FORMAT(CONCAT(#{endDt}, ' 23:59:59'), '%Y-%m-%d %H:%i:%s') -- 종료일변수
+		      ]]>
+		      AND B.ORD_DTL_STAT NOT IN ('G013_00', 'G013_10', 'G013_98')               -- 주문접수,입금대기,입금전취소 제외
+		      AND B.ORD_QTY > B.CNCL_RTN_QTY
+              <if test="applyGbArr == null">
+	              /* 프로모션유형값없을시 */
+			      AND (B.TMTB1_DC_AMT + B.TMTB2_DC_AMT) > 0
+              </if>
+	          <if test="applyGbArr != null">
+	              /* 프로모션유형 */
+	              <foreach collection="applyGbArr" item="item" index="index">
+	                  <if test='item == "G810_10"'>
+	                      AND TMTB1_DC_AMT > 0 -- 수량
+	                  </if>
+	                  <if test='item == "G810_11"'>
+	                      AND TMTB2_DC_AMT > 0 -- 금액
+	                  </if>
+	              </foreach>
+	          </if>
+		)
+		-- 수량할인
+		, TMTB1 AS (
+		    SELECT
+		        TMTB_SQ
+		        , TMTB_NM
+		        , FN_GET_CODE_NM('G810', APPLY_GB) AS APPLY_GB
+		        , SUM(ORD_CNT) AS ORD_CNT
+		        , SUM(ORD_AMT) AS ORD_AMT
+		        , SUM(DC_AMT) AS DC_AMT
+		    FROM
+		    (
+		        SELECT A.TMTB_SQ
+		            , A.TMTB_NM
+		            , APPLY_GB
+		            , COUNT(1) AS ORD_CNT
+		            , SUM((B.CURR_PRICE + (SELECT SUM(OPT_ADD_PRICE * ITEM_QTY) FROM TB_ORDER_DETAIL_ITEM X WHERE X.ORD_DTL_NO = B.ORD_DTL_NO)) * (B.ORD_QTY - B.CNCL_RTN_QTY)) AS ORD_AMT
+		            , SUM(B.TMTB1_DC_AMT) AS DC_AMT
+		        FROM TB_TMTB A, TAB B
+		        WHERE A.TMTB_SQ = B.TMTB1_SQ
+		        GROUP BY A.TMTB_SQ, A.TMTB_NM, A.APPLY_GB, B.ORD_NO
+		    ) X
+		    GROUP BY TMTB_SQ, TMTB_NM, APPLY_GB
+		)
+		-- 금액할인
+		, TMTB2 AS (
+		    SELECT
+		        TMTB_SQ
+		        , TMTB_NM
+		        , FN_GET_CODE_NM('G810', APPLY_GB) AS APPLY_GB
+		        , SUM(ORD_CNT) AS ORD_CNT
+		        , SUM(ORD_AMT) AS ORD_AMT
+		        , SUM(DC_AMT) AS DC_AMT
+		    FROM
+		    (
+		        SELECT A.TMTB_SQ
+		            , A.TMTB_NM
+		            , APPLY_GB
+		            , COUNT(1) AS ORD_CNT
+		            , SUM((B.CURR_PRICE + (SELECT SUM(OPT_ADD_PRICE * ITEM_QTY) FROM TB_ORDER_DETAIL_ITEM X WHERE X.ORD_DTL_NO = B.ORD_DTL_NO)) * (B.ORD_QTY - B.CNCL_RTN_QTY)) AS ORD_AMT
+		            , SUM(B.TMTB1_DC_AMT) AS DC_AMT
+		        FROM TB_TMTB A, TAB B
+		        WHERE A.TMTB_SQ = B.TMTB2_SQ
+                <if test="applyGbArr != null">
+                    /* 프로모션유형 */
+                    <foreach collection="applyGbArr" item="item" index="index"  open="AND A.APPLY_GB IN (" close=")" separator=",">#{item}</foreach>
+                </if>
+		        GROUP BY A.TMTB_SQ, A.TMTB_NM, A.APPLY_GB, B.ORD_NO
+		    ) X
+		    GROUP BY TMTB_SQ, TMTB_NM, APPLY_GB
+		)
+		SELECT *
+		FROM TMTB1
+		WHERE 1=1
+        <if test="multiTmtbSq != null">
+            /* 프로모션번호  */
+            <foreach collection="multiTmtbSq" item="item" index="index"  open="AND TMTB_SQ IN (" close=")" separator=",">#{item}</foreach>
+        </if>
+		UNION ALL
+		SELECT *
+		FROM TMTB2
+		WHERE 1=1
+        <if test="multiTmtbSq != null">
+            /* 프로모션번호  */
+            <foreach collection="multiTmtbSq" item="item" index="index"  open="AND TMTB_SQ IN (" close=")" separator=",">#{item}</foreach>
+        </if>
+	</select>
+
+	<!-- 다다익선 주문 통계 상세조회 -->
+	<select id="getTmtbOrderDetailList" parameterType="Statistics" resultType="Statistics">
+	   /* TsaStatistics.getTmtbOrderDetailList */
+		SELECT
+		    A.BRAND_CD
+		    , B.BRAND_ENM
+		    , A.GOODS_CD
+		    , A.GOODS_NM
+		    , SUM(ORD_AMT) AS ORD_AMT
+		    , SUM(ORD_QTY) AS ORD_QTY
+		    , SUM(CUST_CNT) AS CUST_CNT
+		FROM (
+		     SELECT
+		        C.BRAND_CD
+		        , C.GOODS_CD
+		        , C.GOODS_NM
+		        , SUM((B.CURR_PRICE + (SELECT SUM(OPT_ADD_PRICE * ITEM_QTY) FROM TB_ORDER_DETAIL_ITEM X WHERE X.ORD_DTL_NO = B.ORD_DTL_NO)) * (B.ORD_QTY - B.CNCL_RTN_QTY)) AS ORD_AMT
+		        , SUM(B.ORD_QTY - B.CNCL_RTN_QTY) AS ORD_QTY
+		        , COUNT(1) OVER(PARTITION BY C.BRAND_CD, C.GOODS_CD, A.CUST_NO) AS CUST_CNT
+		    FROM TB_ORDER A, TB_ORDER_DETAIL B, TB_GOODS C, TB_CUSTOMER D
+		    WHERE A.ORD_NO = B.ORD_NO
+		    AND B.GOODS_CD = C.GOODS_CD
+		    AND A.CUST_NO = D.CUST_NO
+		    <![CDATA[
+		    AND A.PAY_DT >= DATE_FORMAT(#{startDt}, '%Y-%m-%d')                         -- 시작일변수
+		    AND A.PAY_DT <= DATE_FORMAT(CONCAT(#{endDt}, ' 23:59:59'), '%Y-%m-%d %H:%i:%s') -- 종료일변수
+		    ]]>
+		    AND B.ORD_DTL_STAT NOT IN ('G013_00', 'G013_10', 'G013_98') -- 주문접수,입금대기,입금전취소 제외
+		    AND B.ORD_QTY > B.CNCL_RTN_QTY
+            <if test="applyGbArr != null">
+                /* 프로모션유형 */
+                <foreach collection="applyGbArr" item="item" index="index">
+                    <if test='item == "G810_10"'>
+                        AND B.TMTB1_SQ = #{tmtbSq} -- 수량
+                    </if>
+                    <if test='item == "G810_11"'>
+                        AND B.TMTB2_SQ = #{tmtbSq} -- 금액
+                    </if>
+                </foreach>
+            </if>
+		    GROUP BY C.BRAND_CD, C.GOODS_CD, A.CUST_NO
+		) A, TB_BRAND B
+		WHERE A.BRAND_CD = B.BRAND_CD
+		GROUP BY A.BRAND_CD, B.BRAND_ENM, A.GOODS_CD
+	</select>
+
+	<!-- 사은품 주문조회 -->
+	<select id="getPlanOrderList" parameterType="Statistics" resultType="Statistics">
+	    /* TsaStatistics.getPlanOrderList */
+		SELECT
+		    CASE WHEN DISTRIBUTION_GB = 'G065_20' THEN '입점' ELSE '위탁' END AS DISTRIBUTION_GB
+		    , BRAND_ENM
+		    , PLAN_SQ
+		    , (SELECT PLAN_NM FROM TB_PLAN P WHERE P.PLAN_SQ = X.PLAN_SQ) AS PLAN_NM
+		    , SUM(ORD_AMT) AS ORD_AMT
+		    , SUM(ORD_CNT) AS ORD_CNT
+		FROM (
+		    SELECT C.DISTRIBUTION_GB
+		         , F.BRAND_ENM
+		         , E.PLAN_SQ
+		         , SUM((B.CURR_PRICE + (SELECT SUM(OPT_ADD_PRICE * ITEM_QTY) FROM TB_ORDER_DETAIL_ITEM X WHERE X.ORD_DTL_NO = B.ORD_DTL_NO)) * (B.ORD_QTY - B.CNCL_RTN_QTY)) AS ORD_AMT
+		         , COUNT(1) AS ORD_CNT
+		    FROM TB_ORDER A,
+		         TB_ORDER_DETAIL B,
+		         TB_GOODS C,
+		         TB_CUSTOMER D,
+		         TB_PLAN_DETAIL E,
+		         TB_BRAND F
+		    WHERE A.ORD_NO = B.ORD_NO
+		      AND B.GOODS_CD = C.GOODS_CD
+		      AND A.CUST_NO = D.CUST_NO
+		      AND B.PLAN_DTL_SQ = E.PLAN_DTL_SQ
+		      AND F.BRAND_CD = C.BRAND_CD
+		      <![CDATA[
+		      AND A.PAY_DT >= DATE_FORMAT(#{startDt}, '%Y-%m-%d')                         -- 시작일변수
+		      AND A.PAY_DT <= DATE_FORMAT(CONCAT(#{endDt}, ' 23:59:59'), '%Y-%m-%d %H:%i:%s') -- 종료일변수
+		      ]]>
+		      AND B.ORD_DTL_STAT NOT IN ('G013_00', 'G013_10', 'G013_98')               -- 주문접수,입금대기,입금전취소 제외
+		      AND B.ORD_QTY > B.CNCL_RTN_QTY
+	          <if test="multiDistributionGb != null">
+	              /* 물류구분 */
+	              <foreach collection="multiDistributionGb" item="item" index="index">
+	                  <if test="item == 'SCM'">
+	                      AND C.DISTRIBUTION_GB = 'G065_20' -- 입점
+	                  </if>
+	                  <if test="item == 'WMS'">
+		                  AND C.DISTRIBUTION_GB IN ('G065_10', 'G065_11', 'G065_12') -- 위탁
+	                  </if>
+	              </foreach>
+	          </if>
+		      <if test="multiTmtbSq != null">
+		          /* 기획전번호  */
+		          <foreach collection="multiPlanSq" item="item" index="index"  open="AND E.PLAN_SQ IN (" close=")" separator=",">#{item}</foreach>
+		      </if>
+		    GROUP BY C.DISTRIBUTION_GB, F.BRAND_ENM, E.PLAN_SQ, A.ORD_NO
+		) X
+		GROUP BY DISTRIBUTION_GB, BRAND_ENM, PLAN_SQ
+	</select>
+
+	<!-- 사은품 주문상세 조회 -->
+	<select id="getPlanOrderDetailList" parameterType="Statistics" resultType="Statistics">
+	    /* TsaStatistics.getPlanOrderDetailList */
+		WITH TAB AS (
+		    SELECT SUM(CUST_CNT) AS TOT_CUST_CNT
+		    FROM (
+		        SELECT COUNT(1) AS CUST_CNT
+		        FROM TB_ORDER A,
+		             TB_ORDER_DETAIL B,
+		             TB_GOODS C,
+		             TB_CUSTOMER D,
+		             TB_PLAN_DETAIL E,
+		             TB_BRAND F
+		        WHERE A.ORD_NO = B.ORD_NO
+		          AND B.GOODS_CD = C.GOODS_CD
+		          AND A.CUST_NO = D.CUST_NO
+		          AND B.PLAN_DTL_SQ = E.PLAN_DTL_SQ
+		          AND F.BRAND_CD = C.BRAND_CD
+		          <![CDATA[
+		          AND A.PAY_DT >= DATE_FORMAT(#{startDt}, '%Y-%m-%d')                         -- 시작일변수
+		          AND A.PAY_DT <= DATE_FORMAT(CONCAT(#{endDt}, ' 23:59:59'), '%Y-%m-%d %H:%i:%s') -- 종료일변수
+		          ]]>
+		          AND B.ORD_DTL_STAT NOT IN ('G013_00', 'G013_10', 'G013_98')               -- 주문접수,입금대기,입금전취소 제외
+		          AND B.ORD_QTY > B.CNCL_RTN_QTY
+		          AND E.PLAN_SQ = #{planSq}
+		        GROUP BY A.CUST_NO
+		    ) Z
+		)
+		SELECT
+		    CASE WHEN DISTRIBUTION_GB = 'G065_20' THEN '입점' ELSE '위탁' END AS DISTRIBUTION_GB
+		    , GOODS_CD
+		    , GOODS_NM
+		    , SUM(ORD_AMT) AS ORD_AMT
+		    , SUM(ORD_QTY) AS ORD_QTY
+		    , SUM(CUST_CNT) AS CUST_CNT
+		    , FLOOR((SUM(CUST_CNT) / (SELECT TOT_CUST_CNT FROM TAB) * 100) / 10) * 10 AS ORD_RATE
+		FROM (
+		     SELECT C.DISTRIBUTION_GB
+		         , C.GOODS_CD
+		         , C.GOODS_NM
+		         , SUM((B.CURR_PRICE + (SELECT SUM(OPT_ADD_PRICE * ITEM_QTY) FROM TB_ORDER_DETAIL_ITEM X WHERE X.ORD_DTL_NO = B.ORD_DTL_NO)) * (B.ORD_QTY - B.CNCL_RTN_QTY)) AS ORD_AMT
+		         , SUM(B.ORD_QTY - B.CNCL_RTN_QTY) AS ORD_QTY
+		         , COUNT(1) OVER(PARTITION BY C.DISTRIBUTION_GB, C.GOODS_CD, A.CUST_NO) AS CUST_CNT
+		    FROM TB_ORDER A,
+		         TB_ORDER_DETAIL B,
+		         TB_GOODS C,
+		         TB_CUSTOMER D,
+		         TB_PLAN_DETAIL E,
+		         TB_BRAND F
+		    WHERE A.ORD_NO = B.ORD_NO
+		      AND B.GOODS_CD = C.GOODS_CD
+		      AND A.CUST_NO = D.CUST_NO
+		      AND B.PLAN_DTL_SQ = E.PLAN_DTL_SQ
+		      AND F.BRAND_CD = C.BRAND_CD
+		      <![CDATA[
+		      AND A.PAY_DT >= DATE_FORMAT(#{startDt}, '%Y-%m-%d')                         -- 시작일변수
+		      AND A.PAY_DT <= DATE_FORMAT(CONCAT(#{endDt}, ' 23:59:59'), '%Y-%m-%d %H:%i:%s') -- 종료일변수
+		      ]]>
+		      AND B.ORD_DTL_STAT NOT IN ('G013_00', 'G013_10', 'G013_98')               -- 주문접수,입금대기,입금전취소 제외
+		      AND B.ORD_QTY > B.CNCL_RTN_QTY
+              <if test="multiDistributionGb != null">
+                  /* 물류구분 */
+                  <foreach collection="multiDistributionGb" item="item" index="index">
+                      <if test="item == 'SCM'">
+                          AND C.DISTRIBUTION_GB = 'G065_20' -- 입점
+                      </if>
+                      <if test="item == 'WMS'">
+                          AND C.DISTRIBUTION_GB IN ('G065_10', 'G065_11', 'G065_12') -- 위탁
+                      </if>
+                  </foreach>
+              </if>
+		      AND E.PLAN_SQ = #{planSq}
+		    GROUP BY C.DISTRIBUTION_GB, C.GOODS_CD, C.GOODS_NM, A.CUST_NO
+		) X
+		GROUP BY DISTRIBUTION_GB, GOODS_CD, GOODS_NM
+	</select>
+
+	<!-- 카드 목록 -->
+	<select id="getCardList" resultType="Card">
+		/* TsaStatistics.getCardList */
+		SELECT CD AS CARD_CD
+		, CD_NM AS CARD_NM
+		FROM   TB_COMMON_CODE
+		WHERE CD_GB = 'G050'
+		ORDER  BY CD_GB, DISP_ORD
+	</select>
+
+	<!-- 결제수단별통계 목록 -->
+	<select id="getPaymentList" parameterType="Statistics" resultType="Statistics">
+	/* TsaStatistics.getPaymentList */
+		WITH TAB AS (
+			SELECT
+				DATE_FORMAT(DAY, '%Y-%m-%d') AS DAY
+				, PAY_MEANS -- 결제수단
+				, PAY_AMT -- 결제금액
+				, PG_GB -- PG구분
+			FROM TB_STAT_PAY A
+			WHERE 1=1
+				AND A.DAY <![CDATA[>=]]> STR_TO_DATE(#{startDt},'%Y-%m-%d')
+			  	AND A.DAY <![CDATA[<]]> DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
+			<if test='multiCardId != null and multiCardId != ""'>
+				AND COM_CARD_CD IN
+				<foreach collection="multiCardId" item="item" index="index"  open="(" close=")" separator=",">
+					#{item}
+				</foreach>
+			</if>
+			<choose>
+			<when test='simpleGbC != null and simpleGbC != "" and simpleGbB != null and simpleGbB != ""'>
+				AND PG_GB IN('KAKAO','NAVER','PAYCO')
+			    AND PAY_MEANS IN ('G014_30','G014_10')
+			</when>
+			<when test='simpleGbC != null and simpleGbC != ""'>
+				AND PG_GB IN('KAKAO','NAVER','PAYCO')
+			  	AND PAY_MEANS = 'G014_30'
+			</when>
+			<when test='simpleGbB != null and simpleGbB != ""'>
+				AND PG_GB IN('KAKAO','NAVER','PAYCO')
+			  	AND PAY_MEANS = 'G014_10'
+			</when>
+			</choose>
+		)
+		SELECT
+			DAY
+			, SUM(CD_AMT) AS CD_AMT -- 카드
+			, SUM(AC_AMT) AS AC_AMT -- 실시간계좌이체
+			, SUM(VA_AMT) AS VA_AMT -- 무통장
+			, SUM(HP_AMT) AS HP_AMT -- 휴대폰
+			, SUM(CP_AMT) AS CP_AMT -- PG쿠폰
+			, SUM(NPAY_AMT) AS NPAY_AMT -- 네이버페이
+			, SUM(PAYCO_AMT) AS PAYCO_AMT -- 페이코
+			, SUM(KAKAO_AMT) AS KAKAO_AMT -- 카카오
+		FROM (
+			SELECT
+				DAY
+				, CASE WHEN PAY_MEANS = 'G014_30' THEN PAY_AMT ELSE 0 END AS CD_AMT
+				, CASE WHEN PAY_MEANS = 'G014_10' THEN PAY_AMT ELSE 0 END AS AC_AMT
+				, CASE WHEN PAY_MEANS = 'G014_20' THEN PAY_AMT ELSE 0 END AS VA_AMT
+				, CASE WHEN PAY_MEANS = 'G014_60' THEN PAY_AMT ELSE 0 END AS HP_AMT
+				, CASE WHEN PAY_MEANS = 'G014_50' THEN PAY_AMT ELSE 0 END AS CP_AMT
+				, CASE WHEN PAY_MEANS = 'NAVER' THEN PAY_AMT ELSE 0 END AS NPAY_AMT
+				, CASE WHEN PAY_MEANS = 'PAYCO' THEN PAY_AMT ELSE 0 END AS PAYCO_AMT
+				, CASE WHEN PAY_MEANS = 'KAKAO' THEN PAY_AMT ELSE 0 END AS KAKAO_AMT
+			FROM (
+				SELECT
+			<choose>
+				<when test='dayGb == "W"'> <!-- 주별 -->
+					CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주') AS DAY
+				</when>
+				<when test='dayGb == "M"'> <!-- 월별 -->
+					DATE_FORMAT(DAY,'%Y-%m')                          AS DAY
+				</when>
+				<otherwise> <!-- 일별 -->
+					DATE_FORMAT(DAY,'%Y-%m-%d')                       AS DAY
+				</otherwise>
+			</choose>
+					, PAY_MEANS
+					, SUM(PAY_AMT) AS PAY_AMT
+				FROM TAB
+				WHERE PAY_MEANS = 'G014_30'
+		<choose>
+			<when test='dayGb == "W"'> <!-- 주별 -->
+				GROUP  BY CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주')
+			</when>
+			<when test='dayGb == "M"'> <!-- 월별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m')
+			</when>
+			<otherwise> <!-- 일별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m-%d')
+			</otherwise>
+		</choose>
+				UNION ALL
+				SELECT
+			<choose>
+				<when test='dayGb == "W"'> <!-- 주별 -->
+					CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주') AS DAY
+				</when>
+				<when test='dayGb == "M"'> <!-- 월별 -->
+					DATE_FORMAT(DAY,'%Y-%m')                          AS DAY
+				</when>
+				<otherwise> <!-- 일별 -->
+					DATE_FORMAT(DAY,'%Y-%m-%d')                       AS DAY
+				</otherwise>
+			</choose>
+					, PAY_MEANS
+					, SUM(PAY_AMT) AS PAY_AMT
+				FROM TAB
+				WHERE PAY_MEANS = 'G014_10'
+		<choose>
+			<when test='dayGb == "W"'> <!-- 주별 -->
+				GROUP  BY CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주')
+			</when>
+			<when test='dayGb == "M"'> <!-- 월별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m')
+			</when>
+			<otherwise> <!-- 일별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m-%d')
+			</otherwise>
+		</choose>
+				UNION ALL
+				SELECT
+			<choose>
+				<when test='dayGb == "W"'> <!-- 주별 -->
+					CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주') AS DAY
+				</when>
+				<when test='dayGb == "M"'> <!-- 월별 -->
+					DATE_FORMAT(DAY,'%Y-%m')                          AS DAY
+				</when>
+				<otherwise> <!-- 일별 -->
+					DATE_FORMAT(DAY,'%Y-%m-%d')                       AS DAY
+				</otherwise>
+			</choose>
+					, PAY_MEANS
+					, SUM(PAY_AMT) AS PAY_AMT
+				FROM TAB
+				WHERE PAY_MEANS = 'G014_20'
+		<choose>
+			<when test='dayGb == "W"'> <!-- 주별 -->
+				GROUP  BY CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주')
+			</when>
+			<when test='dayGb == "M"'> <!-- 월별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m')
+			</when>
+			<otherwise> <!-- 일별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m-%d')
+			</otherwise>
+		</choose>
+				UNION ALL
+				SELECT
+			<choose>
+				<when test='dayGb == "W"'> <!-- 주별 -->
+					CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주') AS DAY
+				</when>
+				<when test='dayGb == "M"'> <!-- 월별 -->
+					DATE_FORMAT(DAY,'%Y-%m')                          AS DAY
+				</when>
+				<otherwise> <!-- 일별 -->
+					DATE_FORMAT(DAY,'%Y-%m-%d')                       AS DAY
+				</otherwise>
+			</choose>
+					, PAY_MEANS
+					, SUM(PAY_AMT) AS PAY_AMT
+				FROM TAB
+				WHERE PAY_MEANS = 'G014_60'
+		<choose>
+			<when test='dayGb == "W"'> <!-- 주별 -->
+				GROUP  BY CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주')
+			</when>
+			<when test='dayGb == "M"'> <!-- 월별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m')
+			</when>
+			<otherwise> <!-- 일별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m-%d')
+			</otherwise>
+		</choose>
+				UNION ALL
+				SELECT
+			<choose>
+				<when test='dayGb == "W"'> <!-- 주별 -->
+					CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주') AS DAY
+				</when>
+				<when test='dayGb == "M"'> <!-- 월별 -->
+					DATE_FORMAT(DAY,'%Y-%m')                          AS DAY
+				</when>
+				<otherwise> <!-- 일별 -->
+					DATE_FORMAT(DAY,'%Y-%m-%d')                       AS DAY
+				</otherwise>
+			</choose>
+					, PAY_MEANS
+					, SUM(PAY_AMT) AS PAY_AMT
+				FROM TAB
+				WHERE PAY_MEANS = 'G014_50'
+		<choose>
+			<when test='dayGb == "W"'> <!-- 주별 -->
+				GROUP  BY CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주')
+			</when>
+			<when test='dayGb == "M"'> <!-- 월별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m')
+			</when>
+			<otherwise> <!-- 일별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m-%d')
+			</otherwise>
+		</choose>
+				UNION ALL
+				SELECT
+			<choose>
+				<when test='dayGb == "W"'> <!-- 주별 -->
+					CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주') AS DAY
+				</when>
+				<when test='dayGb == "M"'> <!-- 월별 -->
+					DATE_FORMAT(DAY,'%Y-%m')                          AS DAY
+				</when>
+				<otherwise> <!-- 일별 -->
+					DATE_FORMAT(DAY,'%Y-%m-%d')                       AS DAY
+				</otherwise>
+			</choose>
+					, PG_GB AS PAY_MEANS
+					, SUM(PAY_AMT) AS PAY_AMT
+				FROM TAB
+				WHERE PG_GB = 'NAVER'
+		<choose>
+			<when test='dayGb == "W"'> <!-- 주별 -->
+				GROUP  BY CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주')
+			</when>
+			<when test='dayGb == "M"'> <!-- 월별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m')
+			</when>
+			<otherwise> <!-- 일별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m-%d')
+			</otherwise>
+		</choose>
+				UNION ALL
+				SELECT
+			<choose>
+				<when test='dayGb == "W"'> <!-- 주별 -->
+					CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주') AS DAY
+				</when>
+				<when test='dayGb == "M"'> <!-- 월별 -->
+					DATE_FORMAT(DAY,'%Y-%m')                          AS DAY
+				</when>
+				<otherwise> <!-- 일별 -->
+					DATE_FORMAT(DAY,'%Y-%m-%d')                       AS DAY
+				</otherwise>
+			</choose>
+					, PG_GB AS PAY_MEANS
+					, SUM(PAY_AMT) AS PAY_AMT
+				FROM TAB
+				WHERE PG_GB = 'PAYCO'
+		<choose>
+			<when test='dayGb == "W"'> <!-- 주별 -->
+				GROUP  BY CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주')
+			</when>
+			<when test='dayGb == "M"'> <!-- 월별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m')
+			</when>
+			<otherwise> <!-- 일별 -->
+				GROUP  BY DATE_FORMAT(DAY,'%Y-%m-%d')
+			</otherwise>
+		</choose>
+				UNION ALL
+				SELECT
+			<choose>
+				<when test='dayGb == "W"'> <!-- 주별 -->
+					CONCAT(MONTH(DAY), '월 ', WEEK(DAY,5) - WEEK(DATE_SUB(DAY, INTERVAL DAYOFMONTH(DAY) - 1 DAY), 5) + 1, '주') AS DAY
+				</when>
+				<when test='dayGb == "M"'> <!-- 월별 -->
+					DATE_FORMAT(DAY,'%Y-%m')                          AS DAY
+				</when>
+				<otherwise> <!-- 일별 -->
+					DATE_FORMAT(DAY,'%Y-%m-%d')                       AS DAY
+				</otherwise>
+			</choose>
+					, PG_GB AS PAY_MEANS
+					, SUM(PAY_AMT) AS PAY_AMT
+				FROM TAB
+				WHERE PG_GB = 'KAKAO'
+				GROUP BY DAY
+			) Z
+		) Z
+		GROUP BY DAY
+	</select>
+
 </mapper>
 </mapper>

+ 152 - 0
src/main/webapp/WEB-INF/views/business/Bizday2Form.html

@@ -0,0 +1,152 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : Bizday2Form.html
+ * @desc    : 총알배송영업일관리 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.09.29   gagamel     최초 작성
+ *******************************************************************************
+ -->
+	<link rel="stylesheet" href="/ux/plugins/fullcalendar/fullcalendar-4.2.0.css"/>
+	
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+		
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc">
+		</div>
+		<!-- //메뉴 설명 -->
+		
+		<div class="panelStyle">
+			<ul class="notice">
+				<li><strong class="cBlue">영업일 : </strong>휴일을 클릭하시면 영업일로 변경됩니다.</li>
+				<li><strong class="cRed">휴무일 : </strong>영업일을 클릭하시면 휴무일로 변경됩니다.</li>
+			</ul>
+			
+			<!-- FULLCALENDAR -->
+			<div id="calendar"></div>
+			<!-- //FULLCALENDAR -->
+		</div>
+	</div>
+	
+	<form id="calendarForm" name="calendarForm">
+		<input type="hidden" name="startDt" id="startDt"/>
+		<input type="hidden" name="endDt" id="endDt"/>
+		<input type="hidden" name="bizday" id="bizday"/>
+	</form>
+
+<script type="text/javascript" src="/ux/plugins/fullcalendar/fullcalendar-4.2.0.js"></script>
+<script th:inline="javascript">
+/*<![CDATA[*/
+	// 해당월의 시작일, 마지막일 설정
+	var setViewDate = function(date) {
+		var dt = [];
+		dt[0] = (new Date(date.startStr)).format('YYYYMMDD');
+		dt[1] = (new Date(date.endStr)).format('YYYYMMDD');
+		return dt;
+	}
+	
+	// 휴일,영업일 업데이트(저장)
+	var fnUpdateBizday = function(day ,arg) {
+		var start = "";
+		var end = "";
+		$('#calendarForm input[name=bizday]').val("");
+		
+		if (day == 'Holiday') {
+			var bizday = (new Date(arg.start)).format('YYYYMMDD');
+			$('#calendarForm input[name=bizday]').val(bizday);
+			
+			gagajf.ajaxFormSubmit('/business/bizday2/save', '#calendarForm', function() {
+				calendar.addEvent({
+					title: '휴일',
+					start: arg.start,
+					end: arg.end,
+					allDay: arg.allDay
+				});
+			});
+		} else {
+			var bizday = (new Date(arg.event.start)).format('YYYYMMDD');
+			$('#calendarForm input[name=bizday]').val(bizday);
+			
+			gagajf.ajaxFormSubmit('/business/bizday2/save', '#calendarForm', function() {
+				arg.event.remove();
+			});
+		}
+	}
+	
+	// 캘린더 생성
+	var calendar;
+	var fnCreateCalendar = function() {
+		var calendarEl = document.getElementById('calendar');
+		
+		calendar = new FullCalendar.Calendar(calendarEl, {
+			plugins: [ 'interaction', 'dayGrid' ],
+			locale: 'ko', // 한글화
+// 			weekNumberCalculation: 'ISO', //월~일 순서로
+			selectable: true,
+			editable: true,
+			eventLimit: true, // allow "more" link when too many events
+
+			select: function(arg) {
+				if ((new Date(arg.end)).format('YYYYMMDD') - (new Date(arg.start)).format('YYYYMMDD') > 1) return;
+				var title ='휴일';
+				
+				mcxDialog.confirm("휴일로 변경하시겠습니까?", {
+					cancelBtnText: "취소",
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						fnUpdateBizday('Holiday', arg);
+					}
+				});
+				calendar.unselect();
+			},
+
+			// 영업일로 변경 -----
+			eventClick: function(arg) {
+				mcxDialog.confirm("영업일로 변경하시겠습니까?", {
+					cancelBtnText: "취소",
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						fnUpdateBizday('Bizday', arg);
+					}
+				});
+			},
+
+			events: function(info, callback) {
+				var dt = setViewDate(info);
+				$('#calendarForm input[name=startDt]').val(dt[0]);
+				$('#calendarForm input[name=endDt]').val(dt[1]);
+				$.get('/business/holiday2/list' + '?' + $('#calendarForm').serialize()
+					, function(data) {
+						var events = [];
+						for (var i = 0 ; i < data.length ; i++) {
+							events.push({
+								title : (gagajf.isNull(data[i].restdayDesc) ? '' : data[i].restdayDesc),
+								start : data[i].bizday
+							});
+						}
+						callback(events);
+					});
+			}
+		});
+		
+		calendar.render();
+	}
+
+	$(document).ready(function() {
+		fnCreateCalendar();
+	});
+/*]]>*/
+</script>
+
+</html>

+ 152 - 0
src/main/webapp/WEB-INF/views/business/SupplyCompanyPopupForm2.html

@@ -0,0 +1,152 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : SupplyCompanyPopupForm2.html
+ * @desc    : 공급업체 목록 페이지
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.12.23   xodud1202   최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="530" id="popupCompanyList2">
+	<div class="panelStyle"  style="max-height:700px;overflow-y:scroll;">
+		<!-- TITLE -->
+		<div class="panelTitle">
+			<strong>공급업체 목록</strong>
+			<button type="button" class="close" onclick="uifnPopupClose('popupCompanyList2');"><em class="fa fa-times"></em></button>
+		</div>
+		<!-- //TITLE -->
+		<!-- 검색 조건 -->
+		<div class="panelContent">
+			<form id="searchCompanyListForm" name="searchCompanyListForm" action="#" th:action="@{'/business/supply/company/scm/list'}" onsubmit="$('#btnSearchCompanyList').trigger('click'); return false;">
+				<input type="hidden" name="searchGb" value="NAME" />		<!-- 공급업체 목록 검색 조건은 업체명으로만 -->
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:15%;"/>
+						<col style="width:35%;"/>
+						<col style="width:15%;"/>
+						<col/>
+					</colgroup>
+					<tbody>
+						<tr>
+							<th>사용여부</th>
+							<td colspan="3">
+								<select name="useYn" id="useYn">
+									<option value="">전체</option>
+									<option value="Y" selected>사용</option>
+									<option value="N">중지</option>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<th>업체코드<i class="required" title="필수"></i></th>
+							<td>
+								<textarea class="textareaR2" name="searchSupplyCompCd" id="searchSupplyCompCd"></textarea>
+							</td>
+							<th>업체명<i class="required" title="필수"></i></th>
+							<td>
+								<textarea class="textareaR2" name="searchSupplyCompNm" id="searchSupplyCompNm"></textarea>
+							</td>
+						</tr>
+					</tbody>
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearchCompanyList">조회</button>
+					</li>
+				</ul>
+			</form>
+			<!-- 리스트 영역 -->
+			<div class="panelContent">
+				<div id="gridComapanyPopupList" style="width: 100%; height: 380px" class="ag-theme-balham"></div>
+			</div>
+			<!-- //리스트 영역 -->
+	
+			<!-- 버튼 배치 영역 -->
+			<ul class="panelBar">
+				<li class="right">
+					<button type="button" class="btn btn-info btn-lg" id="btnConfirmCompany">확인</button>
+				</li>
+			</ul>
+		</div>
+		<!-- //검색 조건 -->
+	</div>
+	<script th:inline="javascript">
+		/*<![CDATA[*/
+		let headerSelection = false;
+		if([[${params.multiGb}]] == "M") headerSelection = true;
+		let columnCompanyPopupDefList = [
+			{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: headerSelection, checkboxSelection: true, filter: false},
+			{headerName: "공급업체번호", field: "supplyCompCd", width: 120, cellClass: 'text-center'},
+			{headerName: "공급업체국문명", field: "supplyCompNm", width: 150, cellClass: 'text-center'},
+			{headerName: "입점상태", field: "supplyStatNm", width: 150, cellClass: 'text-center'}
+		];
+
+		let gridOptionsCompanyPopupList = gagaAgGrid.getGridOptions(columnCompanyPopupDefList);
+		if(headerSelection) {	gridOptionsCompanyPopupList.rowSelection = "multiple";	}
+
+		// Row double click
+		gridOptionsCompanyPopupList.onRowDoubleClicked = function(event) {
+			$('#btnConfirmCompany').trigger('click');
+		}
+
+		// 조회
+		$('#btnSearchCompanyList').on('click', function() {
+			
+			// if (gagajf.isNull($('#searchCompanyListForm textarea[name=searchSupplyCompCd]').val())  && gagajf.isNull($('#searchCompanyListForm textarea[name=searchSupplyCompNm]').val())){
+			// 	mcxDialog.alert('검색조건을 입력하세요.');
+			// 	return false;
+			// }
+			
+			// Fetch data
+			gagaAgGrid.fetch($('#searchCompanyListForm').prop('action'), gridOptionsCompanyPopupList, '#searchCompanyListForm');
+		});
+
+		// 확인
+		$('#btnConfirmCompany').on('click', function() {
+			var selectedData = gagaAgGrid.selectedRowData(gridOptionsCompanyPopupList);
+
+			if (selectedData.length == 0) {
+				mcxDialog.alert('선택된 공급업체가 없습니다.');
+				return false;
+			}
+
+			var callbackFn = [[${params.callbackFn}]];
+
+			var jsonData = JSON.stringify(selectedData);
+
+			if (typeof callbackFn != 'undefined' && callbackFn) {
+				if (typeof callbackFn == 'function') {
+					callbackFn(jsonData);
+				} else {
+					if (callbackFn) {
+						if (callbackFn.indexOf("(") == -1) {
+							(new Function(callbackFn + "(" + jsonData + ");"))();
+						} else {
+							(new Function(callbackFn(jsonData)))();
+						}
+					}
+				}
+				uifnPopupClose('popupCompanyList2');
+			}
+		});
+
+		$(document).ready(function() {
+			// Create a agGrid
+			gagaAgGrid.createGrid('gridComapanyPopupList', gridOptionsCompanyPopupList);
+
+			//  조회
+			//$('#btnSearchCompanyList').trigger('click');
+		});
+		/*]]>*/
+	</script>
+
+</div>
+
+</html>

+ 612 - 0
src/main/webapp/WEB-INF/views/delivery/DeliveryListScmForm.html

@@ -0,0 +1,612 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : DeliveryListForm.html
+ * @desc    : 배송목록(입점)Page
+ *============================================================================
+ * ISTYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.09.15   moon        최초 작성
+ *******************************************************************************
+ -->
+<div id="main">
+	<!-- 메인타이틀 영역 -->
+	<div class="main-title">
+	</div>
+	<!-- //메인타이틀 영역 -->
+
+	<!-- 메뉴 설명 -->
+	<div class="infoBox menu-desc">
+	</div>
+	<!-- //메뉴 설명 -->
+	<!-- 검색조건 영역 -->
+	<form id="searchForm" name="searchForm" action="#" th:action="@{'/delivery/scm/list/'}" onsubmit="fnSearchList(); return false;">
+	<div class="panelStyle">
+		<!-- TITLE -->
+		<div class="panelTitle">
+			<h3><i class="fa fa-info-circle"></i>아래 검색조건 <font color="red">기간, 키워드</font>중 하나를 꼭 입력해 주세요.</h3>
+			<span class="panelControl">
+				<i class="fa fa-chevron-up"></i>
+			</span>
+		</div>
+		<!-- //TITLE -->
+		<div class="panelContent">
+
+				<table class="frmStyle">
+					<colgroup>
+						<col style="width:8%;"/>
+						<col style="width:12%;"/>
+						<col style="width:8%;"/>
+						<col style="width:12%;"/>
+						<col style="width:8%;"/>
+						<col style="width:12%;"/>
+						<col style="width:8%;"/>
+						<col style="width:12%;"/>
+					</colgroup>
+					<tr>
+						<th>업체</th>
+						<td>
+							<input type="text" class="w100" name="supplyCompSearchTxt" id="supplyCompSearchTxt" maxlength="20" />
+							<button type="button" class="btn icn" id="btnSearchSupplyComp"><i class="fa fa-search"></i></button>
+							<span id="supplyCompText"></span>
+							<input type="hidden" name="supplyCompList"/>
+						</td>
+
+						<th>주문상세상태</th>
+						<td colspan="3">
+							<div class="multiCheckBox" style="width:190px">
+								<button type="button" class="sltBtn" data-name="[전체]" style="overflow-x: hidden; padding-right:5px;">[전체]</button>
+								<ul style="display: none; box-shadow: 3px 3px 3px; overflow-y: scroll; height: 112px;" id="group1">
+									<li th:if="${ordDtlStatList}" th:each="oneData, status : ${ordDtlStatList}">
+										<label class="chkBox" data-group="group1">
+											<input type="checkbox" name="multiOrdDtlStat" th:value="${oneData.cd}" th:text="|[${oneData.cd}] ${oneData.cdNm}|">
+										</label>
+									</li>
+								</ul>
+							</div>
+						</td>
+						
+						<th rowspan="5">키워드<em class="required" title="필수"></em><i class="star"></i></th>
+						<td rowspan="5" colspan="5">
+							<select class="w200" name="search" id="search">
+								<option value="searchOrdNo">주문번호</option>
+								<option value="searchCustId">고객ID</option>
+							</select>
+							<textarea class="textareaR3 w90p" name="condition" id="condition"></textarea>
+						</td>
+						
+												
+					</tr>
+					<tr>
+						<th>주문자명</th>
+						<td>
+							<input type="text" class="" name="orderNm" placeholder="" maxlength="20"/>
+						</td>
+						<th>주문자휴대폰번호</th>
+						<td>
+							<input type="text" class="" name="orderPhnno" placeholder="" maxlength="20"/>
+						</td>
+						<th>주문상세번호</th>
+						<td>
+							<input type="text" class="w200" name="ordDtlNo" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" placeholder="" maxlength="9"/>
+						</td>
+
+					</tr>
+					<tr>
+						<th>수령인</th>
+						<td>
+							<input type="text" class="" name="recipNm" placeholder="" maxlength="20"/>
+						</td>
+						<th>송장번호</th>
+						<td>
+							<input type="text" class="" name="invoiceNo" placeholder="" maxlength="20"/>
+						</td>
+						<th>상품코드</th>
+						<td>
+							<input type="text" class="w200" name="goodsCd" placeholder="" maxlength="20"/>
+						</td>
+					</tr>
+					<tr>
+						<th>고객ID</th>
+						<td>
+							<input type="text" class="" name="custId" placeholder="" maxlength="20" />
+						</td>
+						<th>배송지연일</th>
+						<td colspan="4">
+							<input type="text" class="w50" name="delvDelayDays" data-valid-type="integer" placeholder="" maxlength="3" style="width:20%;"/>일
+							이상(결제일 기준)
+						</td>
+					</tr>
+					<tr>
+						<th>기간<em class="required" title="필수"></em></th>
+						<td colspan="8">
+							<select name="termGb" id="termGb">
+								<option value="ordDt">주문등록일</option>
+								<option value="delvDt">배송일자</option>
+								<option value="delvStDt">배송시작일자</option>
+							</select>
+							<span id="terms"></span>
+						</td>
+					</tr>
+
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+					<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
+					<button type="button" class="btn btn-gray btn-lg" onclick="$('#searchForm')[0].reset(); fnInitCalendar(); $('#multiBrand').empty(); fnInitSupplyComp();">초기화</button>
+					<button type="button" id="btnExcel" class="btn btn-info btn-lg">엑셀다운로드</button>
+					</li>
+				</ul>
+
+		</div>
+	</div>
+	<!-- //검색조건 영역 -->
+
+	<!-- 리스트 영역 -->
+	<div class="panelStyle">
+		<ul class="panelBar">
+			<li class="left">
+				<!--  <button type="button" id="btnSoldout" class="btn btn-danger btn-lg">품절처리</button> -->
+				<!-- <button type="button" id="btnSave" class="btn btn-success btn-lg btnRight" onclick="deliveryInfoSave();">저장</button>
+				<button type="button" id="btnWith" class="btn btn-success btn-lg btnRight">T</button> -->
+			</li>
+			<li class="right">
+				검색결과 : <strong><span id="gridRowTotalCount">0</span> 건</strong>&nbsp;
+				쪽번호 <span id="pgNo">0</span>/ <strong id="endPgNo">0</strong>&nbsp;&nbsp;
+				<select id="pageSize" name="pageSize">
+					<option value="50" selected="selected">50개씩 보기</option>
+					<option value="100">100개씩 보기</option>
+					<option value="500">500개씩 보기</option>
+					<option value="1000">1000개씩 보기</option>
+					<option value="3000">3000개씩 보기</option>
+					<option value="5000">5000개씩 보기</option>
+				</select>
+				<input type="hidden" name="pageNo" id="pageNo" value ="1"/>
+			</li>
+		</ul>
+
+		<div id="gridDeliveryList" style="width:100%; height: 700px;" class="ag-theme-balham"></div>
+		<ul class="panelBar">
+			<li class="center">
+				<div class="tablePaging" id="deliveryListPagination"></div>
+			</li>
+		</ul>
+	</div>
+	</form>
+	<!-- //리스트 영역 -->
+</div>
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=20210114"></script>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	/*************************************************************************
+	* AG-GRID 영역
+	**************************************************************************/
+	var shipCompanyList =  gagajf.convertToArray([[${shipCompanyList}]]);
+	var roleCd          = [[${sessionInfo.roleCd}]];
+	var currOrdNo       = 0;
+	var columnDefs = [
+		/*
+		{
+			headerName: "결품",
+			field: "soldout",
+			width: 50,
+			cellClass: 'text-center',
+			headerCheckboxSelection: true,
+			headerCheckboxSelectionFilteredOnly: true
+			,
+			checkboxSelection: function (params) {
+				return (params.data.ordDtlStat == 'G013_20') ? true : false;
+			}
+		},
+		*/
+		{headerName: "지연일",	field: "delvDelayDays", 	width: 70, cellClass: 'text-center'},
+		{headerName: "업체명", 	field: "supplyCompNm", 	width: 150, cellClass: 'text-center'},
+		{headerName: "주문번호",	field: "ordNo", width: 95, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				if (roleCd.indexOf("C") < 0) {
+					return "<a href=\"javascript:void(0);\" onclick=\"fnOrderDetailPopup('" + params.data.ordNo + "');\">" + params.data.ordNo + "</a>";
+				} else {
+					return params.value;
+				}
+			}
+		},
+		{headerName: "주문상세번호", 	field: "ordDtlNo", 		width: 90, cellClass: 'text-center'},
+		{headerName: "주문상세상태", 	field: "ordDtlStatNm", 	width: 120, cellClass: 'text-center'},
+		{headerName: "주문교환", 		field: "ordExchGb", 	width: 80, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				if (params.value == "Y") {
+					return "교환";
+				} else {
+					return "주문";
+				}
+			}
+		},
+		{headerName: "판매몰명", 		field: "extmallNm", 	width: 150, cellClass: 'text-left'},
+		{headerName: "주문일시", 		field: "ordDt", 		width: 150, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				return !gagajf.isNull(params.value) ? gagaAgGrid.toDateTimeFormat(params.value) : '';
+			}
+		},
+		{headerName: "결제일시", 		field: "ordDt", 		width: 150, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				return !gagajf.isNull(params.value) ? gagaAgGrid.toDateTimeFormat(params.value) : '';
+			}
+		},
+		{headerName: "몰구분", 		field: "mallGbNm", 		width: 70, cellClass: 'text-center'},
+		{headerName: "주문자", 		field: "maskingOrdNm", 		width: 100, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				if (roleCd.indexOf("C") < 0 && !gagajf.isNull(params.value) && params.data.mallGb === 'G011_10' && params.data.custNo > 0) {
+					return '<a href="javascript:void(0);" onclick=\"cfnOpenCustDetailPopup(' + params.data.custNo + ');\">' + params.data.maskingOrdNm + '</a>';
+				} else {
+					return params.data.maskingOrdNm;
+				}
+			}
+		},
+		{headerName: "고객ID", 			field: "custId", 		width: 100, cellClass: 'text-center'},
+		{headerName: "휴대번호", 		field: "maskingOrdPhnno", 		width: 100, cellClass: 'text-center',
+			valueGetter: function (params) { return params.data.maskingOrdPhnno; }
+		},
+		{headerName: "LMS", 			field: "maskingOrdPhnno", 	width: 80, cellClass: "text-center",
+			cellRenderer: function(params) {
+				return '<button type="button" class="btn btn-base btn-sm" onclick="fnLms(\'' + params.data.ordPhnno + '\',\'' + params.data.custNo + '\');">&nbsp;LMS&nbsp;</button>';
+			}
+		},
+		{headerName: "수령인", 		field: "maskingRecipNm", 		width: 100, cellClass: 'text-center'},
+		
+		{headerName: "상품코드", 		field: "goodsCd", 		width: 120, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				if (roleCd.indexOf("C") < 0) {
+					return "<a href=\"javascript:void(0);\" onclick=\"cfnOpenGoodsDetailPopup('U','" + params.value + "');\">" + params.value + "</a>";
+				} else {
+					return params.value;
+				}
+			}
+		},
+		{headerName: "구성유형", 		field: "goodsTypeNm",	 width: 130, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				var option;
+				if (params.data.goodsType == 'G056_S') {
+					option = "<a href=\"javascript:void(0);\" onclick=\"fnOrderDetailItemForm('" + params.data.ordDtlNo + "');\">" + params.value + "</a>";
+				} else {
+					option = params.value
+				}
+				return option;
+			}
+		},
+		{headerName: "상품명", 		field: "goodsNm", 		width: 280, cellClass: 'text-left'},
+		{headerName: "옵션코드", 		field: "optCd", 		width: 100, cellClass: 'text-left'},
+		{headerName: "옵션코드1", 		field: "optCd1", 		width: 100, cellClass: 'text-center'},
+		{headerName: "옵션코드2", 		field: "optCd2", 		width: 100, cellClass: 'text-center'},
+		{headerName: "주문수량", 		field: "ordQty", 		width: 80, cellClass: 'text-center'},
+		{headerName: "취소수량", 		field: "cnclRtnQty", 	width: 80, cellClass: 'text-center'},
+		{headerName: "판매수량", 		field: "saleQty", 		width: 80, cellClass: 'text-right'},
+		{headerName: "판매금액", 		field: "saleAmt", 		width: 100, cellClass: 'text-right'
+			, valueFormatter: function (params) {
+				return params.value.addComma();
+			}
+		},
+		{headerName: "실결제금액", 	field: "realOrdAmt", 	width: 100, cellClass: 'text-right'
+			, valueFormatter: function (params) {
+				return params.value.addComma();
+			}
+		},
+		{headerName: "출고택배사", 	field: "shipCompCd", 	width: 170, cellClass: 'text-center'
+			, valueGetter: function (params) { return gagaAgGrid.lookupValue(shipCompanyList, params.data.shipCompCd); }
+		},
+		{headerName: "배송추적", 		field: "invcTracking", 	width: 80, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				if (params.value == "Y") {
+					return "요청";
+				} else {
+					return "미요청";
+				}
+			}
+		},
+		{headerName: "출고송장", 		field: "invoiceNo", 	width: 150, cellClass: 'text-left'},
+		{headerName: "송장등록수정", 	field: "invoiceNo", 	width: 120, cellClass: 'text-center'
+			, cellRenderer : function (params) {
+				var buttonTag = '';
+				if (params.data.ordDtlStat == 'G013_30' || params.data.ordDtlStat == 'G013_40' || params.data.ordDtlStat == 'G013_50' || params.data.ordDtlStat == 'G013_55') {
+					buttonTag = '<button type="button"class="btn btn-success" onClick="fnSaveInvoiceNo('+params.data.ordDtlNo+');">송장등록수정</button>';
+
+				}
+				return buttonTag;
+			}
+		},
+		{headerName: "배송완료처리", 	field: "ordDtlStat", width: 120, cellClass: 'text-center'
+			, cellRenderer: function(params) {
+				var buttonTag = '';
+				if (params.value == 'G013_50' || params.value == 'G013_55'  ) {
+					buttonTag = '<button type="button"class="btn btn-success" onClick="deliveryComplete(\''+params.data.ordNo+ '\' , \''+params.data.ordDtlNo+'\' , \'' + params.data.ordDtlStat + '\');">배송완료</button>';
+
+				}
+				return buttonTag;
+			}
+		},
+		{headerName: "배송메모", 		field: "delvMemo", 		width: 200, cellClass: 'text-left'},
+		{headerName: "우편번호", 		field: "recipZipcode", 		width: 80, cellClass: 'text-center'},
+		{headerName: "기본주소", 		field: "recipBaseAddr", 	width: 200, cellClass: 'text-left'},
+		{headerName: "상세주소", 		field: "maskingRecipDtlAddr", 		width: 200, cellClass: 'text-left'},
+		{headerName: "product_no", 	field: "productNo", 	width: 100, cellClass: 'text-center'},
+		{headerName: "product_code",field: "productCode", 	width: 100, cellClass: 'text-center'}
+
+	];
+
+	//Get GridOptions
+	var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	//Grid editable
+	//gridOptions.defaultColDef.editable = true;
+
+	gridOptions.suppressRowClickSelection = true;
+	gridOptions.rowSelection = 'multiple';
+	gridOptions.isRowSelectable = function(rowNode) {
+		return rowNode.data.ordDtlStat == 'G013_20' || rowNode.data.ordDtlStat == 'G013_25';
+	}
+	gridOptions.getRowStyle = function (params) {
+		if (params.data.ordExchGb === 'Y') {
+			return {background: 'orange'}
+		}
+	}
+
+	var fnInitCalendar = function () {
+		$(".btnToday").trigger('click');
+	}
+
+	var fnInitSupplyComp = function(){
+		$("#searchForm #supplyCompText").text("");
+		$('#searchForm input[name=supplyCompList]').val('');
+	}
+
+	
+	
+	/*************************************************************************
+	*  주문상세 팝업
+	**************************************************************************/
+	var fnOrderDetailPopup = function(ordNo){
+		currOrdNo = ordNo;
+		cfnOpenOrderDetailPopup(currOrdNo);
+	}
+
+	/*************************************************************************
+	*  팝업 콜백
+	**************************************************************************/
+	var fnReOpenOrderDetailPopup = function () {
+		cfnOpenOrderDetailPopup(currOrdNo);
+		fnSearchList();
+	};
+
+
+	/*************************************************************************
+	* 조회 클릭
+	**************************************************************************/
+	$('#btnSearch').on('click', function () {
+		$("#searchForm input[name=pageNo]").val('1');
+		fnSearchList();
+	});
+
+	/*************************************************************************
+	* 조회
+	**************************************************************************/
+	var fnSearchList = function () {
+
+		if ($('#searchForm input[name=ordNo]').val() == '') {
+			if ($('#stDate').val() == '') {
+				mcxDialog.alert('시작 기간을 입력하세요.');
+				return;
+			}
+
+			if ($('#edDate').val() == '') {
+				mcxDialog.alert('종료 기간을 입력하세요.');
+				return;
+			}
+		}
+
+		if ($('#searchForm input[name=delvDelayDays]').val() != '') {
+			if ($('#stDate').val() == '') {
+				mcxDialog.alert('시작 기간을 입력하세요.');
+				return;
+			}
+
+			if ($('#edDate').val() == '') {
+				mcxDialog.alert('종료 기간을 입력하세요.');
+				return;
+			}
+		}
+
+		gagaPaging.init('searchForm', fnSearchCallBack, 'deliveryListPagination', $('#searchForm').find('#pageSize').val());
+	    gagaPaging.load($("#searchForm input[name=pageNo]").val());
+
+	}
+
+	// 페이징
+	$('#searchForm select[name=pageSize]').on('change', function() {
+		$("#searchForm input[name=pageNo]").val('1');
+		fnSearchList();
+	});
+
+
+	/*************************************************************************
+	* 조회 콜백
+	**************************************************************************/
+	var fnSearchCallBack = function(result){
+
+		$('#searchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
+		$('#searchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
+		$('#searchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
+		$('#searchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
+		gridOptions.api.setRowData(result.deliveryList);
+		gagaPaging.createPagination(result.pageing.pageable);
+
+	}
+
+
+	/*************************************************************************
+	* 구성상품 내역 팝업 호출
+	**************************************************************************/
+	var fnOrderDetailItemForm = function (ordDtlNo) {
+		var actionUrl = "/delivery/detail/item/form/" + ordDtlNo;
+		cfnOpenModalPopup(actionUrl, 'popupDeliveryDetailItemForm');
+	}
+
+	/*************************************************************************
+	*  LMS
+	**************************************************************************/
+	var fnLms = function(chgerPhnno, custNo){
+		let param = {};
+		param.elementCellPhnno = chgerPhnno;
+		param.elementCustNo =    custNo;
+		param.pageGb = 'delv';
+		cfnOpenLmsPopup2(param);
+	}
+
+
+	/*************************************************************************
+	* 엑셀다운로드
+	**************************************************************************/
+	$('#btnExcel').on('click', function () {
+		var totalRows = gridOptions.api.getDisplayedRowCount();
+		if (totalRows == 0) {
+			mcxDialog.alert('조회된 내역이 없습니다.');
+			return;
+		}
+		var date = new Date().format("YYYYMMDDHHmmss");
+		var params = {
+
+			fileName: "배송목록_" + date,
+			sheetName: "DATA"
+		}
+		gridOptions.excelStyles = [
+			{
+				id: 'dateFormat',
+				dataType: 'dateTime',
+				numberFormat: {
+					format: 'YYYY-MM-DD;@'
+				}
+			},
+			{
+				id: 'textFormat',
+				dataType: 'string'
+			}
+		]
+		gridOptions.api.exportDataAsExcel(params);
+	});
+
+
+	/*************************************************************************
+	* 품절처리
+	**************************************************************************/
+	$('#btnSoldout').on('click', function () {
+		var selectedData = gridOptions.api.getSelectedRows();
+
+		if (selectedData.length == 0) {
+			mcxDialog.alert('선택된 행이 없습니다.');
+			return;
+		}
+
+		mcxDialog.confirm('품절 처리하시겠습니까?', {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function () {
+				var jsonData = JSON.stringify(selectedData);
+				gagajf.ajaxJsonSubmit('/delivery/list/soldout'
+					, jsonData
+					, function () {
+						$('#btnSearch').trigger('click');
+				});
+			}
+		});
+	});
+
+
+	/*************************************************************************
+	* 배송완료처리 -수동
+	**************************************************************************/
+	var deliveryComplete = function (ordNo,ordDtlNo, odStat) {
+
+		mcxDialog.confirm('배송완료 처리를 하시겠습니까?', {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function () {
+				var jsonData = {
+					"ordNo": ordNo,
+					"ordDtlNo": ordDtlNo,
+					"orgOrdDtlStat": odStat
+				};
+				var tranData = JSON.stringify(jsonData);
+				gagajf.ajaxJsonSubmit('/delivery/complete/save', tranData, fnSearchList);
+			}
+		});
+	}
+
+	/*************************************************************************
+	* 송장변경 팝업호출
+	**************************************************************************/
+	var fnSaveInvoiceNo = function (ordDtlNo) {
+		var actionUrl = "/delivery/save/invoice/form/" + ordDtlNo ;
+		cfnOpenModalPopup(actionUrl, 'popupChangeInvoice');
+	};
+
+	/*************************************************************************
+	*  업체 콤보박스 변경 시
+	**************************************************************************/
+	$('#searchForm select[name=supplyCompCd]').on('change', function() {
+		var actionUrl = '/renderer/supplyCompany/brand/list/'+ $(this).val();
+		cfnCreateMultiCombo(actionUrl, "multiBrand",  "[전체]", null, 'Y');
+		var actionUrl2 = '/renderer/delvloc/list/'+ $(this).val();
+		cfnCreateCombo(actionUrl2, $('#searchForm select[name=delvLocCd]'), "[전체]");
+	});
+
+	// 업체 조회 선택시
+	$('#btnSearchSupplyComp').on('click', function() {
+		cfnOpenCompanyListPopup2('fnSetSupplyCompInfo', 'M');
+	});
+
+	// 업체 조회 팝업에서 호출
+	var fnSetSupplyCompInfo = function(result) {
+		var arrSupplyComp 	= [];
+		var supplyCompText 	= "";
+		var sIndex 			= 0;
+
+		$('#searchForm').find('#supplyCompText').html('');
+		$('#searchForm input[name=supplyCompSearchTxt]').val('');
+
+		result.forEach(function(supplyComp){
+			sIndex++;
+			arrSupplyComp.push(supplyComp.supplyCompCd);
+		});
+
+		// 조회값이 하나일 경우 화면에 코드 노출 그외는 갯수 처리
+		if (sIndex == 1) {
+			$('#searchForm input[name=supplyCompSearchTxt]').val(arrSupplyComp[0]);
+		} else {
+			supplyCompText = sIndex + " 개";
+			$('#searchForm').find('#supplyCompText').html(supplyCompText);
+		}
+
+		var jsonData = JSON.stringify(arrSupplyComp);
+		$("#searchForm input[name=supplyCompList]").val(jsonData);
+	}
+	
+
+	
+	/*************************************************************************
+	* init
+	**************************************************************************/
+	$(document).ready(function () {
+		gagaAgGrid.createGrid('gridDeliveryList', gridOptions);
+		var hideList = ["btnThisWeek", "btnYesterWeek", "btnRecentMonth", "btnThisMonth", "btnYesterMonth", "btnRecent3Month"];
+		cfnCreateCalendar('#terms', 'stDate', 'edDate', true, '주문', '', hideList);
+		$(".btnToday").trigger('click');
+		$('#searchForm select[name=mallGb]').trigger('change');
+		$('#searchForm').find('#multiBrand').empty();
+	});
+
+	/*]]>*/
+</script>
+</html>

+ 4 - 0
src/main/webapp/WEB-INF/views/goods/GoodsTitleReserveForm.html

@@ -433,6 +433,10 @@
 	
 	
 	var fnGoodsTnmResDeleteCollBack = function(){
 	var fnGoodsTnmResDeleteCollBack = function(){
 		//fnGoodsRsvtTnmListSearch($("#goodsTnmListForm input[name=searchGb]").val());
 		//fnGoodsRsvtTnmListSearch($("#goodsTnmListForm input[name=searchGb]").val());
+		
+		$("#goodsTnmListForm input[name=pageNo]").val('1');
+		fnGoodsTnmListSearch('BASIC');
+		
 	}
 	}
 	
 	
 	$(document).ready(function() {
 	$(document).ready(function() {

+ 5 - 3
src/main/webapp/WEB-INF/views/statistics/BestTradingForm.html

@@ -70,7 +70,9 @@
                     <tr>
                     <tr>
                         <th>성별</th>
                         <th>성별</th>
                         <td>
                         <td>
-                            <label th:if="${sexGbList}" th:each="oneData, status : ${sexGbList}" class="chkBox checked"><input type="checkbox" name="multiSexGb" th:value="${oneData.cd}" th:text="${oneData.cdNm}" checked="checked"/></label>
+							<label class="chkBox checked"><input type="checkbox" name="multiSexGb" value="G007_F" checked="checked"/>여성</label>
+							<label class="chkBox checked"><input type="checkbox" name="multiSexGb" value="G007_M" checked="checked"/>남성</label>
+							<label class="chkBox checked"><input type="checkbox" name="multiSexGb" value="G007_X" checked="checked"/>알수없음</label>
                         </td>
                         </td>
                         <th>연령별</th>
                         <th>연령별</th>
                         <td>
                         <td>
@@ -140,9 +142,9 @@
 /*<![CDATA[*/
 /*<![CDATA[*/
 	let columnDefs = [
 	let columnDefs = [
 		{ headerName: "No", field: "day", width: 100, cellClass: 'text-center', valueGetter: "node.rowIndex + 1" },
 		{ headerName: "No", field: "day", width: 100, cellClass: 'text-center', valueGetter: "node.rowIndex + 1" },
-		{ headerName: "이미지", field: "sysImgUrl", width: 100, height: 60, cellClass: 'text-center'
+		{ headerName: "이미지", field: "sysImgNm", width: 100, height: 60, cellClass: 'text-center'
             ,cellRenderer: function(params) {
             ,cellRenderer: function(params) {
-                return '<img width="60" src="'+ _goodsUrl+ "/" + params.value + '?RS=60" alt="" onerror="this.src=\'/image/no.png\';"/>';
+				return '<img width="60" src="'+ _goodsUrl + "/" + params.value + '?RS=60" alt="" onerror="this.src=\'/image/no.png\';"/>';
             }
             }
         },
         },
         { headerName: "브랜드", field: "brandEnm", width: 100, cellClass: 'text-center'},
         { headerName: "브랜드", field: "brandEnm", width: 100, cellClass: 'text-center'},

+ 15 - 7
src/main/webapp/WEB-INF/views/statistics/BrandTradingForm.html

@@ -177,9 +177,9 @@
 						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
 						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
 					}
 					}
 				},
 				},
-				{headerName: "정상비", field: "amtRate10", width: 120, cellClass: 'text-right',
-					cellRenderer: function (params) {
-						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+				{headerName: "정상비", field: "amtRate10", width: 100, cellClass: 'text-right',
+					cellRenderer: function(params) {
+						return params.value +'%';
 					}
 					}
 				}
 				}
 			]
 			]
@@ -379,7 +379,6 @@
 		totInfo.cnclAmt     = 0;
 		totInfo.cnclAmt     = 0;
 		totInfo.totAmt10    = 0;
 		totInfo.totAmt10    = 0;
 		totInfo.totAmt20    = 0;
 		totInfo.totAmt20    = 0;
-		totInfo.amtRate10   = 0;
 		totInfo.yoyRate     = 0;
 		totInfo.yoyRate     = 0;
 		totInfo.yoyTotOrdAmt= 0;
 		totInfo.yoyTotOrdAmt= 0;
 
 
@@ -392,16 +391,25 @@
 				if( typeof rowNode.data.cnclAmt     == 'number') { totInfo.cnclAmt      += rowNode.data.cnclAmt     ; }
 				if( typeof rowNode.data.cnclAmt     == 'number') { totInfo.cnclAmt      += rowNode.data.cnclAmt     ; }
 				if( typeof rowNode.data.totAmt10    == 'number') { totInfo.totAmt10     += rowNode.data.totAmt10    ; }
 				if( typeof rowNode.data.totAmt10    == 'number') { totInfo.totAmt10     += rowNode.data.totAmt10    ; }
 				if( typeof rowNode.data.totAmt20    == 'number') { totInfo.totAmt20     += rowNode.data.totAmt20    ; }
 				if( typeof rowNode.data.totAmt20    == 'number') { totInfo.totAmt20     += rowNode.data.totAmt20    ; }
-				if( typeof rowNode.data.amtRate10   == 'number') { totInfo.amtRate10    += rowNode.data.amtRate10   ; }
 				if( typeof rowNode.data.yoyTotOrdAmt== 'number') { totInfo.yoyTotOrdAmt += rowNode.data.yoyTotOrdAmt; }
 				if( typeof rowNode.data.yoyTotOrdAmt== 'number') { totInfo.yoyTotOrdAmt += rowNode.data.yoyTotOrdAmt; }
 			}
 			}
 		});
 		});
 
 
-		if(totInfo.totAmt > 0 && totInfo.yoyTotOrdAmt > 0){
+		/*if(totInfo.totAmt > 0 && totInfo.yoyTotOrdAmt > 0){
 			totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
 			totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
 		}else{
 		}else{
 			totInfo.yoyRate = 0;
 			totInfo.yoyRate = 0;
-		}
+		}*/
+
+		var mod = 1;
+		if(totInfo.yoyTotOrdAmt > 0) mod = totInfo.yoyTotOrdAmt;
+
+		totInfo.yoyRate = Math.floor(totInfo.totAmt / mod * 100 * 100) / 100;
+
+		mod = 1;
+		if(totInfo.totAmt > 0) mod = totInfo.totAmt;
+
+		totInfo.amtRate10 = Math.floor(totInfo.totAmt10 / mod * 100 * 100) / 100;
 
 
 		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
 		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
 	}
 	}

+ 127 - 0
src/main/webapp/WEB-INF/views/statistics/CardSearchForm.html

@@ -0,0 +1,127 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CardSearchForm.html
+ * @desc    : 카드 리스트 팝업
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.09.28   swkim       최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="500" id="popupCardList">
+	<div class="panelStyle">
+		<!-- TITLE -->
+		<div class="panelTitle">
+			<strong>카드 목록</strong>
+			<button type="button" class="close" onclick="uifnPopupClose('popupCardList');"><em class="fa fa-times"></em></button>
+		</div>
+		<!-- //TITLE -->
+
+		<!-- 검색 조건 -->
+		<div class="panelContent">
+			<form id="searchCardListForm" class="searchCardListForm" name="searchCardListForm" action="#" th:action="@{'/statistics/card/list'}" onsubmit="$('#btnSearchCardList').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:15%;"/>
+						<col/>
+					</colgroup>
+					<tbody>
+				</table>
+				<!--<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearchCardList">조회</button>
+					</li>
+				</ul>-->
+			</form>
+		</div>
+		<!-- //검색 조건 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelContent">
+			<div id="gridCardPopupList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+
+		<!-- 버튼 배치 영역 -->
+		<ul class="panelBar">
+			<li class="right">
+				<button type="button" class="btn btn-info btn-lg" id="btnConfirmCard">확인</button>
+			</li>
+		</ul>
+	</div>
+
+	<script th:inline="javascript">
+		/*<![CDATA[*/
+		let columnCardPopupDefList = [
+			{width: 40, minWidth: 40, field: "cardCheck", cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+			{headerName: "카드명", field: "cardNm", width: 400, cellClass: 'text-center'}
+		];
+
+		let gridOptionsCardPopupList = gagaAgGrid.getGridOptions(columnCardPopupDefList);
+		gridOptionsCardPopupList.rowSelection = "multiple";
+
+		// Row double click
+		gridOptionsCardPopupList.onRowDoubleClicked = function(event) {
+			$('#btnConfirmCard').trigger('click');
+		}
+
+		// 조회
+		/*$('#btnSearchCardList').on('click', function() {
+			// Fetch data
+			gagaAgGrid.fetch($('#searchCardListForm').prop('action'), gridOptionsCardPopupList, '#searchCardListForm', function() {
+				gridOptionsCardPopupList.api.forEachNode(function(rowNode, index) {
+				});
+			});
+		});*/
+
+		// 확인
+		$('#btnConfirmCard').on('click', function() {
+			var selectedData = gagaAgGrid.selectedRowData(gridOptionsCardPopupList);
+
+			if (selectedData.length == 0) {
+				mcxDialog.alert('선택된 카드가 없습니다.');
+				return false;
+			}
+
+			var callbackFn = [[${params.callbackFn}]];
+
+			var jsonData = JSON.stringify(selectedData);
+
+			if (typeof callbackFn != 'undefined' && callbackFn) {
+				if (typeof callbackFn == 'function') {
+					callbackFn(jsonData);
+				} else {
+					if (callbackFn) {
+						if (callbackFn.indexOf("(") == -1) {
+							eval(callbackFn + "(" + jsonData + ")");
+						} else {
+							eval(callbackFn(jsonData));
+						}
+					}
+				}
+				uifnPopupClose('popupCardList');
+			}
+		});
+
+		$(document).ready(function() {
+			// Create a agGrid
+			gagaAgGrid.createGrid('gridCardPopupList', gridOptionsCardPopupList);
+
+			// Fetch data
+			gagaAgGrid.fetch($('#searchCardListForm').prop('action'), gridOptionsCardPopupList, '#searchCardListForm', function() {
+				gridOptionsCardPopupList.api.forEachNode(function(rowNode, index) {
+				});
+			});
+		});
+		/*]]>*/
+	</script>
+
+</div>
+
+</html>

+ 8 - 3
src/main/webapp/WEB-INF/views/statistics/ChannelTradingForm.html

@@ -56,7 +56,7 @@
 						</td>
 						</td>
 						<th>정상/이월구분</th>
 						<th>정상/이월구분</th>
 						<td>
 						<td>
-							<label th:if="${formalGbList}" th:each="oneData, status : ${formalGbList}" class="chkBox checked"><input type="checkbox" name="multiFormalGb" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" checked="checked"/></label>
+							<label th:if="${formalGbList}" th:each="oneData, status : ${formalGbList}" class="chkBox checked"><input type="checkbox" name="multiFormalGb" th:value="${oneData.cd}" th:text="${oneData.cdNm}" checked="checked"/></label>
 						</td>
 						</td>
 					</tr>
 					</tr>
 					<tr>
 					<tr>
@@ -375,11 +375,16 @@
 			}
 			}
 		});
 		});
 
 
-		if(totInfo.totAmt > 0 && totInfo.yoyTotOrdAmt > 0 ){
+		/*if(totInfo.totAmt > 0 && totInfo.yoyTotOrdAmt > 0 ){
 			totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
 			totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
 		}else{
 		}else{
 			totInfo.yoyRate = 0;
 			totInfo.yoyRate = 0;
-		}
+		}*/
+
+		var mod = 1;
+		if(totInfo.yoyTotOrdAmt > 0) mod = totInfo.yoyTotOrdAmt;
+
+		totInfo.yoyRate = Math.floor(totInfo.totAmt / mod * 100 * 100) / 100;
 
 
 		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
 		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
 	}
 	}

+ 342 - 0
src/main/webapp/WEB-INF/views/statistics/CouponTradingForm.html

@@ -0,0 +1,342 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CouponTradingForm.html
+ * @desc    : 쿠폰 사용 통계 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021-09-28 화   lmc        최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title"></div>
+		<!-- //메인타이틀 영역 -->
+
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc"></div>
+		<!-- //메뉴 설명 -->
+
+		<!-- 검색조건 영역 -->
+		<div class="panelStyle">
+			<form id="searchForm" name="searchForm" action="#" th:action="@{'/statistics/coupon/order/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col style="width:10%;"/>
+						<col style="width:60%;"/>
+						<col style="width:20%;"/>
+					</colgroup>
+					<tr>
+						<th>기간<i class="required" title="필수" aria-hidden="true"></i></th>
+						<td colspan="2" id="terms"></td>
+						<td rowspan="2">
+						  <textarea class="textareaR3 w70p" name="cpnId" placeholder="쿠폰번호/쿠폰코드를 입력하세요."></textarea>
+						</td>
+					</tr>
+					<tr>
+					   <th>쿠폰유형</th>
+					   <td colspan="2">
+					       <label class="chkBox checked" th:if="${cpnTypeList}" th:each="oneData, status : ${cpnTypeList}"><input type="checkbox" name="cpnTypeArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}" checked="checked"/></label>
+					   </td>
+					</tr>
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
+						<button type="button" class="btn btn-gray btn-lg" id="btnInit">초기화</button>
+					</li>
+				</ul>
+			</form>
+			<form id="detailSearchForm" action="/statistics/coupon/order/detail/list" style="display:none;">
+				<input name="startDt">
+				<input name="endDt">
+				<input name="cpnId">
+			</form>
+		</div>
+		<!-- 검색조건 영역 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelStyle">
+			<ul class="panelBar">
+				<li>
+					<button type="button" class="btn btn-default btn-lg" onclick="fnExcelDownLoad();">엑셀다운로드</button>
+				</li>
+			</ul>
+			<div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<div class="panelStyle">
+			<ul class="panelBar">
+				<li>
+					<button type="button" class="btn btn-default btn-lg" onclick="fnDetailExcelDownLoad();">엑셀다운로드</button>
+				</li>
+			</ul>
+			<div id="detailGridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+	</div>
+
+<style>
+.ag-header-group-text{
+	margin-left: calc(50% - 25px);
+}
+</style>
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let columnDefs = [
+		{ headerName: "쿠폰유형", field: "cpnId", width: 100, cellClass: 'text-center', hide:true },
+		{ headerName: "쿠폰유형", field: "cpnTypeNm", width: 100, cellClass: 'text-center' },
+		{ headerName: "쿠폰번호", field: "cpnId", width: 100, cellClass: 'text-center' },
+		{ headerName: "쿠폰명", field: "cpnNm", width: 200, cellClass: 'text-left' },
+		{ headerName: "자사분담율", field: "burden", width: 150, cellClass: 'text-right',
+            cellRenderer: function(params) {
+                return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+            }
+		},
+		{ headerName: "다운수", field: "downCnt", width: 150, cellClass: 'text-right',
+            cellRenderer: function(params) {
+                return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+            }
+		},
+		{ headerName: "사용수", field: "useCnt", width: 150, cellClass: 'text-right',
+            cellRenderer: function(params) {
+                return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+            }
+		},
+		{ headerName: "주문결제액", field: "ordAmt", width: 150, cellClass: 'text-right',
+            cellRenderer: function(params) {
+                return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+            }
+		},
+		{ headerName: "쿠폰비용", field: "cpnAmt", width: 150, cellClass: 'text-right',
+            cellRenderer: function(params) {
+                return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+            }
+		},
+		{ headerName: "상세보기", field: "detail", width: 100, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				return '<a href="javascript:void(0);">판매현황보기</a>';
+			}
+		},
+	];
+
+	let detailColumnDefs = [
+		{ headerName: "브랜드", field: "brandEnm", width: 150, cellClass: 'text-center' },
+		{ headerName: "상품번호", field: "goodsCd", width: 150, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				return '<a href="javascript:void(0);">'+params.value+'</a>';
+			}
+		},
+		{ headerName: "상품명", field: "goodsNm", width: 300, cellClass: 'text-left',
+			cellRenderer: function (params) {
+				return '<a href="javascript:void(0);">'+params.value+'</a>';
+			}
+		},
+		{ headerName: "원판매가액", field: "ordAmt", width: 150, cellClass: 'text-right',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+			}
+		},
+		{ headerName: "판매수량", field: "ordQty", width: 150, cellClass: 'text-right',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+			}
+		},
+		{ headerName: "구매자수", field: "custCpnCnt", width: 150, cellClass: 'text-right',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+			}
+		},
+		{ headerName: "구매율", field: "ordRate", width: 150, cellClass: 'text-right',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+			}
+		},
+	];
+
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+	let detailGridOptions = gagaAgGrid.getGridOptions(detailColumnDefs);
+
+	// Row Click
+	gridOptions.onCellClicked = function(event) {
+		var params = event.data;
+		if (event.colDef.field == "goodsCd"){
+			cfnOpenGoodsDetailPopup('U', params.goodsCd);
+		}
+		else if (event.colDef.field == "goodsNm"){
+			cfnOpenGoodsDetailPopup('U', params.goodsCd);
+		}
+		else if (event.colDef.field == "detail"){
+			$("#detailSearchForm input[name=startDt]").val($("#searchForm input[name=startDt]").val());
+			$("#detailSearchForm input[name=endDt]").val($("#searchForm input[name=endDt]").val());
+			$("#detailSearchForm input[name=cpnId]").val(params.cpnId);
+			gagaAgGrid.fetch($('#detailSearchForm').prop('action'), detailGridOptions, '#detailSearchForm', fnDetailCreateTotal);
+		}
+	}
+
+	// Row Click
+	detailGridOptions.onCellClicked = function(event) {
+		var params = event.data;
+		if (event.colDef.field == "goodsCd"){
+			cfnOpenGoodsDetailPopup('U',goodsCd);
+		}
+		else if (event.colDef.field == "goodsNm"){
+			cfnOpenGoodsDetailPopup('U',goodsCd);
+		}
+	}
+
+    gridOptions.excelStyles = [
+        {
+            id: 'text-center',
+            dataType: 'string',
+			font: {size : 10, bold: false}
+        },
+        {
+            id: 'text-left',
+            dataType: 'string',
+			font: {size : 10, bold: false}
+        },
+        {
+            id: 'text-right',
+            dataType: 'number',
+			font: {size : 10, bold: false}
+        }
+    ];
+
+    detailGridOptions.excelStyles = gridOptions.excelStyles;
+
+    var fnExcelDownLoad = function(){
+
+    	var totalRows = gridOptions.api.getDisplayedRowCount();
+		if(totalRows==0){
+			mcxDialog.alert('조회된 내역이 없습니다.');
+			return;
+		}
+
+    	var date = new Date().format("YYYYMMDDHHmmss");
+		var params = {
+						fileName : "쿠폰주문목록_"+ date,
+						sheetName: "DATA"
+					 };
+		gridOptions.api.exportDataAsExcel(params);
+    }
+    var fnDetailExcelDownLoad = function(){
+
+    	var totalRows = detailGridOptions.api.getDisplayedRowCount();
+		if(totalRows==0){
+			mcxDialog.alert('조회된 내역이 없습니다.');
+			return;
+		}
+
+    	var date = new Date().format("YYYYMMDDHHmmss");
+		var params = {
+						fileName : "쿠폰주문상세목록_"+ date,
+						sheetName: "DATA"
+					 };
+		detailGridOptions.api.exportDataAsExcel(params);
+    }
+
+
+	// 검색
+	$('#btnSearch').on('click', function() {
+		// 입력 값 체크
+		if (!gagajf.validation($('#searchForm')))
+			return false;
+
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', fnCreateTotal);
+	});
+
+	// 합계 생성
+	let fnCreateTotal = function() {
+
+		let totInfo = {};
+		totInfo.cpnTypeNm =   "TOTAL";
+		totInfo.burden    =   0;
+		totInfo.downCnt   =   0;
+		totInfo.useRate   =   0;
+		totInfo.useCnt    =   0;
+		totInfo.ordAmt    =   0;
+		totInfo.cpnAmt	  =   0;
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if( typeof rowNode.data.burden      == 'number') { totInfo.burden       += rowNode.data.burden      ; }
+				if( typeof rowNode.data.downCnt     == 'number') { totInfo.downCnt      += rowNode.data.downCnt     ; }
+				if( typeof rowNode.data.useRate     == 'number') { totInfo.useRate      += rowNode.data.useRate     ; }
+				if( typeof rowNode.data.useCnt      == 'number') { totInfo.useCnt       += rowNode.data.useCnt      ; }
+				if( typeof rowNode.data.ordAmt      == 'number') { totInfo.ordAmt       += rowNode.data.ordAmt      ; }
+				if( typeof rowNode.data.cpnAmt	    == 'number') { totInfo.cpnAmt	    += rowNode.data.cpnAmt	    ; }
+			}
+		});
+
+		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
+	}
+
+	// 합계 생성
+	let fnDetailCreateTotal = function() {
+
+		let totInfo = {};
+		totInfo.brandEnm   = 'TOTAL';
+		totInfo.goodsCd   = '';
+		totInfo.goodsNm   = '';
+		totInfo.ordAmt     = 0;
+		totInfo.ordQty     = 0;
+		totInfo.custCnt    = 0;
+		totInfo.custCpnCnt = 0;
+		totInfo.ordRate    = 0;
+
+		detailGridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if( typeof rowNode.data.ordAmt        == 'number') { totInfo.ordAmt         += rowNode.data.ordAmt        ; }
+				if( typeof rowNode.data.ordQty        == 'number') { totInfo.ordQty         += rowNode.data.ordQty        ; }
+				if( typeof rowNode.data.custCnt       == 'number') { totInfo.custCnt        += rowNode.data.custCnt       ; }
+				if( typeof rowNode.data.custCpnCnt    == 'number') { totInfo.custCpnCnt     += rowNode.data.custCpnCnt    ; }
+				if( typeof rowNode.data.ordRate       == 'number') { totInfo.ordRate        += rowNode.data.ordRate       ; }
+			}
+		});
+
+		if(totInfo.custCpnCnt > 0 && totInfo.custCnt > 0){
+			totInfo.ordRate = Math.floor((totInfo.custCpnCnt / totInfo.custCnt * 100) / 10) * 10;
+		}else{
+			totInfo.ordRate = 0;
+		}
+
+		gagaAgGrid.setPinnedRowData(detailGridOptions, totInfo, 'top');
+	}
+
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+		$('#searchForm')[0].reset();
+
+		$('#extmallIdTxt').html('');
+		$('#searchForm input[name=extmallIdList]').val('');
+		$('#supplyCompCdTxt').html('');
+		$('#searchForm input[name=supplyCompCdList]').val('');
+		$('#afLinkCdTxt').html('');
+		$('#searchForm input[name=afLinkCdList]').val('');
+		$('#brandCdTxt').html('');
+		$('#searchForm input[name=brandCdList]').val('');
+		$('#itemkindCdTxt').html('');
+		$('#searchForm input[name=itemkindCdList]').val('');
+	});
+
+	$(document).ready(function() {
+		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문', undefined, ['btnToday']);
+		$('.btnYesterday').trigger('click');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+		// Create a agGrid
+		gagaAgGrid.createGrid('detailGridList', detailGridOptions);
+
+	});
+/*]]>*/
+</script>
+
+</html>

+ 2 - 2
src/main/webapp/WEB-INF/views/statistics/DailyOrderForm.html

@@ -147,7 +147,7 @@
 		{ headerName: "YOY(%)", field: "yoyRate", width: 100, cellClass: 'text-center' },
 		{ headerName: "YOY(%)", field: "yoyRate", width: 100, cellClass: 'text-center' },
 		{
 		{
 			headerName: "자사직방문", field: "selfAmt", width: 150, cellClass: 'text-right',
 			headerName: "자사직방문", field: "selfAmt", width: 150, cellClass: 'text-right',
-			cellRenderer: function (params) { return params.value +'%'; }
+			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
 		},
 		},
 		{
 		{
 			headerName: "채널", field: "channelAmt", width: 150, cellClass: 'text-right',
 			headerName: "채널", field: "channelAmt", width: 150, cellClass: 'text-right',
@@ -478,7 +478,7 @@
 
 
 	$(document).ready(function() {
 	$(document).ready(function() {
 		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문', undefined, ['btnToday']);
 		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문', undefined, ['btnToday']);
-		$('.btnYesterday').trigger('click');
+		$('.btnRecentWeek').trigger('click');
 
 
 		// Create a agGrid
 		// Create a agGrid
 		gagaAgGrid.createGrid('gridList', gridOptions);
 		gagaAgGrid.createGrid('gridList', gridOptions);

+ 8 - 3
src/main/webapp/WEB-INF/views/statistics/ExtmallTradingForm.html

@@ -49,7 +49,7 @@
 						</td>
 						</td>
 						<th>정상/이월구분</th>
 						<th>정상/이월구분</th>
 						<td>
 						<td>
-							<label th:if="${formalGbList}" th:each="oneData, status : ${formalGbList}" class="chkBox checked"><input type="checkbox" name="multiFormalGb" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" checked="checked"/></label>
+							<label th:if="${formalGbList}" th:each="oneData, status : ${formalGbList}" class="chkBox checked"><input type="checkbox" name="multiFormalGb" th:value="${oneData.cd}" th:text="${oneData.cdNm}" checked="checked"/></label>
 						</td>
 						</td>
 					</tr>
 					</tr>
 					<tr>
 					<tr>
@@ -316,11 +316,16 @@
 			}
 			}
 		});
 		});
 
 
-		if(totInfo.totAmt > 0 && totInfo.yoyTotOrdAmt > 0 ){
+		/*if(totInfo.totAmt > 0 && totInfo.yoyTotOrdAmt > 0 ){
 			totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
 			totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
 		}else{
 		}else{
 			totInfo.yoyRate = 0;
 			totInfo.yoyRate = 0;
-		}
+		}*/
+
+		var mod = 1;
+		if(totInfo.yoyTotOrdAmt > 0) mod = totInfo.yoyTotOrdAmt;
+
+		totInfo.yoyRate = Math.floor(totInfo.totAmt / mod * 100 * 100) / 100;
 
 
 		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
 		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
 	}
 	}

+ 8 - 5
src/main/webapp/WEB-INF/views/statistics/HourlyTradingForm.html

@@ -44,8 +44,7 @@
 						<td colspan="3">
 						<td colspan="3">
 							<label class="chkBox checked"><input type="checkbox" name="dtGb" value="COMPARE_TERMS"/>직전 동일 기간 비교</label>
 							<label class="chkBox checked"><input type="checkbox" name="dtGb" value="COMPARE_TERMS"/>직전 동일 기간 비교</label>
 							<label class="chkBox checked"><input type="checkbox" name="dtGb" value="YOY"/>전년 비교</label>
 							<label class="chkBox checked"><input type="checkbox" name="dtGb" value="YOY"/>전년 비교</label>
-							<label class="chkBox checked"><input type="checkbox" name="dtGb" value="DIY" checked />직접선택</label>
-							<span>직접선택</span>
+							<label class="chkBox checked"><input type="checkbox" name="dtGb" value="DIY" checked/>직접선택</label>
 							<span id="compTerms"></span>
 							<span id="compTerms"></span>
 						</td>
 						</td>
 					</tr>
 					</tr>
@@ -389,6 +388,10 @@
 			}
 			}
 		});
 		});
 
 
+		var mod = 1;
+		if(totInfo.compOrdAmt > 0) mod = totInfo.compOrdAmt;
+
+		totInfo.cplRate = Math.floor(totInfo.ordAmt / mod * 100 * 100) / 100;
 		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
 		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
 	}
 	}
 
 
@@ -472,10 +475,10 @@
 	});
 	});
 
 
 	$(document).ready(function() {
 	$(document).ready(function() {
-		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문', undefined, ['btnToday']);
-		$('.btnYesterday').trigger('click');
+		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문', undefined, ['X']);
+		$('.btnToday').trigger('click');
 		cfnCreateCalendar('#compTerms', 'compStDt', 'compEdDt', true, '주문', undefined, ['btnToday']);
 		cfnCreateCalendar('#compTerms', 'compStDt', 'compEdDt', true, '주문', undefined, ['btnToday']);
-		$('.btnYesterday').trigger('click');
+		gagajf.setDate('#compTerms', 'compStDt', 'compEdDt', 'y');
 
 
 
 
 		// Create a agGrid
 		// Create a agGrid

+ 304 - 0
src/main/webapp/WEB-INF/views/statistics/PaymentForm.html

@@ -0,0 +1,304 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : PaymentForm.html
+ * @desc    : 결제수단별통계 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.09.28   swkim       최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc">
+		</div>
+		<!-- //메뉴 설명 -->
+
+		<!-- 검색조건 영역 -->
+		<div class="panelStyle">
+			<form id="searchForm" name="searchForm" action="#" th:action="@{'/statistics/payment/main/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+				<input type="hidden" name="dayGb" value="D"/>
+
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col style="width:25%;"/>
+						<col style="width:10%;"/>
+						<col style="width:25%;"/>
+						<col style="width:10%;"/>
+						<col style="width:20%;"/>
+					</colgroup>
+					<tr>
+						<th>기간<i class="required" title="필수" aria-hidden="true"></i></th>
+						<td colspan="5" id="terms">
+						</td>
+					</tr>
+					<tr>
+						<th>PG카드사</th>
+						<td colspan="5">
+							<input type="text" class="w100" name="cardIdSearchTxt" id="cardIdSearchTxt" maxlength="20"/>
+							<button type="button" class="btn icn" onclick="cfnOpenPgCardListPopup('fnSetCardInfo', 'M');"><i class="fa fa-search"></i></button>
+							<span id="cardIdTxt"></span>
+							<input type="hidden" name="cardIdList"/>
+						</td>
+
+					</tr>
+					<tr>
+						<th>간편결제</th>
+						<td colspan="5">
+							<label class="chkBox checked"><input type="checkbox" name="simpleGbC" value="C"/>카드 간편결제</label>
+							<label class="chkBox checked"><input type="checkbox" name="simpleGbB" value="B"/>간편 계좌이체</label>
+						</td>
+					</tr>
+				</table>
+
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
+						<button type="button" class="btn btn-gray btn-lg" id="btnInit">초기화</button>
+					</li>
+				</ul>
+			</form>
+		</div>
+		<!-- 검색조건 영역 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelStyle">
+			<!-- 버튼 배치 영역 -->
+			<ul class="panelBar">
+				<li class="left">
+					<button type="button" class="btn btn-default btn-lg" id="btnExcel">엑셀다운로드</button>
+				</li>
+				<li class="right">
+					<span class="btnGroup marR10">
+						<button type="button" class="btn btn-default btn-lg active" id="dayGbD" onclick="fnSetDayGb('D');">일별</button>
+						<button type="button" class="btn btn-default btn-lg" id="dayGbW" onclick="fnSetDayGb('W');">주별</button>
+						<button type="button" class="btn btn-default btn-lg" id="dayGbM" onclick="fnSetDayGb('M');">월별</button>
+					</span>
+				</li>
+			</ul>
+			<!-- //버튼 배치 영역 -->
+
+			<div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+	</div>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let columnDefs = [
+		{ headerName: "기간", field: "day", width: 100, cellClass: 'text-center' },
+		{
+			headerName: "PG수단별", field: "", width: 600, cellClass: 'text-center',
+			children: [
+				{headerName: "카드", field: "", width: 120, cellClass: 'text-center',
+					children: [
+						{headerName: "3.3%", field: "cdAmt", width: 120, cellClass: 'text-center',
+							cellRenderer: function(params) {
+								return gagaAgGrid.toAddComma(params.value);
+							}
+						}
+					]
+				},
+				{headerName: "실시간계좌", field: "", width: 120, cellClass: 'text-center',
+					children: [
+						{headerName: "2.4%", field: "acAmt", width: 120, cellClass: 'text-center',
+							cellRenderer: function(params) {
+								return gagaAgGrid.toAddComma(params.value);
+							}
+						}
+					]
+				},
+				{headerName: "무통장입금", field: "", width: 120, cellClass: 'text-center',
+					children: [
+						{headerName: "1건당 100원", field: "vaAmt", width: 120, cellClass: 'text-center',
+							cellRenderer: function(params) {
+								return gagaAgGrid.toAddComma(params.value);
+							}
+						}
+					]
+				},
+				{headerName: "휴대폰결제", field: "", width: 120, cellClass: 'text-center',
+					children: [
+						{headerName: "200원", field: "hpAmt", width: 120, cellClass: 'text-center',
+							cellRenderer: function(params) {
+								return gagaAgGrid.toAddComma(params.value);
+							}
+						}
+					]
+				},
+				{headerName: "PG쿠폰", field: "", width: 120, cellClass: 'text-center',
+					children: [
+						{headerName: "", field: "cpAmt", width: 120, cellClass: 'text-center',
+							cellRenderer: function(params) {
+								return gagaAgGrid.toAddComma(params.value);
+							}
+						}
+					]
+				}
+			]
+		},
+		{
+			headerName: "간편결제", field: "", width: 490, cellClass: 'text-center',
+			children: [
+				{headerName: "네이버페이", field: "", width: 130, cellClass: 'text-center',
+					children: [
+						{headerName: "카드3.2%/계좌3.4%", field: "npayAmt", width: 130, cellClass: 'text-center',
+							cellRenderer: function(params) {
+								return gagaAgGrid.toAddComma(params.value);
+							}
+						}
+					]
+				},
+				{headerName: "페이코", field: "", width: 130, cellClass: 'text-center',
+					children: [
+						{headerName: "카드3.2%/계좌3.4%", field: "paycoAmt", width: 130, cellClass: 'text-center',
+							cellRenderer: function(params) {
+								return gagaAgGrid.toAddComma(params.value);
+							}
+						}
+					]
+				},
+				{headerName: "카카오페이", field: "", width: 130, cellClass: 'text-center',
+					children: [
+						{headerName: "카드3.2%/계좌3.4%", field: "kakaoAmt", width: 130, cellClass: 'text-center',
+							cellRenderer: function(params) {
+								return gagaAgGrid.toAddComma(params.value);
+							}
+						}
+					]
+				}
+			]
+		}
+	];
+
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	gridOptions.autoGroupColumnDef = {
+			headerName: "일자",
+			field: "grouping",
+			width: 200,
+			cellRendererParams: {
+				suppressCount: true
+			}
+		};
+
+	// for expand everything
+	gridOptions.groupDefaultExpanded = -1;
+
+	// 제휴몰 조회 팝업에서 호출
+	var fnSetCardInfo = function(result) {
+		var arrCardId = [];
+		var cardIdTxt = "";
+		var sIndex = 0;
+		$('#cardIdTxt').html('');
+		$('#searchForm input[name=cardIdSearchTxt]').val('');
+
+		result.forEach(function(card) {
+			sIndex++;
+			arrCardId.push(card.cardCd);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리
+		if (sIndex == 1) {
+			$('#searchForm input[name=cardIdSearchTxt]').val(arrCardId[0]);
+		} else {
+			cardIdTxt = sIndex + " 개";
+			$('#cardIdTxt').html(cardIdTxt);
+		}
+
+		var jsonData = JSON.stringify(arrCardId);
+		$("#searchForm input[name=cardIdList]").val(jsonData);
+	}
+
+	// 검색
+	$('#btnSearch').on('click', function() {
+		// 입력 값 체크
+		if (!gagajf.validation($('#searchForm')))
+			return false;
+
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', fnCreateTotal);
+	});
+
+	// 합계 생성
+	let fnCreateTotal = function() {
+		// Draw chart
+
+		let cdAmt = 0;
+		let acAmt = 0;
+		let vaAmt = 0;
+		let hpAmt = 0;
+		let cpAmt = 0;
+		let npayAmt = 0;
+		let paycoAmt = 0;
+		let kakaoAmt = 0;
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if (typeof rowNode.data.cdAmt == 'number') { cdAmt += rowNode.data.cdAmt; }
+				if (typeof rowNode.data.acAmt == 'number') { acAmt += rowNode.data.acAmt; }
+				if (typeof rowNode.data.vaAmt == 'number') { vaAmt += rowNode.data.vaAmt; }
+				if (typeof rowNode.data.hpAmt == 'number') { hpAmt += rowNode.data.hpAmt; }
+				if (typeof rowNode.data.cpAmt == 'number') { cpAmt += rowNode.data.cpAmt; }
+				if (typeof rowNode.data.npayAmt == 'number') { npayAmt += rowNode.data.npayAmt; }
+				if (typeof rowNode.data.paycoAmt == 'number') { paycoAmt += rowNode.data.paycoAmt; }
+				if (typeof rowNode.data.kakaoAmt == 'number') { kakaoAmt += rowNode.data.kakaoAmt; }
+			}
+		});
+
+		let data = {
+			day: 'TOTAL',
+			cdAmt: cdAmt, acAmt: acAmt, vaAmt: vaAmt,
+			hpAmt: hpAmt, cpAmt: cpAmt, npayAmt: npayAmt,
+			paycoAmt: paycoAmt, kakaoAmt: kakaoAmt
+		};
+
+		gagaAgGrid.setPinnedRowData(gridOptions, data, 'top');
+	}
+
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+		$('#searchForm')[0].reset();
+
+		$('#cardIdTxt').html('');
+		$('#searchForm input[name=cardIdList]').val('');
+	});
+
+	// 엑셀다운로드
+	$('#btnExcel').on('click', function() {
+		gagaAgGrid.exportToExcel('결제수단별통계 목록', gridOptions);
+	});
+
+	// 일자구분 변경 시
+	var fnSetDayGb = function(dayGb) {
+		$('#searchForm input[name=dayGb]').val(dayGb);
+		$('#dayGbD').removeClass('active');
+		$('#dayGbW').removeClass('active');
+		$('#dayGbM').removeClass('active');
+		$('#dayGb' + dayGb).addClass('active');
+		$('#btnSearch').trigger('click');
+	}
+
+	$(document).ready(function() {
+		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문', undefined, ['btnToday']);
+		$('.btnRecentWeek').trigger('click');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+	});
+/*]]>*/
+</script>
+
+</html>

+ 314 - 0
src/main/webapp/WEB-INF/views/statistics/PlanTradingForm.html

@@ -0,0 +1,314 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : PlanTradingForm.html
+ * @desc    : 기획전 주문 통계 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021-09-28 화   lmc        최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title"></div>
+		<!-- //메인타이틀 영역 -->
+
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc"></div>
+		<!-- //메뉴 설명 -->
+
+		<!-- 검색조건 영역 -->
+		<div class="panelStyle">
+			<form id="searchForm" name="searchForm" action="#" th:action="@{'/statistics/plan/order/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col style="width:10%;"/>
+						<col style="width:60%;"/>
+						<col style="width:20%;"/>
+					</colgroup>
+					<tr>
+						<th>기간<i class="required" title="필수" aria-hidden="true"></i></th>
+						<td colspan="2" id="terms"></td>
+						<td rowspan="2">
+						  <textarea class="textareaR3 w70p" name="planSq" placeholder="기획전 번호를 입력하세요."></textarea>
+						</td>
+					</tr>
+					<tr>
+					   <th>물류구분</th>
+					   <td colspan="2">
+                            <label class="chkBox checked"><input type="checkbox" name="multiDistributionGb" value="SCM" checked="checked"/>입점</label>
+                            <label class="chkBox checked"><input type="checkbox" name="multiDistributionGb" value="WMS" checked="checked"/>위탁</label>
+					   </td>
+					</tr>
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
+						<button type="button" class="btn btn-gray btn-lg" id="btnInit">초기화</button>
+					</li>
+				</ul>
+			</form>
+			<form id="detailSearchForm" action="/statistics/plan/order/detail/list" style="display:none;">
+				<input name="startDt">
+				<input name="endDt">
+				<input name="planSq">
+			</form>
+		</div>
+		<!-- 검색조건 영역 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelStyle">
+			<ul class="panelBar">
+				<li>
+					<button type="button" class="btn btn-default btn-lg" onclick="fnExcelDownLoad();">엑셀다운로드</button>
+				</li>
+			</ul>
+			<div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<div class="panelStyle">
+			<ul class="panelBar">
+				<li>
+					<button type="button" class="btn btn-default btn-lg" onclick="fnDetailExcelDownLoad();">엑셀다운로드</button>
+				</li>
+			</ul>
+			<div id="detailGridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+	</div>
+
+<style>
+.ag-header-group-text{
+	margin-left: calc(50% - 25px);
+}
+</style>
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let columnDefs = [
+		{ headerName: "구분", field: "distributionGb", width: 100, cellClass: 'text-center' },
+		{ headerName: "브랜드", field: "brandEnm", width: 100, cellClass: 'text-center' },
+		{ headerName: "기획전번호", field: "planSq", width: 250, cellClass: 'text-center' },
+		{ headerName: "기획전명", field: "planNm", width: 250, cellClass: 'text-left' },
+		{ headerName: "결제수", field: "ordCnt", width: 150, cellClass: 'text-right',
+            cellRenderer: function(params) {
+                return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+            }
+		},
+		{ headerName: "결제액", field: "ordAmt", width: 150, cellClass: 'text-right',
+            cellRenderer: function(params) {
+                return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+            }
+		},
+		{ headerName: "상세보기", field: "detail", width: 100, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				return '<a href="javascript:void(0);">상세현황보기</a>';
+			}
+		},
+	];
+
+	let detailColumnDefs = [
+		{ headerName: "구분", field: "distributionGb", width: 150, cellClass: 'text-center' },
+		{ headerName: "상품번호", field: "goodsCd", width: 150, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				return '<a href="javascript:void(0);">'+params.value+'</a>';
+			}
+		},
+		{ headerName: "상품명", field: "goodsNm", width: 300, cellClass: 'text-left',
+			cellRenderer: function (params) {
+				return '<a href="javascript:void(0);">'+params.value+'</a>';
+			}
+		},
+		{ headerName: "상품당 결제액", field: "ordAmt", width: 150, cellClass: 'text-right',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+			}
+		},
+		{ headerName: "판매수량", field: "ordQty", width: 150, cellClass: 'text-right',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+			}
+		},
+		{ headerName: "구매자수", field: "custCnt", width: 150, cellClass: 'text-right',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+			}
+		},
+		{ headerName: "구매율", field: "custCnt", width: 150, cellClass: 'text-right',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+			}
+		},
+	];
+
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+	let detailGridOptions = gagaAgGrid.getGridOptions(detailColumnDefs);
+
+	// Row Click
+	gridOptions.onCellClicked = function(event) {
+		var params = event.data;
+		if (event.colDef.field == "goodsCd"){
+			cfnOpenGoodsDetailPopup('U', params.goodsCd);
+		}
+		else if (event.colDef.field == "goodsNm"){
+			cfnOpenGoodsDetailPopup('U', params.goodsCd);
+		}
+		else if (event.colDef.field == "detail"){
+			$("#detailSearchForm input[name=startDt]").val($("#searchForm input[name=startDt]").val());
+			$("#detailSearchForm input[name=endDt]").val($("#searchForm input[name=endDt]").val());
+			$("#detailSearchForm input[name=planSq]").val(params.planSq);
+			gagaAgGrid.fetch($('#detailSearchForm').prop('action'), detailGridOptions, '#detailSearchForm', fnDetailCreateTotal);
+		}
+	}
+
+	// Row Click
+	detailGridOptions.onCellClicked = function(event) {
+		var params = event.data;
+		if (event.colDef.field == "goodsCd"){
+			cfnOpenGoodsDetailPopup('U',goodsCd);
+		}
+		else if (event.colDef.field == "goodsNm"){
+			cfnOpenGoodsDetailPopup('U',goodsCd);
+		}
+	}
+
+    gridOptions.excelStyles = [
+        {
+            id: 'text-center',
+            dataType: 'string',
+			font: {size : 10, bold: false}
+        },
+        {
+            id: 'text-left',
+            dataType: 'string',
+			font: {size : 10, bold: false}
+        },
+        {
+            id: 'text-right',
+            dataType: 'number',
+			font: {size : 10, bold: false}
+        }
+    ];
+
+    detailGridOptions.excelStyles = gridOptions.excelStyles;
+
+    var fnExcelDownLoad = function(){
+
+    	var totalRows = gridOptions.api.getDisplayedRowCount();
+		if(totalRows==0){
+			mcxDialog.alert('조회된 내역이 없습니다.');
+			return;
+		}
+
+    	var date = new Date().format("YYYYMMDDHHmmss");
+		var params = {
+						fileName : "기획전 주문목록_"+ date,
+						sheetName: "DATA"
+					 };
+		gridOptions.api.exportDataAsExcel(params);
+    }
+    var fnDetailExcelDownLoad = function(){
+
+    	var totalRows = detailGridOptions.api.getDisplayedRowCount();
+		if(totalRows==0){
+			mcxDialog.alert('조회된 내역이 없습니다.');
+			return;
+		}
+
+    	var date = new Date().format("YYYYMMDDHHmmss");
+		var params = {
+						fileName : "기획전 주문상세 목록_"+ date,
+						sheetName: "DATA"
+					 };
+		detailGridOptions.api.exportDataAsExcel(params);
+    }
+
+
+	// 검색
+	$('#btnSearch').on('click', function() {
+		// 입력 값 체크
+		if (!gagajf.validation($('#searchForm')))
+			return false;
+
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', fnCreateTotal);
+	});
+
+	// 합계 생성
+	let fnCreateTotal = function() {
+
+		let totInfo = {};
+		totInfo.distributionGb   = "TOTAL";
+		totInfo.brandEnm         = "";
+		totInfo.planSq           = "";
+		totInfo.planNm           = "";
+		totInfo.ordAmt           = 0;
+		totInfo.ordCnt		     = 0;
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if( typeof rowNode.data.ordAmt == 'number') { totInfo.ordAmt   += rowNode.data.ordAmt ; }
+				if( typeof rowNode.data.ordCnt == 'number') { totInfo.ordCnt   += rowNode.data.ordCnt ; }
+			}
+		});
+
+		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
+	}
+
+	// 합계 생성
+	let fnDetailCreateTotal = function() {
+
+		let totInfo = {};
+		totInfo.brandCd  = "";
+		totInfo.brandEnm = "TOTAL";
+		totInfo.goodsCd  = "";
+		totInfo.goodsNm  = "";
+		totInfo.ordAmt   = 0;
+		totInfo.ordQty   = 0;
+		totInfo.custCnt  = 0;
+
+		detailGridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if( typeof rowNode.data.ordAmt        == 'number') { totInfo.ordAmt         += rowNode.data.ordAmt        ; }
+				if( typeof rowNode.data.ordQty        == 'number') { totInfo.ordQty         += rowNode.data.ordQty        ; }
+				if( typeof rowNode.data.custCnt       == 'number') { totInfo.custCnt        += rowNode.data.custCnt       ; }
+			}
+		});
+
+		gagaAgGrid.setPinnedRowData(detailGridOptions, totInfo, 'top');
+	}
+
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+		$('#searchForm')[0].reset();
+
+		$('#extmallIdTxt').html('');
+		$('#searchForm input[name=extmallIdList]').val('');
+		$('#supplyCompCdTxt').html('');
+		$('#searchForm input[name=supplyCompCdList]').val('');
+		$('#afLinkCdTxt').html('');
+		$('#searchForm input[name=afLinkCdList]').val('');
+		$('#brandCdTxt').html('');
+		$('#searchForm input[name=brandCdList]').val('');
+		$('#itemkindCdTxt').html('');
+		$('#searchForm input[name=itemkindCdList]').val('');
+	});
+
+	$(document).ready(function() {
+		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문', undefined, ['btnToday']);
+		$('.btnYesterday').trigger('click');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+		// Create a agGrid
+		gagaAgGrid.createGrid('detailGridList', detailGridOptions);
+
+	});
+/*]]>*/
+</script>
+
+</html>

+ 318 - 0
src/main/webapp/WEB-INF/views/statistics/TmtbTradingForm.html

@@ -0,0 +1,318 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : TmtbTradingForm.html
+ * @desc    : 다다익선 사용 통계 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021-09-28 화   lmc        최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title"></div>
+		<!-- //메인타이틀 영역 -->
+
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc"></div>
+		<!-- //메뉴 설명 -->
+
+		<!-- 검색조건 영역 -->
+		<div class="panelStyle">
+			<form id="searchForm" name="searchForm" action="#" th:action="@{'/statistics/tmtb/order/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col style="width:10%;"/>
+						<col style="width:60%;"/>
+						<col style="width:20%;"/>
+					</colgroup>
+					<tr>
+						<th>기간<i class="required" title="필수" aria-hidden="true"></i></th>
+						<td colspan="2" id="terms"></td>
+						<td rowspan="2">
+						  <textarea class="textareaR3 w70p" name="tmtbSq" placeholder="프로모션 번호를 입력하세요."></textarea>
+						</td>
+					</tr>
+					<tr>
+					   <th>프로모션 유형</th>
+					   <td colspan="2">
+					       <label class="chkBox checked" th:if="${applyGbList}" th:each="oneData, status : ${applyGbList}"><input type="checkbox" name="applyGbArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}" checked="checked"/></label>
+					   </td>
+					</tr>
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
+						<button type="button" class="btn btn-gray btn-lg" id="btnInit">초기화</button>
+					</li>
+				</ul>
+			</form>
+			<form id="detailSearchForm" action="/statistics/tmtb/order/detail/list" style="display:none;">
+				<input name="startDt">
+				<input name="endDt">
+				<input name="tmtbSq">
+			</form>
+		</div>
+		<!-- 검색조건 영역 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelStyle">
+			<ul class="panelBar">
+				<li>
+					<button type="button" class="btn btn-default btn-lg" onclick="fnExcelDownLoad();">엑셀다운로드</button>
+				</li>
+			</ul>
+			<div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<div class="panelStyle">
+			<ul class="panelBar">
+				<li>
+					<button type="button" class="btn btn-default btn-lg" onclick="fnDetailExcelDownLoad();">엑셀다운로드</button>
+				</li>
+			</ul>
+			<div id="detailGridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+	</div>
+
+<style>
+.ag-header-group-text{
+	margin-left: calc(50% - 25px);
+}
+</style>
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let columnDefs = [
+		{ headerName: "유형", field: "applyGb", width: 100, cellClass: 'text-center' },
+		{ headerName: "다다익선 번호", field: "tmtbSq", width: 100, cellClass: 'text-center' },
+		{ headerName: "프로모션명", field: "tmtbNm", width: 250, cellClass: 'text-left' },
+		{ headerName: "자사분담율", field: "burden", width: 150, cellClass: 'text-right',
+            cellRenderer: function(params) {
+                return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+            }
+		},
+		{ headerName: "적용주문수", field: "ordCnt", width: 150, cellClass: 'text-right',
+            cellRenderer: function(params) {
+                return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+            }
+		},
+		{ headerName: "주문결제액", field: "ordAmt", width: 150, cellClass: 'text-right',
+            cellRenderer: function(params) {
+                return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+            }
+		},
+		{ headerName: "프로모션비용", field: "dcAmt", width: 150, cellClass: 'text-right',
+            cellRenderer: function(params) {
+                return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+            }
+		},
+		{ headerName: "상세보기", field: "detail", width: 100, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				return '<a href="javascript:void(0);">상세현황보기</a>';
+			}
+		},
+	];
+
+	let detailColumnDefs = [
+		{ headerName: "브랜드", field: "brandEnm", width: 150, cellClass: 'text-center' },
+		{ headerName: "상품번호", field: "goodsCd", width: 150, cellClass: 'text-center',
+			cellRenderer: function (params) {
+				return '<a href="javascript:void(0);">'+params.value+'</a>';
+			}
+		},
+		{ headerName: "상품명", field: "goodsNm", width: 300, cellClass: 'text-left',
+			cellRenderer: function (params) {
+				return '<a href="javascript:void(0);">'+params.value+'</a>';
+			}
+		},
+		{ headerName: "상품매출액", field: "ordAmt", width: 150, cellClass: 'text-right',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+			}
+		},
+		{ headerName: "판매수량", field: "ordQty", width: 150, cellClass: 'text-right',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+			}
+		},
+		{ headerName: "구매자수", field: "custCnt", width: 150, cellClass: 'text-right',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+			}
+		},
+	];
+
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+	let detailGridOptions = gagaAgGrid.getGridOptions(detailColumnDefs);
+
+	// Row Click
+	gridOptions.onCellClicked = function(event) {
+		var params = event.data;
+		if (event.colDef.field == "goodsCd"){
+			cfnOpenGoodsDetailPopup('U', params.goodsCd);
+		}
+		else if (event.colDef.field == "goodsNm"){
+			cfnOpenGoodsDetailPopup('U', params.goodsCd);
+		}
+		else if (event.colDef.field == "detail"){
+			$("#detailSearchForm input[name=startDt]").val($("#searchForm input[name=startDt]").val());
+			$("#detailSearchForm input[name=endDt]").val($("#searchForm input[name=endDt]").val());
+			$("#detailSearchForm input[name=tmtbSq]").val(params.tmtbSq);
+			gagaAgGrid.fetch($('#detailSearchForm').prop('action'), detailGridOptions, '#detailSearchForm', fnDetailCreateTotal);
+		}
+	}
+
+	// Row Click
+	detailGridOptions.onCellClicked = function(event) {
+		var params = event.data;
+		if (event.colDef.field == "goodsCd"){
+			cfnOpenGoodsDetailPopup('U',goodsCd);
+		}
+		else if (event.colDef.field == "goodsNm"){
+			cfnOpenGoodsDetailPopup('U',goodsCd);
+		}
+	}
+
+    gridOptions.excelStyles = [
+        {
+            id: 'text-center',
+            dataType: 'string',
+			font: {size : 10, bold: false}
+        },
+        {
+            id: 'text-left',
+            dataType: 'string',
+			font: {size : 10, bold: false}
+        },
+        {
+            id: 'text-right',
+            dataType: 'number',
+			font: {size : 10, bold: false}
+        }
+    ];
+
+    detailGridOptions.excelStyles = gridOptions.excelStyles;
+
+    var fnExcelDownLoad = function(){
+
+    	var totalRows = gridOptions.api.getDisplayedRowCount();
+		if(totalRows==0){
+			mcxDialog.alert('조회된 내역이 없습니다.');
+			return;
+		}
+
+    	var date = new Date().format("YYYYMMDDHHmmss");
+		var params = {
+						fileName : "다다익선 주문목록_"+ date,
+						sheetName: "DATA"
+					 };
+		gridOptions.api.exportDataAsExcel(params);
+    }
+    var fnDetailExcelDownLoad = function(){
+
+    	var totalRows = detailGridOptions.api.getDisplayedRowCount();
+		if(totalRows==0){
+			mcxDialog.alert('조회된 내역이 없습니다.');
+			return;
+		}
+
+    	var date = new Date().format("YYYYMMDDHHmmss");
+		var params = {
+						fileName : "다다익선 주문상세 목록_"+ date,
+						sheetName: "DATA"
+					 };
+		detailGridOptions.api.exportDataAsExcel(params);
+    }
+
+
+	// 검색
+	$('#btnSearch').on('click', function() {
+		// 입력 값 체크
+		if (!gagajf.validation($('#searchForm')))
+			return false;
+
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', fnCreateTotal);
+	});
+
+	// 합계 생성
+	let fnCreateTotal = function() {
+
+		let totInfo = {};
+		totInfo.applyGb = "TOTAL";
+		totInfo.tmtbSq  = "";
+		totInfo.tmtbNm  = "";
+		totInfo.ordCnt  = 0;
+		totInfo.ordAmt  = 0;
+		totInfo.dcAmt	= 0;
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if( typeof rowNode.data.ordCnt  == 'number') { totInfo.ordCnt   += rowNode.data.ordCnt  ; }
+				if( typeof rowNode.data.ordAmt  == 'number') { totInfo.ordAmt   += rowNode.data.ordAmt  ; }
+				if( typeof rowNode.data.dcAmt	== 'number') { totInfo.dcAmt    += rowNode.data.dcAmt	; }
+			}
+		});
+
+		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
+	}
+
+	// 합계 생성
+	let fnDetailCreateTotal = function() {
+
+		let totInfo = {};
+		totInfo.brandCd  = "";
+		totInfo.brandEnm = "TOTAL";
+		totInfo.goodsCd  = "";
+		totInfo.goodsNm  = "";
+		totInfo.ordAmt   = 0;
+		totInfo.ordQty   = 0;
+		totInfo.custCnt  = 0;
+
+		detailGridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if( typeof rowNode.data.ordAmt        == 'number') { totInfo.ordAmt         += rowNode.data.ordAmt        ; }
+				if( typeof rowNode.data.ordQty        == 'number') { totInfo.ordQty         += rowNode.data.ordQty        ; }
+				if( typeof rowNode.data.custCnt       == 'number') { totInfo.custCnt        += rowNode.data.custCnt       ; }
+			}
+		});
+
+		gagaAgGrid.setPinnedRowData(detailGridOptions, totInfo, 'top');
+	}
+
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+		$('#searchForm')[0].reset();
+
+		$('#extmallIdTxt').html('');
+		$('#searchForm input[name=extmallIdList]').val('');
+		$('#supplyCompCdTxt').html('');
+		$('#searchForm input[name=supplyCompCdList]').val('');
+		$('#afLinkCdTxt').html('');
+		$('#searchForm input[name=afLinkCdList]').val('');
+		$('#brandCdTxt').html('');
+		$('#searchForm input[name=brandCdList]').val('');
+		$('#itemkindCdTxt').html('');
+		$('#searchForm input[name=itemkindCdList]').val('');
+	});
+
+	$(document).ready(function() {
+		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문', undefined, ['btnToday']);
+		$('.btnYesterday').trigger('click');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+		// Create a agGrid
+		gagaAgGrid.createGrid('detailGridList', detailGridOptions);
+
+	});
+/*]]>*/
+</script>
+
+</html>

+ 45 - 0
src/main/webapp/ux/js/admin.popup.js

@@ -873,6 +873,34 @@ var cfnOpenCompanyListPopup = function(callbackfn, multiGb, searchTxt, inputId,
 	}
 	}
 }
 }
 
 
+var cfnOpenCompanyListPopup2 = function(callbackfn, multiGb, searchTxt, inputId, selfYn) {
+	var actionUrl = "/business/comapny/search/scm/form?callbackFn=" + callbackfn;
+	if (typeof(multiGb) != 'undefined' && multiGb != null && multiGb == "M") actionUrl += "&multiGb=" + multiGb; else actionUrl += "&multiGb=S";
+	if (typeof(searchTxt) != 'undefined') actionUrl += "&searchTxt=" + encodeURIComponent(searchTxt);
+	if (typeof(selfYn) != 'undefined') actionUrl += "&selfYn="+ selfYn ; else actionUrl += "&selfYn=" ;
+	if(multiGb == "S") {
+		if(searchTxt && searchTxt != "" && inputId && inputId != "") {
+			var data = {  searchTxt : searchTxt, searchGb : "NAME"};
+			var jsonData = JSON.stringify(data);
+
+			gagajf.ajaxJsonSubmit('/business/supply/company/scm/list', jsonData, function(result) {
+				if(result && result.length == 1) {
+					$("#" + inputId).val(result[0].supplyCompCd);
+				} else {
+					uifnPopupClose('popupCompanyList2');
+					cfnOpenModalPopup(actionUrl, 'popupCompanyList2');
+				}
+			});
+		} else {
+			uifnPopupClose('popupCompanyList2');
+			cfnOpenModalPopup(actionUrl, 'popupCompanyList2');
+		}
+	} else {
+		uifnPopupClose('popupCompanyList2');
+		cfnOpenModalPopup(actionUrl, 'popupCompanyList2');
+	}
+}
+
 /**
 /**
  * @type   : function
  * @type   : function
  * @access : public
  * @access : public
@@ -1115,4 +1143,21 @@ var cfnOpenAfLinkListPopup = function(callbackfn, multiGb, searchTxt){
 	if (typeof(multiGb) != 'undefined' && multiGb != null && multiGb == "M") actionUrl += "&multiGb=" + multiGb; else actionUrl += "&multiGb=S";
 	if (typeof(multiGb) != 'undefined' && multiGb != null && multiGb == "M") actionUrl += "&multiGb=" + multiGb; else actionUrl += "&multiGb=S";
 	if (typeof(searchTxt) != 'undefined') actionUrl += "&searchTxt=" + encodeURIComponent(searchTxt);
 	if (typeof(searchTxt) != 'undefined') actionUrl += "&searchTxt=" + encodeURIComponent(searchTxt);
 	cfnOpenModalPopup(actionUrl, "popupAflinkList");
 	cfnOpenModalPopup(actionUrl, "popupAflinkList");
+}
+
+/**
+ * @type   : function
+ * @access : public
+ * @desc   : 카드사 조회 팝업
+ * <pre>
+ *     cfnOpenPgCardListPopup();
+ * </pre>
+ * @since  : 2021/09/28
+ * @author : swkim
+ */
+var cfnOpenPgCardListPopup = function(callbackfn) {
+	var actionUrl = "/statistics/card/search/form";
+	if (typeof(callbackfn) != 'undefined') actionUrl += "?callbackFn=" + callbackfn;
+	uifnPopupClose('popupPgCardList');
+	cfnOpenModalPopup(actionUrl, 'popupPgCardList');
 }
 }