Commit 456ef065 authored by 周健威's avatar 周健威

Merge branch 'feature-zjw' into dev

parents 3e80895d c9b3bf14
...@@ -54,6 +54,9 @@ public class UsableVeicleDTO extends PageParam { ...@@ -54,6 +54,9 @@ public class UsableVeicleDTO extends PageParam {
@ApiModelProperty(hidden = true) @ApiModelProperty(hidden = true)
Boolean yearNo4Where; Boolean yearNo4Where;
@ApiModelProperty(hidden = true)
Integer withoutRecordWhere = 1;
public void setStartDateTamp(Long startDateTamp) { public void setStartDateTamp(Long startDateTamp) {
this.startDateTamp = startDateTamp; this.startDateTamp = startDateTamp;
this.startDate = DEFAULT_DATE_TIME_FORMATTER.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(startDateTamp), ZoneOffset.ofHours(8))); this.startDate = DEFAULT_DATE_TIME_FORMATTER.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(startDateTamp), ZoneOffset.ofHours(8)));
......
...@@ -522,11 +522,17 @@ ...@@ -522,11 +522,17 @@
</if> </if>
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 --> <!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<if test=" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"> <if test=" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true">
,max( ,(max(
<foreach collection="yearMonthAndParam" index="yearMonth" item="andOperation" separator="and"> <foreach collection="yearMonthAndParam" index="yearMonth" item="andOperation" separator="and">
<include refid="yearMonthAndParamSql"></include> <include refid="yearMonthAndParamSql"></include>
</foreach> </foreach>
) as hasVehicle <!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle-->
<if test="withoutRecordWhere != null and withoutRecordWhere = 1 and startCompanyId != null and endCompanyId != null ">
and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})
and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})
</if>
)
)as hasVehicle
</if> </if>
<if test="lon != null and lat != null"> <if test="lon != null and lat != null">
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance ,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
...@@ -557,7 +563,7 @@ ...@@ -557,7 +563,7 @@
) > 0 ) > 0
</if> </if>
) )
<!-- union 所有车型 --> <!-- union 所有下架车型 -->
<if test="startCompanyId != null or parkBranchCompanyId != null "> <if test="startCompanyId != null or parkBranchCompanyId != null ">
union union
(select vm.id as model_id, bc.id as company_id (select vm.id as model_id, bc.id as company_id
...@@ -635,14 +641,15 @@ ...@@ -635,14 +641,15 @@
</foreach> </foreach>
</if> </if>
<!-- 若需根据预定日期条件查询,针对换为位操作 --> <!-- 根据前后record 过滤车辆 -->
<!-- yearNo4Where 标识时间参数是否用于where条件 -->
<if test="startCompanyId != null and endCompanyId != null "> <if test="startCompanyId != null and endCompanyId != null ">
and ( <if test="withoutRecordWhere == null">
and (
(abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId}) (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})
and and
(abr.to_return_company is null or abr.to_return_company = #{endCompanyId}) (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})
) )
</if>
</if> </if>
<if test=" modelId != null "> <if test=" modelId != null ">
and v.model_id = #{modelId} and v.model_id = #{modelId}
......
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