public int addAppeal(int user_pick_seat_id,String appeal_desc){
Date appeal_time = new Date();
int whetherDefault = addAppealMapper.whetherDefault(user_pick_seat_id);
System.out.println(whetherDefault);
if(whetherDefault == 1)
return addAppealMapper.addAppeal(user_pick_seat_id,appeal_desc,appeal_time);
else
return 0;//未违约,申诉失败
}
Mapper类新增:
@Select("SELECT defaults FROM user_pick_seat WHERE user_pick_seat_id = #{user_pick_seat_id}")
int whetherDefault(int user_pick_seat_id);
//查询是否违约