Commit 888aed62 authored by 周健威's avatar 周健威

添加时间条件

parent b8b5890d
......@@ -51,6 +51,18 @@ public class RentVehicleBookDTO extends PageParam {
@ApiModelProperty("预定目标时间(结束)")
private String bookEndDateTime;
/**
* 预定目标日期(开始)时间戳
*/
@ApiModelProperty("预定目标时间(开始)")
private Long bookStartDateTimestamp;
/**
* 预定目标日期(结束)时间戳
*/
@ApiModelProperty("预定目标时间(结束)")
private Long bookEndDateTimestamp;
/**
* 提车地点
......@@ -143,6 +155,9 @@ public class RentVehicleBookDTO extends PageParam {
@ApiModelProperty(hidden = true)
Boolean recordIntersection;
@ApiModelProperty(hidden = true)
Boolean timeUse;
@ApiModelProperty("城市")
Integer addrCity;
@ApiModelProperty("经度")
......
......@@ -252,10 +252,13 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
rbd.setBookEndDate(dto.getEndDate());
rbd.setBookStartDateTime(dto.getStartDateTime());
rbd.setBookEndDateTime(dto.getEndDateTime());
rbd.setBookStartDateTimestamp(dto.getStartDateTamp());
rbd.setBookEndDateTimestamp(dto.getEndDateTamp());
rbd.setCatas2(dto.getCatas());
rbd.setGoodsType(dto.getGoodsType());
rbd.setRecordIntersection(Boolean.FALSE);
rbd.setYearNo4Where(Boolean.FALSE);
rbd.setTimeUse(Boolean.TRUE);
//查询可车辆信息
PageDataVO<UsableVeicleVO> pageDataVO = vehicleBiz.searchUsableVehicle(rbd);
if(CollUtil.isNotEmpty(pageDataVO.getData())) {
......
......@@ -1190,6 +1190,9 @@
left join vehicle_model vm on v.model_id = vm.id
left join branch_company bc on v.park_branch_company_id = bc.id
left join branch_company bcm on v.manage_company_id = bcm.id
<if test="timeUse != null and timeUse == true">
left join vehicle_use_time vut on v.id = vut.vehicle_id and vut.status = 1
</if>
<!-- <if test="startCompanyId != null and endCompanyId != null ">-->
<!--
* 原(大于预约结束时间,小于预约开始时间的预约记录)
......@@ -1213,6 +1216,12 @@
left join (select vehicle_id,GROUP_CONCAT(cata_id) as catas from vehicle_extension where is_del = 0 group by vehicle_id) vc on v.id = vc.vehicle_id
</if>
<where>
<if test="timeUse != null and timeUse == true">
<if test="startCompanyId != null and endCompanyId != null">
and (vut.company_id = #{startCompanyId} and vut.company_id = #{endCompanyId})
</if>
and (vut.vehicle_id is null or (#{bookStartDateTimestamp} &gt; vut.start_time and #{bookEndDateTimestamp} &lt; vut.end_time) )
</if>
<!-- 若需根据预定日期条件查询,针对换为位操作 -->
<!-- yearNo4Where 标识时间参数是否用于where条件 -->
<if test=" yearMonthAndParam !=null and yearMonthAndParam != null and (yearNo4Where == null or yearNo4Where != true)">
......
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