Commit 4f7fd043 by 刘宇峰

修改商品查询条件

1 parent c90fa382
package cn.com.glsx.admin.modules.enums;
import com.glsx.plat.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum ShelvesStatusEnum implements BaseEnum<ShelvesStatusEnum, Integer> {
ON_SHELVES(1001, "上架"),
OFF_SHELVES(1002, "下架"),
;
private final Integer value;
private final String text;
@Override
public String getDisplayName() {
return text;
}
}
...@@ -61,6 +61,6 @@ public class BizOrderNotifyMessage implements Serializable { ...@@ -61,6 +61,6 @@ public class BizOrderNotifyMessage implements Serializable {
*/ */
private String reason; private String reason;
private Long time; private String time;
} }
package cn.com.glsx.admin.modules.model.cloudcrane.response; package cn.com.glsx.admin.modules.model.cloudcrane.response;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@Data @Data
public class GoodsSkuListItem { public class GoodsSkuListItem {
@Schema(description = "商品spu编码")
private String goodsCode; private String goodsCode;
@Schema(description = "商品Sku名称")
private String goodsSkuCode; private String goodsSkuCode;
@Schema(description = "商品Sku编码")
private String goodsSkuName; private String goodsSkuName;
@Schema(description = "商品销售价")
private Double sellPrice; private Double sellPrice;
@Schema(description = "商品起购数量")
private Integer startQty; private Integer startQty;
@Schema(description = "商品上下架状态")
private Integer shelvesStatus; private Integer shelvesStatus;
} }
package cn.com.glsx.admin.modules.model.cloudcrane.response; package cn.com.glsx.admin.modules.model.cloudcrane.response;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
/** /**
...@@ -13,9 +14,16 @@ import lombok.Data; ...@@ -13,9 +14,16 @@ import lombok.Data;
@Data @Data
public class GoodsSkuListSearchItem extends GoodsSkuListItem { public class GoodsSkuListSearchItem extends GoodsSkuListItem {
@Schema(description = "商品主图")
private String imgUrl; private String imgUrl;
@Schema(description = "商品库存状态")
private Integer stockStatus; private Integer stockStatus;
@Schema(description = "商品主图")
private Integer stockNum;
@Schema(description = "商品市场价")
private Double marketPrice; private Double marketPrice;
} }
...@@ -2,6 +2,8 @@ package cn.com.glsx.admin.modules.service; ...@@ -2,6 +2,8 @@ package cn.com.glsx.admin.modules.service;
import cn.com.glsx.admin.modules.converter.GoodsConverter; import cn.com.glsx.admin.modules.converter.GoodsConverter;
import cn.com.glsx.admin.modules.entity.*; import cn.com.glsx.admin.modules.entity.*;
import cn.com.glsx.admin.modules.enums.ShelvesStatusEnum;
import cn.com.glsx.admin.modules.enums.StockStatusEnum;
import cn.com.glsx.admin.modules.mapper.*; import cn.com.glsx.admin.modules.mapper.*;
import cn.com.glsx.admin.modules.model.cloudcrane.request.QueryGoodsListByConditionRequestDTO; import cn.com.glsx.admin.modules.model.cloudcrane.request.QueryGoodsListByConditionRequestDTO;
import cn.com.glsx.admin.modules.model.cloudcrane.request.QueryGoodsListRequest; import cn.com.glsx.admin.modules.model.cloudcrane.request.QueryGoodsListRequest;
...@@ -69,6 +71,11 @@ public class GoodsService { ...@@ -69,6 +71,11 @@ public class GoodsService {
*/ */
public PageInfo<GoodsSkuListSearchItem> queryGoodsListByCondition(QueryGoodsListByConditionRequestDTO req) { public PageInfo<GoodsSkuListSearchItem> queryGoodsListByCondition(QueryGoodsListByConditionRequestDTO req) {
Page<GoodsSkuListSearchItem> pages = PageHelper.startPage(req.getPageNum(), req.getPageSize()); Page<GoodsSkuListSearchItem> pages = PageHelper.startPage(req.getPageNum(), req.getPageSize());
//展示有库存且是上架状态的商品,过滤无库存和下架商品
req.setShelvesStatus(ShelvesStatusEnum.ON_SHELVES.getValue());
req.setStockStatus(StockStatusEnum.HAVE_STOCK.getValue());
goodsMapper.queryGoodsListByCondition(req); goodsMapper.queryGoodsListByCondition(req);
// cloudCraneService.queryGoodsListByCondition(req); // cloudCraneService.queryGoodsListByCondition(req);
return new PageInfo(pages); return new PageInfo(pages);
......
...@@ -18,6 +18,7 @@ import cn.com.glsx.admin.modules.model.cloudcrane.response.OrderChildOrderDetail ...@@ -18,6 +18,7 @@ import cn.com.glsx.admin.modules.model.cloudcrane.response.OrderChildOrderDetail
import cn.com.glsx.admin.modules.model.cloudcrane.response.OrderGoodsListItem; import cn.com.glsx.admin.modules.model.cloudcrane.response.OrderGoodsListItem;
import cn.com.glsx.admin.modules.model.cloudcrane.response.QueryOrderDetailResponse; import cn.com.glsx.admin.modules.model.cloudcrane.response.QueryOrderDetailResponse;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.glsx.plat.common.utils.DateUtils;
import com.glsx.plat.common.utils.SnowFlake; import com.glsx.plat.common.utils.SnowFlake;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.KafkaProducer;
...@@ -283,6 +284,7 @@ public class OrderChildService implements InitializingBean { ...@@ -283,6 +284,7 @@ public class OrderChildService implements InitializingBean {
.tparOrderCode(orderChild.getParentOrderCode()) .tparOrderCode(orderChild.getParentOrderCode())
.parentOrderCode(orderChild.getTparOrderCode()) .parentOrderCode(orderChild.getTparOrderCode())
.orderStatus(orderChild.getOrderStatus()) .orderStatus(orderChild.getOrderStatus())
.time(DateUtils.currentDateTime())
.build(); .build();
if (Objects.equals(OrderStatusEnum.WAIT_DELIVERY.getValue(), orderChild.getOrderStatus())) { if (Objects.equals(OrderStatusEnum.WAIT_DELIVERY.getValue(), orderChild.getOrderStatus())) {
...@@ -308,6 +310,7 @@ public class OrderChildService implements InitializingBean { ...@@ -308,6 +310,7 @@ public class OrderChildService implements InitializingBean {
.expressCode(orderLogistic.getExpressCode()) .expressCode(orderLogistic.getExpressCode())
.expressName(orderLogistic.getExpressName()) .expressName(orderLogistic.getExpressName())
.expressNumber(orderLogistic.getShipmentCode()) .expressNumber(orderLogistic.getShipmentCode())
.time(DateUtils.currentDateTime())
.build(); .build();
return message; return message;
} }
...@@ -321,6 +324,7 @@ public class OrderChildService implements InitializingBean { ...@@ -321,6 +324,7 @@ public class OrderChildService implements InitializingBean {
.tparReturnOrderCode(afterSalesOrder.getTparReturnOrderCode()) .tparReturnOrderCode(afterSalesOrder.getTparReturnOrderCode())
.returnOrderCode(afterSalesOrder.getReturnOrderCode()) .returnOrderCode(afterSalesOrder.getReturnOrderCode())
.returnOrderStatus(afterSalesOrder.getReturnStatus()) .returnOrderStatus(afterSalesOrder.getReturnStatus())
.time(DateUtils.currentDateTime())
.build(); .build();
return message; return message;
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.glsx.admin.modules.mapper.GoodsMapper"> <mapper namespace="cn.com.glsx.admin.modules.mapper.GoodsMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.admin.modules.entity.Goods"> <resultMap id="BaseResultMap" type="cn.com.glsx.admin.modules.entity.Goods">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="goods_code" jdbcType="VARCHAR" property="goodsCode" /> <result column="goods_code" jdbcType="VARCHAR" property="goodsCode"/>
<result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode" /> <result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/>
<result column="goods_sku_name" jdbcType="VARCHAR" property="goodsSkuName" /> <result column="goods_sku_name" jdbcType="VARCHAR" property="goodsSkuName"/>
<result column="goods_sku_title" jdbcType="VARCHAR" property="goodsSkuTitle" /> <result column="goods_sku_title" jdbcType="VARCHAR" property="goodsSkuTitle"/>
<result column="sell_price" jdbcType="DOUBLE" property="sellPrice" /> <result column="sell_price" jdbcType="DOUBLE" property="sellPrice"/>
<result column="market_price" jdbcType="DOUBLE" property="marketPrice" /> <result column="market_price" jdbcType="DOUBLE" property="marketPrice"/>
<result column="start_qty" jdbcType="INTEGER" property="startQty" /> <result column="start_qty" jdbcType="INTEGER" property="startQty"/>
<result column="shelves_status" jdbcType="INTEGER" property="shelvesStatus" /> <result column="shelves_status" jdbcType="INTEGER" property="shelvesStatus"/>
<result column="tax_code" jdbcType="VARCHAR" property="taxCode" /> <result column="tax_code" jdbcType="VARCHAR" property="taxCode"/>
<result column="tax_rate" jdbcType="REAL" property="taxRate" /> <result column="tax_rate" jdbcType="REAL" property="taxRate"/>
<result column="bar_code" jdbcType="VARCHAR" property="barCode" /> <result column="bar_code" jdbcType="VARCHAR" property="barCode"/>
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" /> <result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
<result column="brand_code" jdbcType="VARCHAR" property="brandCode" /> <result column="brand_code" jdbcType="VARCHAR" property="brandCode"/>
<result column="brand_name" jdbcType="VARCHAR" property="brandName" /> <result column="brand_name" jdbcType="VARCHAR" property="brandName"/>
<result column="first_category_code" jdbcType="VARCHAR" property="firstCategoryCode" /> <result column="first_category_code" jdbcType="VARCHAR" property="firstCategoryCode"/>
<result column="first_category_name" jdbcType="VARCHAR" property="firstCategoryName" /> <result column="first_category_name" jdbcType="VARCHAR" property="firstCategoryName"/>
<result column="second_category_code" jdbcType="VARCHAR" property="secondCategoryCode" /> <result column="second_category_code" jdbcType="VARCHAR" property="secondCategoryCode"/>
<result column="second_category_name" jdbcType="VARCHAR" property="secondCategoryName" /> <result column="second_category_name" jdbcType="VARCHAR" property="secondCategoryName"/>
<result column="last_category_code" jdbcType="VARCHAR" property="lastCategoryCode" /> <result column="last_category_code" jdbcType="VARCHAR" property="lastCategoryCode"/>
<result column="last_category_name" jdbcType="VARCHAR" property="lastCategoryName" /> <result column="last_category_name" jdbcType="VARCHAR" property="lastCategoryName"/>
<result column="return_goods_rules" jdbcType="INTEGER" property="returnGoodsRules" /> <result column="return_goods_rules" jdbcType="INTEGER" property="returnGoodsRules"/>
<result column="goods_characteristic" jdbcType="VARCHAR" property="goodsCharacteristic" /> <result column="goods_characteristic" jdbcType="VARCHAR" property="goodsCharacteristic"/>
<result column="goods_unit" jdbcType="VARCHAR" property="goodsUnit" /> <result column="goods_unit" jdbcType="VARCHAR" property="goodsUnit"/>
<result column="model_number" jdbcType="VARCHAR" property="modelNumber" /> <result column="model_number" jdbcType="VARCHAR" property="modelNumber"/>
<result column="product_place" jdbcType="VARCHAR" property="productPlace" /> <result column="product_place" jdbcType="VARCHAR" property="productPlace"/>
<result column="have_shelf_life" jdbcType="INTEGER" property="haveShelfLife" /> <result column="have_shelf_life" jdbcType="INTEGER" property="haveShelfLife"/>
<result column="shelf_life" jdbcType="VARCHAR" property="shelfLife" /> <result column="shelf_life" jdbcType="VARCHAR" property="shelfLife"/>
<result column="fragile_goods" jdbcType="INTEGER" property="fragileGoods" /> <result column="fragile_goods" jdbcType="INTEGER" property="fragileGoods"/>
<result column="gross_weight" jdbcType="DOUBLE" property="grossWeight" /> <result column="gross_weight" jdbcType="DOUBLE" property="grossWeight"/>
<result column="gross_weight_unit" jdbcType="VARCHAR" property="grossWeightUnit" /> <result column="gross_weight_unit" jdbcType="VARCHAR" property="grossWeightUnit"/>
<result column="density" jdbcType="DOUBLE" property="density" /> <result column="density" jdbcType="DOUBLE" property="density"/>
<result column="extent" jdbcType="INTEGER" property="extent" /> <result column="extent" jdbcType="INTEGER" property="extent"/>
<result column="width" jdbcType="INTEGER" property="width" /> <result column="width" jdbcType="INTEGER" property="width"/>
<result column="height" jdbcType="INTEGER" property="height" /> <result column="height" jdbcType="INTEGER" property="height"/>
<result column="del_flag" jdbcType="TINYINT" property="delFlag" /> <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate" /> <result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
<result column="created_by" jdbcType="INTEGER" property="createdBy" /> <result column="created_by" jdbcType="INTEGER" property="createdBy"/>
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate" /> <result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
<result column="updated_by" jdbcType="INTEGER" property="updatedBy" /> <result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
id, goods_code, goods_sku_code, goods_sku_name, goods_sku_title, sell_price, market_price, id, goods_code, goods_sku_code, goods_sku_name, goods_sku_title, sell_price, market_price,
start_qty, shelves_status, tax_code, tax_rate, bar_code, is_deleted, brand_code, start_qty, shelves_status, tax_code, tax_rate, bar_code, is_deleted, brand_code,
brand_name, first_category_code, first_category_name, second_category_code, second_category_name, brand_name, first_category_code, first_category_name, second_category_code, second_category_name,
last_category_code, last_category_name, return_goods_rules, goods_characteristic, last_category_code, last_category_name, return_goods_rules, goods_characteristic,
goods_unit, model_number, product_place, have_shelf_life, shelf_life, fragile_goods, goods_unit, model_number, product_place, have_shelf_life, shelf_life, fragile_goods,
gross_weight, gross_weight_unit, density, extent, width, height, del_flag, created_date, gross_weight, gross_weight_unit, density, extent, width, height, del_flag, created_date,
created_by, updated_date, updated_by created_by, updated_date, updated_by
</sql> </sql>
<resultMap id="GoodsDetailMap" extends="BaseResultMap" type="cn.com.glsx.admin.modules.entity.Goods"> <resultMap id="GoodsDetailMap" extends="BaseResultMap" type="cn.com.glsx.admin.modules.entity.Goods">
<association property="descDetail" javaType="cn.com.glsx.admin.modules.entity.GoodsDescDetail"> <association property="descDetail" javaType="cn.com.glsx.admin.modules.entity.GoodsDescDetail">
<id column="sgdd_id" javaType="LONG" property="id"/> <id column="sgdd_id" javaType="LONG" property="id"/>
<result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/> <result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/>
<result column="goods_describe" jdbcType="VARCHAR" property="goodsDescribe"/> <result column="goods_describe" jdbcType="VARCHAR" property="goodsDescribe"/>
</association> </association>
<association property="goodsStock" javaType="cn.com.glsx.admin.modules.entity.GoodsStock"> <association property="goodsStock" javaType="cn.com.glsx.admin.modules.entity.GoodsStock">
<id column="sgsk_id" javaType="LONG" property="id"/> <id column="sgsk_id" javaType="LONG" property="id"/>
<result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/> <result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/>
<result column="stock_status" jdbcType="INTEGER" property="stockStatus"/> <result column="stock_status" jdbcType="INTEGER" property="stockStatus"/>
<result column="stock_num" jdbcType="INTEGER" property="stockNum"/> <result column="stock_num" jdbcType="INTEGER" property="stockNum"/>
</association> </association>
<association property="goodsLimit" javaType="cn.com.glsx.admin.modules.entity.GoodsSaleLimit"> <association property="goodsLimit" javaType="cn.com.glsx.admin.modules.entity.GoodsSaleLimit">
<id column="sgsl_id" javaType="LONG" property="id"/> <id column="sgsl_id" javaType="LONG" property="id"/>
<result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/> <result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/>
<result column="sale_limit_type" jdbcType="INTEGER" property="saleLimitType"/> <result column="sale_limit_type" jdbcType="INTEGER" property="saleLimitType"/>
<result column="province_ids" jdbcType="VARCHAR" property="provinceIds"/> <result column="province_ids" jdbcType="VARCHAR" property="provinceIds"/>
<result column="city_ids" jdbcType="VARCHAR" property="cityIds"/> <result column="city_ids" jdbcType="VARCHAR" property="cityIds"/>
<result column="area_ids" jdbcType="VARCHAR" property="areaIds"/> <result column="area_ids" jdbcType="VARCHAR" property="areaIds"/>
</association> </association>
<collection property="specList" ofType="cn.com.glsx.admin.modules.entity.GoodsSpecification"> <collection property="specList" ofType="cn.com.glsx.admin.modules.entity.GoodsSpecification">
<id column="sgs_id" javaType="LONG" property="id"/> <id column="sgs_id" javaType="LONG" property="id"/>
<result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/> <result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/>
<result column="spec_name" jdbcType="VARCHAR" property="specName"/> <result column="spec_name" jdbcType="VARCHAR" property="specName"/>
<result column="spec_value" jdbcType="VARCHAR" property="specValue"/> <result column="spec_value" jdbcType="VARCHAR" property="specValue"/>
</collection> </collection>
<collection property="attributeList" ofType="cn.com.glsx.admin.modules.entity.GoodsAttribute"> <collection property="attributeList" ofType="cn.com.glsx.admin.modules.entity.GoodsAttribute">
<id column="sga_id" javaType="LONG" property="id"/> <id column="sga_id" javaType="LONG" property="id"/>
<result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/> <result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/>
<result column="attribute_code" jdbcType="VARCHAR" property="attributeCode"/> <result column="attribute_code" jdbcType="VARCHAR" property="attributeCode"/>
<result column="attribute_name" jdbcType="VARCHAR" property="attributeName"/> <result column="attribute_name" jdbcType="VARCHAR" property="attributeName"/>
<result column="attribute_value_code" jdbcType="VARCHAR" property="attributeValueCode"/> <result column="attribute_value_code" jdbcType="VARCHAR" property="attributeValueCode"/>
<result column="attribute_value_name" jdbcType="VARCHAR" property="attributeValueName"/> <result column="attribute_value_name" jdbcType="VARCHAR" property="attributeValueName"/>
</collection> </collection>
<collection property="goodsImageList" ofType="cn.com.glsx.admin.modules.entity.GoodsImage"> <collection property="goodsImageList" ofType="cn.com.glsx.admin.modules.entity.GoodsImage">
<id column="sgi_id" javaType="LONG" property="id"/> <id column="sgi_id" javaType="LONG" property="id"/>
<result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/> <result column="goods_sku_code" jdbcType="VARCHAR" property="goodsSkuCode"/>
<result column="img_url" jdbcType="VARCHAR" property="imgUrl"/> <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
<result column="img_main" jdbcType="INTEGER" property="imgMain"/> <result column="img_main" jdbcType="INTEGER" property="imgMain"/>
<result column="img_sort" jdbcType="INTEGER" property="imgSort"/> <result column="img_sort" jdbcType="INTEGER" property="imgSort"/>
</collection> </collection>
</resultMap> </resultMap>
<select id="queryGoodsList" resultType="cn.com.glsx.admin.modules.model.cloudcrane.response.GoodsSkuListItem"> <select id="queryGoodsList" resultType="cn.com.glsx.admin.modules.model.cloudcrane.response.GoodsSkuListItem">
select sg.goods_code,sg.goods_sku_code,sg.goods_sku_name,sg.sell_price,sg.start_qty,sg.shelves_status select sg.goods_code, sg.goods_sku_code, sg.goods_sku_name, sg.sell_price, sg.start_qty, sg.shelves_status
from shopmall_goods sg from shopmall_goods sg
where sg.del_flag = 0 where sg.del_flag = 0
</select> </select>
<select id="queryGoodsListByCondition" resultType="cn.com.glsx.admin.modules.model.cloudcrane.response.GoodsSkuListSearchItem"> <select id="queryGoodsListByCondition"
select sg.goods_code,sg.goods_sku_code,sg.goods_sku_name,sgi.img_url,sgs.stock_status,sg.sell_price,sg.market_price,sg.start_qty,sg.shelves_status resultType="cn.com.glsx.admin.modules.model.cloudcrane.response.GoodsSkuListSearchItem">
from shopmall_goods sg select
left join shopmall_goods_image sgi on sg.goods_sku_code = sgi.goods_sku_code and img_main=1 sg.goods_code,sg.goods_sku_code,sg.goods_sku_name,sgi.img_url,sgs.stock_status,sgs.stock_num,sg.sell_price,
left join shopmall_goods_stock sgs on sg.goods_sku_code = sgs.goods_sku_code sg.market_price,sg.start_qty,sg.shelves_status
left join shopmall_goods_sale_limit sgsl on sg.goods_sku_code = sgsl.goods_sku_code from shopmall_goods sg
where sg.del_flag = 0 left join shopmall_goods_image sgi on sg.goods_sku_code = sgi.goods_sku_code and img_main=1
<if test="goodsSkuCode != null and goodsSkuCode != ''"> left join shopmall_goods_stock sgs on sg.goods_sku_code = sgs.goods_sku_code
and sg.goods_sku_code = #{goodsSkuCode} left join shopmall_goods_sale_limit sgsl on sg.goods_sku_code = sgsl.goods_sku_code
</if> where sg.del_flag = 0
<if test="goodsSkuName != null and goodsSkuName != ''"> <if test="goodsSkuCode != null and goodsSkuCode != ''">
and sg.goods_sku_name like concat('%',#{goodsSkuName},'%') and sg.goods_sku_code = #{goodsSkuCode}
</if> </if>
<if test="brandCode != null and brandCode != ''"> <if test="goodsSkuName != null and goodsSkuName != ''">
and sg.brand_code = #{brandCode} and sg.goods_sku_name like concat('%',#{goodsSkuName},'%')
</if> </if>
<if test="categoryCode != null and categoryCode != ''"> <if test="brandCode != null and brandCode != ''">
and sg.last_category_code = #{categoryCode} and sg.brand_code = #{brandCode}
</if> </if>
<if test="startSellPrice != null"> <if test="categoryCode != null and categoryCode != ''">
and sg.sell_price &gt;= #{startSellPrice} and sg.last_category_code = #{categoryCode}
</if> </if>
<if test="endSellPrice != null"> <if test="startSellPrice != null">
and sg.sell_price &lt; #{endSellPrice} and sg.sell_price &gt;= #{startSellPrice}
</if> </if>
<if test="startMarketPrice != null"> <if test="endSellPrice != null">
and sg.market_price &gt;= #{startMarketPrice} and sg.sell_price &lt; #{endSellPrice}
</if> </if>
<if test="endMarketPrice != null"> <if test="startMarketPrice != null">
and sg.market_price &lt; #{endMarketPrice} and sg.market_price &gt;= #{startMarketPrice}
</if> </if>
<if test="startDiffPrice != null and endDiffPrice != null"> <if test="endMarketPrice != null">
and (sg.market_price-sg.sell_price) between #{startDiffPrice} and #{endDiffPrice} and sg.market_price &lt; #{endMarketPrice}
</if> </if>
<if test="shelvesStatus != null"> <if test="startDiffPrice != null and endDiffPrice != null">
and sg.shelves_status = #{shelvesStatus} and (sg.market_price-sg.sell_price) between #{startDiffPrice} and #{endDiffPrice}
</if> </if>
<if test="stockStatus != null"> <if test="shelvesStatus != null">
and sgs.stock_status = #{stockStatus} and sg.shelves_status = #{shelvesStatus}
</if> </if>
<if test="provinceId != null"> <if test="stockStatus != null">
and find_in_set(#{provinceId}, sgsl.province_ids) and sgs.stock_status = #{stockStatus}
</if> </if>
<if test="cityId != null"> <if test="provinceId != null">
and find_in_set(#{cityId}, sgsl.city_ids) and find_in_set(#{provinceId}, sgsl.province_ids)
</if> </if>
<if test="areaId != null"> <if test="cityId != null">
and find_in_set(#{areaId}, sgsl.area_ids) and find_in_set(#{cityId}, sgsl.city_ids)
</if> </if>
</select> <if test="areaId != null">
and find_in_set(#{areaId}, sgsl.area_ids)
</if>
<choose>
<when test="priceOrderType == 1">
order by sg.sell_price desc
</when>
<when test="priceOrderType == 2">
order by sg.sell_price asc
</when>
<otherwise>
</otherwise>
</choose>
</select>
<select id="queryGoodsDetail" resultMap="GoodsDetailMap"> <select id="queryGoodsDetail" resultMap="GoodsDetailMap">
select sg.id,sg.goods_code,sg.goods_sku_code,sg.goods_sku_name,sg.goods_sku_title,sg.sell_price,sg.market_price, select sg.id,sg.goods_code,sg.goods_sku_code,sg.goods_sku_name,sg.goods_sku_title,sg.sell_price,sg.market_price,
sg.start_qty,sg.shelves_status,sg.tax_code,sg.tax_rate,sg.bar_code,sg.is_deleted,sg.brand_code, sg.start_qty,sg.shelves_status,sg.tax_code,sg.tax_rate,sg.bar_code,sg.is_deleted,sg.brand_code,
sg.brand_name,sg.first_category_code,sg.first_category_name,sg.second_category_code,sg.second_category_name, sg.brand_name,sg.first_category_code,sg.first_category_name,sg.second_category_code,sg.second_category_name,
sg.last_category_code,sg.last_category_name,sg.return_goods_rules,sg.goods_characteristic,sg.goods_unit, sg.last_category_code,sg.last_category_name,sg.return_goods_rules,sg.goods_characteristic,sg.goods_unit,
...@@ -171,77 +185,81 @@ ...@@ -171,77 +185,81 @@
sgi.id sgi_id,sgi.img_url,sgi.img_main,sgi.img_sort, sgi.id sgi_id,sgi.img_url,sgi.img_main,sgi.img_sort,
sgs2.id sgsk_id,sgs2.stock_status,sgs2.stock_num, sgs2.id sgsk_id,sgs2.stock_status,sgs2.stock_num,
sgsl.id sgsl_id,sgsl.sale_limit_type,sgsl.province_ids,sgsl.city_ids,sgsl.area_ids sgsl.id sgsl_id,sgsl.sale_limit_type,sgsl.province_ids,sgsl.city_ids,sgsl.area_ids
from shopmall_goods sg from shopmall_goods sg
inner join shopmall_goods_desc_detail sgdd on sg.goods_sku_code=sgdd.goods_sku_code inner join shopmall_goods_desc_detail sgdd on sg.goods_sku_code=sgdd.goods_sku_code
inner join shopmall_goods_stock sgs2 on sg.goods_sku_code=sgs2.goods_sku_code inner join shopmall_goods_stock sgs2 on sg.goods_sku_code=sgs2.goods_sku_code
inner join shopmall_goods_sale_limit sgsl on sg.goods_sku_code=sgsl.goods_sku_code inner join shopmall_goods_sale_limit sgsl on sg.goods_sku_code=sgsl.goods_sku_code
left join shopmall_goods_specification sgs on sg.goods_sku_code=sgs.goods_sku_code left join shopmall_goods_specification sgs on sg.goods_sku_code=sgs.goods_sku_code
left join shopmall_goods_attribute sga on sg.goods_sku_code=sga.goods_sku_code left join shopmall_goods_attribute sga on sg.goods_sku_code=sga.goods_sku_code
left join shopmall_goods_image sgi on sg.goods_sku_code=sgi.goods_sku_code left join shopmall_goods_image sgi on sg.goods_sku_code=sgi.goods_sku_code
where sg.del_flag = 0 where sg.del_flag = 0
and sg.goods_sku_code in and sg.goods_sku_code in
<foreach collection="goodsSkuCodes" separator="," item="item" open="(" close=")"> <foreach collection="goodsSkuCodes" separator="," item="item" open="(" close=")">
#{item} #{item}
</foreach> </foreach>
</select> </select>
<select id="queryGoodsShelvesList" resultType="cn.com.glsx.admin.modules.model.cloudcrane.response.QueryGoodsShelvesListResponse"> <select id="queryGoodsShelvesList"
select sg.goods_sku_code,sg.shelves_status resultType="cn.com.glsx.admin.modules.model.cloudcrane.response.QueryGoodsShelvesListResponse">
from shopmall_goods sg select sg.goods_sku_code,sg.shelves_status
where sg.del_flag = 0 from shopmall_goods sg
and sg.goods_sku_code in where sg.del_flag = 0
<foreach collection="goodsSkuCodes" separator="," item="item" open="(" close=")"> and sg.goods_sku_code in
#{item} <foreach collection="goodsSkuCodes" separator="," item="item" open="(" close=")">
</foreach> #{item}
</select> </foreach>
</select>
<select id="queryGoodsPriceList" resultType="cn.com.glsx.admin.modules.model.cloudcrane.response.QueryGoodsPriceListResponse"> <select id="queryGoodsPriceList"
select sg.goods_sku_code,sg.sell_price,sg.market_price resultType="cn.com.glsx.admin.modules.model.cloudcrane.response.QueryGoodsPriceListResponse">
from shopmall_goods sg select sg.goods_sku_code,sg.sell_price,sg.market_price
where sg.del_flag = 0 from shopmall_goods sg
and sg.goods_sku_code in where sg.del_flag = 0
<foreach collection="goodsSkuCodes" separator="," item="item" open="(" close=")"> and sg.goods_sku_code in
#{item} <foreach collection="goodsSkuCodes" separator="," item="item" open="(" close=")">
</foreach> #{item}
</select> </foreach>
</select>
<select id="selectByGoodsSkuCodes" resultMap="BaseResultMap"> <select id="selectByGoodsSkuCodes" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from shopmall_goods sg from shopmall_goods sg
where sg.del_flag = 0 where sg.del_flag = 0
and sg.goods_sku_code in and sg.goods_sku_code in
<foreach collection="goodsSkuCodes" separator="," item="item" open="(" close=")"> <foreach collection="goodsSkuCodes" separator="," item="item" open="(" close=")">
#{item} #{item}
</foreach> </foreach>
</select> </select>
<insert id="insertOrUpdate"> <insert id="insertOrUpdate">
INSERT INTO shopmall_goods INSERT INTO shopmall_goods
(goods_code, goods_sku_code, goods_sku_name, goods_sku_title, sell_price, market_price, (goods_code, goods_sku_code, goods_sku_name, goods_sku_title, sell_price, market_price,
start_qty, shelves_status, tax_code, tax_rate, bar_code, is_deleted, brand_code, start_qty, shelves_status, tax_code, tax_rate, bar_code, is_deleted, brand_code,
brand_name, first_category_code, first_category_name, second_category_code, second_category_name, brand_name, first_category_code, first_category_name, second_category_code, second_category_name,
last_category_code, last_category_name, return_goods_rules, goods_characteristic, last_category_code, last_category_name, return_goods_rules, goods_characteristic,
goods_unit, model_number, product_place, have_shelf_life, shelf_life, fragile_goods, goods_unit, model_number, product_place, have_shelf_life, shelf_life, fragile_goods,
gross_weight, gross_weight_unit, density, extent, width, height, del_flag, created_date) gross_weight, gross_weight_unit, density, extent, width, height, del_flag, created_date)
VALUES (#{goodsCode}, #{goodsSkuCode}, #{goodsSkuName}, #{goodsSkuTitle}, #{sellPrice}, #{marketPrice}, VALUES (#{goodsCode}, #{goodsSkuCode}, #{goodsSkuName}, #{goodsSkuTitle}, #{sellPrice}, #{marketPrice},
#{startQty}, #{shelvesStatus}, #{taxCode}, #{taxRate}, #{barCode}, #{isDeleted}, #{brandCode}, #{brandName}, #{startQty}, #{shelvesStatus}, #{taxCode}, #{taxRate}, #{barCode}, #{isDeleted}, #{brandCode},
#{firstCategoryCode}, #{firstCategoryName}, #{secondCategoryCode}, #{secondCategoryName}, #{brandName},
#{lastCategoryCode}, #{lastCategoryCode}, #{firstCategoryCode}, #{firstCategoryName}, #{secondCategoryCode}, #{secondCategoryName},
#{returnGoodsRules}, #{goodsCharacteristic}, #{goodsUnit}, #{modelNumber}, #{productPlace}, #{lastCategoryCode}, #{lastCategoryCode},
#{haveShelfLife}, #{shelfLife}, #{fragileGoods}, #{returnGoodsRules}, #{goodsCharacteristic}, #{goodsUnit}, #{modelNumber}, #{productPlace},
#{grossWeight}, #{grossWeightUnit}, #{density}, #{extent}, #{width}, #{height}, 0, #{haveShelfLife}, #{shelfLife}, #{fragileGoods},
sysdate()) ON DUPLICATE KEY #{grossWeight}, #{grossWeightUnit}, #{density}, #{extent}, #{width}, #{height}, 0,
UPDATE sysdate()) ON DUPLICATE KEY
sell_price=#{sellPrice}, UPDATE
market_price=#{marketPrice}, sell_price=#{sellPrice},
updated_date=sysdate() market_price=#{marketPrice},
</insert> updated_date=sysdate()
</insert>
<select id="selectByGoodsSkuCode" resultMap="BaseResultMap"> <select id="selectByGoodsSkuCode" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> select
from shopmall_goods sg <include refid="Base_Column_List"/>
where sg.del_flag = 0 from shopmall_goods sg
and sg.goods_sku_code = #{goodsSkuCode} where sg.del_flag = 0
</select> and sg.goods_sku_code = #{goodsSkuCode}
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!