/**
* 根据车次和座位类型获得对应的已订座位数
*
* @param id
* @return
*/
public Long countOrderedSeat(int scheduleID, int seatType) {
// count(Type)返回的是Long类型,无奈
Long retVal = null;
String sql = " select count(Type) from tb_train_seat where Type=? "
+ " and tb_train_seat.TrainID=("
+ " select TrainID from tb_train_schedule where AutoID=?)";
Object[] params = { seatType, scheduleID };
try {
retVal = (Long) super.findOnly(sql, params);
} catch (Exception e) {
log.error("根据车次和座位类型获得对应的已订座位数出错:", e);
}
return retVal;
}
dbutils的count问题
最新推荐文章于 2021-03-19 13:01:35 发布