1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
public void deleteVoyagesPrev(ILieu origine, ILieu destination,
String clientOrigine, String clientDestination, Date debutPeriode,
Date finPeriode, int nombreASupprimer) throws DaoException {
SqlMapClient sqlMap = SqlManager.getSqlMapInstance();
Map<String, Object> map = new HashMap<String, Object>();
Object[] minMax = null;
BigDecimal min_id = null, max_id = null;
minMax = new BigDecimal[2];
if (origine != null)
map.put("idLieuOrigine", origine.getIdLieu());
if (destination != null) {
map.put("idLieuDestination", destination.getIdLieu());
}
map.put("clientOrigine", clientOrigine);
map.put("clientDestination", clientDestination);
if (debutPeriode != null) {
map
.put("dateDebutPeriode", DateHelper
.formatDate(debutPeriode));
}
if (finPeriode != null) {
map.put("dateFinPeriode", DateHelper.formatDate(finPeriode));
}
try{
minMax= (BigDecimal[])(sqlMap.queryForObject(
"Voyage.findVoyageStatSupprById", map));
min_id =(BigDecimal) minMax[0];
max_id =(BigDecimal) minMax[1];
map.put("min", min_id);
map.put("max", max_id);
sqlMap.queryForObject("Voyage.deleteVoyageStat", map);
} catch (SQLException e) {
throw new DaoException(e);
}
} |
Partager