Skip to content

Commit

Permalink
Merge pull request #453 from essol2/#451
Browse files Browse the repository at this point in the history
[리스트페이지 카테고리]
  • Loading branch information
jaejunseo authored Apr 30, 2021
2 parents 07a409d + 42bf231 commit 458b798
Show file tree
Hide file tree
Showing 11 changed files with 239 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,15 @@ public ModelAndView carList(ModelAndView mv) {
}

List<Business> carList = bService.selectCarList();

List<Review> reviewList = bService.selectReviewList();
for(Business t : carList) {
for(Review r : reviewList) {
if(t.getBus_code() == r.getBus_code()) {
t.setAvstar(r.getAvstar());
t.setRevcnt(r.getRevcnt());
}
}
}
if(carList != null) {
mv.addObject("carList", carList);
mv.setViewName("business/rentcar/car_list");
Expand Down Expand Up @@ -1201,6 +1209,15 @@ public List<Business> starList(HttpServletResponse response, @RequestParam Strin
//System.out.println(starList);
return starList;

}
@RequestMapping(value="starList2", method=RequestMethod.POST)
@ResponseBody
public List<Business> starList2(HttpServletResponse response, @RequestParam String kinds) {

List<Business> starList2 = bService.starList2();
//System.out.println(starList);
return starList2;

}

@RequestMapping(value="reviewList", method=RequestMethod.POST)
Expand All @@ -1213,6 +1230,16 @@ public List<Business> reviewList(HttpServletResponse response, @RequestParam Str

}

@RequestMapping(value="reviewList2", method=RequestMethod.POST)
@ResponseBody
public List<Business> reviewList2(HttpServletResponse response, @RequestParam String kinds) {

List<Business> reviewList2 = bService.reviewList2();

return reviewList2;

}

//찜하기 ajax받기
@RequestMapping("/jjim")
@ResponseBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,10 @@ public interface businessDao {
List<Review> selectReviewList();

List<Business> starList();
List<Business> starList2();

List<Business> reviewList();
List<Business> reviewList2();

List<Business> facList(String kind);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,22 @@ public List<Business> starList() {
// TODO Auto-generated method stub
return sqlSession.selectList("businessMapper.starList");
}
@Override
public List<Business> starList2() {
// TODO Auto-generated method stub
return sqlSession.selectList("businessMapper.starList2");
}

@Override
public List<Business> reviewList( ) {
public List<Business> reviewList() {
// TODO Auto-generated method stub
return sqlSession.selectList("businessMapper.reviewList");
}
@Override
public List<Business> reviewList2( ) {
// TODO Auto-generated method stub
return sqlSession.selectList("businessMapper.reviewList2");
}

@Override
public List<Business> facList(String kind) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ public interface businessService {
List<Review> selectReviewList();

List<Business> starList();
List<Business> starList2();

List<Business> reviewList();
List<Business> reviewList2();

List<Business> facList(String kind);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,18 +414,28 @@ public List<Review> selectReviewList() {
// TODO Auto-generated method stub
return bDao.selectReviewList();
}

@Override
public List<Business> starList() {
// TODO Auto-generated method stub
return bDao.starList();
}
@Override
public List<Business> starList2() {
// TODO Auto-generated method stub
return bDao.starList2();
}

@Override
public List<Business> reviewList() {
// TODO Auto-generated method stub
return bDao.reviewList();
}
@Override
public List<Business> reviewList2() {
// TODO Auto-generated method stub
return bDao.reviewList2();
}

@Override
public List<Business> facList(String kind) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@ public class Business {

private String avstar;
private String revcnt;
private int avgstar;

}
95 changes: 94 additions & 1 deletion src/main/resources/mappers/business-mapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
, PRO_ADULT
, PRO_YOUTH
, PRO_CHILD
, AVGSTAR
FROM
BUSINESS B, BUSINESS_ATT BT, TOUR_PRODUCT TP
WHERE
Expand Down Expand Up @@ -697,6 +698,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
, HOTEL_CATEGORY
, BT.FILE_RENAME
, BT.FILE_LV
, AVGSTAR
FROM
BUSINESS B
JOIN
Expand Down Expand Up @@ -760,6 +762,8 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
, BUS_OPENING
, BT.FILE_RENAME
, BT.FILE_LV
, AVGSTAR
, RES_CATEGORY
FROM
BUSINESS B
JOIN
Expand Down Expand Up @@ -794,6 +798,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
, BUS_OPENING
, BT.FILE_RENAME
, BT.FILE_LV
, AVGSTAR
FROM
BUSINESS B
JOIN
Expand Down Expand Up @@ -1441,6 +1446,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
, PRO_CHILD
, TOUR_TEMA
, TOUR_CATEGORY
, AVGSTAR
FROM
BUSINESS B, BUSINESS_ATT BT, TOUR_PRODUCT TP
WHERE
Expand Down Expand Up @@ -1476,6 +1482,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
, BUS_OPENING
, BT.FILE_RENAME
, BT.FILE_LV
, AVGSTAR
FROM
BUSINESS B, BUSINESS_ATT BT
WHERE
Expand Down Expand Up @@ -1517,6 +1524,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
, PRO_CHILD
, TOUR_TEMA
, TOUR_CATEGORY
, AVGSTAR
FROM
BUSINESS B, BUSINESS_ATT BT, TOUR_PRODUCT TP
WHERE
Expand Down Expand Up @@ -1552,6 +1560,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
, BT.FILE_RENAME
, BT.FILE_LV
, HOTEL_CATEGORY
, AVGSTAR
FROM
BUSINESS B, BUSINESS_ATT BT
WHERE
Expand Down Expand Up @@ -1614,6 +1623,47 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
ORDER BY AVSTAR
</select>

<select id="starList2" resultMap="BusinessResultSet">
SELECT
B.BUS_CODE
, B.US_NO
, BUS_NAME
, BUS_ADDRESS
, BUS_INTRO
, BUS_DATE
, BUS_MODIFY
, AD_COUNT
, BUS_CLASSIFY
, BUS_CATEGORY
, BUS_STATUS
, BUS_PHONE
, RES_CATEGORY
, BUS_OPENING
, HOTEL_CATEGORY
, BT.FILE_RENAME
, BT.FILE_LV
, COUNT(REV_COMMENT) AS "REVCNT"
, AVG(RE_STAR) AS "AVSTAR"
FROM
BUSINESS B, BUSINESS_ATT BT, REVIEW R
WHERE
B.BUS_CODE = BT.BUS_CODE
AND B.BUS_CODE = R.BUS_CODE
AND BUS_STATUS = 'Y'
AND BT.FILE_LV = '0'
AND B.BUS_CODE NOT IN (SELECT
R.REF_BUS_CODE
FROM
BUSINESS B, REPORT R
WHERE B.BUS_CODE = R.REF_BUS_CODE
AND R.REXDATE IS NOT NULL)
GROUP BY B.BUS_CODE, B.US_NO, BUS_NAME, BUS_ADDRESS, BUS_INTRO,
BUS_DATE, BUS_MODIFY, AD_COUNT, BUS_CLASSIFY, BUS_CATEGORY,
BUS_STATUS, BUS_PHONE, RES_CATEGORY, BUS_OPENING, BT.FILE_RENAME,
HOTEL_CATEGORY, BT.FILE_LV
ORDER BY AVSTAR
</select>

<select id="reviewList" resultMap="BusinessResultSet">
SELECT
B.BUS_CODE
Expand Down Expand Up @@ -1644,7 +1694,6 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
WHERE
B.BUS_CODE = BT.BUS_CODE AND B.BUS_CODE = TP.BUS_CODE
AND B.BUS_CODE = R.BUS_CODE
AND BUS_CATEGORY = 'T'
AND BUS_STATUS = 'Y'
AND BT.FILE_LV = '0'
AND B.BUS_CODE NOT IN (SELECT
Expand All @@ -1660,6 +1709,46 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
PRO_CHILD
ORDER BY REVCNT
</select>
<select id="reviewList2" resultMap="BusinessResultSet">
SELECT
B.BUS_CODE
, B.US_NO
, BUS_NAME
, BUS_ADDRESS
, BUS_INTRO
, BUS_DATE
, BUS_MODIFY
, AD_COUNT
, BUS_CLASSIFY
, BUS_CATEGORY
, BUS_STATUS
, BUS_PHONE
, RES_CATEGORY
, BUS_OPENING
, HOTEL_CATEGORY
, BT.FILE_RENAME
, BT.FILE_LV
, COUNT(REV_COMMENT) AS "REVCNT"
, AVG(RE_STAR) AS "AVSTAR"
FROM
BUSINESS B, BUSINESS_ATT BT, REVIEW R
WHERE
B.BUS_CODE = BT.BUS_CODE
AND B.BUS_CODE = R.BUS_CODE
AND BUS_STATUS = 'Y'
AND BT.FILE_LV = '0'
AND B.BUS_CODE NOT IN (SELECT
R.REF_BUS_CODE
FROM
BUSINESS B, REPORT R
WHERE B.BUS_CODE = R.REF_BUS_CODE
AND R.REXDATE IS NOT NULL)
GROUP BY B.BUS_CODE, B.US_NO, BUS_NAME, BUS_ADDRESS, BUS_INTRO,
BUS_DATE, BUS_MODIFY, AD_COUNT, BUS_CLASSIFY, BUS_CATEGORY,
BUS_STATUS, BUS_PHONE, RES_CATEGORY, BUS_OPENING, BT.FILE_RENAME,
HOTEL_CATEGORY, BT.FILE_LV
ORDER BY REVCNT
</select>


<select id="selectReview" resultMap="ReviewResultSet">
Expand Down Expand Up @@ -1750,6 +1839,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
, HOTEL_CATEGORY
, BT.FILE_RENAME
, BT.FILE_LV
, AVGSTAR
FROM
BUSINESS B
JOIN
Expand Down Expand Up @@ -1790,6 +1880,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
, PRO_ADULT
, PRO_YOUTH
, PRO_CHILD
, AVGSTAR
FROM
BUSINESS B, BUSINESS_ATT BT, TOUR_PRODUCT TP
WHERE
Expand Down Expand Up @@ -1821,6 +1912,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
, RES_CATEGORY
, BT.FILE_RENAME
, BT.FILE_LV
, AVGSTAR
FROM
BUSINESS B
JOIN
Expand Down Expand Up @@ -1857,6 +1949,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN"
, BUS_OPENING
, BT.FILE_RENAME
, BT.FILE_LV
, AVGSTAR
FROM
BUSINESS B
JOIN
Expand Down
Loading

0 comments on commit 458b798

Please sign in to comment.