Commit 2e7511ec authored by unset's avatar unset

Merge branch 'master-vehicle-price' into dev-tiande

parents 73924e25 e5cb6e94
......@@ -14,6 +14,7 @@ import com.xxfc.platform.vehicle.entity.VehicleCommonPriceInfo;
import com.xxfc.platform.vehicle.entity.VehicleHolidayPriceInfo;
import com.xxfc.platform.vehicle.mapper.VehicleHolidayPriceInfoMapper;
import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO;
import com.xxfc.platform.vehicle.pojo.vo.VehicleHolidayPriceInfoVo;
import lombok.extern.slf4j.Slf4j;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
......@@ -234,7 +235,15 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
public ObjectRestResponse getAll(String vehicleId, Integer festivalId) {
return ObjectRestResponse.succ(mapper.getAll(vehicleId, festivalId));
List<VehicleHolidayPriceInfoVo> list = mapper.getAll(vehicleId, festivalId);
if (list != null && list.size() > 0) {
list.parallelStream().forEach(vehicleHolidayPriceInfoVo -> {
VehicleHolidayPriceInfo vehicleHolidayPriceInfo = getByVehicleId(vehicleHolidayPriceInfoVo.getVehicleId(), vehicleHolidayPriceInfoVo.getStartTime());
vehicleHolidayPriceInfoVo.setAllModelUse(vehicleHolidayPriceInfo.getAllModelUse());
vehicleHolidayPriceInfoVo.setAllVehicleUse(vehicleHolidayPriceInfo.getAllVehicleUse());
});
}
return ObjectRestResponse.succ();
}
......
......@@ -4,8 +4,8 @@
<mapper namespace="com.xxfc.platform.vehicle.mapper.VehicleHolidayPriceInfoMapper">
<select id="getAll" resultType="com.xxfc.platform.vehicle.pojo.vo.VehicleHolidayPriceInfoVo">
select festival_id, festival_day, MIN(festival_date) as startTime, MAX(festival_date) as endTime, rent_price, rent_free_day,vehicle_id, all_model_use, all_vehicle_use from vehicle_holiday_price_info
GROUP BY festival_id,festival_day,rent_price, rent_free_day,vehicle_id, all_model_use, all_vehicle_use
select festival_id, festival_day, MIN(festival_date) as startTime, MAX(festival_date) as endTime, rent_price, rent_free_day,vehicle_id from vehicle_holiday_price_info
GROUP BY festival_id,festival_day,rent_price, rent_free_day,vehicle_id
HAVING vehicle_id = #{vehicleId}
<if test="festivalId != null">
and festival_id = #{festivalId}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment