Commit e9613285 authored by hezhen's avatar hezhen

123

parent de177794
......@@ -52,4 +52,7 @@ public class VehicleFindDTO extends PageParam implements DataInter {
List<Integer> dataCompanyIds;
Integer bizType;
@ApiModelProperty("店铺类型:1-店铺资产;2-店铺经营;3-店铺停靠")
private Integer type;
}
......@@ -21,9 +21,16 @@ public class VehicleVO extends Vehicle {
private String categoryName;
@ApiModelProperty("店铺名称")
@ApiModelProperty("所属店铺名称")
private String companyName;
@ApiModelProperty("经营店铺名称")
private String manageCompanyName;
@ApiModelProperty("停靠店铺名称")
private String parkCompanyName;
private VehicleApply vehicleApply;
private List<VehicleExtensionVO> extensionVOS;
......
......@@ -18,6 +18,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
......@@ -53,6 +54,14 @@ public class AdminVehicleController extends BaseController<VehicleBiz>{
@ApiModelProperty("店铺商品列表")
public ObjectRestResponse shopSelectList(VehicleFindDTO vehicleFindDTO) {
setPowerData(vehicleFindDTO);
Integer type=vehicleFindDTO.getType() == null ? 0 :vehicleFindDTO.getType();
if (type > 0){
List<Integer> dataCompanyIds=vehicleFindDTO.getDataCompanyIds() == null ? new ArrayList<>() : vehicleFindDTO.getDataCompanyIds();
if (vehicleFindDTO.getBranchId() != null && vehicleFindDTO.getBranchId() > 0){
dataCompanyIds.add(vehicleFindDTO.getBranchId());
vehicleFindDTO.setDataCompanyIds(dataCompanyIds);
}
}
return baseBiz.selectList(vehicleFindDTO);
}
......
......@@ -1297,11 +1297,15 @@
v.*,
b.cn_name as brandName,
c.`name` categoryName,
bc.`name` as companyName
bc.`name` as companyName,
bc1.`name` as manageCompanyName,
bc2.`name` as parkCompanyName
FROM vehicle v
LEFT JOIN vehicle_brand b ON v.brand_id=b.id
LEFT JOIN vehicle_category c ON v.category_id=c.id
LEFT JOIN branch_company bc ON v.subordinate_branch=bc.id
LEFT JOIN branch_company bc1 ON v.manage_company_id=bc1.id
LEFT JOIN branch_company bc2 ON v.park_branch_company_id=bc2.id
<where>
v.is_del = 0
<if test="name != null and name != ''">
......@@ -1317,7 +1321,7 @@
AND v.`category_id`= #{categoryId}
</if>
<if test="branchId != null and branchId > 0">
AND v.`subordinate_branch`= #{branchId}
AND (v.`subordinate_branch`= #{branchId} or v.`park_branch_company_id`= #{branchId} or v.`manage_company_id`= #{branchId} )
</if>
<if test="state != null ">
AND v.`state`= #{state}
......@@ -1326,10 +1330,43 @@
AND v.`goods_type`= #{goodsType}
</if>
<if test="dataCompanyIds != null and dataCompanyIds.size > 0">
<if test="type != null and type > 0">
<choose>
<when test="type !=null and type == 1">
and bc.id in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</when>
<when test="type !=null and type == 2">
and bc1.id in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</when>
<when test="type !=null and type == 3">
and bc2.id in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</when>
<otherwise>
and (bc.id in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
or bc1.id in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
or bc2.id in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
</otherwise>
</choose>
</if>
</if>
<if test="dataCorporationIds != null and dataCorporationIds.size > 0">
and bc.company_id in
......
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