Commit f5c4bb84 authored by unset's avatar unset

Merge branch 'master-vehicle-price' into dev-tiande

# Conflicts:
#	xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
parents c2643bab db8d0acb
...@@ -3,11 +3,9 @@ package com.github.wxiaoqi.security.admin.entity; ...@@ -3,11 +3,9 @@ package com.github.wxiaoqi.security.admin.entity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.*;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date; import java.util.Date;
import java.util.List;
@Table(name = "base_user") @Table(name = "base_user")
@Data @Data
...@@ -109,5 +107,8 @@ public class User { ...@@ -109,5 +107,8 @@ public class User {
private String attr8; private String attr8;
@Transient
private List<Integer> companyIds;
} }
\ No newline at end of file
...@@ -37,6 +37,9 @@ public interface UserFeign { ...@@ -37,6 +37,9 @@ public interface UserFeign {
@RequestMapping(value = "/public/userinfo-by-token") @RequestMapping(value = "/public/userinfo-by-token")
public ObjectRestResponse<UserDTO> userinfoByToken(@RequestParam("token") String token); public ObjectRestResponse<UserDTO> userinfoByToken(@RequestParam("token") String token);
@RequestMapping(value = "/public/v2/userinfo-by-token")
ObjectRestResponse<UserDTO> userinfoByTokenV2(@RequestParam("token") String token,@RequestParam("flag") boolean flag);
@RequestMapping(value = "/public/userinfo-by-uid") @RequestMapping(value = "/public/userinfo-by-uid")
public ObjectRestResponse<UserDTO> userinfoByUid(@RequestParam("uid") Integer uid); public ObjectRestResponse<UserDTO> userinfoByUid(@RequestParam("uid") Integer uid);
......
...@@ -17,7 +17,10 @@ public class UserDTO extends User { ...@@ -17,7 +17,10 @@ public class UserDTO extends User {
} }
public List<Integer> dataCompany2List() { public List<Integer> dataCompany2List() {
return str2List(getDataCompany()); if (getCompanyIds() != null && getCompanyIds().size() > 0){
return getCompanyIds();
}
return str2List(getDataCompany());
} }
public List<Integer> dataCorporation2List() { public List<Integer> dataCorporation2List() {
......
...@@ -17,6 +17,8 @@ import java.util.List; ...@@ -17,6 +17,8 @@ import java.util.List;
public interface UserRestInterface { public interface UserRestInterface {
public UserFeign getUserFeign(); public UserFeign getUserFeign();
default HttpServletRequest getRequest() { default HttpServletRequest getRequest() {
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
} }
...@@ -39,14 +41,22 @@ public interface UserRestInterface { ...@@ -39,14 +41,22 @@ public interface UserRestInterface {
} }
} }
default UserDTO getAdminUserInfoV2(boolean flag) {
if(getRequest().getHeader("Authorization") !=null) {
return getUserFeign().userinfoByTokenV2(getRequest().getHeader("Authorization"),flag).getData();
}else {
return null;
}
}
default void checkAdminUser(){ default void checkAdminUser(){
if(null == getAdminUserInfo()) { if(null == getAdminUserInfo()) {
throw new BaseException(ResultCode.NOTEXIST_CODE); throw new BaseException(ResultCode.NOTEXIST_CODE);
} }
} }
default void setPowerData(DataInter dataInter){ default void setPowerData(DataInter dataInter,boolean flag){
UserDTO userDTO = getAdminUserInfo(); UserDTO userDTO = getAdminUserInfoV2(flag);
if (userDTO == null) { if (userDTO == null) {
return; return;
} }
...@@ -58,7 +68,12 @@ public interface UserRestInterface { ...@@ -58,7 +68,12 @@ public interface UserRestInterface {
}else { }else {
List<Integer> dataCorporation2List = userDTO.dataCorporation2List(); List<Integer> dataCorporation2List = userDTO.dataCorporation2List();
if (dataCorporation2List != null && dataCorporation2List.size() > 0){ if (dataCorporation2List != null && dataCorporation2List.size() > 0){
dataInter.setDataCorporationIds(dataCorporation2List); if (flag){
dataInter.setDataCorporationIds(dataCorporation2List);
}else {
dataInter.setDataCompanyIds(dataCompany2List);
}
}else { }else {
List<Integer> ids=new ArrayList<>(); List<Integer> ids=new ArrayList<>();
ids.add(0); ids.add(0);
......
...@@ -12,13 +12,18 @@ import com.github.wxiaoqi.security.admin.vo.UserMemberVo; ...@@ -12,13 +12,18 @@ import com.github.wxiaoqi.security.admin.vo.UserMemberVo;
import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil; import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.CompanySearchDTO;
import com.xxfc.platform.vehicle.pojo.CompanySearchVO;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* ${DESCRIPTION} * ${DESCRIPTION}
...@@ -51,6 +56,9 @@ public class PublicController { ...@@ -51,6 +56,9 @@ public class PublicController {
@Autowired @Autowired
private AppUserRelationBiz relationBiz; private AppUserRelationBiz relationBiz;
@Autowired
VehicleFeign vehicleFeign;
@RequestMapping(value = "/userinfo-by-token", method = RequestMethod.GET) @RequestMapping(value = "/userinfo-by-token", method = RequestMethod.GET)
public @ResponseBody public @ResponseBody
ObjectRestResponse userinfoByToken(String token) throws Exception { ObjectRestResponse userinfoByToken(String token) throws Exception {
...@@ -65,6 +73,32 @@ public class PublicController { ...@@ -65,6 +73,32 @@ public class PublicController {
return new ObjectRestResponse<User>().rel(true).data(user); return new ObjectRestResponse<User>().rel(true).data(user);
} }
@RequestMapping(value = "v2/userinfo-by-token", method = RequestMethod.GET)
public @ResponseBody
ObjectRestResponse userinfoByTokenV2(String token,boolean flag) throws Exception {
String username = userAuthUtil.getInfoFromToken(token).getUniqueName();
if (username == null) {
return ObjectRestResponse.createFailedResult(ResultCode.USER_NOTEXIST_CODE, ResultCode.getMsg(ResultCode.USER_NOTEXIST_CODE));
}
User user = userBiz.getUserByUsername(username);
if (user == null) {
return ObjectRestResponse.createFailedResult(ResultCode.USER_NOTEXIST_CODE, ResultCode.getMsg(ResultCode.USER_NOTEXIST_CODE));
}
if (!flag && user.getDataCorporation() != null){
CompanySearchDTO companySearchDTO =new CompanySearchDTO();
companySearchDTO.setCompanyIds(Arrays.asList(user.getDataCorporation().split(",")).parallelStream().map(s -> Integer.valueOf(s)).collect(Collectors.toList()));
ObjectRestResponse<List<CompanySearchVO>> restResponse=vehicleFeign.listByIds(companySearchDTO);
if (restResponse != null ){
List<CompanySearchVO> companySearchVOList=restResponse.getData();
if(companySearchVOList != null && companySearchVOList.size() > 0){
List<Integer> companyIds = companySearchVOList.stream().map(CompanySearchVO::getId).distinct().collect(Collectors.toList());
user.setCompanyIds(companyIds);
}
}
}
return new ObjectRestResponse<User>().rel(true).data(user);
}
@RequestMapping(value = "/app/userinfo-by-token", method = RequestMethod.GET) @RequestMapping(value = "/app/userinfo-by-token", method = RequestMethod.GET)
public @ResponseBody public @ResponseBody
ObjectRestResponse userDetailByToken(String token) throws Exception { ObjectRestResponse userDetailByToken(String token) throws Exception {
......
...@@ -3,6 +3,8 @@ package com.xxfc.platform.vehicle.pojo.dto; ...@@ -3,6 +3,8 @@ package com.xxfc.platform.vehicle.pojo.dto;
import com.github.wxiaoqi.security.common.vo.PageParam; import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class VehicleCommonPriceDto extends PageParam { public class VehicleCommonPriceDto extends PageParam {
private Integer companyId; private Integer companyId;
...@@ -19,4 +21,7 @@ public class VehicleCommonPriceDto extends PageParam { ...@@ -19,4 +21,7 @@ public class VehicleCommonPriceDto extends PageParam {
*/ */
private Integer parkBranchCompanyId; private Integer parkBranchCompanyId;
List<Integer> dataCompanyIds;
List<Integer> dataCorporationIds;
} }
...@@ -1138,7 +1138,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -1138,7 +1138,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
* @throws Exception * @throws Exception
*/ */
public PageDataVO<ResultVehicleVo> getByPage(VehiclePageQueryVo vehiclePageQueryVo) throws Exception { public PageDataVO<ResultVehicleVo> getByPage(VehiclePageQueryVo vehiclePageQueryVo) throws Exception {
setPowerData(vehiclePageQueryVo); setPowerData(vehiclePageQueryVo, true);
Map<String, Object> params = PropertyUtils.describe(vehiclePageQueryVo); Map<String, Object> params = PropertyUtils.describe(vehiclePageQueryVo);
Integer pageSize = (Integer) params.get("limit"); Integer pageSize = (Integer) params.get("limit");
params.remove("pageSize"); params.remove("pageSize");
...@@ -1163,7 +1163,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -1163,7 +1163,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
* @return * @return
* @throws Exception * @throws Exception
*/ */
public PageDataVO<ResultVehicleVo> getByPageNotAllData(VehiclePageQueryVo vehiclePageQueryVo, List<Integer> companyList) throws Exception { public PageDataVO<ResultVehicleVo> getByPageNotAllData(VehiclePageQueryVo vehiclePageQueryVo) throws Exception {
Map<String, Object> params = PropertyUtils.describe(vehiclePageQueryVo); Map<String, Object> params = PropertyUtils.describe(vehiclePageQueryVo);
Integer pageSize = (Integer) params.get("limit"); Integer pageSize = (Integer) params.get("limit");
params.remove("pageSize"); params.remove("pageSize");
...@@ -1171,11 +1171,6 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -1171,11 +1171,6 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
params.remove("pageNo"); params.remove("pageNo");
//处理预定日期相关参数 //处理预定日期相关参数
adjustBookedInfoParam(params, vehiclePageQueryVo); adjustBookedInfoParam(params, vehiclePageQueryVo);
if (companyList != null && companyList.size() > 0) {
params.put("companyList", companyList);
} else {
params.put("companyList", null);
}
PageHelper.startPage(pageNo, pageSize); PageHelper.startPage(pageNo, pageSize);
List<ResultVehicleVo> vehicles = mapper.getByPageNotAllData(params); List<ResultVehicleVo> vehicles = mapper.getByPageNotAllData(params);
PageInfo<ResultVehicleVo> vehiclePageInfo = new PageInfo<>(vehicles); PageInfo<ResultVehicleVo> vehiclePageInfo = new PageInfo<>(vehicles);
......
...@@ -50,7 +50,8 @@ public class VehicleCommonPriceInfoBiz extends BaseBiz<VehicleCommonPriceInfoMap ...@@ -50,7 +50,8 @@ public class VehicleCommonPriceInfoBiz extends BaseBiz<VehicleCommonPriceInfoMap
if (vehicle == null) { if (vehicle == null) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "车辆不存在!"); return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "车辆不存在!");
} }
setPowerData(vehicleCommonPriceInfo); vehicleCommonPriceInfo.setModelId(vehicle.getModelId());
setPowerData(vehicleCommonPriceInfo, false);
vehicleCommonPriceInfo.setCompanyId(vehicle.getSubordinateBranch()); vehicleCommonPriceInfo.setCompanyId(vehicle.getSubordinateBranch());
List<Vehicle> vehicleList = null; List<Vehicle> vehicleList = null;
if (vehicleCommonPriceInfo.getAllVehicleUse() != null && vehicleCommonPriceInfo.getAllVehicleUse() == 1) {//所有车辆可用 if (vehicleCommonPriceInfo.getAllVehicleUse() != null && vehicleCommonPriceInfo.getAllVehicleUse() == 1) {//所有车辆可用
......
...@@ -70,7 +70,7 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM ...@@ -70,7 +70,7 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
if (vehicle == null) { if (vehicle == null) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "车辆不存在!"); return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "车辆不存在!");
} }
setPowerData(vehicleHolidayPriceInfo); setPowerData(vehicleHolidayPriceInfo, false);
vehicleHolidayPriceInfo.setCompanyId(vehicle.getSubordinateBranch()); vehicleHolidayPriceInfo.setCompanyId(vehicle.getSubordinateBranch());
List<Vehicle> vehicleList = null; List<Vehicle> vehicleList = null;
if (vehicleHolidayPriceInfo.getAllVehicleUse() != null && vehicleHolidayPriceInfo.getAllVehicleUse() == 1) {//所有车辆可用 if (vehicleHolidayPriceInfo.getAllVehicleUse() != null && vehicleHolidayPriceInfo.getAllVehicleUse() == 1) {//所有车辆可用
......
...@@ -148,8 +148,8 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use ...@@ -148,8 +148,8 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
UserDTO userDTO = userFeign.userinfoByToken(userAuthConfig.getToken(request)).getData(); UserDTO userDTO = userFeign.userinfoByToken(userAuthConfig.getToken(request)).getData();
if (userDTO != null) { if (userDTO != null) {
if (userDTO.getDataAll() == 2) { if (userDTO.getDataAll() == 2) {
setPowerData(vehiclePageQueryVo); setPowerData(vehiclePageQueryVo, true);
return RestResponse.data(baseBiz.getByPageNotAllData(vehiclePageQueryVo, vehiclePageQueryVo.getDataCompanyIds())); return RestResponse.data(baseBiz.getByPageNotAllData(vehiclePageQueryVo));
} }
} }
return RestResponse.data(baseBiz.getByPage(vehiclePageQueryVo)); return RestResponse.data(baseBiz.getByPage(vehiclePageQueryVo));
...@@ -169,8 +169,8 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use ...@@ -169,8 +169,8 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
UserDTO userDTO = userFeign.userinfoByUid(uid).getData(); UserDTO userDTO = userFeign.userinfoByUid(uid).getData();
if (userDTO != null) { if (userDTO != null) {
if (userDTO.getDataAll() == 2) { if (userDTO.getDataAll() == 2) {
setPowerData(vehiclePageQueryVo); setPowerData(vehiclePageQueryVo, true);
return RestResponse.data(baseBiz.getByPageNotAllData(vehiclePageQueryVo, vehiclePageQueryVo.getDataCompanyIds())); return RestResponse.data(baseBiz.getByPageNotAllData(vehiclePageQueryVo));
} }
} }
......
...@@ -38,7 +38,7 @@ public class AdminBranchCompanyController extends BaseController<BranchCompanyBi ...@@ -38,7 +38,7 @@ public class AdminBranchCompanyController extends BaseController<BranchCompanyBi
@RequestMapping(value ="/search",method = RequestMethod.GET) @RequestMapping(value ="/search",method = RequestMethod.GET)
public RestResponse<PageDataVO<CompanySearchVO>> search(@Validated CompanySearchDTO vo) { public RestResponse<PageDataVO<CompanySearchVO>> search(@Validated CompanySearchDTO vo) {
setPowerData(vo); setPowerData(vo,false);
return RestResponse.data(baseBiz.search(vo)); return RestResponse.data(baseBiz.search(vo));
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
and vci.model_id = #{modelId} and vci.model_id = #{modelId}
</if> </if>
<if test="subordinateBranch !=null "> <if test="subordinateBranch !=null ">
and ( v.park_branch_company_id = #{subordinateBranch}) and ( bc2.id = #{subordinateBranch})
</if> </if>
<if test="parkBranchCompanyId !=null "> <if test="parkBranchCompanyId !=null ">
and ( bc.id = #{parkBranchCompanyId}) and ( bc.id = #{parkBranchCompanyId})
...@@ -34,6 +34,25 @@ ...@@ -34,6 +34,25 @@
<if test="companyId !=null "> <if test="companyId !=null ">
and ( ci.id = #{companyId}) and ( ci.id = #{companyId})
</if> </if>
<if test="dataCorporationIds != null and dataCorporationIds.size > 0">
and ci.id in (
<foreach collection="dataCorporationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
</if>
<if test="dataCompanyIds != null and dataCompanyIds.size > 0">
and (bc.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>
))
</if>
<if test="numberPlate !=null and numberPlate != ''"> <if test="numberPlate !=null and numberPlate != ''">
and v.number_plate like concat('%',#{numberPlate},'%') and v.number_plate like concat('%',#{numberPlate},'%')
</if> </if>
......
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
</foreach> </foreach>
</if> </if>
<if test="subordinateBranch !=null "> <if test="subordinateBranch !=null ">
and ( v.park_branch_company_id = #{subordinateBranch}) and ( bc2.id = #{subordinateBranch})
</if> </if>
<if test="parkBranchCompanyId !=null "> <if test="parkBranchCompanyId !=null ">
and ( bc.id = #{parkBranchCompanyId}) and ( bc.id = #{parkBranchCompanyId})
...@@ -174,6 +174,25 @@ ...@@ -174,6 +174,25 @@
<if test="companyId !=null "> <if test="companyId !=null ">
and ( ci.id = #{companyId}) and ( ci.id = #{companyId})
</if> </if>
<if test="dataCorporationIds != null and dataCorporationIds.size > 0">
and ci.id in (
<foreach collection="dataCorporationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
</if>
<if test="dataCompanyIds != null and dataCompanyIds.size > 0">
and (bc.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>
))
</if>
<if test=" addrProvince !=null or addrCity !=null or zoneId !=null "> <if test=" addrProvince !=null or addrCity !=null or zoneId !=null ">
<if test="addrProvince !=null"> <if test="addrProvince !=null">
and bc.addr_province=#{addrProvince} and bc.addr_province=#{addrProvince}
...@@ -257,29 +276,6 @@ ...@@ -257,29 +276,6 @@
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where where
v.is_del=0 v.is_del=0
<if test="companyList != null">
and ( v.park_branch_company_id in (
<trim suffixOverrides=",">
<foreach collection="companyList" item="companyId">
#{companyId},
</foreach>
</trim>
)
<!--or v.expect_destination_branch_company_id in (
<trim suffixOverrides=",">
<foreach collection="companyList" item="companyId">
#{companyId},
</foreach>
</trim>
)-->
<!-- or v.subordinate_branch in (-->
<!-- <trim suffixOverrides=",">-->
<!-- <foreach collection="companyList" item="companyId">-->
<!-- #{companyId},-->
<!-- </foreach>-->
<!-- </trim>-->
)
</if>
<if test="mRangeDateEnd !=null"> <if test="mRangeDateEnd !=null">
and v.maintenance_date &lt;= #{mRangeDateEnd} and v.maintenance_date &lt;= #{mRangeDateEnd}
</if> </if>
...@@ -310,9 +306,6 @@ ...@@ -310,9 +306,6 @@
<if test="vin !=null and vin != ''"> <if test="vin !=null and vin != ''">
and v.vin = #{vin} and v.vin = #{vin}
</if> </if>
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>-->
<if test="code !=null"> <if test="code !=null">
and v.code = #{code} and v.code = #{code}
</if> </if>
...@@ -342,7 +335,7 @@ ...@@ -342,7 +335,7 @@
</foreach> </foreach>
</if> </if>
<if test="subordinateBranch !=null "> <if test="subordinateBranch !=null ">
and ( v.park_branch_company_id = #{subordinateBranch}) and ( bc2.id = #{subordinateBranch})
</if> </if>
<if test="parkBranchCompanyId !=null "> <if test="parkBranchCompanyId !=null ">
and ( bc.id = #{parkBranchCompanyId}) and ( bc.id = #{parkBranchCompanyId})
...@@ -350,6 +343,26 @@ ...@@ -350,6 +343,26 @@
<if test="companyId !=null "> <if test="companyId !=null ">
and ( ci.id = #{companyId}) and ( ci.id = #{companyId})
</if> </if>
<if test="dataCorporationIds != null and dataCorporationIds.size > 0">
and ci.id in (
<foreach collection="dataCorporationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
</if>
<if test="dataCompanyIds != null and dataCompanyIds.size > 0">
and (bc.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>
))
</if>
<if test=" addrProvince !=null or addrCity !=null or zoneId !=null "> <if test=" addrProvince !=null or addrCity !=null or zoneId !=null ">
<if test="addrProvince !=null"> <if test="addrProvince !=null">
and bc.addr_province=#{addrProvince} and bc.addr_province=#{addrProvince}
...@@ -473,6 +486,25 @@ ...@@ -473,6 +486,25 @@
<if test="companyId !=null "> <if test="companyId !=null ">
and ( ci.id = #{companyId}) and ( ci.id = #{companyId})
</if> </if>
<if test="dataCorporationIds != null and dataCorporationIds.size > 0">
and ci.id in (
<foreach collection="dataCorporationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
</if>
<if test="dataCompanyIds != null and dataCompanyIds.size > 0">
and (bc.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>
))
</if>
<if test=" addrProvince !=null or addrCity !=null or zoneId !=null "> <if test=" addrProvince !=null or addrCity !=null or zoneId !=null ">
<if test="addrProvince !=null"> <if test="addrProvince !=null">
and bc.addr_province=#{addrProvince} and bc.addr_province=#{addrProvince}
...@@ -512,29 +544,6 @@ ...@@ -512,29 +544,6 @@
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where where
v.is_del=0 v.is_del=0
<if test="companyList != null">
and ( v.park_branch_company_id in (
<trim suffixOverrides=",">
<foreach collection="companyList" item="companyId">
#{companyId},
</foreach>
</trim>
)
<!--or v.expect_destination_branch_company_id in (
<trim suffixOverrides=",">
<foreach collection="companyList" item="companyId">
#{companyId},
</foreach>
</trim>
)-->
<!-- or v.subordinate_branch in (-->
<!-- <trim suffixOverrides=",">-->
<!-- <foreach collection="companyList" item="companyId">-->
<!-- #{companyId},-->
<!-- </foreach>-->
<!-- </trim>-->
)
</if>
<if test="mRangeDateEnd !=null"> <if test="mRangeDateEnd !=null">
and v.maintenance_date &lt;= #{mRangeDateEnd} and v.maintenance_date &lt;= #{mRangeDateEnd}
</if> </if>
...@@ -606,6 +615,25 @@ ...@@ -606,6 +615,25 @@
and ( v.park_branch_company_id = #{subordinateBranch} or and ( v.park_branch_company_id = #{subordinateBranch} or
v.expect_destination_branch_company_id=#{subordinateBranch} ) v.expect_destination_branch_company_id=#{subordinateBranch} )
</if> </if>
<if test="dataCorporationIds != null and dataCorporationIds.size > 0">
and ci.id in (
<foreach collection="dataCorporationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
</if>
<if test="dataCompanyIds != null and dataCompanyIds.size > 0">
and (bc.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>
))
</if>
<if test=" addrProvince !=null or addrCity !=null or zoneId !=null "> <if test=" addrProvince !=null or addrCity !=null or zoneId !=null ">
<if test="addrProvince !=null"> <if test="addrProvince !=null">
and bc.addr_province=#{addrProvince} and bc.addr_province=#{addrProvince}
......
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