复杂的mysql语句
/**
* 检查未支付并且已经逾期的分期订单,并把状态修改未逾期
*/
@Update({"update `payment_order_stage` pos " +
"INNER JOIN (`payment_order` po,`payment_plan` pp) " +
"on pos.order_id=po.id and po.plan_id= pp.id " +
"set pos.`status`=2 " +
"where pos.`status`=0 and pos.repayment_date <= (SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL pp.payment_term DAY),'%Y-%m-%d'))"
})
void changeStatus4Timeout();
其中涉及到日期的格式化,日期减函数,多表联合修改语句