解决门店车辆查询语句的问题
This commit is contained in:
@ -28,6 +28,9 @@ public class StoreCarDTO {
|
|||||||
@ApiModelProperty("车辆型号名称")
|
@ApiModelProperty("车辆型号名称")
|
||||||
private String modelName;
|
private String modelName;
|
||||||
|
|
||||||
|
@ApiModelProperty("车辆图片,多图片逗号分隔")
|
||||||
|
private String images;
|
||||||
|
|
||||||
@ApiModelProperty("支持电池类型(48V标准版/100km,48V超长版/200km等)")
|
@ApiModelProperty("支持电池类型(48V标准版/100km,48V超长版/200km等)")
|
||||||
private String batteryType;
|
private String batteryType;
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ApiModel(value = "门店车辆查询请求")
|
@ApiModel(value = "门店车辆查询请求")
|
||||||
public class StoreCarReq {
|
public class StoreCarReq {
|
||||||
@ -14,4 +16,7 @@ public class StoreCarReq {
|
|||||||
@ApiModelProperty("车牌号码")
|
@ApiModelProperty("车牌号码")
|
||||||
private String licensePlate;
|
private String licensePlate;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店车辆状态")
|
||||||
|
private List<String> storeCarStatusList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,7 +54,7 @@ public class CarServiceImpl implements CarService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long countCarByStoreId(Long storeId) {
|
public Long countCarByStoreId(Long storeId) {
|
||||||
return carRepo.count(new LambdaQueryWrapper<CarPO>().eq(CarPO::getStoreId, storeId));
|
return carRepo.count(new LambdaQueryWrapper<CarPO>().eq(CarPO::getStoreId, storeId).eq(CarPO::getDelFlag, "0").eq(CarPO::getStatus, "0"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -3,6 +3,10 @@
|
|||||||
<mapper namespace="com.sczx.car.mapper.CarMapper">
|
<mapper namespace="com.sczx.car.mapper.CarMapper">
|
||||||
|
|
||||||
<select id="pageStoreCar" resultType="com.sczx.car.dto.StoreCarDTO">
|
<select id="pageStoreCar" resultType="com.sczx.car.dto.StoreCarDTO">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from
|
||||||
|
(
|
||||||
select
|
select
|
||||||
zc.id,
|
zc.id,
|
||||||
zc.vin,
|
zc.vin,
|
||||||
@ -21,7 +25,13 @@
|
|||||||
and zom.order_status = 'RENT_ING' then 'RENTING'
|
and zom.order_status = 'RENT_ING' then 'RENTING'
|
||||||
when zc.brs_status = '0' then 'FREE'
|
when zc.brs_status = '0' then 'FREE'
|
||||||
when zc.brs_status = '1' then 'REMOVED'
|
when zc.brs_status = '1' then 'REMOVED'
|
||||||
END ) store_car_status
|
END ) store_car_status,
|
||||||
|
zc.brs_status,
|
||||||
|
zc.images,
|
||||||
|
zom.order_status,
|
||||||
|
zom.order_no,
|
||||||
|
zc.update_time,
|
||||||
|
zc.store_id
|
||||||
from
|
from
|
||||||
zc_car zc
|
zc_car zc
|
||||||
left join (
|
left join (
|
||||||
@ -40,14 +50,22 @@
|
|||||||
where
|
where
|
||||||
del_flag = 0
|
del_flag = 0
|
||||||
and status = 0
|
and status = 0
|
||||||
and store_id = #{storeCarReq.storeId}
|
and store_id = #{storeCarReq.storeId}) )zom
|
||||||
<if test="storeCarReq.licensePlate != null and storeCarReq.licensePlate != ''">
|
|
||||||
and license_plate like concat('%', #{storeCarReq.licensePlate}, '%')
|
|
||||||
</if>
|
|
||||||
) )zom
|
|
||||||
on
|
on
|
||||||
zc.id = zom.vehicle_id
|
zc.id = zom.vehicle_id
|
||||||
|
) a
|
||||||
|
where
|
||||||
|
a.store_id = #{storeCarReq.storeId}
|
||||||
|
<if test="storeCarReq.storeCarStatusList != null and storeCarReq.storeCarStatusList.size() > 0">
|
||||||
|
and a.store_car_status
|
||||||
|
in <foreach collection="storeCarReq.storeCarStatusList" item="carStatus" open="(" separator="," close=")">
|
||||||
|
#{carStatus}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="storeCarReq.licensePlate != null and storeCarReq.licensePlate != ''">
|
||||||
|
and a.license_plate like concat('%', #{storeCarReq.licensePlate}, '%')
|
||||||
|
</if>
|
||||||
order by
|
order by
|
||||||
zc.update_time desc
|
a.update_time desc
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user