Przeglądaj źródła

门店供应链物品管理/记录

zhangkaikai 1 rok temu
rodzic
commit
e2024b2ea7

+ 3 - 0
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/ChannelGoodsOrderMgrController.java

@@ -94,6 +94,7 @@ public class ChannelGoodsOrderMgrController extends BaseApiController {
         queryWrapper.ge(null != queryParam && null != queryParam.getStartTime(), "t1.created_time", queryParam.getStartTime());
         queryWrapper.le(null != queryParam && null != queryParam.getEndTime(), "t1.created_time", queryParam.getEndTime());
         queryWrapper.eq(null != queryParam && null != queryParam.getSupplierId(), "t3.supplier_id", queryParam.getSupplierId());
+        queryWrapper.eq(null != queryParam && null != queryParam.getChannelId(), "t4.channel_id", queryParam.getChannelId());
         queryWrapper.like(null != queryParam && StringUtils.isNotBlank(queryParam.getTitle()), "t2.title", queryParam.getTitle());
         queryWrapper.orderByDesc("t1.created_time", "t1.order_id");
         List<ChannelGoodsOrderVO> list = channelGoodsOrderService.selectChannelGoodsOrderVOList(queryWrapper);
@@ -212,6 +213,7 @@ public class ChannelGoodsOrderMgrController extends BaseApiController {
         queryWrapper.ge(null != queryParam && null != queryParam.getStartTime(), "t1.created_time", queryParam.getStartTime());
         queryWrapper.le(null != queryParam && null != queryParam.getEndTime(), "t1.created_time", queryParam.getEndTime());
         queryWrapper.eq(null != queryParam && null != queryParam.getSupplierId(), "t3.supplier_id", queryParam.getSupplierId());
+        queryWrapper.eq(null != queryParam && null != queryParam.getChannelId(), "t4.channel_id", queryParam.getChannelId());
         queryWrapper.like(null != queryParam && StringUtils.isNotBlank(queryParam.getTitle()), "t2.title", queryParam.getTitle());
         queryWrapper.orderByDesc("t1.created_time", "t1.order_id");
         int totalSize = channelGoodsOrderService.selectChannelGoodsOrderCount(queryWrapper);
@@ -275,6 +277,7 @@ public class ChannelGoodsOrderMgrController extends BaseApiController {
                             excel.setOrderNo(goodsOrderVO.getOrderId());
                             excel.setReceiver(goodsOrderVO.getReceiver());
                             excel.setTel(goodsOrderVO.getTel());
+                            excel.setMemo(goodsOrderVO.getMemo());
                             excelList.add(excel);
                         }
                     }

+ 6 - 3
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/ChannelGoodsSettleMgrController.java

@@ -3,15 +3,15 @@ package com.qs.mp.web.controller.api.admin;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.qs.mp.admin.domain.param.ChannelGoodsOrderQueryParam;
 import com.qs.mp.channel.domain.ChannelGoodsOrder;
-import com.qs.mp.channel.domain.vo.ChannelGoodsOrderSettleVO;
 import com.qs.mp.channel.domain.vo.ChannelGoodsSettleVO;
 import com.qs.mp.channel.service.IChannelGoodsOrderService;
 import com.qs.mp.channel.service.IChannelGoodsService;
-import com.qs.mp.common.core.domain.AjaxResult;
 import com.qs.mp.common.core.page.TableDataInfo;
 import com.qs.mp.web.controller.common.BaseApiController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -42,6 +42,9 @@ public class ChannelGoodsSettleMgrController extends BaseApiController {
     @PostMapping("/list")
     @ApiOperation(value = "门店库存结算列表")
     @PreAuthorize("@ss.hasPermi('business:goods:list')")
+    @ApiResponses(
+            @ApiResponse(code = 200, message = "成功", response = ChannelGoodsSettleVO.class)
+    )
     public TableDataInfo list(@RequestBody ChannelGoodsOrderQueryParam queryParam) {
         startPage();
         QueryWrapper<ChannelGoodsOrder> queryWrapper = new QueryWrapper<>();
@@ -58,7 +61,7 @@ public class ChannelGoodsSettleMgrController extends BaseApiController {
 
         List<ChannelGoodsSettleVO> channelGoodsOrderSettleVOS = channelGoodsOrderService.selectChannelGoodsSettleList(queryWrapper);
 
-        return getDataTable(new ArrayList<>());
+        return getDataTable(channelGoodsOrderSettleVOS);
     }
 
 

+ 2 - 0
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/GoodsMgrController.java

@@ -386,6 +386,8 @@ public class GoodsMgrController extends BaseApiController {
                 goods.setExchangePrice(firstGoodsSku.getExchangePrice());
                 goods.setValue(firstGoodsSku.getValue());
                 goods.setCost(firstGoodsSku.getCost());
+                goods.setPurchasePrice(firstGoodsSku.getPurchasePrice());
+                goods.setPurchaseCost(firstGoodsSku.getPurchaseCost());
                 goods.setDiscountRate(firstGoodsSku.getDiscountRate());
                 // 累计库存
                 int totalQuantity = skuList.stream().mapToInt(GoodsSku::getQuantity).sum();

+ 7 - 0
mp-admin/src/main/java/com/qs/mp/web/controller/api/channel/ChannelGoodsController.java

@@ -2,8 +2,10 @@ package com.qs.mp.web.controller.api.channel;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.qs.mp.admin.domain.Goods;
+import com.qs.mp.admin.domain.GoodsSku;
 import com.qs.mp.admin.domain.vo.GoodsVO;
 import com.qs.mp.admin.service.IGoodsService;
+import com.qs.mp.admin.service.IGoodsSkuService;
 import com.qs.mp.channel.domain.ChannelGoods;
 import com.qs.mp.channel.domain.param.SiteGoodsForChannelQueryParam;
 import com.qs.mp.channel.domain.param.SiteGoodsQueryParam;
@@ -43,6 +45,9 @@ public class ChannelGoodsController extends BaseApiController {
     @Autowired
     private IGoodsService goodsService;
 
+    @Autowired
+    private IGoodsSkuService goodsSkuService;
+
     @Autowired
     private IChannelGoodsService channelGoodsService;
 
@@ -74,7 +79,9 @@ public class ChannelGoodsController extends BaseApiController {
     )
     public AjaxResult siteGoodsDetail(@PathVariable("goodsId") Integer goodsId) {
         Goods goods = goodsService.getById(goodsId);
+        List<GoodsSku> skuList = goodsSkuService.list(new QueryWrapper<GoodsSku>().eq("goods_id", goodsId));
         GoodsVO goodsVO = mapperFacade.map(goods, GoodsVO.class);
+        goodsVO.setSkuList(skuList);
         return AjaxResult.success(goodsVO);
     }
 

+ 14 - 0
mp-admin/src/main/java/com/qs/mp/web/controller/api/channel/mall/ChannelGoodsOrderController.java

@@ -5,8 +5,10 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.qs.mp.admin.domain.Goods;
+import com.qs.mp.admin.domain.GoodsSku;
 import com.qs.mp.admin.domain.vo.ShippingTemplateCalculateVO;
 import com.qs.mp.admin.service.IGoodsService;
+import com.qs.mp.admin.service.IGoodsSkuService;
 import com.qs.mp.channel.domain.Channel;
 import com.qs.mp.channel.domain.ChannelGoods;
 import com.qs.mp.channel.domain.ChannelGoodsOrder;
@@ -91,6 +93,9 @@ public class ChannelGoodsOrderController extends BaseApiController {
     @Autowired
     private IGoodsService goodsService;
 
+    @Autowired
+    private IGoodsSkuService goodsSkuService;
+
     @Autowired
     private IDeliveryCompanyService deliveryCompanyService;
 
@@ -199,6 +204,7 @@ public class ChannelGoodsOrderController extends BaseApiController {
         }
 
         Goods goods = goodsService.getById(param.getGoodsId());
+        GoodsSku sku = goodsSkuService.getById(param.getSkuId());
 
         // 订单金额计算
         orderSettleVO.setGoodsId(goods.getGoodsId());
@@ -213,6 +219,14 @@ public class ChannelGoodsOrderController extends BaseApiController {
         channelGoods.setPicUrl(goods.getPicUrl());
         channelGoods.setPurchasePrice(goods.getPurchasePrice());
         channelGoods.setPurchaseCost(goods.getPurchaseCost());
+        if (Objects.nonNull(sku)) {
+            channelGoods.setSkuId(sku.getSkuId());
+            channelGoods.setProperties(sku.getProperties());
+            channelGoods.setPicUrl(sku.getPicUrl());
+            channelGoods.setPurchasePrice(sku.getPurchasePrice());
+            channelGoods.setPurchaseCost(sku.getPurchaseCost());
+            orderSettleVO.setOrderAmt(sku.getPurchasePrice() * param.getOrderNum());
+        }
         goodsList.add(channelGoods);
         orderSettleVO.setItems(goodsList);
 

+ 3 - 1
mp-common/src/main/java/com/qs/mp/common/enums/ChannelGoodsSettleStatusTypeEnum.java

@@ -16,7 +16,9 @@ public enum ChannelGoodsSettleStatusTypeEnum implements IEnum<Integer> {
 
     NO(1, "未结算"),
     FINISHED(2, "已结算"),
-    DOING(3, "结算中"),;
+    DOING(3, "结算中"),
+    Verify(4, "核销完成"),
+    ;
 
     private final Integer value;
     private final String desc;

+ 13 - 0
mp-service/src/main/java/com/qs/mp/admin/domain/GoodsSku.java

@@ -123,5 +123,18 @@ public class GoodsSku implements Serializable {
   @TableField("updated_time")
   private Date updatedTime;
 
+  /**
+   * 采购商品经销商进货价格
+   */
+  @ApiModelProperty("经销商进货价格")
+  @TableField("purchase_price")
+  private Integer purchasePrice;
+
+  /**
+   * 采购商品经销商采购成本
+   */
+  @ApiModelProperty("采购商品经销商采购成本")
+  @TableField("purchase_cost")
+  private Integer purchaseCost;
 
 }

+ 20 - 0
mp-service/src/main/java/com/qs/mp/channel/domain/ChannelGoods.java

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
 import com.baomidou.mybatisplus.annotation.*;
 import com.qs.mp.common.enums.ChannelGoodsSettleStatusTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 /**
@@ -107,6 +108,12 @@ public class ChannelGoods implements Serializable {
     @TableField("remain_qty")
     private Integer remainQty;
 
+    /**
+     * 结算库存
+     */
+    @TableField("settle_qty")
+    private Integer settleQty;
+
     /**
      * 结算状态,1未结算2已结算
      */
@@ -144,6 +151,19 @@ public class ChannelGoods implements Serializable {
     @TableField("sku_prop")
     private String skuProp;
 
+    /**
+     * skuID
+     */
+    @TableField("sku_id")
+    private Long skuId;
+
+    /**
+     * sku 属性
+     */
+    @TableField("properties")
+    @ApiModelProperty("sku 属性")
+    private String properties;
+
     /**
      * 逻辑删除标识
      */

+ 3 - 0
mp-service/src/main/java/com/qs/mp/channel/domain/excel/ChannelGoodsOrderExcel.java

@@ -41,4 +41,7 @@ public class ChannelGoodsOrderExcel {
 
     @Excel(name = "收货地址")
     private String address;
+
+    @Excel(name = "买家留言")
+    private String memo;
 }

+ 3 - 0
mp-service/src/main/java/com/qs/mp/channel/domain/param/ChannelGoodsOrderParam.java

@@ -15,6 +15,9 @@ public class ChannelGoodsOrderParam {
     @ApiModelProperty(value = "商品ID",required=false)
     private Long goodsId;
 
+    @ApiModelProperty("sku Id")
+    private Long skuId;
+
     @ApiModelProperty(value = "订单类型 3 采购商品",required = false)
     private Integer type;
 

+ 3 - 0
mp-service/src/main/java/com/qs/mp/channel/domain/vo/ChannelGoodsOrderVO.java

@@ -21,4 +21,7 @@ public class ChannelGoodsOrderVO extends ChannelGoodsOrder {
 
     @ApiModelProperty("供应商名称")
     private String supplierName;
+
+    @ApiModelProperty("门店名称")
+    private String channelName;
 }

+ 10 - 0
mp-service/src/main/java/com/qs/mp/channel/domain/vo/ChannelGoodsSettleVO.java

@@ -1,5 +1,9 @@
 package com.qs.mp.channel.domain.vo;
 
+import com.alibaba.fastjson.annotation.JSONField;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.qs.mp.common.enums.ChannelGoodsSettleStatusTypeEnum;
+import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -42,4 +46,10 @@ public class ChannelGoodsSettleVO {
     @ApiModelProperty("采购成本")
     private Integer purchaseCost;
 
+    @ApiModelProperty("结算库存")
+    private Integer settleQty;
+
+    @ApiModelProperty("状态 1未结算 2已结算 3已结算 4核销完成")
+    @JSONField(serialzeFeatures = SerializerFeature.WriteEnumUsingToString)
+    private ChannelGoodsSettleStatusTypeEnum status;
 }

+ 1 - 0
mp-service/src/main/java/com/qs/mp/channel/service/impl/ChannelCouponVerifyLogServiceImpl.java

@@ -117,6 +117,7 @@ public class ChannelCouponVerifyLogServiceImpl extends ServiceImpl<ChannelCoupon
       boolean rst = channelGoodsService.update(new LambdaUpdateWrapper<ChannelGoods>()
               .set(ChannelGoods::getRemainQty, channelGoods.getRemainQty() - 1)
               .set(ChannelGoods::getVerifyQty, channelGoods.getVerifyQty() + 1)
+              .set(channelGoods.getQuantity() == channelGoods.getVerifyQty() + 1,ChannelGoods::getStatus, ChannelGoodsSettleStatusTypeEnum.Verify)
               .eq(ChannelGoods::getId, channelGoods.getId()));
       Assert.isTrue(rst,"更新门店下铺设商品失败,channel_goods_id:" + channelGoods.getId());
     } else {

+ 59 - 20
mp-service/src/main/java/com/qs/mp/channel/service/impl/ChannelGoodsOrderServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.qs.mp.admin.domain.Goods;
+import com.qs.mp.admin.domain.GoodsSku;
 import com.qs.mp.admin.service.IGoodsService;
 import com.qs.mp.admin.service.IGoodsSkuService;
 import com.qs.mp.channel.domain.ChannelGoods;
@@ -36,6 +37,7 @@ import org.springframework.util.Assert;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * @auther quanshu
@@ -74,16 +76,16 @@ public class ChannelGoodsOrderServiceImpl extends ServiceImpl<ChannelGoodsOrderM
         String orderId = bizIdGenerator.newId();
         Goods goods = goodsService.getById(orderSettleVO.getGoodsId());
 
-        if (goods.getQuantity() < orderSettleVO.getOrderNum()) {
-            throw new ServiceException(goods.getTitle() + "库存不足,请重新下单");
-        }
-        // 更新库存
-        boolean updateGoods = goodsService.update(new LambdaUpdateWrapper<Goods>()
-                .set(goods.getQuantity() - orderSettleVO.getOrderNum() == 0, Goods::getStatus,
-                        GoodsStatusEnum.PUT_OFF)
-                .set(Goods::getQuantity, goods.getQuantity() - orderSettleVO.getOrderNum())
-                .eq(Goods::getGoodsId, goods.getGoodsId()).eq(Goods::getQuantity, goods.getQuantity()));
-        Assert.isTrue(updateGoods, "门店购买采购商品更新GOODS库存失败。goodsId:" + goods.getGoodsId());
+//        if (goods.getQuantity() < orderSettleVO.getOrderNum()) {
+//            throw new ServiceException(goods.getTitle() + "库存不足,请重新下单");
+//        }
+//        // 更新库存
+//        boolean updateGoods = goodsService.update(new LambdaUpdateWrapper<Goods>()
+//                .set(goods.getQuantity() - orderSettleVO.getOrderNum() == 0, Goods::getStatus,
+//                        GoodsStatusEnum.PUT_OFF)
+//                .set(Goods::getQuantity, goods.getQuantity() - orderSettleVO.getOrderNum())
+//                .eq(Goods::getGoodsId, goods.getGoodsId()).eq(Goods::getQuantity, goods.getQuantity()));
+//        Assert.isTrue(updateGoods, "门店购买采购商品更新GOODS库存失败。goodsId:" + goods.getGoodsId());
 
         // 创建订单
         ChannelGoodsOrder channelGoodsOrder = new ChannelGoodsOrder();
@@ -109,16 +111,49 @@ public class ChannelGoodsOrderServiceImpl extends ServiceImpl<ChannelGoodsOrderM
         channelGoodsOrderService.save(channelGoodsOrder);
 
         // 创建订单明细
-        ChannelGoodsOrderItem item = new ChannelGoodsOrderItem();
-        item.setChannelId(channelId);
-        item.setOrderId(orderId);
-        item.setGoodsId(goods.getGoodsId());
-
-        item.setTitle(goods.getTitle());
-        item.setGoodsNum(orderSettleVO.getOrderNum());
-        item.setPicUrl(goods.getPicUrl());
-        item.setSupplierId(goods.getSupplierId());
-        channelGoodsOrderItemService.save(item);
+        for (ChannelGoods channelGoods : orderSettleVO.getItems()) {
+            ChannelGoodsOrderItem item = new ChannelGoodsOrderItem();
+            item.setChannelId(channelId);
+            item.setOrderId(orderId);
+            item.setGoodsId(goods.getGoodsId());
+            item.setSkuId(channelGoods.getSkuId());
+            item.setProperties(channelGoods.getProperties());
+            item.setTitle(goods.getTitle());
+            item.setGoodsNum(channelGoods.getQuantity());
+            item.setPicUrl(goods.getPicUrl());
+            item.setSupplierId(goods.getSupplierId());
+            channelGoodsOrderItemService.save(item);
+
+            if (Objects.nonNull(channelGoods.getSkuId()) && channelGoods.getSkuId() != 0) {
+                GoodsSku goodsSku = goodsSkuService.getById(channelGoods.getSkuId());
+                if (goodsSku.getQuantity() < channelGoods.getQuantity()) {
+                    throw new ServiceException(channelGoods.getTitle() + "库存不足,请重新下单");
+                }
+
+                // 更新库存
+                boolean updateSku = goodsSkuService.update(new LambdaUpdateWrapper<GoodsSku>()
+                        .set(GoodsSku::getQuantity, goodsSku.getQuantity() - channelGoods.getQuantity())
+                        .set(GoodsSku::getSoldQty, goodsSku.getSoldQty() + channelGoods.getQuantity())
+                        .eq(GoodsSku::getSkuId, goodsSku.getSkuId())
+                        .eq(GoodsSku::getQuantity, goodsSku.getQuantity())
+                        .eq(GoodsSku::getSoldQty, goodsSku.getSoldQty()));
+                Assert.isTrue(updateSku,
+                        "门店购买采购商品更新SKU库存失败。goodsId:" + goodsSku.getGoodsId() + ",skuId:" + goodsSku.getSkuId());
+
+            } else {
+                if (goods.getQuantity() < channelGoods.getQuantity()) {
+                    throw new ServiceException(channelGoods.getTitle() + "库存不足,请重新下单");
+                }
+                // 更新库存
+                boolean updateGoods = goodsService.update(new LambdaUpdateWrapper<Goods>()
+                        .set(goods.getQuantity() - channelGoods.getQuantity() == 0, Goods::getStatus,
+                                GoodsStatusEnum.PUT_OFF)
+                        .set(Goods::getQuantity, goods.getQuantity() - channelGoods.getQuantity())
+                        .eq(Goods::getGoodsId, goods.getGoodsId())
+                        .eq(Goods::getQuantity, goods.getQuantity()));
+                Assert.isTrue(updateGoods, "门店购买采购商品更新GOODS库存失败。goodsId:" + goods.getGoodsId());
+            }
+        }
 
 
         return channelGoodsOrder.getOrderId();
@@ -194,6 +229,8 @@ public class ChannelGoodsOrderServiceImpl extends ServiceImpl<ChannelGoodsOrderM
             channelGoods.setChannelId(item.getChannelId());
             channelGoods.setGoodsId(item.getGoodsId());
             channelGoods.setOrderId(item.getOrderId());
+            channelGoods.setSkuId(item.getSkuId());
+            channelGoods.setProperties(item.getProperties());
             channelGoods.setTitle(item.getTitle());
             channelGoods.setPicUrl(item.getPicUrl());
             channelGoods.setStatus(ChannelGoodsSettleStatusTypeEnum.NO);
@@ -231,6 +268,8 @@ public class ChannelGoodsOrderServiceImpl extends ServiceImpl<ChannelGoodsOrderM
                 channelGoods.setChannelId(item.getChannelId());
                 channelGoods.setGoodsId(item.getGoodsId());
                 channelGoods.setOrderId(item.getOrderId());
+                channelGoods.setSkuId(item.getSkuId());
+                channelGoods.setProperties(item.getProperties());
                 channelGoods.setTitle(item.getTitle());
                 channelGoods.setPicUrl(item.getPicUrl());
                 channelGoods.setStatus(ChannelGoodsSettleStatusTypeEnum.NO);

+ 8 - 2
mp-service/src/main/resources/mapper/channel/ChannelGoodsOrderMapper.xml

@@ -35,10 +35,11 @@
         order_id, channel_id, title, order_amt, discount_amt, freight_amt, pay_amt, type, status, order_num, memo, receiver, tel, province, city, area, address, delivery_id, delivery_flow_id, delivery_time, confirm_time, pay_time, created_time, updated_time
     </sql>
     <select id="selectChannelGoodsOrderVOList" resultType="com.qs.mp.channel.domain.vo.ChannelGoodsOrderVO">
-        select DISTINCT t1.* , t3.name as supplierName
+        select DISTINCT t1.* , t3.name as supplierName,t4.name as channelName
         from mp_channel_goods_order t1
                  left join mp_channel_goods_order_item t2 on t1.order_id = t2.order_id
                  left join mp_supplier t3 on t2.supplier_id = t3.id
+                 left join mp_channel t4 on t1.channel_id = t4.channel_id
             ${ew.customSqlSegment}
     </select>
     <select id="selectChannelGoodsOrderCount" resultType="java.lang.Integer">
@@ -46,10 +47,15 @@
         from mp_channel_goods_order t1
                  left join mp_channel_goods_order_item t2 on t1.order_id = t2.order_id
                  left join mp_supplier t3 on t2.supplier_id = t3.id
+                 left join mp_channel t4 on t1.channel_id = t4.channel_id
             ${ew.customSqlSegment}
     </select>
     <select id="selectChannelGoodsSettleList" resultType="com.qs.mp.channel.domain.vo.ChannelGoodsSettleVO">
-
+        select t1.order_id,t1.created_time,t1.title,t2.name as channelName,t1.tel,t3.quantity,t3.verify_qty,t3.remain_qty,t3.purchase_cost,t3.settle_qty,t3.status
+        from mp_channel_goods_order t1
+        left join mp_channel t2 on t1.channel_id = t2.channel_id
+        left join mp_channel_goods t3 on t1.order_id = t3.order_id
+            ${ew.customSqlSegment}
     </select>
 
 </mapper>