Commit cbcc37bd by 刘宇峰

添加搜索条件

1 parent 8fbbeee5
...@@ -73,4 +73,7 @@ public class QueryGoodsListByConditionRequestDTO implements Serializable { ...@@ -73,4 +73,7 @@ public class QueryGoodsListByConditionRequestDTO implements Serializable {
@Schema(description = "可售区Id") @Schema(description = "可售区Id")
private Integer areaId; private Integer areaId;
@Schema(description = "搜索关键词")
private String keywords;
} }
...@@ -30,4 +30,7 @@ public class GoodsSkuListSearchItem extends GoodsSkuListItem { ...@@ -30,4 +30,7 @@ public class GoodsSkuListSearchItem extends GoodsSkuListItem {
@Schema(description = "商品市场价") @Schema(description = "商品市场价")
private Double marketPrice; private Double marketPrice;
@Schema(description = "商品品牌")
private String brandName;
} }
...@@ -109,9 +109,9 @@ ...@@ -109,9 +109,9 @@
<select id="queryGoodsListByCondition" <select id="queryGoodsListByCondition"
resultType="cn.com.glsx.admin.modules.model.cloudcrane.response.GoodsSkuListSearchItem"> resultType="cn.com.glsx.admin.modules.model.cloudcrane.response.GoodsSkuListSearchItem">
select select sg.goods_code,sg.goods_sku_code,sg.goods_sku_name,sg.brand_code,sg.brand_name,
sg.goods_code,sg.goods_sku_code,sg.goods_sku_name,sgi.img_url,sgs.stock_status,sgs.stock_num,sg.sell_price, sgi.img_url,sgs.stock_status,sgs.stock_num,
sg.market_price,sg.start_qty,sg.shelves_status sg.sell_price,sg.market_price,sg.start_qty,sg.shelves_status
from shopmall_goods sg from shopmall_goods sg
left join shopmall_goods_image sgi on sg.goods_sku_code = sgi.goods_sku_code and img_main=1 left join shopmall_goods_image sgi on sg.goods_sku_code = sgi.goods_sku_code and img_main=1
left join shopmall_goods_stock sgs on sg.goods_sku_code = sgs.goods_sku_code left join shopmall_goods_stock sgs on sg.goods_sku_code = sgs.goods_sku_code
...@@ -159,6 +159,14 @@ ...@@ -159,6 +159,14 @@
<if test="areaId != null"> <if test="areaId != null">
and find_in_set(#{areaId}, sgsl.area_ids) and find_in_set(#{areaId}, sgsl.area_ids)
</if> </if>
<if test="keywords != null and keywords != ''">
and (
sg.goods_code like CONCAT('%',#{keywords},'%')
or sg.goods_sku_code like CONCAT('%',#{keywords},'%')
or sg.goods_sku_name like CONCAT('%',#{keywords},'%')
or sg.brand_code like CONCAT('%',#{keywords},'%')
)
</if>
<choose> <choose>
<when test="priceOrderType == 1"> <when test="priceOrderType == 1">
order by sg.sell_price desc order by sg.sell_price desc
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!