|
|
@@ -310,24 +310,11 @@ public class HotelCouponImplDao implements HotelCouponDao {
|
|
|
"\thc.deduction_price as deductionPrice,\n" +
|
|
|
"\thc.max_deduction as maxDeduction,\n" +
|
|
|
"\thc.meet_price as meetPrice,\n" +
|
|
|
- "\thc.effective_end_date as effectiveEndDate ,hc.effective_start_date as effectiveStartDate, hc.effective_day as effectiveDay,hc.effective_lose_day as effectiveLoseDay , hc.effective_type as effectiveType, hcs.create_date as dateTime , \n" +
|
|
|
- "\thcs2.count AS count\n" +
|
|
|
+ "\thc.effective_end_date as effectiveEndDate ,hc.effective_start_date as effectiveStartDate, hc.effective_day as effectiveDay,hc.effective_lose_day as effectiveLoseDay , hc.effective_type as effectiveType, hcs.create_date AS dateTime \n" +
|
|
|
"FROM\n" +
|
|
|
"\thotel_coupon_status hcs\n" +
|
|
|
- "\tLEFT JOIN hotel_coupon hc ON hc.id = hcs.complaint_id LEFT JOIN (\n" +
|
|
|
- "SELECT\n" +
|
|
|
- "\thc2.id AS id,\n" +
|
|
|
- "\tcount( hcs.complaint_id ) AS count \n" +
|
|
|
- "FROM\n" +
|
|
|
- "\thotel_coupon_status hcs\n" +
|
|
|
- "\tLEFT JOIN hotel_coupon hc2 ON hc2.id = hcs.complaint_id \n" +
|
|
|
- "WHERE\n" +
|
|
|
- "\tFIND_IN_SET( hc2.type, :status ) \n" +
|
|
|
- "\tAND hcs.user_id = :userId \n" +
|
|
|
- "\tAND hcs.`status` = 1 \n" +
|
|
|
- "GROUP BY\n" +
|
|
|
- "\thcs.complaint_id \n" +
|
|
|
- "\t) hcs2 ON hcs2.id = hc.id where FIND_IN_SET(hc.type,:status) and hcs.user_id=:userId and hcs.status=1 \n" +
|
|
|
+ "\tLEFT JOIN hotel_coupon hc ON hc.id = hcs.complaint_id " +
|
|
|
+ "\t where FIND_IN_SET(hc.type,:status) and hcs.user_id=:userId and hcs.status=1 \n" +
|
|
|
"\tORDER BY hc.effective_start_date DESC limit :start,:rows";
|
|
|
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|