Browse Source

站点添加供应商条件查询

mssql
Yen 3 years ago
parent
commit
150a479ae6
  1. 24
      src/main/java/com/qs/serve/modules/bms/controller/BmsChannelPointController.java
  2. 3
      src/main/java/com/qs/serve/modules/bms/entity/BmsChannelPoint.java
  3. 5
      src/main/java/com/qs/serve/modules/bms/mapper/BmsChannelPointMapper.java
  4. 3
      src/main/java/com/qs/serve/modules/bms/service/BmsChannelPointService.java
  5. 5
      src/main/java/com/qs/serve/modules/bms/service/impl/BmsChannelPointServiceImpl.java
  6. 92
      src/main/resources/mapper/bms/BmsChannelPointMapper.xml

24
src/main/java/com/qs/serve/modules/bms/controller/BmsChannelPointController.java

@ -53,29 +53,7 @@ public class BmsChannelPointController {
@PreAuthorize("hasRole('bms:channelPoint:query')") @PreAuthorize("hasRole('bms:channelPoint:query')")
public R<PageVo<BmsChannelPoint>> getPage(BmsChannelPoint param){ public R<PageVo<BmsChannelPoint>> getPage(BmsChannelPoint param){
PageUtil.startPage(); PageUtil.startPage();
LambdaQueryWrapper<BmsChannelPoint> channelPointWrapper = new LambdaQueryWrapper<>(); List<BmsChannelPoint> list = bmsChannelPointService.selectChannelPointList(param);
if(StringUtils.hasText(param.getChannelName())){
channelPointWrapper.like(BmsChannelPoint::getChannelName,param.getChannelName());
}
if(StringUtils.hasText(param.getPointName())){
channelPointWrapper.like(BmsChannelPoint::getPointName,param.getPointName());
}
if(StringUtils.hasText(param.getPointCode())){
channelPointWrapper.like(BmsChannelPoint::getPointCode,param.getPointCode());
}
if(StringUtils.hasText(param.getBizRegionPath())){
channelPointWrapper.like(BmsChannelPoint::getBizRegionPath,param.getBizRegionPath());
}
if(StringUtils.hasText(param.getSaleRegionPath())){
channelPointWrapper.like(BmsChannelPoint::getSaleRegionPath,param.getSaleRegionPath());
}
if(StringUtils.hasText(param.getPointType())){
channelPointWrapper.eq(BmsChannelPoint::getPointType,param.getPointType());
}
if(StringUtils.hasText(param.getPointLevel())){
channelPointWrapper.eq(BmsChannelPoint::getPointLevel,param.getPointLevel());
}
List<BmsChannelPoint> list = bmsChannelPointService.list(channelPointWrapper);
for (BmsChannelPoint channelPoint : list) { for (BmsChannelPoint channelPoint : list) {
if(StringUtils.hasText(channelPoint.getBizRegionPath())){ if(StringUtils.hasText(channelPoint.getBizRegionPath())){
String[] bizRegions = channelPoint.getBizRegionPath().split("_"); String[] bizRegions = channelPoint.getBizRegionPath().split("_");

3
src/main/java/com/qs/serve/modules/bms/entity/BmsChannelPoint.java

@ -126,5 +126,8 @@ public class BmsChannelPoint implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String bizRegionName; private String bizRegionName;
@TableField(exist = false)
private String supplierId;
} }

5
src/main/java/com/qs/serve/modules/bms/mapper/BmsChannelPointMapper.java

@ -1,5 +1,7 @@
package com.qs.serve.modules.bms.mapper; package com.qs.serve.modules.bms.mapper;
import java.util.List;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qs.serve.modules.bms.entity.BmsChannelPoint; import com.qs.serve.modules.bms.entity.BmsChannelPoint;
@ -20,5 +22,8 @@ public interface BmsChannelPointMapper extends BaseMapper<BmsChannelPoint> {
@InterceptorIgnore(tenantLine = "1") @InterceptorIgnore(tenantLine = "1")
@Update("update bms_channel_point set biz_region_path = #{bizRegionPath} where biz_region_id = #{bizRegionId}") @Update("update bms_channel_point set biz_region_path = #{bizRegionPath} where biz_region_id = #{bizRegionId}")
int udpateBizRegionPathByBizRegionId(@Param("bizRegionPath") String bizRegionPath,String bizRegionId); int udpateBizRegionPathByBizRegionId(@Param("bizRegionPath") String bizRegionPath,String bizRegionId);
List<BmsChannelPoint> selectChannelPointList(@Param("query") BmsChannelPoint channelPoint);
} }

3
src/main/java/com/qs/serve/modules/bms/service/BmsChannelPointService.java

@ -3,6 +3,7 @@ package com.qs.serve.modules.bms.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.qs.serve.modules.bms.entity.BmsChannelPoint; import com.qs.serve.modules.bms.entity.BmsChannelPoint;
import com.qs.serve.modules.bms.entity.bo.BmsChannelPointBo; import com.qs.serve.modules.bms.entity.bo.BmsChannelPointBo;
import org.apache.ibatis.annotations.Param;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -16,6 +17,8 @@ public interface BmsChannelPointService extends IService<BmsChannelPoint> {
boolean modify(BmsChannelPointBo param); boolean modify(BmsChannelPointBo param);
List<BmsChannelPoint> selectChannelPointList(BmsChannelPoint channelPoint);
List<BmsChannelPoint> listByBizRegionId(String id); List<BmsChannelPoint> listByBizRegionId(String id);
List<BmsChannelPoint> listBySaleRegionId(String id); List<BmsChannelPoint> listBySaleRegionId(String id);

5
src/main/java/com/qs/serve/modules/bms/service/impl/BmsChannelPointServiceImpl.java

@ -59,6 +59,11 @@ public class BmsChannelPointServiceImpl extends ServiceImpl<BmsChannelPointMappe
return this.saveOrUpdate(channelPoint); return this.saveOrUpdate(channelPoint);
} }
@Override
public List<BmsChannelPoint> selectChannelPointList(BmsChannelPoint channelPoint) {
return baseMapper.selectChannelPointList(channelPoint);
}
@Override @Override
public List<BmsChannelPoint> listByBizRegionId(String id) { public List<BmsChannelPoint> listByBizRegionId(String id) {
LambdaQueryWrapper<BmsChannelPoint> channelPointWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<BmsChannelPoint> channelPointWrapper = new LambdaQueryWrapper<>();

92
src/main/resources/mapper/bms/BmsChannelPointMapper.xml

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qs.serve.modules.bms.mapper.BmsChannelPointMapper">
<resultMap id="bmsChannelPointMap" type="com.qs.serve.modules.bms.entity.BmsChannelPoint" >
<result property="id" column="id"/>
<result property="channelId" column="channel_id"/>
<result property="channelName" column="channel_name"/>
<result property="pointCode" column="point_code"/>
<result property="pointName" column="point_name"/>
<result property="shopArea" column="shop_area"/>
<result property="countCheckstand" column="count_checkstand"/>
<result property="pointLevel" column="point_level"/>
<result property="pointType" column="point_type"/>
<result property="address" column="address"/>
<result property="saleRegionId" column="sale_region_id"/>
<result property="saleRegionPath" column="sale_region_path"/>
<result property="saleRegionPathIds" column="sale_region_path_ids"/>
<result property="bizRegionId" column="biz_region_id"/>
<result property="bizRegionPath" column="biz_region_path"/>
<result property="bizRegionPathIds" column="biz_region_path_ids"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="tenantId" column="tenant_id"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
</resultMap>
<sql id="bmsChannelPointSql">
bms_channel_point.`id`,
bms_channel_point.`channel_id`,
bms_channel_point.`channel_name`,
bms_channel_point.`point_code`,
bms_channel_point.`point_name`,
bms_channel_point.`shop_area`,
bms_channel_point.`count_checkstand`,
bms_channel_point.`point_level`,
bms_channel_point.`point_type`,
bms_channel_point.`address`,
bms_channel_point.`sale_region_id`,
bms_channel_point.`sale_region_path`,
bms_channel_point.`sale_region_path_ids`,
bms_channel_point.`biz_region_id`,
bms_channel_point.`biz_region_path`,
bms_channel_point.`biz_region_path_ids`,
bms_channel_point.`remark`,
bms_channel_point.`create_time`,
bms_channel_point.`update_time`,
bms_channel_point.`tenant_id`,
bms_channel_point.`del_flag`,
bms_channel_point.`create_by`,
bms_channel_point.`update_by` </sql>
<select id="selectChannelPointList" parameterType="com.qs.serve.modules.bms.entity.BmsChannelPoint" resultMap="bmsChannelPointMap">
SELECT <include refid="bmsChannelPointSql"/>
FROM `bms_channel_point` `bms_channel_point`
<if test="query.supplierId!=null and query.supplierId!=''">
LEFT JOIN bms_supplier_channel ON bms_supplier_channel.`channel_id` = `bms_channel_point`.`channel_id`
</if>
<where>
<if test="query.supplierId!=null and query.supplierId!=''"> and bms_supplier_channel.`supplier_id` = #{query.supplierId} </if>
<if test="query.id != null"> and `bms_channel_point`.`id` = #{query.id}</if>
<if test="query.channelId != null"> and `bms_channel_point`.`channel_id` = #{query.channelId}</if>
<if test="query.channelName != null and query.channelName != ''"> and `bms_channel_point`.`channel_name` like concat('%',#{query.channelName},'%') </if>
<if test="query.pointCode != null and query.pointCode != ''"> and `bms_channel_point`.`point_code` like concat('%',#{query.pointCode},'%') </if>
<if test="query.pointName != null and query.pointName != ''"> and `bms_channel_point`.`point_name` like concat('%',#{query.pointName},'%') </if>
<if test="query.shopArea != null and query.shopArea != ''"> and `bms_channel_point`.`shop_area` = #{query.shopArea}</if>
<if test="query.countCheckstand != null"> and `bms_channel_point`.`count_checkstand` = #{query.countCheckstand}</if>
<if test="query.pointLevel != null and query.pointLevel != ''"> and `bms_channel_point`.`point_level` = #{query.pointLevel}</if>
<if test="query.pointType != null and query.pointType != ''"> and `bms_channel_point`.`point_type` like concat('%',#{query.pointType},'%') </if>
<if test="query.address != null and query.address != ''"> and `bms_channel_point`.`address` = #{query.address}</if>
<if test="query.saleRegionId != null and query.saleRegionId != ''"> and `bms_channel_point`.`sale_region_id` = #{query.saleRegionId}</if>
<if test="query.saleRegionPath != null and query.saleRegionPath != ''"> and `bms_channel_point`.`sale_region_path` like concat('%',#{query.saleRegionPath},'%') </if>
<if test="query.saleRegionPathIds != null and query.saleRegionPathIds != ''"> and `bms_channel_point`.`sale_region_path_ids` = #{query.saleRegionPathIds}</if>
<if test="query.bizRegionId != null and query.bizRegionId != ''"> and `bms_channel_point`.`biz_region_id` = #{query.bizRegionId}</if>
<if test="query.bizRegionPath != null and query.bizRegionPath != ''"> and `bms_channel_point`.`biz_region_path` like concat('%',#{query.bizRegionPath},'%') </if>
<if test="query.bizRegionPathIds != null and query.bizRegionPathIds != ''"> and `bms_channel_point`.`biz_region_path_ids` = #{query.bizRegionPathIds}</if>
<if test="query.remark != null and query.remark != ''"> and `bms_channel_point`.`remark` = #{query.remark}</if>
<if test="query.createTime != null"> and `bms_channel_point`.`create_time` = #{query.createTime}</if>
<if test="query.updateTime != null"> and `bms_channel_point`.`update_time` = #{query.updateTime}</if>
<if test="query.tenantId != null and query.tenantId != ''"> and `bms_channel_point`.`tenant_id` = #{query.tenantId}</if>
<if test="query.delFlag != null and query.delFlag != ''"> and `bms_channel_point`.`del_flag` = #{query.delFlag}</if>
<if test="query.createBy != null and query.createBy != ''"> and `bms_channel_point`.`create_by` = #{query.createBy}</if>
<if test="query.updateBy != null and query.updateBy != ''"> and `bms_channel_point`.`update_by` = #{query.updateBy}</if>
</where>
</select>
</mapper>
Loading…
Cancel
Save