Commit bac48d7b authored by xiamw's avatar xiamw

价格列表查询条件优化

parent add9a4ea
......@@ -11,12 +11,21 @@ public class WarehouseLineSearchVO {
private String transportType;
/**始发地城市*/
private Long startCityId;
/**目的地城市*/
private Long destCityId;
/**目的地城市*/
private Long destCountryId;
/**目的仓*/
private Long destWarehouseId;
/**目的地城市*/
private List<Long> destCityIds;
/**目的地城市*/
private List<Long> destCountryIds;
/**目的仓*/
private List<Long> destWarehouseIds;
/**渠道id*/
private Long channelId;
......@@ -25,4 +34,6 @@ public class WarehouseLineSearchVO {
/** 线路id列表 */
private List<Long> lineIdList;
}
......@@ -46,6 +46,7 @@
<if test="params.startCityId != null and params.startCityId != 0">
and ew_start.shi = #{params.startCityId}
</if>
<if test="params.destCityId != null and params.destCityId != 0">
and ew_dest.shi = #{params.destCityId}
</if>
......@@ -55,6 +56,29 @@
<if test="params.destWarehouseId != null and params.destWarehouseId != 0">
and ewl.dest_warehouse_id = #{params.destWarehouseId}
</if>
<!--目的地-->
<if test="params.destCityIds != null and params.destCityIds.size()>0 ">
and ew_dest.`shi` in
<foreach item='destCity' index='index' collection='params.destCityIds' open='(' separator=',' close=')'>
#{destCity}
</foreach>
</if>
<!--目的国-->
<if test="params.destCountryIds != null and params.destCountryIds.size()>0 ">
and ew_dest.`guojia` in
<foreach item='destCountry' index='index' collection='params.destCountryIds' open='(' separator=',' close=')'>
#{destCountry}
</foreach>
</if>
<!--目的仓-->
<if test="params.destWarehouseIds != null and params.destWarehouseIds.size()>0 ">
and ewl.dest_warehouse_id in
<foreach item='destWarehouse' index='index' collection='params.destWarehouseIds' open='(' separator=',' close=')'>
#{destWarehouse}
</foreach>
</if>
<if test="params.lineId != null and params.lineId != 0">
and ewl.id = #{params.lineId}
</if>
......
......@@ -217,10 +217,15 @@ public class WarehouseController {
channelInfoEvent.setChannelId(requestVO.getChannelId());
applicationContext.publishEvent(channelInfoEvent);
if (Objects.nonNull(channelInfoEvent.getCountryId()) && channelInfoEvent.getCountryId() > 0L){
if (Objects.nonNull(requestVO.getDestCountryId()) && requestVO.getDestCountryId() > 0L && !Objects.equals(requestVO.getDestCountryId(),channelInfoEvent.getCountryId())) {
return error(400,"目的国与渠道不匹配");
if (Objects.nonNull(requestVO.getDestCountryIds()) && requestVO.getDestCountryIds().size() > 0 ) {
List<Long> destCountryIds = requestVO.getDestCountryIds();
for(Long countryid:destCountryIds) {
if(!Objects.equals(countryid,channelInfoEvent.getCountryId())) {
return error(400,"目的国与渠道不匹配");
}
}
}
requestVO.setDestCountryId(channelInfoEvent.getCountryId());
//requestVO.setDestCountryId(channelInfoEvent.getCountryId());
}
}
List<WarehouseLineDO> list = warehouseService.openedRouterList(requestVO);
......
......@@ -367,7 +367,7 @@ public interface CouponMapper extends BaseMapperX<CouponDO> {
"AND c.start_time between #{reqVO.beginStartTime} and #{reqVO.endStartTime} ",
"</when>",
"<when test = 'reqVO.beginEndTime != null and reqVO.endEndTime != null'>",
"AND DATE_FORMAT(c.end_time,'%Y-%m-%d 23:59:59') between #{reqVO.beginEndTime} and #{reqVO.endEndTime} ",
"AND <![CDATA[ ( (DATE_FORMAT(c.end_time,'%Y-%m-%d 23:59:59') between #{reqVO.beginEndTime} and #{reqVO.endEndTime}) or (now() <= #{reqVO.endEndTime} and c.end_time is null) ) ]]> ",
"</when>",
" <when test='reqVO.beginCreateTime != null' >",
......
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