Commit 514e5960 authored by 周健威's avatar 周健威

Merge branch 'master' into master-merge-modify

parents a4fda1c0 b867bf06
......@@ -167,7 +167,7 @@ public class UserController extends CommonBaseController {
}
if(list.size()==1){
User user=list.get(0);
if(user.getId()!=vo.getId()){
if(!user.getId().equals(vo.getId())){
throw new RuntimeException("用户名不能重复");
}
}
......
......@@ -837,4 +837,13 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
//去重
return zoneCompanyIds.parallelStream().distinct().collect(Collectors.toList());
}
//删除车辆信息
public RestResponse delVehicleById(String id){
Vehicle vehicle=new Vehicle();
vehicle.setId(id);
vehicle.setIsDel(1);
updateSelectiveById(vehicle);
return RestResponse.suc();
}
}
......@@ -136,4 +136,9 @@ public class Vehicle {
*/
private Integer expectDestinationBranchCompanyId;
/**
* 是否删除;0-正常;1-删除
*/
private Integer isDel;
}
\ No newline at end of file
......@@ -293,5 +293,16 @@ public class VehicleController extends BaseController<VehicleBiz> {
return vehicleBookRecordBiz.retVehicle(operatorId, userName, retVehicleVo);
}
/**
* 删除车辆信息
* @param id
* @return
* @throws Exception
*/
@RequestMapping(value = "/del/{id}", method = RequestMethod.DELETE)
public RestResponse retVehicle(@PathVariable String id) throws Exception {
return baseBiz.delVehicleById(id);
}
}
......@@ -12,6 +12,7 @@
<select id="getByPage" parameterType="java.util.Map"
resultType="com.xinxincaravan.caravan.vehicle.vo.QueryVehicleVo">
SELECT r.* FROM (
select DISTINCT v.`id`,
v.`code`,
v.`status`,
......@@ -49,7 +50,7 @@
LEFT JOIN branch_company bc ON v.park_branch_company_id = bc.id
LEFT JOIN branch_company bc1 ON v.expect_destination_branch_company_id = bc1.id
where
1=1
v.is_del=0
<if test="mRangeDateEnd !=null">
and v.maintenance_date &lt;= #{mRangeDateEnd}
</if>
......@@ -98,12 +99,13 @@
)
</foreach>
</if>
<if test="subordinateBranch !=null or addrProvince !=null or addrCity !=null or zoneId !=null ">
and (
<trim suffixOverrides="OR">
<if test="subordinateBranch !=null ">
( v.park_branch_company_id = #{subordinateBranch} or v.expect_destination_branch_company_id=#{subordinateBranch} ) OR
and ( v.park_branch_company_id = #{subordinateBranch} or v.expect_destination_branch_company_id=#{subordinateBranch} )
</if>
<if test=" addrProvince !=null or addrCity !=null or zoneId !=null ">
and (
<trim suffixOverrides="OR">
<if test="addrProvince !=null">
(bc.addr_province=#{addrProvince} or bc1.addr_province=#{addrProvince}) OR
</if>
......@@ -117,10 +119,12 @@
)
</if>
order by v.code
) r ORDER BY r.subBranchName
</select>
<select id="getByPageNotAllData" parameterType="java.util.Map"
resultType="com.xinxincaravan.caravan.vehicle.vo.QueryVehicleVo">
SELECT r.* FROM (
select DISTINCT v.`id`,
v.`code`,
v.`status`,
......@@ -158,7 +162,7 @@
LEFT JOIN branch_company bc ON v.park_branch_company_id = bc.id
LEFT JOIN branch_company bc1 ON v.expect_destination_branch_company_id = bc1.id
where
1=1
v.is_del=0
<if test="companyList != null">
and ( v.park_branch_company_id in (
<trim suffixOverrides=",">
......@@ -224,12 +228,12 @@
)
</foreach>
</if>
<if test="subordinateBranch !=null or addrProvince !=null or addrCity !=null or zoneId !=null ">
<if test="subordinateBranch !=null ">
and ( v.park_branch_company_id = #{subordinateBranch} or v.expect_destination_branch_company_id=#{subordinateBranch} )
</if>
<if test=" addrProvince !=null or addrCity !=null or zoneId !=null ">
and (
<trim suffixOverrides="OR">
<if test="subordinateBranch !=null ">
( v.park_branch_company_id = #{subordinateBranch} or v.expect_destination_branch_company_id=#{subordinateBranch} ) OR
</if>
<if test="addrProvince !=null">
(bc.addr_province=#{addrProvince} or bc1.addr_province=#{addrProvince}) OR
</if>
......@@ -243,6 +247,7 @@
)
</if>
order by v.code
) r ORDER BY r.subBranchName
</select>
<select id="lockByCode" resultType="com.xinxincaravan.caravan.vehicle.entity.Vehicle"
......
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