SELECT A.gd_mst_seq
     , A.gd_mst_cd
     , A.ba_comp_seq
     , A.cate_cls_l_seq
     , A.cate_cls_m_seq
     , A.cate_cls_s_seq
     , A.gd_nm
    , A.mst_amt
	, A.img_path_arr
  FROM GD_MST A
 WHERE A.ba_comp_seq = :login_comp_seq
 AND (SELECT COUNT(X.seat_local) FROM GD_MST_PAY X WHERE X.gd_mst_seq = A.gd_mst_seq AND X.tour_day_st >= :day) > 0
 :_filterQuery
 AND A.homepage_disp_yn = 'Y'
 AND A.use_yn = 'Y'
 AND A.sale_day_st <= :day AND sale_day_ed >= :day
 ORDER BY A.sort_idx ASC,A.gd_mst_seq DESC