|
@@ -313,7 +313,7 @@ public class HotelCouponImplDao implements HotelCouponDao {
|
|
|
String sql = "select " +
|
|
String sql = "select " +
|
|
|
"id,hotelIds,name,type,rebate_price,deduction_price,max_deduction,grant_number,limit_number,grant_start_date,grant_end_date," +
|
|
"id,hotelIds,name,type,rebate_price,deduction_price,max_deduction,grant_number,limit_number,grant_start_date,grant_end_date," +
|
|
|
"meet_price,effective_start_date,effective_end_date,effective_type,effective_day,effective_lose_day,create_id,create_date,modify_date,status,remainder_number,reversed_number" +
|
|
"meet_price,effective_start_date,effective_end_date,effective_type,effective_day,effective_lose_day,create_id,create_date,modify_date,status,remainder_number,reversed_number" +
|
|
|
- " from hotel_coupon where status = 1 and DATE_FORMAT( grant_end_date, '%Y-%m-%d' ) >= CURDATE( )" + sqlx + " ORDER BY create_date DESC limit :start , :rows ";
|
|
|
|
|
|
|
+ " from hotel_coupon where status = 1 and DATE_FORMAT( grant_end_date, '%Y-%m-%d' ) >= CURDATE( ) and CURDATE( ) >= DATE_FORMAT( grant_start_date, '%Y-%m-%d' )" + sqlx + " ORDER BY create_date DESC limit :start , :rows ";
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
sps.addValue("start", start);
|
|
sps.addValue("start", start);
|
|
|
sps.addValue("rows", rows);
|
|
sps.addValue("rows", rows);
|
|
@@ -326,7 +326,7 @@ public class HotelCouponImplDao implements HotelCouponDao {
|
|
|
@Override
|
|
@Override
|
|
|
public int advertisingCouponPageTotal(String sqlx) {
|
|
public int advertisingCouponPageTotal(String sqlx) {
|
|
|
SqlUtil.filterKeyword(sqlx);
|
|
SqlUtil.filterKeyword(sqlx);
|
|
|
- String sql = "SELECT count(*) FROM `hotel_coupon` where status = 1 and DATE_FORMAT( grant_end_date, '%Y-%m-%d' ) >= CURDATE( ) " + sqlx;
|
|
|
|
|
|
|
+ String sql = "SELECT count(*) FROM `hotel_coupon` where status = 1 and DATE_FORMAT( grant_end_date, '%Y-%m-%d' ) >= CURDATE( ) and CURDATE( ) >= DATE_FORMAT( grant_start_date, '%Y-%m-%d' ) " + sqlx;
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
return namedParameterJdbcTemplate.queryForInt(sql, sps);
|
|
return namedParameterJdbcTemplate.queryForInt(sql, sps);
|
|
|
}
|
|
}
|