|
|
@@ -53,11 +53,22 @@ public class BookingComplainImplDao implements BookingComplainDao {
|
|
|
" left join users u on a.create_id = u.id " +
|
|
|
" where a.status != 0 ";
|
|
|
|
|
|
+
|
|
|
+ private String selectLeftSql1 = "select " +
|
|
|
+ " bk.order_num,u.user_phone as complainPhone,m.corpn_phone as hotelPhone,a.id,a.booking_id,a.hotel_id,a.house_id,a.title,a.content,a.create_id,a.create_date,a.modify_date,/*a.status,*/h.h_name as house_name,h2.hname as hotel_name,(SELECT bcp.progress_type FROM booking_complaint_progress bcp WHERE bcp.complaint_id = a.id ORDER BY bcp.create_date DESC LIMIT 1 ) AS status" +
|
|
|
+ " from booking_complaint a " +
|
|
|
+ " left join house h on a.house_id = h.id " +
|
|
|
+ " left join hotel h2 on a.hotel_id = h2.id "+
|
|
|
+ " left join booking bk on a.booking_id = bk.id"+
|
|
|
+ " left join admin_manager m on h2.manager_id = m.id " +
|
|
|
+ " left join users u on a.create_id = u.id " +
|
|
|
+ " where 1=1 ";
|
|
|
+
|
|
|
@Override
|
|
|
public List<BookingComplaintVo> queryPage(String sqlx, int page, int rows) {
|
|
|
SqlUtil.filterKeyword(sqlx);
|
|
|
int start = (page - 1) * rows;// 每页的起始下标
|
|
|
- String sql = selectLeftSql + sqlx + "and a.status != 0" +" ORDER BY a.create_date DESC limit :start,:rows ";
|
|
|
+ String sql = selectLeftSql1 + sqlx +" ORDER BY a.create_date DESC limit :start,:rows ";
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
sps.addValue("start", start);
|
|
|
sps.addValue("rows", rows);
|
|
|
@@ -80,7 +91,7 @@ public class BookingComplainImplDao implements BookingComplainDao {
|
|
|
@Override
|
|
|
public int queryTotal(String sqlx) {
|
|
|
SqlUtil.filterKeyword(sqlx);
|
|
|
- String sql = "SELECT count(*) FROM ("+ selectSql +") a where status != 0 "+sqlx;
|
|
|
+ String sql = "SELECT count(*) FROM ("+ selectSql +") a where 1=1 "+sqlx;
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
return namedParameterJdbcTemplate.queryForInt(sql, sps);
|
|
|
}
|