Browse Source

添加客户查询条件

v1.0
15989082884@163.com 2 years ago
parent
commit
bd90f9f713
  1. 23
      src/main/java/com/qs/serve/modules/bms/controller/BmsSupplierController.java
  2. 2
      src/main/java/com/qs/serve/modules/bms/entity/BmsSupplier.java
  3. 22
      src/main/resources/mapper/bms/BmsSupplierMapper.xml

23
src/main/java/com/qs/serve/modules/bms/controller/BmsSupplierController.java

@ -119,6 +119,29 @@ public class BmsSupplierController {
PageUtil.setPageNum(param.getPageNum()+""); PageUtil.setPageNum(param.getPageNum()+"");
return supplierMyController.getUnderlingAndMinePage(param); return supplierMyController.getUnderlingAndMinePage(param);
} }
if(StringUtils.hasText(param.getRegion2Label())){
LambdaQueryWrapper<BmsRegion2> region2LambdaQueryWrapper = new LambdaQueryWrapper<>();
region2LambdaQueryWrapper.like(BmsRegion2::getPathNames,param.getRegion2Label());
List<BmsRegion2> region2List = bmsRegion2Service.list(region2LambdaQueryWrapper);
if(region2List.size()>0) {
param.setRegion2Ids(region2List.stream().map(a -> a.getId()).collect(Collectors.toList()));
}else{
param.setRegion2Ids(Arrays.asList("#"));
}
}
if(StringUtils.hasText(param.getRegionLabel())){
LambdaQueryWrapper<BmsRegion> regionLambdaQueryWrapper = new LambdaQueryWrapper<>();
regionLambdaQueryWrapper.like(BmsRegion::getPathNames,param.getRegionLabel());
List<BmsRegion> regionList = bmsRegionService.list(regionLambdaQueryWrapper);
if(regionList.size()>0) {
param.setRegionIds(regionList.stream().map(a -> a.getId()).collect(Collectors.toList()));
}else{
param.setRegion2Ids(Arrays.asList("#"));
}
}
PageHelper.startPage(param.getPageNum(),param.getPageSize()); PageHelper.startPage(param.getPageNum(),param.getPageSize());
List<BmsSupplier> list = bmsSupplierService.selectSupplierList(param); List<BmsSupplier> list = bmsSupplierService.selectSupplierList(param);
initSupplierList(list); initSupplierList(list);

2
src/main/java/com/qs/serve/modules/bms/entity/BmsSupplier.java

@ -166,7 +166,7 @@ public class BmsSupplier implements Serializable {
/** 多选:行政区域ID */ /** 多选:行政区域ID */
@TableField(exist = false) @TableField(exist = false)
private String[] region2Ids; private List<String> region2Ids;
/** 销售区域 */ /** 销售区域 */
@TableField(exist = false) @TableField(exist = false)

22
src/main/resources/mapper/bms/BmsSupplierMapper.xml

@ -87,7 +87,7 @@
<if test="query.pid != null"> and `bms_supplier`.`pid` = #{query.pid}</if> <if test="query.pid != null"> and `bms_supplier`.`pid` = #{query.pid}</if>
<if test="query.parentCode != null and query.parentCode != ''"> and `bms_supplier`.`parent_code` = #{query.parentCode}</if> <if test="query.parentCode != null and query.parentCode != ''"> and `bms_supplier`.`parent_code` = #{query.parentCode}</if>
<if test="query.stopFlag != null"> and `bms_supplier`.`stop_flag` = #{query.stopFlag}</if> <if test="query.stopFlag != null"> and `bms_supplier`.`stop_flag` = #{query.stopFlag}</if>
<if test="query.belong != null"> and `bms_supplier`.`belong` = #{query.belong}</if> <if test="query.belong != null and query.belong != ''"> and `bms_supplier`.`belong` = #{query.belong}</if>
<if test="query.createTime != null"> and `bms_supplier`.`create_time` = #{query.createTime}</if> <if test="query.createTime != null"> and `bms_supplier`.`create_time` = #{query.createTime}</if>
<if test="query.createBy != null and query.createBy != ''"> and `bms_supplier`.`create_by` = #{query.createBy}</if> <if test="query.createBy != null and query.createBy != ''"> and `bms_supplier`.`create_by` = #{query.createBy}</if>
<if test="query.updateTime != null"> and `bms_supplier`.`update_time` = #{query.updateTime}</if> <if test="query.updateTime != null"> and `bms_supplier`.`update_time` = #{query.updateTime}</if>
@ -111,10 +111,22 @@
#{selectId} #{selectId}
</foreach> </foreach>
</if> </if>
<if test='query.isRegionNull != null and query.isRegionNull == "1"'> <if test="query.region2Ids!=null and query.region2Ids.size > 0">
and (`bms_supplier`.`region_last` is null or TRIM(`bms_supplier`.`region_last`) = '' and bms_supplier.region2_last in
or `bms_supplier`.`region2_last` is null or TRIM(`bms_supplier`.`region2_last`) = '' <foreach collection="query.region2Ids" item ="selectId" index="i" open="(" close=")" separator=",">
) #{selectId}
</foreach>
</if>
<if test='query.isRegionNull != null '>
<if test=' query.isRegionNull == "1"'>
and (`bms_supplier`.`region_last` is null or TRIM(`bms_supplier`.`region_last`) = ''
or `bms_supplier`.`region2_last` is null or TRIM(`bms_supplier`.`region2_last`) = ''
)
</if>
<if test=' query.isRegionNull != "1"'>
and `bms_supplier`.`region_last` is not null and `bms_supplier`.`region2_last` is not null
and TRIM(`bms_supplier`.`region_last`) != '' and TRIM(`bms_supplier`.`region2_last`) != ''
</if>
</if> </if>
</where> </where>
ORDER BY `bms_supplier`.`update_time` DESC ORDER BY `bms_supplier`.`update_time` DESC

Loading…
Cancel
Save