feat(stock): 添加供应商信息并优化查询功能

- 在多个 BO 和 DTO 中添加供应商 ID、编号和名称字段
- 更新查询接口和 Excel 导出模型,支持供应商信息展示
- 在查询 SQL 中添加供应商 ID 条件,支持按供应商筛选
This commit is contained in:
lijiaqi 2024-11-25 13:12:12 +08:00
parent f8e573162e
commit 3ff9f82a49
12 changed files with 208 additions and 22 deletions

View File

@ -1,21 +1,21 @@
package com.lframework.xingyun.sc.bo.stock.product; package com.lframework.xingyun.sc.bo.stock.product;
import com.lframework.starter.common.utils.NumberUtil; import com.lframework.starter.common.utils.NumberUtil;
import com.lframework.starter.common.utils.ObjectUtil;
import com.lframework.starter.web.bo.BaseBo; import com.lframework.starter.web.bo.BaseBo;
import com.lframework.starter.web.common.utils.ApplicationUtil; import com.lframework.starter.web.common.utils.ApplicationUtil;
import com.lframework.xingyun.basedata.entity.Product; import com.lframework.xingyun.basedata.entity.*;
import com.lframework.xingyun.basedata.entity.ProductBrand;
import com.lframework.xingyun.basedata.entity.ProductCategory;
import com.lframework.xingyun.basedata.entity.StoreCenter;
import com.lframework.xingyun.basedata.service.product.ProductBrandService; import com.lframework.xingyun.basedata.service.product.ProductBrandService;
import com.lframework.xingyun.basedata.service.product.ProductCategoryService; import com.lframework.xingyun.basedata.service.product.ProductCategoryService;
import com.lframework.xingyun.basedata.service.product.ProductService; import com.lframework.xingyun.basedata.service.product.ProductService;
import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService; import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService;
import com.lframework.xingyun.basedata.service.supplier.SupplierService;
import com.lframework.xingyun.sc.entity.ProductStock; import com.lframework.xingyun.sc.entity.ProductStock;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
@Data @Data
public class QueryProductStockBo extends BaseBo<ProductStock> { public class QueryProductStockBo extends BaseBo<ProductStock> {
@ -91,6 +91,24 @@ public class QueryProductStockBo extends BaseBo<ProductStock> {
@ApiModelProperty("含税金额") @ApiModelProperty("含税金额")
private BigDecimal taxAmount; private BigDecimal taxAmount;
/**
* 供应商id
*/
@ApiModelProperty("供应商id")
private String supplierId;
/**
* 供应商编号
*/
@ApiModelProperty("供应商编号")
private String supplierCode;
/**
* 供应商名称
*/
@ApiModelProperty("供应商名称")
private String supplierName;
public QueryProductStockBo() { public QueryProductStockBo() {
} }
@ -118,6 +136,9 @@ public class QueryProductStockBo extends BaseBo<ProductStock> {
ProductBrandService productBrandService = ApplicationUtil.getBean(ProductBrandService.class); ProductBrandService productBrandService = ApplicationUtil.getBean(ProductBrandService.class);
ProductBrand productBrand = productBrandService.findById(product.getBrandId()); ProductBrand productBrand = productBrandService.findById(product.getBrandId());
SupplierService supplierService = ApplicationUtil.getBean(SupplierService.class);
Supplier supplier = supplierService.findById(product.getSupplierId());
this.productCode = product.getCode(); this.productCode = product.getCode();
this.productName = product.getName(); this.productName = product.getName();
this.categoryName = productCategory.getName(); this.categoryName = productCategory.getName();
@ -125,5 +146,10 @@ public class QueryProductStockBo extends BaseBo<ProductStock> {
this.taxPrice = NumberUtil.getNumber(dto.getTaxPrice(), 2); this.taxPrice = NumberUtil.getNumber(dto.getTaxPrice(), 2);
this.taxAmount = NumberUtil.getNumber(dto.getTaxAmount(), 2); this.taxAmount = NumberUtil.getNumber(dto.getTaxAmount(), 2);
if (ObjectUtil.isNotNull(supplier)) {
this.supplierCode = supplier.getCode();
this.supplierName = supplier.getName();
this.supplierId = supplier.getId();
}
} }
} }

View File

@ -3,16 +3,15 @@ package com.lframework.xingyun.sc.bo.stock.product.log;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.lframework.starter.common.constants.StringPool; import com.lframework.starter.common.constants.StringPool;
import com.lframework.starter.common.utils.NumberUtil; import com.lframework.starter.common.utils.NumberUtil;
import com.lframework.starter.common.utils.ObjectUtil;
import com.lframework.starter.web.bo.BaseBo; import com.lframework.starter.web.bo.BaseBo;
import com.lframework.starter.web.common.utils.ApplicationUtil; import com.lframework.starter.web.common.utils.ApplicationUtil;
import com.lframework.xingyun.basedata.entity.Product; import com.lframework.xingyun.basedata.entity.*;
import com.lframework.xingyun.basedata.entity.ProductBrand;
import com.lframework.xingyun.basedata.entity.ProductCategory;
import com.lframework.xingyun.basedata.entity.StoreCenter;
import com.lframework.xingyun.basedata.service.product.ProductBrandService; import com.lframework.xingyun.basedata.service.product.ProductBrandService;
import com.lframework.xingyun.basedata.service.product.ProductCategoryService; import com.lframework.xingyun.basedata.service.product.ProductCategoryService;
import com.lframework.xingyun.basedata.service.product.ProductService; import com.lframework.xingyun.basedata.service.product.ProductService;
import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService; import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService;
import com.lframework.xingyun.basedata.service.supplier.SupplierService;
import com.lframework.xingyun.sc.entity.ProductStockLog; import com.lframework.xingyun.sc.entity.ProductStockLog;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -143,6 +142,24 @@ public class QueryProductStockLogBo extends BaseBo<ProductStockLog> {
@ApiModelProperty("业务类型") @ApiModelProperty("业务类型")
private Integer bizType; private Integer bizType;
/**
* 供应商id
*/
@ApiModelProperty("供应商id")
private String supplierId;
/**
* 供应商编号
*/
@ApiModelProperty("供应商编号")
private String supplierCode;
/**
* 供应商名称
*/
@ApiModelProperty("供应商名称")
private String supplierName;
public QueryProductStockLogBo() { public QueryProductStockLogBo() {
} }
@ -176,6 +193,9 @@ public class QueryProductStockLogBo extends BaseBo<ProductStockLog> {
ProductBrandService productBrandService = ApplicationUtil.getBean(ProductBrandService.class); ProductBrandService productBrandService = ApplicationUtil.getBean(ProductBrandService.class);
ProductBrand productBrand = productBrandService.findById(product.getBrandId()); ProductBrand productBrand = productBrandService.findById(product.getBrandId());
SupplierService supplierService = ApplicationUtil.getBean(SupplierService.class);
Supplier supplier = supplierService.findById(product.getSupplierId());
this.productCode = product.getCode(); this.productCode = product.getCode();
this.productName = product.getName(); this.productName = product.getName();
this.categoryName = productCategory.getName(); this.categoryName = productCategory.getName();
@ -186,5 +206,11 @@ public class QueryProductStockLogBo extends BaseBo<ProductStockLog> {
this.taxAmount = NumberUtil.getNumber(dto.getTaxAmount(), 2); this.taxAmount = NumberUtil.getNumber(dto.getTaxAmount(), 2);
this.bizType = dto.getBizType().getCode(); this.bizType = dto.getBizType().getCode();
if (ObjectUtil.isNotNull(supplier)) {
this.supplierCode = supplier.getCode();
this.supplierName = supplier.getName();
this.supplierId = supplier.getId();
}
} }
} }

View File

@ -3,18 +3,17 @@ package com.lframework.xingyun.sc.bo.stock.transfer;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.lframework.starter.common.constants.StringPool; import com.lframework.starter.common.constants.StringPool;
import com.lframework.starter.common.utils.ObjectUtil;
import com.lframework.starter.common.utils.StringUtil; import com.lframework.starter.common.utils.StringUtil;
import com.lframework.starter.web.bo.BaseBo; import com.lframework.starter.web.bo.BaseBo;
import com.lframework.starter.web.common.utils.ApplicationUtil; import com.lframework.starter.web.common.utils.ApplicationUtil;
import com.lframework.starter.web.utils.EnumUtil; import com.lframework.starter.web.utils.EnumUtil;
import com.lframework.xingyun.basedata.entity.Product; import com.lframework.xingyun.basedata.entity.*;
import com.lframework.xingyun.basedata.entity.ProductBrand;
import com.lframework.xingyun.basedata.entity.ProductCategory;
import com.lframework.xingyun.basedata.entity.StoreCenter;
import com.lframework.xingyun.basedata.service.product.ProductBrandService; import com.lframework.xingyun.basedata.service.product.ProductBrandService;
import com.lframework.xingyun.basedata.service.product.ProductCategoryService; import com.lframework.xingyun.basedata.service.product.ProductCategoryService;
import com.lframework.xingyun.basedata.service.product.ProductService; import com.lframework.xingyun.basedata.service.product.ProductService;
import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService; import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService;
import com.lframework.xingyun.basedata.service.supplier.SupplierService;
import com.lframework.xingyun.sc.dto.stock.transfer.ScTransferOrderFullDto; import com.lframework.xingyun.sc.dto.stock.transfer.ScTransferOrderFullDto;
import com.lframework.xingyun.sc.entity.ProductStock; import com.lframework.xingyun.sc.entity.ProductStock;
import com.lframework.xingyun.sc.enums.ScTransferOrderStatus; import com.lframework.xingyun.sc.enums.ScTransferOrderStatus;
@ -268,6 +267,24 @@ public class ScTransferOrderFullBo extends BaseBo<ScTransferOrderFullDto> {
@ApiModelProperty(hidden = true) @ApiModelProperty(hidden = true)
private Integer status; private Integer status;
/**
* 供应商id
*/
@ApiModelProperty("供应商id")
private String supplierId;
/**
* 供应商编号
*/
@ApiModelProperty("供应商编号")
private String supplierCode;
/**
* 供应商名称
*/
@ApiModelProperty("供应商名称")
private String supplierName;
public DetailBo(ScTransferOrderFullDto.DetailDto dto, String scId, Integer status) { public DetailBo(ScTransferOrderFullDto.DetailDto dto, String scId, Integer status) {
this.scId = scId; this.scId = scId;
@ -314,6 +331,15 @@ public class ScTransferOrderFullBo extends BaseBo<ScTransferOrderFullDto> {
this.scId); this.scId);
this.curStockNum = productStock == null ? 0 : productStock.getStockNum(); this.curStockNum = productStock == null ? 0 : productStock.getStockNum();
} }
SupplierService supplierService = ApplicationUtil.getBean(SupplierService.class);
Supplier supplier = supplierService.findById(product.getSupplierId());
if (ObjectUtil.isNotNull(supplier)) {
this.supplierCode = supplier.getCode();
this.supplierName = supplier.getName();
this.supplierId = supplier.getId();
}
} }
} }
} }

View File

@ -79,6 +79,25 @@ public class ScTransferProductBo extends BaseBo<ScTransferProductDto> {
@ApiModelProperty(hidden = true) @ApiModelProperty(hidden = true)
private String scId; private String scId;
/**
* 供应商id
*/
@ApiModelProperty("供应商id")
private String supplierId;
/**
* 供应商编号
*/
@ApiModelProperty("供应商编号")
private String supplierCode;
/**
* 供应商名称
*/
@ApiModelProperty("供应商名称")
private String supplierName;
public ScTransferProductBo() { public ScTransferProductBo() {
} }
@ -101,5 +120,8 @@ public class ScTransferProductBo extends BaseBo<ScTransferProductDto> {
ProductStock productStock = productStockService.getByProductIdAndScId(dto.getId(), ProductStock productStock = productStockService.getByProductIdAndScId(dto.getId(),
this.scId); this.scId);
this.curStockNum = productStock == null ? 0 : productStock.getStockNum(); this.curStockNum = productStock == null ? 0 : productStock.getStockNum();
this.supplierId = dto.getSupplierId();
this.supplierCode = dto.getSupplierCode();
this.supplierName = dto.getSupplierName();
} }
} }

View File

@ -2,6 +2,8 @@ package com.lframework.xingyun.sc.dto.stock.transfer;
import com.lframework.starter.web.dto.BaseDto; import com.lframework.starter.web.dto.BaseDto;
import java.io.Serializable; import java.io.Serializable;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@Data @Data
@ -68,4 +70,20 @@ public class ScTransferProductDto implements BaseDto, Serializable {
* 当前库存数量 * 当前库存数量
*/ */
private Integer curStockNum; private Integer curStockNum;
/**
* 供应商id
*/
private String supplierId;
/**
* 供应商编号
*/
private String supplierCode;
/**
* 供应商名称
*/
private String supplierName;
} }

View File

@ -2,19 +2,20 @@ package com.lframework.xingyun.sc.excel.stock;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.lframework.starter.common.utils.NumberUtil; import com.lframework.starter.common.utils.NumberUtil;
import com.lframework.starter.common.utils.ObjectUtil;
import com.lframework.starter.web.bo.BaseBo; import com.lframework.starter.web.bo.BaseBo;
import com.lframework.starter.web.common.utils.ApplicationUtil; import com.lframework.starter.web.common.utils.ApplicationUtil;
import com.lframework.starter.web.components.excel.ExcelModel; import com.lframework.starter.web.components.excel.ExcelModel;
import com.lframework.xingyun.basedata.entity.Product; import com.lframework.xingyun.basedata.entity.*;
import com.lframework.xingyun.basedata.entity.ProductBrand;
import com.lframework.xingyun.basedata.entity.ProductCategory;
import com.lframework.xingyun.basedata.entity.StoreCenter;
import com.lframework.xingyun.basedata.service.product.ProductBrandService; import com.lframework.xingyun.basedata.service.product.ProductBrandService;
import com.lframework.xingyun.basedata.service.product.ProductCategoryService; import com.lframework.xingyun.basedata.service.product.ProductCategoryService;
import com.lframework.xingyun.basedata.service.product.ProductService; import com.lframework.xingyun.basedata.service.product.ProductService;
import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService; import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService;
import com.lframework.xingyun.basedata.service.supplier.SupplierService;
import com.lframework.xingyun.sc.entity.ProductStock; import com.lframework.xingyun.sc.entity.ProductStock;
import java.math.BigDecimal; import java.math.BigDecimal;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@Data @Data
@ -74,6 +75,19 @@ public class ProductStockExportModel extends BaseBo<ProductStock> implements Exc
@ExcelProperty("含税金额") @ExcelProperty("含税金额")
private BigDecimal taxAmount; private BigDecimal taxAmount;
/**
* 供应商编号
*/
@ExcelProperty("供应商编号")
private String supplierCode;
/**
* 供应商名称
*/
@ExcelProperty("供应商名称")
private String supplierName;
public ProductStockExportModel() { public ProductStockExportModel() {
} }
@ -108,6 +122,9 @@ public class ProductStockExportModel extends BaseBo<ProductStock> implements Exc
ProductBrandService productBrandService = ApplicationUtil.getBean(ProductBrandService.class); ProductBrandService productBrandService = ApplicationUtil.getBean(ProductBrandService.class);
ProductBrand productBrand = productBrandService.findById(product.getBrandId()); ProductBrand productBrand = productBrandService.findById(product.getBrandId());
SupplierService supplierService = ApplicationUtil.getBean(SupplierService.class);
Supplier supplier = supplierService.findById(product.getSupplierId());
this.productCode = product.getCode(); this.productCode = product.getCode();
this.productName = product.getName(); this.productName = product.getName();
this.categoryName = productCategory.getName(); this.categoryName = productCategory.getName();
@ -116,5 +133,10 @@ public class ProductStockExportModel extends BaseBo<ProductStock> implements Exc
this.setStockNum(dto.getStockNum()); this.setStockNum(dto.getStockNum());
this.setTaxPrice(NumberUtil.getNumber(dto.getTaxPrice(), 2)); this.setTaxPrice(NumberUtil.getNumber(dto.getTaxPrice(), 2));
this.setTaxAmount(NumberUtil.getNumber(dto.getTaxAmount(), 2)); this.setTaxAmount(NumberUtil.getNumber(dto.getTaxAmount(), 2));
if (ObjectUtil.isNotNull(supplier)) {
this.supplierCode = supplier.getCode();
this.supplierName = supplier.getName();
}
} }
} }

View File

@ -5,17 +5,16 @@ import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.lframework.starter.common.constants.StringPool; import com.lframework.starter.common.constants.StringPool;
import com.lframework.starter.common.utils.DateUtil; import com.lframework.starter.common.utils.DateUtil;
import com.lframework.starter.common.utils.NumberUtil; import com.lframework.starter.common.utils.NumberUtil;
import com.lframework.starter.common.utils.ObjectUtil;
import com.lframework.starter.web.bo.BaseBo; import com.lframework.starter.web.bo.BaseBo;
import com.lframework.starter.web.common.utils.ApplicationUtil; import com.lframework.starter.web.common.utils.ApplicationUtil;
import com.lframework.starter.web.components.excel.ExcelModel; import com.lframework.starter.web.components.excel.ExcelModel;
import com.lframework.xingyun.basedata.entity.Product; import com.lframework.xingyun.basedata.entity.*;
import com.lframework.xingyun.basedata.entity.ProductBrand;
import com.lframework.xingyun.basedata.entity.ProductCategory;
import com.lframework.xingyun.basedata.entity.StoreCenter;
import com.lframework.xingyun.basedata.service.product.ProductBrandService; import com.lframework.xingyun.basedata.service.product.ProductBrandService;
import com.lframework.xingyun.basedata.service.product.ProductCategoryService; import com.lframework.xingyun.basedata.service.product.ProductCategoryService;
import com.lframework.xingyun.basedata.service.product.ProductService; import com.lframework.xingyun.basedata.service.product.ProductService;
import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService; import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService;
import com.lframework.xingyun.basedata.service.supplier.SupplierService;
import com.lframework.xingyun.sc.entity.ProductStockLog; import com.lframework.xingyun.sc.entity.ProductStockLog;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@ -121,6 +120,19 @@ public class ProductStockLogExportModel extends BaseBo<ProductStockLog> implemen
@ExcelProperty("业务类型") @ExcelProperty("业务类型")
private String bizType; private String bizType;
/**
* 供应商编号
*/
@ExcelProperty("供应商编号")
private String supplierCode;
/**
* 供应商名称
*/
@ExcelProperty("供应商名称")
private String supplierName;
public ProductStockLogExportModel() { public ProductStockLogExportModel() {
} }
@ -153,6 +165,9 @@ public class ProductStockLogExportModel extends BaseBo<ProductStockLog> implemen
ProductBrandService productBrandService = ApplicationUtil.getBean(ProductBrandService.class); ProductBrandService productBrandService = ApplicationUtil.getBean(ProductBrandService.class);
ProductBrand productBrand = productBrandService.findById(product.getBrandId()); ProductBrand productBrand = productBrandService.findById(product.getBrandId());
SupplierService supplierService = ApplicationUtil.getBean(SupplierService.class);
Supplier supplier = supplierService.findById(product.getSupplierId());
this.productCode = product.getCode(); this.productCode = product.getCode();
this.productName = product.getName(); this.productName = product.getName();
this.categoryName = productCategory.getName(); this.categoryName = productCategory.getName();
@ -168,5 +183,11 @@ public class ProductStockLogExportModel extends BaseBo<ProductStockLog> implemen
this.setCreateTime(DateUtil.toDate(dto.getCreateTime())); this.setCreateTime(DateUtil.toDate(dto.getCreateTime()));
this.setBizCode(dto.getBizCode()); this.setBizCode(dto.getBizCode());
this.setBizType(dto.getBizType().getDesc()); this.setBizType(dto.getBizType().getDesc());
if (ObjectUtil.isNotNull(supplier)) {
this.supplierCode = supplier.getCode();
this.supplierName = supplier.getName();
}
} }
} }

View File

@ -36,4 +36,10 @@ public class QueryProductStockVo extends SortPageVo {
*/ */
@ApiModelProperty("商品品牌ID") @ApiModelProperty("商品品牌ID")
private String brandId; private String brandId;
/**
* 供应商id
*/
@ApiModelProperty("供应商id")
private String supplierId;
} }

View File

@ -60,4 +60,10 @@ public class QueryProductStockLogVo extends SortPageVo {
@ApiModelProperty("业务类型") @ApiModelProperty("业务类型")
@IsEnum(message = "业务类型不存在!", enumClass = ProductStockBizType.class) @IsEnum(message = "业务类型不存在!", enumClass = ProductStockBizType.class)
private Integer bizType; private Integer bizType;
/**
* 供应商ID
*/
@ApiModelProperty("供应商ID")
private String supplierId;
} }

View File

@ -62,6 +62,9 @@
<if test="vo.categoryId != null and vo.categoryId != ''"> <if test="vo.categoryId != null and vo.categoryId != ''">
AND (g.category_id = #{vo.categoryId} OR FIND_IN_SET(#{vo.categoryId}, rm.path)) AND (g.category_id = #{vo.categoryId} OR FIND_IN_SET(#{vo.categoryId}, rm.path))
</if> </if>
<if test="vo.supplierId != null and vo.supplierId != ''">
AND g.supplier_id = #{vo.supplierId}
</if>
<if test="vo.createStartTime != null"> <if test="vo.createStartTime != null">
AND gsl.create_time >= #{vo.createStartTime} AND gsl.create_time >= #{vo.createStartTime}
</if> </if>

View File

@ -75,6 +75,9 @@
<if test="vo.categoryId != null and vo.categoryId != ''"> <if test="vo.categoryId != null and vo.categoryId != ''">
AND (g.category_id = #{vo.categoryId} OR FIND_IN_SET(#{vo.categoryId}, rm.path)) AND (g.category_id = #{vo.categoryId} OR FIND_IN_SET(#{vo.categoryId}, rm.path))
</if> </if>
<if test="vo.supplierId != null and vo.supplierId != ''">
AND g.supplier_id = #{vo.supplierId}
</if>
</if> </if>
</where> </where>
ORDER BY sc.code, g.code ORDER BY sc.code, g.code

View File

@ -37,6 +37,9 @@
<result column="external_code" property="externalCode"/> <result column="external_code" property="externalCode"/>
<result column="spec" property="spec"/> <result column="spec" property="spec"/>
<result column="unit" property="unit"/> <result column="unit" property="unit"/>
<result column="supplier_id" property="supplierId"/>
<result column="supplier_name" property="supplierName"/>
<result column="supplier_code" property="supplierCode"/>
</resultMap> </resultMap>
<sql id="ScTransferOrderDto_sql"> <sql id="ScTransferOrderDto_sql">
@ -83,12 +86,16 @@
g.sku_code, g.sku_code,
g.external_code, g.external_code,
g.spec, g.spec,
g.unit g.unit,
g.supplier_id,
s.name AS supplier_name,
s.code AS supplier_code
FROM tbl_product_stock AS ps FROM tbl_product_stock AS ps
INNER JOIN base_data_product AS g ON g.id = ps.product_id AND g.product_type = 1 INNER JOIN base_data_product AS g ON g.id = ps.product_id AND g.product_type = 1
LEFT JOIN base_data_product_category AS c ON c.id = g.category_id LEFT JOIN base_data_product_category AS c ON c.id = g.category_id
LEFT JOIN base_data_product_brand AS b ON b.id = g.brand_id LEFT JOIN base_data_product_brand AS b ON b.id = g.brand_id
LEFT JOIN recursion_mapping AS rm ON rm.node_id = c.id and rm.node_type = 2 LEFT JOIN recursion_mapping AS rm ON rm.node_id = c.id and rm.node_type = 2
LEFT JOIN base_data_supplier AS s ON s.id = g.supplier_id
</sql> </sql>
<select id="query" resultType="com.lframework.xingyun.sc.entity.ScTransferOrder"> <select id="query" resultType="com.lframework.xingyun.sc.entity.ScTransferOrder">