-
Notifications
You must be signed in to change notification settings - Fork 72
주요 기능 소개(영화 예매)
채현우 edited this page Jun 2, 2022
·
2 revisions
- 영화 예매 순서 : 영화, 극장,시간 선택 -> 예매 인원 및 좌석 선택 -> 예매 할인 및 결제 수단 선택 -> 예매 완료
- 영화 예매를 할 때 현재 날짜(오늘)를 기준으로 예약 날짜를 보여줌
- 영화를 선택하고 극장은 대 분류 -> 소 분류로 선택 ex) 서울(대 분류) -> 강남대로(씨티)
- 각 영화관(소 분류) 일정 시간에 어떤 영화를 상영하지는 DB에 저장되어 있어 영화관에 맞는 상영 시간(영화)을 보여줌
- 상영 시간을 선택하면 자동으로 인원 및 좌석 선택 페이지로 이동
- 인원 수 만큼 좌석을 선택해야 하고, 우측에는 User가 선택한 영화, 영화관, 시간 및 좌석을 보여줌 (다음 버튼으로 결제 페이지로 이동)
- 할인 수단 및 결제를 하고, 영화 가격 및 인원 수에 맞는 가격을 User한테 보여준다.
- 예매 완료 페이지에서는 User가 예약한 총 정보 및 결제 정보를 보여줌
Booking_1_Controller.java
@Controller
public class Booking_1_Controller {
@Resource
private Booking_1_Service booking_1_Service;
@RequestMapping(value = "/booking_1")
public ModelAndView booking_1() throws Exception {
ModelAndView mav = new ModelAndView();
List<FP_MOVIE_DTO> movielists = booking_1_Service.getMovieLists();
List<FP_MOVIE_NAME_DTO> movieNamelists = new ArrayList<FP_MOVIE_NAME_DTO>();
Iterator<FP_MOVIE_DTO> it = movielists.iterator();
while (it.hasNext()) {
FP_MOVIE_DTO dto = it.next();
FP_MOVIE_NAME_DTO mnDto = new FP_MOVIE_NAME_DTO();
mnDto = movieName(mnDto, dto);
movieNamelists.add(mnDto);
}
mav.addObject("movieNamelists", movieNamelists);
List<FP_REGION_DTO> regionlists = booking_1_Service.getRegionLists();
mav.addObject("regionlists", regionlists);
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy,MM,dd,HH,mm");
String[] nowTime = sdf1.format(new Date()).split(",");
int year = Integer.parseInt(nowTime[0]);
int month = Integer.parseInt(nowTime[1]);
int preDay = Integer.parseInt(nowTime[2]) - 1;
Calendar cal = Calendar.getInstance();
cal.set(year, month, preDay);
int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
List<Date_DTO> dayWeekList = new ArrayList<Date_DTO>();
String strMonth = "";
int cnt = 0;
for (int i = 0; i < 15; i++) {
Date_DTO dto = new Date_DTO();
if ((preDay + i - 2) >= lastDay) {
cnt++;
int nextMonthDay = 0;
if(month == 12) {
year++;
month = 0;
}
dto.setYear(Integer.toString(year));
if((month + 1)<10) {
strMonth = "0" + Integer.toString(month + 1);
}
dto.setMonth(strMonth);
dto.setDay(Integer.toString(nextMonthDay + cnt));
LocalDate date = LocalDate.of(year, month + 1, nextMonthDay + cnt);
DayOfWeek dayOfWeek = date.getDayOfWeek();
dto.setDayOfweek(dayOfWeek.getDisplayName(TextStyle.FULL, Locale.KOREAN).substring(0, 1));
dayWeekList.add(dto);
continue;
}
dto.setYear(Integer.toString(year));
if((month)<10) {
strMonth = "0" + Integer.toString(month);
}
dto.setMonth(strMonth);
dto.setDay(Integer.toString(preDay + i));
LocalDate date = LocalDate.of(year, month, preDay + i);
DayOfWeek dayOfWeek = date.getDayOfWeek();
dto.setDayOfweek(dayOfWeek.getDisplayName(TextStyle.FULL, Locale.KOREAN).substring(0, 1));
dayWeekList.add(dto);
}
mav.addObject("dayWeekList", dayWeekList);
List<String> timeList = new ArrayList<String>();
String strI = "";
for(int i=0;i<10;i++) {
strI = Integer.toString(i);
if(i<10) {
strI = "0" + strI;
}
timeList.add(strI);
}
mav.addObject("timeList", timeList);
mav.setViewName("booking/booking_1");
return mav;
}
public FP_MOVIE_NAME_DTO movieName(FP_MOVIE_NAME_DTO mnDto, FP_MOVIE_DTO dto) throws Exception {
FP_VIEWINGCLASS_DTO vcDto = booking_1_Service.getVc(dto.getVcNum());
mnDto.setNum(dto.getNum());
mnDto.setName(dto.getName());
mnDto.setTagName(vcDto.getTagName());
mnDto.setHangle(vcDto.getHangle());
mnDto.setS_f_n(dto.getS_f_n());
mnDto.setO_f_n(dto.getO_f_n());
return mnDto;
}
@RequestMapping(value = "/movieData")
public ModelAndView movieData(HttpServletRequest request) throws Exception {
int mnNum = Integer.parseInt(request.getParameter("mnNum"));
ModelAndView mav = new ModelAndView();
FP_MOVIE_DTO movieData = booking_1_Service.getMovieData(mnNum);
mav.addObject("movieData", movieData);
mav.setViewName("jsonView");
return mav;
}
@RequestMapping(value = "/regionDetailList")
public ModelAndView regionDetailList(HttpServletRequest request) throws Exception {
String regionNum = request.getParameter("regionNum");
int nRegionNum = Integer.parseInt(regionNum);
ModelAndView mav = new ModelAndView();
List<FP_REGIONDETAIL_DTO> rdLists = booking_1_Service.getRegionDetailLists(nRegionNum);
mav.addObject("rdLists", rdLists);
mav.setViewName("jsonView");
return mav;
}
@RequestMapping(value = "/movieTotalLists")
public ModelAndView movieTotalLists(HttpServletRequest request) throws Exception {
String movieSel = request.getParameter("movieSel");
String rdSel = request.getParameter("rdSel");
String daySel = request.getParameter("daySel");
String timeSel = request.getParameter("timeSel");
List<FP_MOVIETOTAL_NAME_DTO> mtnlists = getMtnlists(movieSel, rdSel, daySel, timeSel);
ModelAndView mav = new ModelAndView();
mav.addObject("mtnlists", mtnlists);
mav.setViewName("jsonView");
return mav;
}
public List<FP_MOVIETOTAL_NAME_DTO> getMtnlists(String movieSel, String rdSel, String daySel, String timeSel) throws Exception {
int nMovieSel = 0;
if(movieSel != null) {
nMovieSel = Integer.parseInt(movieSel);
}
int nRdSel = 0;
if(rdSel != null) {
nRdSel = Integer.parseInt(rdSel);
}
if(daySel == null) {
daySel = "";
}
if(timeSel == null) {
timeSel = "";
}
FP_MOVIETOTAL_DTO mtDto = new FP_MOVIETOTAL_DTO();
mtDto.setMovieNum(nMovieSel);
mtDto.setRdNum(nRdSel);
mtDto.setStrDate(daySel);
mtDto.setStartHour(timeSel);
List<FP_MOVIETOTAL_DTO> movieTotalLists = booking_1_Service.getMovieTotalLists(mtDto);
List<FP_MOVIETOTAL_NAME_DTO> mtnlists = new ArrayList<FP_MOVIETOTAL_NAME_DTO>();
Iterator<FP_MOVIETOTAL_DTO> it = movieTotalLists.iterator();
while (it.hasNext()) {
FP_MOVIETOTAL_DTO dto = it.next();
FP_MOVIETOTAL_NAME_DTO mtnDto = getMtnData(dto);
mtnlists.add(mtnDto);
}
return mtnlists;
}
public FP_MOVIETOTAL_NAME_DTO getMtnData(FP_MOVIETOTAL_DTO dto) throws Exception {
FP_MOVIETOTAL_NAME_DTO mtnDto = new FP_MOVIETOTAL_NAME_DTO();
FP_MOVIE_DTO movieDTO = booking_1_Service.getMovie(dto.getMovieNum());
FP_MOVIE_NAME_DTO mnDTO = new FP_MOVIE_NAME_DTO();
mnDTO = movieName(mnDTO, movieDTO);
FP_PLAYKIND_DTO playKindDTO = booking_1_Service.getPlayKind(dto.getPkNum());
FP_REGION_DTO regionDTO = booking_1_Service.getRegion(dto.getRegionNum());
FP_REGIONDETAIL_DTO rdDTO = booking_1_Service.getRegionDetail(dto.getRdNum());
FP_THEATER_DTO theaterDTO = booking_1_Service.getTheater(dto.getTheaterNum());
mtnDto.setNum(dto.getNum());
mtnDto.setMovie(mnDTO.getName());
mtnDto.setPlayKind(playKindDTO.getName());
mtnDto.setRegion(regionDTO.getName());
mtnDto.setRegionDetail(rdDTO.getName());
mtnDto.setTheater(theaterDTO.getName());
mtnDto.setStrDate(dto.getStrDate());
mtnDto.setStartHour(dto.getStartHour());
mtnDto.setStartMinute(dto.getStartMinute());
mtnDto.setEndHour(dto.getEndHour());
mtnDto.setEndMinute(dto.getEndMinute());
mtnDto.setRemainSeat(dto.getRemainSeat());
mtnDto.setTotalSeat(theaterDTO.getTotalSeat());
return mtnDto;
}
@Bean
MappingJackson2JsonView jsonView() {
return new MappingJackson2JsonView();
}
}
Booking_2_Controller.java
@Controller
public class Booking_2_Controller {
@Resource
private Booking_1_Service booking_1_Service;
@Resource
private Booking_2_Service booking_2_Service;
@RequestMapping(value = "/booking_2")
public ModelAndView booking_2(HttpServletRequest request) throws Exception {
int mtnNum = Integer.parseInt(request.getParameter("mtnNum"));
FP_MOVIETOTAL_DTO mtDto = booking_2_Service.getMt(mtnNum);
FP_MOVIE_DTO movieDTO = booking_2_Service.getMovie(mtDto.getMovieNum());
FP_MOVIE_NAME_DTO mnDTO = new FP_MOVIE_NAME_DTO();
mnDTO = movieName(mnDTO, movieDTO);
FP_PLAYKIND_DTO playKindDTO = booking_2_Service.getPlayKind(mtDto.getPkNum());
FP_REGION_DTO regionDTO = booking_2_Service.getRegion(mtDto.getRegionNum());
FP_REGIONDETAIL_DTO rdDTO = booking_2_Service.getRegionDetail(mtDto.getRdNum());
FP_THEATER_DTO theaterDTO = booking_2_Service.getTheater(mtDto.getTheaterNum());
FP_MOVIETOTAL_NAME_DTO mtnDto = new FP_MOVIETOTAL_NAME_DTO();
mtnDto.setNum(mtDto.getNum());
mtnDto.setTagName(mnDTO.getTagName());
mtnDto.setHangle(mnDTO.getHangle());
mtnDto.setMovie(mnDTO.getName());
mtnDto.setMovieImg(mnDTO.getS_f_n());
mtnDto.setPlayKind(playKindDTO.getName());
mtnDto.setRegion(regionDTO.getName());
mtnDto.setRegionDetail(rdDTO.getName());
mtnDto.setTheater(theaterDTO.getName());
mtnDto.setStrDate(mtDto.getStrDate());
mtnDto.setStartHour(mtDto.getStartHour());
mtnDto.setStartMinute(mtDto.getStartMinute());
mtnDto.setEndHour(mtDto.getEndHour());
mtnDto.setEndMinute(mtDto.getEndMinute());
mtnDto.setRemainSeat(mtDto.getRemainSeat());
mtnDto.setTotalSeat(theaterDTO.getTotalSeat());
String[] arrDate = mtDto.getStrDate().split("\\.");
int year = Integer.parseInt(arrDate[0]);
int month = Integer.parseInt(arrDate[1]);
int day = Integer.parseInt(arrDate[2]);
LocalDate date = LocalDate.of(year, month, day);
DayOfWeek dayOfWeek = date.getDayOfWeek();
mtnDto.setDayOfWeek(dayOfWeek.getDisplayName(TextStyle.FULL, Locale.KOREAN).substring(0, 1));
ModelAndView mav = new ModelAndView();
mav.addObject("mtnDto",mtnDto);
mav.setViewName("booking/booking_2");
return mav;
}
public FP_MOVIE_NAME_DTO movieName(FP_MOVIE_NAME_DTO mnDto, FP_MOVIE_DTO dto) throws Exception {
FP_VIEWINGCLASS_DTO vcDto = booking_1_Service.getVc(dto.getVcNum());
mnDto.setNum(dto.getNum());
mnDto.setName(dto.getName());
mnDto.setTagName(vcDto.getTagName());
mnDto.setHangle(vcDto.getHangle());
mnDto.setS_f_n(dto.getS_f_n());
mnDto.setO_f_n(dto.getO_f_n());
return mnDto;
}
@RequestMapping(value = "/booking_2_ok")
public ModelAndView booking_2_ok(HttpServletRequest request) throws Exception {
String tagName = request.getParameter("tagName_value");
String hangle = request.getParameter("hangle_value");
String movieNm = request.getParameter("movieNm_value");
String movieImg = request.getParameter("movieImg_value");
String playKindNm = request.getParameter("playKindNm_value");
String brchNm = request.getParameter("brchNm_value");
String theater = request.getParameter("theater_value");
String playDe = request.getParameter("playDe_value");
String dowNm = request.getParameter("dowNm_value");
String playTime = request.getParameter("playTime_value");
String adultCnt = request.getParameter("adultCount_value");
String youngCnt = request.getParameter("youngCount_value");
String favorCnt = request.getParameter("favorCount_value");
String adultPrice = request.getParameter("adultPrice_value");
String youngPrice = request.getParameter("youngPrice_value");
String favorPrice = request.getParameter("favorPrice_value");
String totalPrice = request.getParameter("totalPrice_value");
String seat1 = request.getParameter("seat1_value");
String seat2 = request.getParameter("seat2_value");
String seat3 = request.getParameter("seat3_value");
String seat4 = request.getParameter("seat4_value");
String seat5 = request.getParameter("seat5_value");
String seat6 = request.getParameter("seat6_value");
String seat7 = request.getParameter("seat7_value");
String seat8 = request.getParameter("seat8_value");
ModelAndView mav = new ModelAndView();
mav.addObject("tagName",tagName);
mav.addObject("hangle",hangle);
mav.addObject("movieNm",movieNm);
mav.addObject("movieImg",movieImg);
mav.addObject("playKindNm",playKindNm);
mav.addObject("playDe",playDe);
mav.addObject("brchNm",brchNm);
mav.addObject("theater",theater);
mav.addObject("dowNm",dowNm);
mav.addObject("playTime",playTime);
mav.addObject("adultCnt",adultCnt);
mav.addObject("youngCnt",youngCnt);
mav.addObject("favorCnt",favorCnt);
mav.addObject("adultPrice",adultPrice);
mav.addObject("youngPrice",youngPrice);
mav.addObject("favorPrice",favorPrice);
mav.addObject("totalPrice",totalPrice);
mav.addObject("seat1",seat1);
mav.addObject("seat2",seat2);
mav.addObject("seat3",seat3);
mav.addObject("seat4",seat4);
mav.addObject("seat5",seat5);
mav.addObject("seat6",seat6);
mav.addObject("seat7",seat7);
mav.addObject("seat8",seat8);
mav.setViewName("booking/booking_3");
return mav;
}
}
Booking_3_Controller.java
@Controller
public class Booking_3_Controller {
@Resource
private Booking_3_Service booking_3_Service;
@RequestMapping(value = "/booking_3")
public ModelAndView booking_3() throws Exception {
ModelAndView mav = new ModelAndView();
mav.setViewName("booking/booking_3");
return mav;
}
@RequestMapping(value = "/booking_3_ok")
public ModelAndView booking_3_ok(HttpServletRequest request, FP_PAY_DTO dto) throws Exception {
String memp = request.getParameter("memp_value");
String dcoupon = request.getParameter("dcoupon_value");
String vipCpon = request.getParameter("vipCpon_value");
String mcoupon = request.getParameter("mcoupon_value");
String scoupon = request.getParameter("scoupon_value");
String mgfcard = request.getParameter("mgfcard_value");
String bookgift = request.getParameter("bookgift_value");
String cultgift = request.getParameter("cultgift_value");
String paysgift = request.getParameter("paysgift_value");
String friends = request.getParameter("friends_value");
String annus = request.getParameter("annus_value");
String uplus = request.getParameter("uplus_value");
String okcb = request.getParameter("okcb_value");
String lpoint = request.getParameter("lpoint_value");
String gsnp = request.getParameter("gsnp_value");
String hyoil = request.getParameter("hyoil_value");
String happ = request.getParameter("happ_value");
String hbluep = request.getParameter("hbluep_value");
String joongang = request.getParameter("joongang_value");
String hydm = request.getParameter("hydm_value");
String happcash = request.getParameter("happcash_value");
String bookcash = request.getParameter("bookcash_value");
String cultcash = request.getParameter("cultcash_value");
String culturenuri = request.getParameter("culturenuri_value");
String same_use_payment = request.getParameter("same_use_payment");
if (same_use_payment == null) {
same_use_payment = "off";
}
String radio_payment = request.getParameter("radio_payment");
String card_select = request.getParameter("card_select");
String tagName = request.getParameter("tagName_value");
String hangle = request.getParameter("hangle_value");
String movieNm = request.getParameter("movieNm_value");
String movieImg = request.getParameter("movieImg_value");
String playKindNm = request.getParameter("playKindNm_value");
String brchNm = request.getParameter("brchNm_value");
String theater = request.getParameter("theater_value");
String playDe = request.getParameter("playDe_value");
String dowNm = request.getParameter("dowNm_value");
String playTime = request.getParameter("playTime_value");
String adultCnt = request.getParameter("adultCnt_value");
String youngCnt = request.getParameter("youngCnt_value");
String favorCnt = request.getParameter("favorCnt_value");
String adultPrice = request.getParameter("adultPrice_value");
String youngPrice = request.getParameter("youngPrice_value");
String favorPrice = request.getParameter("favorPrice_value");
String totalPrice = request.getParameter("totalPrice_value");
String[] seat = new String[8];
for(int i=1;i<=8;i++) {
seat[i-1] = request.getParameter("seat" + i + "_value");
}
ModelAndView mav = new ModelAndView();
int maxNum = booking_3_Service.maxNum();
dto.setNum(maxNum + 1);
dto.setMemp(memp);
dto.setDcoupon(dcoupon);
dto.setVipCpon(vipCpon);
dto.setMcoupon(mcoupon);
dto.setScoupon(scoupon);
dto.setMgfcard(mgfcard);
dto.setBookgift(bookgift);
dto.setCultgift(cultgift);
dto.setPaysgift(paysgift);
dto.setFriends(friends);
dto.setAnnus(annus);
dto.setUplus(uplus);
dto.setOkcb(okcb);
dto.setLpoint(lpoint);
dto.setGsnp(gsnp);
dto.setHyoil(hyoil);
dto.setHapp(happ);
dto.setHbluep(hbluep);
dto.setJoongang(joongang);
dto.setHydm(hydm);
dto.setHappcash(happcash);
dto.setBookcash(bookcash);
dto.setCultcash(cultcash);
dto.setCulturenuri(culturenuri);
dto.setSame_use_payment(same_use_payment);
dto.setRadio_payment(radio_payment);
dto.setCard_select(card_select);
dto.setTagName(tagName);
dto.setHangle(hangle);
dto.setMovieNm(movieNm);
dto.setMovieImg(movieImg);
dto.setPlayKindNm(playKindNm);
dto.setBrchNm(brchNm);
dto.setTheater(theater);
dto.setPlayDe(playDe);
dto.setDowNm(dowNm);
dto.setPlayTime(playTime);
dto.setAdultCnt(adultCnt);
dto.setYoungCnt(youngCnt);
dto.setFavorCnt(favorCnt);
dto.setAdultPrice(adultPrice);
dto.setYoungPrice(youngPrice);
dto.setFavorPrice(favorPrice);
dto.setTotalPrice(totalPrice);
dto.setSeat1(seat[0]);
dto.setSeat2(seat[1]);
dto.setSeat3(seat[2]);
dto.setSeat4(seat[3]);
dto.setSeat5(seat[4]);
dto.setSeat6(seat[5]);
dto.setSeat7(seat[6]);
dto.setSeat8(seat[7]);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MMdd");
String today = formatter.format(new Date());
String ticketNum = today + "-" + Integer.toString(maxNum);
dto.setTicketNum(ticketNum);
booking_3_Service.insertData(dto);
mav.addObject("tagName",tagName);
mav.addObject("hangle",hangle);
mav.addObject("movieNm",movieNm);
mav.addObject("movieImg",movieImg);
mav.addObject("playKindNm",playKindNm);
mav.addObject("playDe",playDe);
mav.addObject("brchNm",brchNm);
mav.addObject("theater",theater);
mav.addObject("dowNm",dowNm);
mav.addObject("playTime",playTime);
String person = "";
if(!adultCnt.equals(""))
person += "성인 " + adultCnt + "명 ";
if(!youngCnt.equals(""))
person += "청소년 " + youngCnt + "명 ";
if(!favorCnt.equals(""))
person += "우대 " + favorCnt + "명 ";
mav.addObject("person",person);
mav.addObject("adultPrice",adultPrice);
mav.addObject("youngPrice",youngPrice);
mav.addObject("favorPrice",favorPrice);
mav.addObject("totalPrice",totalPrice);
String StrSeat = "";
for(int i=1;i<=8;i++) {
if(!(seat[i-1].equals(""))) {
if(i==1) {
StrSeat += seat[i-1];
continue;
}
StrSeat += " ";
StrSeat += seat[i-1];
} else
break;
}
mav.addObject("StrSeat",StrSeat);
mav.addObject("ticketNum",ticketNum);
mav.setViewName("booking/bookingComplete");
return mav;
}
}
BookingCompleteController.java
@Controller
public class BookingCompleteController {
@RequestMapping(value = "/bookingComplete")
public ModelAndView bookingComplete(HttpServletRequest request, FP_PAY_DTO dto) throws Exception {
ModelAndView mav = new ModelAndView();
mav.setViewName("booking/bookingComplete");
return mav;
}
@RequestMapping(value = "/bookingComplete_ok")
public ModelAndView bookingComplete_ok(HttpServletRequest request, FP_PAY_DTO dto) throws Exception {
ModelAndView mav = new ModelAndView();
mav.setViewName("booking/bookingComplete");
return mav;
}
}
Booking_1_ServiceImpl.java
@Service
public class Booking_1_ServiceImpl implements Booking_1_Service {
@Autowired
private Booking_1_Mapper booking_1_Mapper;
@Override
public List<FP_MOVIE_DTO> getMovieLists() throws Exception {
return booking_1_Mapper.getMovieLists();
}
@Override
public FP_VIEWINGCLASS_DTO getVc(int num) throws Exception {
return booking_1_Mapper.getVc(num);
}
@Override
public FP_MOVIE_DTO getMovieData(int num) throws Exception {
return booking_1_Mapper.getMovieData(num);
}
@Override
public List<FP_REGION_DTO> getRegionLists() throws Exception {
return booking_1_Mapper.getRegionLists();
}
@Override
public List<FP_REGIONDETAIL_DTO> getRegionDetailLists(int regionNum) throws Exception {
return booking_1_Mapper.getRegionDetailLists(regionNum);
}
@Override
public List<FP_MOVIETOTAL_DTO> getMovieTotalLists(FP_MOVIETOTAL_DTO dto) throws Exception {
return booking_1_Mapper.getMovieTotalLists(dto);
}
@Override
public FP_MOVIE_DTO getMovie(int num) throws Exception {
return booking_1_Mapper.getMovie(num);
}
@Override
public FP_PLAYKIND_DTO getPlayKind(int num) throws Exception {
return booking_1_Mapper.getPlayKind(num);
}
@Override
public FP_REGION_DTO getRegion(int num) throws Exception {
return booking_1_Mapper.getRegion(num);
}
@Override
public FP_REGIONDETAIL_DTO getRegionDetail(int num) throws Exception {
return booking_1_Mapper.getRegionDetail(num);
}
@Override
public FP_THEATER_DTO getTheater(int num) throws Exception {
return booking_1_Mapper.getTheater(num);
}
}
Booking_2_ServiceImpl.java
@Service
public class Booking_2_ServiceImpl implements Booking_2_Service{
@Autowired
private Booking_2_Mapper booking_2_Mapper;
@Override
public FP_MOVIETOTAL_DTO getMt(int num) throws Exception {
return booking_2_Mapper.getMt(num);
}
@Override
public FP_MOVIE_DTO getMovie(int num) throws Exception {
return booking_2_Mapper.getMovie(num);
}
@Override
public FP_PLAYKIND_DTO getPlayKind(int num) throws Exception {
return booking_2_Mapper.getPlayKind(num);
}
@Override
public FP_REGION_DTO getRegion(int num) throws Exception {
return booking_2_Mapper.getRegion(num);
}
@Override
public FP_REGIONDETAIL_DTO getRegionDetail(int num) throws Exception {
return booking_2_Mapper.getRegionDetail(num);
}
@Override
public FP_THEATER_DTO getTheater(int num) throws Exception {
return booking_2_Mapper.getTheater(num);
}
}
Booking_3_ServiceImpl.java
@Service
public class Booking_3_ServiceImpl implements Booking_3_Service {
@Autowired
private Booking_3_Mapper booking_Mapper;
@Override
public int maxNum() throws Exception {
return booking_Mapper.maxNum();
}
@Override
public void insertData(FP_PAY_DTO dto) throws Exception {
booking_Mapper.insertData(dto);
}
}
booking_1_Mapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.finalProject.mapper.Booking_1_Mapper">
<select id="getMovieLists" parameterType="map" resultType="com.finalProject.dto.FP_MOVIE_DTO">
select
num,
name,
vcNum,
s_f_n,
o_f_n
from FP_MOVIE
order by name
</select>
<select id="getVc" parameterType="int" resultType="com.finalProject.dto.FP_VIEWINGCLASS_DTO">
select
num,
tagName,
hangle
from FP_VIEWINGCLASS
where num=#{num}
</select>
<select id="getMovieData" parameterType="int" resultType="com.finalProject.dto.FP_MOVIE_DTO">
select
num,
name,
vcNum,
s_f_n,
o_f_n,
director,
actress
from FP_MOVIE
where num=#{num}
</select>
<select id="getRegionLists" parameterType="map" resultType="com.finalProject.dto.FP_REGION_DTO">
select
num,
name
from FP_REGION
</select>
<select id="getRegionDetailLists" parameterType="int" resultType="com.finalProject.dto.FP_REGIONDETAIL_DTO">
select
num,
name,
regionNum
from FP_REGIONDETAIL
where REGIONNUM=#{REGIONNUM}
</select>
<select id="getMovieTotalLists" parameterType="com.finalProject.dto.FP_MOVIETOTAL_DTO" resultType="com.finalProject.dto.FP_MOVIETOTAL_DTO">
select
num,
movieNum,
pkNum,
regionNum,
rdNum,
theaterNum,
strDate,
startHour,
startMinute,
endHour,
endMinute,
remainSeat
from FP_MOVIETOTAL
where 1=1
<if test='movieNum != 0'>
and movieNum=#{movieNum}
</if>
<if test='rdNum != 0'>
and rdNum=#{rdNum}
</if>
<if test='strDate != ""'>
and strDate like '%' || #{strDate} || '%'
</if>
<if test='startHour != ""'>
and startHour like '%' || #{startHour} || '%'
</if>
order by startHour, startMinute
</select>
<select id="getMovie" parameterType="int" resultType="com.finalProject.dto.FP_MOVIE_DTO">
select
num,
name,
vcNum,
s_f_n,
o_f_n,
director,
actress
from FP_MOVIE
where num=#{num}
</select>
<select id="getPlayKind" parameterType="int" resultType="com.finalProject.dto.FP_PLAYKIND_DTO">
select
num,
name
from FP_PLAYKIND
where num=#{num}
</select>
<select id="getRegion" parameterType="int" resultType="com.finalProject.dto.FP_REGION_DTO">
select
num,
name
from FP_REGION
where num=#{num}
</select>
<select id="getRegionDetail" parameterType="int" resultType="com.finalProject.dto.FP_REGIONDETAIL_DTO">
select
num,
name,
regionNum
from FP_REGIONDETAIL
where num=#{num}
</select>
<select id="getTheater" parameterType="int" resultType="com.finalProject.dto.FP_THEATER_DTO">
select
num,
name,
regionDetailNum,
totalSeat
from FP_THEATER
where num=#{num}
</select>
</mapper>
booking_2_Mapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.finalProject.mapper.Booking_2_Mapper">
<select id="getMt" parameterType="int" resultType="com.finalProject.dto.FP_MOVIETOTAL_DTO">
select
num,
movieNum,
pkNum,
regionNum,
rdNum,
theaterNum,
strDate,
startHour,
startMinute,
endHour,
endMinute,
remainSeat
from FP_MOVIETOTAL
where num=#{num}
</select>
<select id="getMovie" parameterType="int" resultType="com.finalProject.dto.FP_MOVIE_DTO">
select
num,
name,
vcNum,
s_f_n,
o_f_n,
director,
actress
from FP_MOVIE
where num=#{num}
</select>
<select id="getPlayKind" parameterType="int" resultType="com.finalProject.dto.FP_PLAYKIND_DTO">
select
num,
name
from FP_PLAYKIND
where num=#{num}
</select>
<select id="getRegion" parameterType="int" resultType="com.finalProject.dto.FP_REGION_DTO">
select
num,
name
from FP_REGION
where num=#{num}
</select>
<select id="getRegionDetail" parameterType="int" resultType="com.finalProject.dto.FP_REGIONDETAIL_DTO">
select
num,
name,
regionNum
from FP_REGIONDETAIL
where num=#{num}
</select>
<select id="getTheater" parameterType="int" resultType="com.finalProject.dto.FP_THEATER_DTO">
select
num,
name,
regionDetailNum,
totalSeat
from FP_THEATER
where num=#{num}
</select>
</mapper>
booking_3_Mapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.finalProject.mapper.Booking_3_Mapper">
<select id="maxNum" resultType="int">
select nvl(max(num),0) from FP_PAY
</select>
<insert id="insertData" parameterType="com.finalProject.dto.FP_PAY_DTO">
insert into FP_PAY
(
num,
memp, dcoupon, vipCpon,
mcoupon, scoupon, mgfcard, bookgift,
cultgift, paysgift, friends, annus,
uplus, okcb, lpoint, gsnp,
hyoil, happ, hbluep, joongang,
hydm, happcash, bookcash, cultcash,
culturenuri,
same_use_payment,
radio_payment, card_select,
tagName,
hangle,
movieNm,
movieImg,
playKindNm,
brchNm,
theater,
playDe,
dowNm,
playTime,
adultCnt, youngCnt, favorCnt,
adultPrice, youngPrice, favorPrice, totalPrice,
seat1, seat2, seat3, seat4,
seat5, seat6, seat7, seat8,
ticketNum
) values (
#{num},
#{memp}, #{dcoupon}, #{vipCpon},
#{mcoupon}, #{scoupon}, #{mgfcard}, #{bookgift},
#{cultgift}, #{paysgift}, #{friends}, #{annus},
#{uplus}, #{okcb}, #{lpoint}, #{gsnp},
#{hyoil}, #{happ}, #{hbluep}, #{joongang},
#{hydm}, #{happcash}, #{bookcash}, #{cultcash},
#{culturenuri},
#{same_use_payment},
#{radio_payment}, #{card_select},
#{tagName},
#{hangle},
#{movieNm},
#{movieImg},
#{playKindNm},
#{brchNm},
#{theater},
#{playDe},
#{dowNm},
#{playTime},
#{adultCnt}, #{youngCnt}, #{favorCnt},
#{adultPrice}, #{youngPrice}, #{favorPrice}, #{totalPrice},
#{seat1}, #{seat2}, #{seat3}, #{seat4},
#{seat5}, #{seat6}, #{seat7}, #{seat8},
#{ticketNum}
)
</insert>
</mapper>