|
@@ -351,11 +351,11 @@ public class BookingCommentImplDao implements BookingCommentDao {
|
|
|
"\t( SELECT round( AVG( score ), 1 ) FROM `booking_comment` WHERE comment_parent_id IS NULL AND `status` = 1 AND hotel_id = bc.hotel_id ) AS hotelScore,\n" +
|
|
"\t( SELECT round( AVG( score ), 1 ) FROM `booking_comment` WHERE comment_parent_id IS NULL AND `status` = 1 AND hotel_id = bc.hotel_id ) AS hotelScore,\n" +
|
|
|
"\thd.`name` AS hotelTownship,\n" +
|
|
"\thd.`name` AS hotelTownship,\n" +
|
|
|
"\tb.hotel_type AS hotelType,\n" +
|
|
"\tb.hotel_type AS hotelType,\n" +
|
|
|
- "\tifnull( cc.commentSum, 0 ) AS commentCount \n" +
|
|
|
|
|
|
|
+ "\tifnull( cc.commentSum, 0 ) AS commentCount ,h.cover_img as coverImg\n" +
|
|
|
"FROM\n" +
|
|
"FROM\n" +
|
|
|
"\t`booking_comment` bc\n" +
|
|
"\t`booking_comment` bc\n" +
|
|
|
"\tLEFT JOIN users u ON u.id = bc.create_id\n" +
|
|
"\tLEFT JOIN users u ON u.id = bc.create_id\n" +
|
|
|
- "\tLEFT JOIN booking b ON b.id = bc.booking_id \n" +
|
|
|
|
|
|
|
+ "\tLEFT JOIN booking b ON b.id = bc.booking_id LEFT JOIN hotel h ON h.id=b.hotel_id \n" +
|
|
|
"\tAND b.status_del = 1\n" +
|
|
"\tAND b.status_del = 1\n" +
|
|
|
"\tLEFT JOIN ( SELECT fi.link_id, GROUP_CONCAT( fi.url ) AS url FROM file_info fi GROUP BY fi.link_id ) fi2 ON fi2.link_id = bc.id\n" +
|
|
"\tLEFT JOIN ( SELECT fi.link_id, GROUP_CONCAT( fi.url ) AS url FROM file_info fi GROUP BY fi.link_id ) fi2 ON fi2.link_id = bc.id\n" +
|
|
|
"\tLEFT JOIN hotel_dict hd ON hd.id = b.hotel_township \n" +
|
|
"\tLEFT JOIN hotel_dict hd ON hd.id = b.hotel_township \n" +
|
|
@@ -507,7 +507,7 @@ public class BookingCommentImplDao implements BookingCommentDao {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public List<PersonageCommentVo> personageNotCommentPage(String usersId, int page, int rows) {
|
|
|
|
|
|
|
+ public List<PersonageCommentVo> personageNotCommentPage(String usersId, int page, int rows) {
|
|
|
int start = (page - 1) * rows;// ÿҳµÄÆðʼÏÂ
|
|
int start = (page - 1) * rows;// ÿҳµÄÆðʼÏÂ
|
|
|
String sql = "SELECT\n" +
|
|
String sql = "SELECT\n" +
|
|
|
"\tb.id AS id,\n" +
|
|
"\tb.id AS id,\n" +
|
|
@@ -518,12 +518,12 @@ public class BookingCommentImplDao implements BookingCommentDao {
|
|
|
"\tb.live_time as liveTime,\n" +
|
|
"\tb.live_time as liveTime,\n" +
|
|
|
"\tb.check_out_time as checkOutTime,\n" +
|
|
"\tb.check_out_time as checkOutTime,\n" +
|
|
|
"\tb.pay_account as payAccount\n" +
|
|
"\tb.pay_account as payAccount\n" +
|
|
|
- "\t,b.create_userid\n" +
|
|
|
|
|
|
|
+ "\t,b.create_userid ,fi.url as url\n" +
|
|
|
"FROM\n" +
|
|
"FROM\n" +
|
|
|
"\t`booking` b\n" +
|
|
"\t`booking` b\n" +
|
|
|
"\tLEFT JOIN booking_comment bc on b.id=bc.booking_id AND bc.comment_parent_id IS NULL AND bc.`status`=1\n" +
|
|
"\tLEFT JOIN booking_comment bc on b.id=bc.booking_id AND bc.comment_parent_id IS NULL AND bc.`status`=1\n" +
|
|
|
"\t\n" +
|
|
"\t\n" +
|
|
|
- "\tLEFT JOIN users u on u.id =b.create_userid\n" +
|
|
|
|
|
|
|
+ "\tLEFT JOIN users u on u.id =b.create_userid LEFT JOIN file_info fi on fi.link_id=b.house_id\n" +
|
|
|
"\t\n" +
|
|
"\t\n" +
|
|
|
"\tWHERE bc.id IS NULL AND u.id= :usersId AND b.order_status=5 AND b.status_del=1 ORDER BY b.order_start_time DESC LIMIT :start,:rows";
|
|
"\tWHERE bc.id IS NULL AND u.id= :usersId AND b.order_status=5 AND b.status_del=1 ORDER BY b.order_start_time DESC LIMIT :start,:rows";
|
|
|
|
|
|
|
@@ -558,13 +558,13 @@ public class BookingCommentImplDao implements BookingCommentDao {
|
|
|
"\tb.house_name AS houseName,\n" +
|
|
"\tb.house_name AS houseName,\n" +
|
|
|
"\tb.live_time AS liveTime,\n" +
|
|
"\tb.live_time AS liveTime,\n" +
|
|
|
"\tb.check_out_time AS checkOutTime,\n" +
|
|
"\tb.check_out_time AS checkOutTime,\n" +
|
|
|
- "\tb.pay_account AS payAccount \n" +
|
|
|
|
|
|
|
+ "\tb.pay_account AS payAccount ,fi.url as url\n" +
|
|
|
"FROM\n" +
|
|
"FROM\n" +
|
|
|
"\t`booking` b\n" +
|
|
"\t`booking` b\n" +
|
|
|
"\tINNER JOIN booking_comment bc ON b.id = bc.booking_id \n" +
|
|
"\tINNER JOIN booking_comment bc ON b.id = bc.booking_id \n" +
|
|
|
"\tAND bc.comment_parent_id IS NULL \n" +
|
|
"\tAND bc.comment_parent_id IS NULL \n" +
|
|
|
"\tAND bc.`status` = 1\n" +
|
|
"\tAND bc.`status` = 1\n" +
|
|
|
- "\tLEFT JOIN users u ON u.id = b.create_userid \n" +
|
|
|
|
|
|
|
+ "\tLEFT JOIN users u ON u.id = b.create_userid LEFT JOIN file_info fi on fi.link_id=b.house_id \n" +
|
|
|
"WHERE\n" +
|
|
"WHERE\n" +
|
|
|
"\tu.id = :usersId \n" +
|
|
"\tu.id = :usersId \n" +
|
|
|
"\tAND b.order_status = 5 \n" +
|
|
"\tAND b.order_status = 5 \n" +
|
|
@@ -593,7 +593,7 @@ public class BookingCommentImplDao implements BookingCommentDao {
|
|
|
"\t`booking` b\n" +
|
|
"\t`booking` b\n" +
|
|
|
"\tLEFT JOIN booking_comment bc on b.id=bc.booking_id AND bc.comment_parent_id IS NULL AND bc.`status`=1\n" +
|
|
"\tLEFT JOIN booking_comment bc on b.id=bc.booking_id AND bc.comment_parent_id IS NULL AND bc.`status`=1\n" +
|
|
|
"\t\n" +
|
|
"\t\n" +
|
|
|
- "\tLEFT JOIN users u on u.id =b.create_userid\n" +
|
|
|
|
|
|
|
+ "\tLEFT JOIN users u on u.id =b.create_userid LEFT JOIN file_info fi on fi.link_id=b.house_id \n" +
|
|
|
"\t\n" +
|
|
"\t\n" +
|
|
|
"\tWHERE bc.id IS NULL AND u.id= :usersId AND b.order_status=5 AND b.status_del=1 ";
|
|
"\tWHERE bc.id IS NULL AND u.id= :usersId AND b.order_status=5 AND b.status_del=1 ";
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
@@ -616,7 +616,7 @@ public class BookingCommentImplDao implements BookingCommentDao {
|
|
|
"\tINNER JOIN booking_comment bc ON b.id = bc.booking_id \n" +
|
|
"\tINNER JOIN booking_comment bc ON b.id = bc.booking_id \n" +
|
|
|
"\tAND bc.comment_parent_id IS NULL \n" +
|
|
"\tAND bc.comment_parent_id IS NULL \n" +
|
|
|
"\tAND bc.`status` = 1\n" +
|
|
"\tAND bc.`status` = 1\n" +
|
|
|
- "\tLEFT JOIN users u ON u.id = b.create_userid \n" +
|
|
|
|
|
|
|
+ "\tLEFT JOIN users u ON u.id = b.create_userid LEFT JOIN file_info fi on fi.link_id=b.house_id \n" +
|
|
|
"WHERE\n" +
|
|
"WHERE\n" +
|
|
|
"\tu.id = :usersId \n" +
|
|
"\tu.id = :usersId \n" +
|
|
|
"\tAND b.order_status = 5 \n" +
|
|
"\tAND b.order_status = 5 \n" +
|
|
@@ -626,38 +626,38 @@ public class BookingCommentImplDao implements BookingCommentDao {
|
|
|
return namedParameterJdbcTemplate.queryForInt(sql, sps);
|
|
return namedParameterJdbcTemplate.queryForInt(sql, sps);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public PersonageDetailsVo personageDetails (String bookingCommentId){
|
|
|
|
|
- String sql = "SELECT\n" +
|
|
|
|
|
- "\tbc.id AS id,\n" +
|
|
|
|
|
- "\tbc.create_date as commentTime, \n" +
|
|
|
|
|
- "\tbc.score AS score,\n" +
|
|
|
|
|
- "\tbc.content AS content,\n" +
|
|
|
|
|
- "\tfi2.url AS url,\n" +
|
|
|
|
|
- "\tb.hotel_name AS hotelName,\n" +
|
|
|
|
|
- "\tb.house_order_number AS houseOrderNumber,\n" +
|
|
|
|
|
- "\tb.house_name AS houseName ,\n" +
|
|
|
|
|
- "\tb.live_time as liveTime,\n" +
|
|
|
|
|
- "\tb.check_out_time as checkOutTime,\n" +
|
|
|
|
|
- "\tb.pay_account as payAccount\n" +
|
|
|
|
|
- "FROM\n" +
|
|
|
|
|
- "\t`booking_comment` bc\n" +
|
|
|
|
|
- "\tLEFT JOIN ( SELECT fi.link_id, GROUP_CONCAT( fi.url ) AS url FROM file_info fi GROUP BY fi.link_id ) fi2 ON fi2.link_id = bc.id\n" +
|
|
|
|
|
- "\tLEFT JOIN booking b on b.id=bc.booking_id and b.status_del=1\n" +
|
|
|
|
|
- "\tWHERE bc.comment_parent_id is NULL AND bc.`status`=1 and bc.id= :bookingCommentId";
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public PersonageDetailsVo personageDetails (String bookingCommentId){
|
|
|
|
|
+ String sql = "SELECT\n" +
|
|
|
|
|
+ "\tbc.id AS id,\n" +
|
|
|
|
|
+ "\tbc.create_date as commentTime, \n" +
|
|
|
|
|
+ "\tbc.score AS score,\n" +
|
|
|
|
|
+ "\tbc.content AS content,\n" +
|
|
|
|
|
+ "\tfi2.url AS url,\n" +
|
|
|
|
|
+ "\tb.hotel_name AS hotelName,\n" +
|
|
|
|
|
+ "\tb.house_order_number AS houseOrderNumber,\n" +
|
|
|
|
|
+ "\tb.house_name AS houseName ,\n" +
|
|
|
|
|
+ "\tb.live_time as liveTime,\n" +
|
|
|
|
|
+ "\tb.check_out_time as checkOutTime,\n" +
|
|
|
|
|
+ "\tb.pay_account as payAccount\n" +
|
|
|
|
|
+ "FROM\n" +
|
|
|
|
|
+ "\t`booking_comment` bc\n" +
|
|
|
|
|
+ "\tLEFT JOIN ( SELECT fi.link_id, GROUP_CONCAT( fi.url ) AS url FROM file_info fi GROUP BY fi.link_id ) fi2 ON fi2.link_id = bc.id\n" +
|
|
|
|
|
+ "\tLEFT JOIN booking b on b.id=bc.booking_id and b.status_del=1\n" +
|
|
|
|
|
+ "\tWHERE bc.comment_parent_id is NULL AND bc.`status`=1 and bc.id= :bookingCommentId";
|
|
|
|
|
|
|
|
- MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
|
|
- sps.addValue("bookingCommentId", bookingCommentId);
|
|
|
|
|
- List<PersonageDetailsVo> list = null;
|
|
|
|
|
- try {
|
|
|
|
|
- list = namedParameterJdbcTemplate.query(sql, sps,
|
|
|
|
|
- new BeanPropertyRowMapper<>(PersonageDetailsVo.class));
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- if (list != null && list.size() > 0) return list.get(0);
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
|
|
+ sps.addValue("bookingCommentId", bookingCommentId);
|
|
|
|
|
+ List<PersonageDetailsVo> list = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ list = namedParameterJdbcTemplate.query(sql, sps,
|
|
|
|
|
+ new BeanPropertyRowMapper<>(PersonageDetailsVo.class));
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
|
|
+ if (list != null && list.size() > 0) return list.get(0);
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
public void appendValue(BookingComment bookingComment, StringBuffer stringBuffer, MapSqlParameterSource sps){
|
|
public void appendValue(BookingComment bookingComment, StringBuffer stringBuffer, MapSqlParameterSource sps){
|
|
|
if (!Func.checkNull(bookingComment.getCommentId())){
|
|
if (!Func.checkNull(bookingComment.getCommentId())){
|
|
|
stringBuffer.append(" comment_id=:comment_id ,");
|
|
stringBuffer.append(" comment_id=:comment_id ,");
|