|
|
@@ -50,11 +50,13 @@ public class HotelCoupomStatusImplDao implements HotelCoupomStatusDao {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int updateExpir() {
|
|
|
- String sql = "SELECT `id` FROM `hotel_coupon_status` where DATE_FORMAT(`lapse_date`, '%Y-%m-%d') < CURDATE() and `status` = 1";
|
|
|
+ public int updateExpir(String dateTime) {
|
|
|
+ String sql = "SELECT `id` FROM `hotel_coupon_status` where `lapse_date` < :now and `status` = 1";
|
|
|
int num = 0;
|
|
|
try{
|
|
|
- List<String> ids = namedParameterJdbcTemplate.queryForList(sql, EmptySqlParameterSource.INSTANCE, String.class);
|
|
|
+ MapSqlParameterSource sps2 = new MapSqlParameterSource();
|
|
|
+ sps2.addValue("now",dateTime);
|
|
|
+ List<String> ids = namedParameterJdbcTemplate.queryForList(sql, sps2, String.class);
|
|
|
if (ids.isEmpty()) return 0;
|
|
|
//修改
|
|
|
StringBuffer stringBuffer = new StringBuffer(" update `hotel_coupon_status` set ");
|