Commit 1428b34e authored by hezhen's avatar hezhen

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform into base-modify

parents 84f73675 3a3f4a03
...@@ -42,11 +42,11 @@ public class VehicleModelVo extends VehicleModel implements Serializable { ...@@ -42,11 +42,11 @@ public class VehicleModelVo extends VehicleModel implements Serializable {
private String config; private String config;
@Column(name = "number") @Column(name = "number")
@ApiModelProperty(value = "乘卧数") @ApiModelProperty(value = "乘卧数id")
private String number; private String number;
@Column(name = "brand") @Column(name = "brand")
@ApiModelProperty(value = "品牌") @ApiModelProperty(value = "品牌id")
private String brand; private String brand;
//关键标签,code逗号分割 //关键标签,code逗号分割
...@@ -158,4 +158,14 @@ public class VehicleModelVo extends VehicleModel implements Serializable { ...@@ -158,4 +158,14 @@ public class VehicleModelVo extends VehicleModel implements Serializable {
@ApiModelProperty(value = "车辆") @ApiModelProperty(value = "车辆")
private Vehicle vehicle; private Vehicle vehicle;
@Column(name = "numberName")
@ApiModelProperty(value = "乘卧数")
private String numberName;
@Column(name = "brandName")
@ApiModelProperty(value = "品牌")
private String brandName;
} }
...@@ -12,6 +12,7 @@ import com.xxfc.platform.vehicle.mapper.VehicleModelMapper; ...@@ -12,6 +12,7 @@ import com.xxfc.platform.vehicle.mapper.VehicleModelMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 车型 * 车型
...@@ -41,7 +42,7 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> { ...@@ -41,7 +42,7 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> {
try { try {
PageDataVO<VehicleModel> mPageDataVO = PageDataVO.pageInfo(vmqc.getPage(), PageDataVO<VehicleModelVo> mPageDataVO = PageDataVO.pageInfo(vmqc.getPage(),
vmqc.getLimit(), () -> mapper.findVehicleModelPage(vmqc)); vmqc.getLimit(), () -> mapper.findVehicleModelPage(vmqc));
return ObjectRestResponse.succ(mPageDataVO); return ObjectRestResponse.succ(mPageDataVO);
......
...@@ -172,6 +172,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi ...@@ -172,6 +172,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
VehicleCata vc = new VehicleCata(); VehicleCata vc = new VehicleCata();
vc.setVehicleModelId(vmId); vc.setVehicleModelId(vmId);
vc.setCataId(Integer.parseInt(con)); vc.setCataId(Integer.parseInt(con));
vc.setCrtTime(System.currentTimeMillis());
vcs.add(vc); vcs.add(vc);
} }
...@@ -179,6 +180,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi ...@@ -179,6 +180,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
e.printStackTrace(); e.printStackTrace();
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
throw new BaseException(ResultCode.FAILED_CODE); throw new BaseException(ResultCode.FAILED_CODE);
} }
...@@ -266,6 +268,10 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi ...@@ -266,6 +268,10 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
// ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "该车型,无法删除"); // ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "该车型,无法删除");
// } // }
if (id==1||id==14) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE,"The label cannot be deleted");
}
//2.进行逻辑删除 //2.进行逻辑删除
VehicleModel vm = new VehicleModel(); VehicleModel vm = new VehicleModel();
vm.setId(id); vm.setId(id);
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
<resultMap id="searchModel" type="com.xxfc.platform.vehicle.pojo.VehicleAndModelInfoVo"> <resultMap id="searchModel" type="com.xxfc.platform.vehicle.pojo.VehicleAndModelInfoVo">
<association property="vehicleModel" column="model_id" <association property="vehicleModel" column="model_id"
select="com.xxfc.platform.vehicle.mapper.VehicleModelMapper.selectByPrimaryKey"/> select="com.xxfc.platform.vehicle.mapper.VehicleModelMapper.selectByPrimaryKey"/>
<association property="vehicleBookRecord" column="id" select="com.xxfc.platform.vehicle.mapper.VehicleBookRecordMapper.getByVehicleId" /> <association property="vehicleBookRecord" column="id"
select="com.xxfc.platform.vehicle.mapper.VehicleBookRecordMapper.getByVehicleId"/>
</resultMap> </resultMap>
<update id="updateStatusById" parameterType="java.util.Map"> <update id="updateStatusById" parameterType="java.util.Map">
...@@ -108,6 +109,11 @@ ...@@ -108,6 +109,11 @@
<if test="useType !=null"> <if test="useType !=null">
and v.use_type = #{useType} and v.use_type = #{useType}
</if> </if>
-- 添加所属大区搜索条件
<if test="zoneId !=null">
and bc.zone_id=#{zoneId}
</if>
<!-- 若需根据预定日期条件查询,针对换为位操作 --> <!-- 若需根据预定日期条件查询,针对换为位操作 -->
<if test=" yearMonthAndParam !=null "> <if test=" yearMonthAndParam !=null ">
<foreach collection="yearMonthAndParam" index="yearMonth" item="andOperation"> <foreach collection="yearMonthAndParam" index="yearMonth" item="andOperation">
...@@ -217,6 +223,10 @@ ...@@ -217,6 +223,10 @@
<if test="useType !=null"> <if test="useType !=null">
and v.use_type = #{useType} and v.use_type = #{useType}
</if> </if>
-- 添加所属大区搜索条件
<if test="zoneId !=null">
and bc.zone_id=#{zoneId}
</if>
<!-- 若需根据预定日期条件查询,针对换为位操作 --> <!-- 若需根据预定日期条件查询,针对换为位操作 -->
<if test=" yearMonthAndParam !=null "> <if test=" yearMonthAndParam !=null ">
<foreach collection="yearMonthAndParam" index="yearMonth" item="andOperation"> <foreach collection="yearMonthAndParam" index="yearMonth" item="andOperation">
......
...@@ -4,11 +4,15 @@ ...@@ -4,11 +4,15 @@
<select id="findVehicleModelPage" parameterType="com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition" <select id="findVehicleModelPage" parameterType="com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition"
resultType="com.xxfc.platform.vehicle.pojo.VehicleModelVo"> resultType="com.xxfc.platform.vehicle.pojo.VehicleModelVo">
SELECT * from SELECT * from
(select vm.*,v.sum,v2.leasableQuantity from vehicle_model vm left JOIN (select vm.*,v.sum,v2.leasableQuantity,vpc.`name` brandName,vpc2.name numberName from vehicle_model vm left JOIN
(select model_id as mid, count(1) as sum FROM vehicle GROUP BY mid) v (select model_id as mid, count(1) as sum FROM vehicle GROUP BY mid) v
on vm.id=v.mid left JOIN on vm.id=v.mid left JOIN
(select model_id as mid2, count(1) as leasableQuantity FROM vehicle where`use_type`=1 GROUP BY model_id) v2 (select model_id as mid2, count(1) as leasableQuantity FROM vehicle where`use_type`=1 GROUP BY model_id) v2
on v.mid=v2.mid2 ) vmqc WHERE 1=1 on v.mid=v2.mid2
left join (SELECT id,name FROM vehicle_plat_cata where state=0) vpc on vm.brand=vpc.id
left join (SELECT id,name FROM vehicle_plat_cata where state=0) vpc2 on vm.number=vpc2.id
where isdel = 0
) vmqc WHERE 1=1
<if test="isDel !=null "> <if test="isDel !=null ">
and isdel=#{isDel} and isdel=#{isDel}
......
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