๊ฐ๊ฒ ๋ฏธ๋ฆฌ ๋ณด๊ธฐ๋ฅผ ํด๋ฆญํ์ฌ, ํด๋น ๊ฐ๊ฒ ๋ด์ ์์ธ ์ ๋ณด๋ฅผ ํ์ธํ ์ ์๋ค,.
- ๊ฐ๊ฒ ๊ธฐ๋ณธ์ ๋ณด : ๊ฐ๊ฒ ์ด๋ฆ, ํ์ , ๊ตฌ๋ ์, ์ฃผ์, ๊ฑฐ๋ฆฌ ๋ฐ ์๊ฐ
- ์์ธ ์ ๋ณด ์ข ๋ฅ 3๊ฐ์ง:
- ์ค๋์ ๋จ์ด ๋ฉ๋ด : ํ๋งค์๊ฐ ๋ฑ๋กํ ๋จ์ด ๋ฉ๋ด ๋ชฉ๋ก (๋ฉ์ธ/์ฌ์ด๋)
- ๊ฐ๊ฒ ์ ๋ณด : ํ๋งค์ ๊ฐ๊ฒ์ ์ ๋ณด๋ค(๊ฐ๊ฒ ๊ธฐ๋ณธ์ ๋ณด + ๊ฐ๊ฒ ํต๊ณ + ์ฌ์ ์ ์ ๋ณด..+ ์์ฐ์ง)
- ๋ฆฌ๋ทฐ : ๋ฆฌ๋ทฐ ํ์ ํํฉ ๋ฐ ๋ชฉ๋ก
๊ฐ๊ฒ ์์ธ ์ ๋ณด์์ ๋งจ ์๋จ์ ํญ์ ๊ณ ์ ๋์ด์๋ ๊ธฐ๋ณธ ์ ๋ณด
- ์๋ต ๋ฐ๋
- ๊ฐ๊ฒId, ๊ฐ๊ฒ ์ด๋ฆ, ์นดํ ๊ณ ๋ฆฌ์ข ๋ฅ, ๊ฐ๊ฒ ๋ฒํธ, ์/๊ฒฝ๋, ๊ฐ๊ฒ ์ฃผ์, ๊ฑฐ๋ฆฌ, ์๊ฐ, ํ์ , ๊ตฌ๋ ์, ๊ตฌ๋ ์ฌ๋ถ
- ์ปจํธ๋กค๋ฌ
- ์๋น์ค
public GetAppStoreInfoRes getAppStoreInfo(int userIdx, int storeIdx, Double longitude, Double latitude) throws BaseException { // 1. ๊ฐ๊ฒ ๊ธฐ๋ณธ ์๋ณ์ ๋ณด ์กฐํ GetAppStoreInfo storeInfo; try { storeInfo = appStoreDao.getAppStoreInfo(storeIdx); } catch (Exception e) { throw new BaseException(RESPONSE_ERROR); // ๋ฆฌ๋ทฐ ์กฐํ์ ์คํจํ์์ต๋๋ค. } // 2. ๊ฐ๊ฒ ๋ณ์ ๊ฐ์ ธ์ค๊ธฐ double starAvg; try { starAvg = appStoreDao.getStoreStar(storeIdx); }catch (IncorrectResultSizeDataAccessException error) { // ์ฟผ๋ฆฌ๋ฌธ์ ํด๋นํ๋ ๊ฒฐ๊ณผ๊ฐ ์๊ฑฐ๋ 2๊ฐ ์ด์์ผ ๋ starAvg = 0; } catch (Exception e) { throw new BaseException(RESPONSE_ERROR); // ๋ฆฌ๋ทฐ ์กฐํ์ ์คํจํ์์ต๋๋ค. } // 3. ๊ฐ๊ฒ ๊ตฌ๋ ์(์ฐ ์) int subscribeCount; try { subscribeCount = appStoreDao.subscribeCount(storeIdx); } catch (Exception e) { throw new BaseException(RESPONSE_ERROR); // ๋ฆฌ๋ทฐ ์กฐํ์ ์คํจํ์์ต๋๋ค. } // 4. ๊ฐ๊ฒ ์์ฐ์ง String ingredientInfo; try { ingredientInfo = appStoreDao.getStoreAppDetailIngredientInfo(storeIdx); } catch (Exception e) { throw new BaseException(RESPONSE_ERROR); // ๋ฆฌ๋ทฐ ์กฐํ์ ์คํจํ์์ต๋๋ค. } int distance = (int) locationValue.getDistance(latitude, longitude, storeInfo.getY(), storeInfo.getX()); int duration = locationValue.getDuration(distance); int subCheck; try{ subCheck = subscribeDao.checkSubscribeValid(userIdx, storeIdx); }catch (Exception e) { throw new BaseException(RESPONSE_ERROR); // ๋ฆฌ๋ทฐ ์กฐํ์ ์คํจํ์์ต๋๋ค. } return new GetAppStoreInfoRes(storeIdx, storeInfo.getStoreName(), storeInfo.getStoreCategory(), storeInfo.getStorePhone(), storeInfo.getX(), storeInfo.getY(), storeInfo.getStoreAddress(), distance, duration, starAvg, subscribeCount, ingredientInfo, subCheck); }
- ๊ฐ๊ฒ ๊ฐ์ฅ ๊ธฐ๋ณธ๋๋ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์ค๊ธฐ(๊ฐ๊ฒ ์ด๋ฆ, ๋ฒํธ, ์/๊ฒฝ๋, ์ฃผ์, ์นดํ ๊ณ ๋ฆฌ)
- ๊ฐ๊ฒ ๋ณ์ ์กฐํ
- ๊ฐ๊ฒ ๊ตฌ๋ ์ ์กฐํ
- ๊ฐ๊ฒ ์์ฐ์ง ์กฐํ(์์ฐ์ง ํญ์ด ๋ฐ๋ก ์๋๋ฐ ์ด๊ธฐ์ ํ๋๊ฑฐ ๊ทธ๋๋ก ๋จ์์์..)
- ๊ฑฐ๋ฆฌ/ ์๊ฐ ๊ตฌํ๊ธฐ
- ๊ฐ๊ฒ ๊ตฌ๋ ์ฌ๋ถ ์กฐํ
- ์๋ต ๋ฐํ
- Dao
// ๊ฐ๊ฒ ๊ธฐ๋ณธ ์ ๋ณด ์กฐํ public GetAppStoreInfo getAppStoreInfo(int storeIdx){ String query = "SELECT \n" + " store_name, store_phone, x, y, store_address, categoryIdx \n" + "FROM Stores S\n" + "WHERE storeIdx = ?"; return this.jdbcTemplate.queryForObject(query, (rs, rowNum) -> new GetAppStoreInfo( rs.getString("store_name"), rs.getString("store_phone"), rs.getInt("categoryIdx"), rs.getDouble("x"), rs.getDouble("y"), rs.getString("store_address") ),storeIdx); }
// ๊ฐ๊ฒ ๊ตฌ๋ ์ ๋ณด ์กฐํ public double getStoreStar(int storeIdx) { String query = "SELECT\n" + " ROUND(AVG(star), 1) AS star_average \n" + "FROM Review\n" + "WHERE storeIdx = ? AND status != 'D'"; return this.jdbcTemplate.queryForObject(query, (rs, rowNum) -> rs.getDouble("star_average") , storeIdx); }
// ๊ฐ๊ฒ ๊ตฌ๋ ์ ์ public int subscribeCount(int storeIdx) { String subscribeCountQuery = "SELECT " + "COUNT(storeIdx) AS Subscribe_Count " + "FROM Subscribe WHERE storeIdx = ? AND status = 'A';"; return this.jdbcTemplate.queryForObject(subscribeCountQuery, int.class, storeIdx); }
// ๊ฐ๊ฒ ๊ตฌ๋ ์ฌ๋ถ public int checkSubscribeValid(int customerIdx, int storeIdx) { String query = "SELECT EXISTS (SELECT * FROM Subscribe WHERE customerIdx=? AND storeIdx=? AND status = 'A');"; Object[] params = new Object[]{customerIdx, storeIdx}; return this.jdbcTemplate.queryForObject(query, int.class, params); }
- ์ปจํธ๋กค๋ฌ
- ์๋ต ๋ฐ๋
- ๊ฐ ๋ฉ๋ด์๋ ์ด๋ฏธ์ง URL, ์ค๋์ ๋ฉ๋ด Idx, ๋ฉ๋ด์ด๋ฆ, ๊ตฌ์ฑ, ๋จ์๊ฐ์, ์๊ฐ, ์ธ์ผ, ํ ์ธ๊ฐ๋ฅผ ํฌํจํ๋ค.
- ์๋น์ค
public GetAppStoreDetailMenuRes getAppStoreDetailMenu(int storeIdx) throws BaseException { //getAppStoreDetailMenu List<GetAppStoreDetailMenuItem> mainMenuList, sideMenuList; //๋ฉ์ธ๋ฉ๋ด์กฐํ try { mainMenuList = appStoreDao.getAppStoreDetailMenuList(storeIdx, "M"); } catch (Exception e) { throw new BaseException(GET_MENU_ERROR); } // ๋ฉ์ธ ๋ฉ๋ด url ๊ฐ์ ธ์ค๊ธฐ try { for (GetAppStoreDetailMenuItem item : mainMenuList) { if (item.getMenuUrl() != null && !item.getMenuUrl().equals("")) { item.setMenuUrl("" + s3Client.getUrl(bucketName, item.getMenuUrl())); } } } catch (Exception e) { throw new BaseException(GET_MENU_ERROR); } try { sideMenuList = appStoreDao.getAppStoreDetailMenuList(storeIdx, "S"); } catch (Exception e) { throw new BaseException(GET_MENU_ERROR); } // ์ฌ์ด๋ ๋ฉ๋ด url ๊ฐ์ ธ์ค๊ธฐ try { for (GetAppStoreDetailMenuItem item : sideMenuList) { if (item.getMenuUrl() != null && !item.getMenuUrl().equals("")) { item.setMenuUrl("" + s3Client.getUrl(bucketName, item.getMenuUrl())); } } } catch (Exception e) { throw new BaseException(GET_MENU_ERROR); } return new GetAppStoreDetailMenuRes(storeIdx, mainMenuList, sideMenuList); }
- DB์์ ๋ฉ์ธ/์ฌ์ด๋๋ฅผ ๊ธฐ์ค์ผ๋ก ๋ฉ๋ด ๊ธฐ๋ณธ ์ ๋ณด๋ฅผ ์กฐํํจ.
- ๋ฉ๋ด์ด๋ฏธ์ง์ URL์ S3๋ฅผ ์ด์ฉํด์ ๊ฐ์ ธ์ด
- ๋ฐํ
- Dao
public List<GetAppStoreDetailMenuItem> getAppStoreDetailMenuList(int storeIdx, String status){ //getAppStoreDetailMenuList String query ="SELECT m.storeIdx, m.menuIdx, tm.todaymenuIdx, m.menu_name, tm.remain, m.menu_url,\n" + " m.composition, m.price, tm.discount, tm.price AS today_price \n" + " FROM TodayMenu tm \n" + " JOIN Menu m ON m.menuIdx = tm.menuIdx \n" + " WHERE tm.storeIdx = ? AND tm.status = ?"; Object[] params = new Object[]{storeIdx,status}; return this.jdbcTemplate.query(query, (rs, rowNum) -> new GetAppStoreDetailMenuItem( rs.getInt("menuIdx"), rs.getInt("todaymenuIdx"), rs.getString("menu_name"), rs.getString("menu_url"), rs.getString("composition"), rs.getInt("remain"), rs.getInt("price"), rs.getInt("discount"), rs.getInt("today_price") ),params); }
- ์๋ต ๋ฐ๋
- ์๋น์ค
public GetAppStoreDetailInfoRes getAppStoreDetailInfo(int storeIdx) throws BaseException { // 1. ๊ฐ๊ฒ ์ ๋ณด // ์ํธ๋ช , ์ด์์๊ฐ, ํด๋ฌด์ผ, ์ ํ๋ฒํธ GetAppStoreDetailStoreInfo detailStoreInfo; try { detailStoreInfo = appStoreDao.getAppStoreDetailStoreInfo(storeIdx); } catch (Exception e) { throw new BaseException(GET_MENU_ERROR); } // 2. ๊ฐ๊ฒ ํต๊ณ GetAppStoreDetailStatisticsInfo detailStatisticsInfo; try { int orderCount = appStoreDao.orderCount(storeIdx); int reviewCount = appStoreDao.reviewCount(storeIdx); int subscribeCount = appStoreDao.subscribeCount(storeIdx); detailStatisticsInfo = new GetAppStoreDetailStatisticsInfo(orderCount,reviewCount, subscribeCount); } catch (Exception e) { throw new BaseException(GET_MENU_ERROR); } // 3. ์ฌ์ ์ ์ ๋ณด GetAppStoreDetailSellerInfo detailSellerInfo; try { detailSellerInfo = appStoreDao.getStoreAppDetailSellerInfo(storeIdx); } catch (Exception e) { throw new BaseException(GET_MENU_ERROR); } // 4. ์์ฐ์ง ์ ๋ณด String ingredientInfo; try { ingredientInfo = appStoreDao.getStoreAppDetailIngredientInfo(storeIdx); } catch (Exception e) { throw new BaseException(GET_MENU_ERROR); } return new GetAppStoreDetailInfoRes(storeIdx, detailStoreInfo,detailStatisticsInfo,detailSellerInfo,ingredientInfo); }
๊ฐ๊ฒ ์ ๋ณด์์ ๋ณด์ด๋ ๊ฐ ๋ธ๋ญ๋ค(๊ฐ๊ฒ์ ๋ณด, ํต๊ณ, ์ฌ์ ์์ ๋ณด, ์์ฐ์ง) ๋ณ๋ก ๋ฐ์ดํฐ๋ฅผ ์กฐํํ์ฌ ์๋ตํจ.
1. ๊ฐ๊ฒ์ ๊ฐ์ฅ ๊ธฐ๋ณธ์ ๋ณด(์ํธ๋ช , ์ด์์๊ฐ, ํด๋ฌด์ผ, ์ ํ๋ฒํธ)
2. ๊ฐ๊ฒ ํต๊ณ๋ฅผ ๊ฐ DB ํ ์ด๋ธ์์ ์ง๊ณํจ์๋ฅผ ํตํด ์กฐํ
3. ์ฌ์ ์ ์ ๋ณด(ํ๋งค์ ์ ๋ณด)
4. ์์ฐ์ง ์ ๋ณด DB์ฟผ๋ฆฌ ํ
- Dao
// ๊ฐ๊ฒ ๊ธฐ๋ณธ ์์ธ ์ ๋ณด public GetAppStoreDetailStoreInfo getAppStoreDetailStoreInfo(int storeIdx){ String query = "SELECT store_name, \n" + " TIME_FORMAT(store_open, '%H:%i') AS store_open, \n" + //(์์ ) ์ด์์๊ฐ ์ด ์๋ฅด๊ธฐ " TIME_FORMAT(store_close, '%H:%i') AS store_close, \n" + " breakday, \n" + " store_phone \n" + "FROM Stores \n" + "WHERE storeIdx = ?;"; return this.jdbcTemplate.queryForObject(query, (rs, rowNum) -> new GetAppStoreDetailStoreInfo( rs.getString("store_name"), rs.getString("store_open"), rs.getString("store_close"), rs.getString("breakday"), rs.getString("store_phone") ), storeIdx); }
// ์ฃผ๋ฌธ, ๋ฆฌ๋ทฐ, ๊ตฌ๋ ์ ์ง๊ณํจ์. public int orderCount(int storeIdx){ String orderCountQuery = "SELECT " + "COUNT(storeIdx) AS Order_Count " + "FROM Orders " + "WHERE storeIdx = ? AND status = 'A';"; return this.jdbcTemplate.queryForObject(orderCountQuery, int.class, storeIdx); } public int reviewCount(int storeIdx){ String reviewCountQuery ="SELECT " + "COUNT(storeIdx) AS Review_Count " + "FROM Review " + "WHERE storeIdx = ? AND status <> 'D';"; return this.jdbcTemplate.queryForObject(reviewCountQuery, int.class, storeIdx); } public int subscribeCount(int storeIdx) { String subscribeCountQuery = "SELECT " + "COUNT(storeIdx) AS Subscribe_Count " + "FROM Subscribe WHERE storeIdx = ? AND status = 'A';"; return this.jdbcTemplate.queryForObject(subscribeCountQuery, int.class, storeIdx); }
// ํ๋งค์ ์ ๋ณด(์ฌ์ ์ ๋ฑ๋ก๋ฒํธ๋ ์์ง๋ฏธ์ ) public GetAppStoreDetailSellerInfo getStoreAppDetailSellerInfo(int storeIdx){ //getStoreAppDetailSellerInfo String query = "SELECT m.name AS seller_name, s.store_name, s.store_address " + "FROM Merchandisers m " + "JOIN Stores s ON m.sellerIdx = s.sellerIdx " + "WHERE s.storeIdx = ?"; return this.jdbcTemplate.queryForObject(query, (rs, rowNum) -> new GetAppStoreDetailSellerInfo( rs.getString("seller_name"), rs.getString("store_name"), rs.getString("store_address"), "123-456-789" ),storeIdx); }
// ์์ฐ์ง ์ ๋ณด group_concatํจ์ ์ฌ์ฉ public String getStoreAppDetailIngredientInfo(int storeIdx){ //์๋ฐ ๋ฌธ๋ฒ์ผ๋ก ํ๋๋ก ๋ฌธ์์ด ํฉ์น๊ธฐ //getStoreAppDetailIngredientInfo String query = "SELECT\n" + " group_concat(ingredient_name, '(', origin, ') ') AS ingredient_info\n" + "FROM Ingredients\n" + "WHERE storeIdx = ?"; return this.jdbcTemplate.queryForObject(query, (rs, rowNum) -> rs.getString("ingredient_info"), storeIdx); }
- ์๋ต ๋ฐ๋
- ์๋น์ค
public GetAppStoreDetailReviewRes getAppStoreDetailReview(int storeIdx) throws BaseException { //getAppStoreDetailReview // 1. ๋ฆฌ๋ทฐ ํ๊ท ํ์ ๊ตฌํ๊ธฐ GetAppReviewStarRes reviewStar; try { reviewStar = appStoreDao.reviewStarTotal(storeIdx); } catch (Exception e) { throw new BaseException(DATABASE_ERROR); } List<StarCountRatio> starCountRatios = new ArrayList<>(); starCountRatios.add(new StarCountRatio("๋ณ 5๊ฐ", reviewStar.getStar5(), (int) (reviewStar.getStar5() * 1.0 / reviewStar.getReviews_total() * 100))); starCountRatios.add(new StarCountRatio("๋ณ 4๊ฐ", reviewStar.getStar4(), (int) (reviewStar.getStar4() * 1.0 / reviewStar.getReviews_total() * 100))); starCountRatios.add(new StarCountRatio("๋ณ 3๊ฐ", reviewStar.getStar3(), (int) (reviewStar.getStar3() * 1.0 / reviewStar.getReviews_total() * 100))); starCountRatios.add(new StarCountRatio("๋ณ 2๊ฐ", reviewStar.getStar2(), (int) (reviewStar.getStar2() * 1.0 / reviewStar.getReviews_total() * 100))); starCountRatios.add(new StarCountRatio("๋ณ 1๊ฐ", reviewStar.getStar1(), (int) (reviewStar.getStar1() * 1.0 / reviewStar.getReviews_total() * 100))); // 2. ๋ฆฌ๋ทฐ ๋ชฉ๋ก ์กฐํ ๋ฐ url ๊ฐ์ ธ์ค๊ธฐ List<AppReviewItems> reviewItems; try { reviewItems = appStoreDao.reviewItems(storeIdx); for (AppReviewItems item : reviewItems) { if (item.getReview_url() != null) item.setReview_url("" + s3Client.getUrl(bucketName, item.getReview_url())); item.setOrderTodayMenu(appStoreDao.appOrderTodayMenus(item.getOrderIdx())); } } catch (Exception e) { throw new BaseException(RESPONSE_ERROR); // ๋ฆฌ๋ทฐ ์กฐํ์ ์คํจํ์์ต๋๋ค. } try{ LocalDateTime now = LocalDateTime.now(); //ํ์ฌ ์๊ฐ for(AppReviewItems reviews : reviewItems){ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); //DAO์์ ๋ฐ์์ค๋ getDate์ ํ์์ ๋ง์ถ์ด ์ค๋ค. LocalDateTime reviewDate = LocalDateTime.parse(reviews.getDate(),formatter); Duration duration = Duration.between(reviewDate, now); // ํ์ฌ ์๊ฐ๊ณผ DB์์ ๊ฐ์ ธ์จ getDate ์ฌ์ด์ ์๊ฐ long years = duration.toDays() / 365; long months = duration.toDays() / 30; long days = duration.toDays(); long hours = duration.toHours(); long minutes = duration.toMinutes(); if (years > 0) { reviews.setDate(years + "๋ ์ "); } else if (months > 0) { reviews.setDate(months + "๊ฐ์ ์ ");; } else if (days > 0) { reviews.setDate(days + "์ผ ์ "); } else if (hours > 0) { reviews.setDate(hours + "์๊ฐ ์ "); } else if (minutes > 0) { reviews.setDate(minutes + "๋ถ ์ "); } else { reviews.setDate("๋ฐฉ๊ธ ์ "); } } }catch (Exception e){ throw new BaseException(DATABASE_ERROR); //๋ ์ง๋ฅผ ์๋ชป ์ถ๋ ฅํ์ต๋๋ค. } return new GetAppStoreDetailReviewRes(storeIdx, reviewStar.getStar_average(), reviewStar.getReviews_total(), reviewStar.getComment_total(), starCountRatios, reviewItems); }
- ์๊ฐ์ Duration ํด๋์ค๋ฅผ ํตํด์ ๋ฆฌ๋ทฐ๋ฅผ ์ด์ง ์ผ๋ง๋ ๋์๋์ง ํ์ธํ๋ฉด์ ์์ฑํ์๋ค.
- Dao
// ๋ฆฌ๋ทฐ ํ์ ๋ฐ ํ๊ท ์กฐํ public GetAppReviewStarRes reviewStarTotal(int storeIdx){ String query ="SELECT\n" + " ROUND(AVG(star),1) AS star_average,\n" + " COUNT(CASE WHEN status <> 'D' THEN reviewIdx END) AS reviews_total,\n" + //(์์ )D๊ฐ ์๋ ์ํ๋ง ์นด์ดํธ ํ๊ธฐ " COUNT(comment) AS comment_total,\n" + " COUNT(CASE WHEN star = 1 THEN 1 END) AS star1_count,\n" + " COUNT(CASE WHEN star = 2 THEN 1 END) AS star2_count,\n" + " COUNT(CASE WHEN star = 3 THEN 1 END) AS star3_count,\n" + " COUNT(CASE WHEN star = 4 THEN 1 END) AS star4_count,\n" + " COUNT(CASE WHEN star = 5 THEN 1 END) AS star5_count\n" + " FROM Review\n" + "WHERE storeIdx = ? AND status != 'D'"; //D๊ฐ ์๋๊ฑฐ ๋ฃ๊ธฐ return this.jdbcTemplate.queryForObject(query, (rs, rowNum) -> new GetAppReviewStarRes( storeIdx, rs.getDouble("star_average"), rs.getInt("reviews_total"), rs.getInt("comment_total"), rs.getInt("star1_count"), rs.getInt("star2_count"), rs.getInt("star3_count"), rs.getInt("star4_count"), rs.getInt("star5_count") ) ,storeIdx); }
// ๋ฆฌ๋ทฐ ๋ชฉ๋ก ์กฐํ public List<AppReviewItems> reviewItems(int storeIdx) { //์ฝ๋ ์๋ฐ๊ฟจ์ผ๋ฉด importํด์ ๊ฐ์ ธ์ค๊ธฐ ---> AppReviewItems ์ฌ๊ธฐ ์์์๋ ๊ฐ์ด ๋ฐ๊ฟจ๊ธฐ ๋๋ฌธ์ ๋ชป ๊ฐ์ ธ์ด String query = "SELECT\n" + " O.orderIdx,\n" + " R.reviewIdx,\n" + " C.name,\n" + " R.star ,\n" + " R.created,\n" + " R.contents, R.comment, R.review_url\n" + "FROM Orders O\n" + "JOIN Review R on O.orderIdx = R.orderIdx\n" + "JOIN Customers C ON R.customerIdx = C.customerIdx\n" + "WHERE\n" + " R.storeIdx = ?\n" + " AND O.status = 'A'\n" + " AND R.status <> 'D'\n" + "ORDER BY created DESC;"; return this.jdbcTemplate.query(query, (rs, rowNum) -> new AppReviewItems( rs.getInt("orderIdx"), rs.getInt("reviewIdx"), null, rs.getString("name"), rs.getInt("star"), rs.getString("created"), rs.getString("contents"), rs.getString("comment") == null ? "" : rs.getString("comment"), rs.getString("review_url"), null ), storeIdx); }
๋ฆฌ๋ทฐ๋ฅผ ์ด ์ฃผ๋ฌธ์ ๋ฉ๋ด ๋ชฉ๋ก ์กฐํ public List<String> appOrderTodayMenus(int orderIdx) { String query = "SELECT\n" + " M.menu_name\n" + "FROM Orders O\n" + "LEFT JOIN OrderLists OL on O.orderIdx = OL.orderIdx\n" + "LEFT JOIN TodayMenu TM on OL.todaymenuIdx = TM.todaymenuIdx\n" + "LEFT JOIN Menu M on TM.menuIdx = M.menuIdx\n" + "WHERE O.orderIdx = ?\n" + "AND O.status = 'A'"; return this.jdbcTemplate.queryForList(query, String.class, orderIdx); }
queryParam : storeIdx
- ํด๋น ๊ฐ๊ฒ์ ์ขํ(์/๊ฒฝ๋), ๊ฐ๊ฒ์ด๋ฆ์ ๋ฐํํด์ค๋ค.
๊ฐ๋จ ๋ก์ง์ด๋ผ ํจ์ค