1
0
Quellcode durchsuchen

伯仲需求:展示品牌查询相关改动,以及购物车相关改动

hyq vor 6 Jahren
Ursprung
Commit
7d62305fb6

+ 15 - 15
kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java

@@ -492,25 +492,25 @@ public class ApiCartController extends ApiBaseAction {
     @PostMapping("checked")
     public Object checked(@LoginUser UserVo loginUser) {
         JSONObject jsonParam = getJsonRequest();
-        String productIds = jsonParam.getString("productIds");
+        String goodsIds = jsonParam.getString("goodsIds");
         Integer isChecked = jsonParam.getInteger("isChecked");
         String goodsBizType = jsonParam.getString("goodsBizType");
         String checkCart = jsonParam.getString("checkCart");
-        String[] productIdArray = null;
+        String[] goodsIdArray = null;
         if(StringUtils.isNullOrEmpty(goodsBizType)) {
-            if (StringUtils.isNullOrEmpty(productIds)) {//点击全选时
+            if (StringUtils.isNullOrEmpty(goodsIds)) {//点击全选时
                 return this.toResponsFail("删除出错");
             }
-            productIdArray = productIds.split(",");
+            goodsIdArray = goodsIds.split(",");
         }else{
             //根据业务类型查询购物车
             List<CartVo> cartVoList = cartService.queryCartByGoodsBizType(goodsBizType);
-            productIdArray = new String[cartVoList.size()];
+            goodsIdArray = new String[cartVoList.size()];
             for (int i = 0;i< cartVoList.size();i++){
-                productIdArray[i] =cartVoList.get(i).getProduct_id()+"";
+                goodsIdArray[i] =cartVoList.get(i).getGoods_id()+"";
             }
         }
-        cartService.updateCheck(productIdArray, isChecked, loginUser.getId(), getStoreId());
+        cartService.updateCheck(goodsIdArray, isChecked, loginUser.getId(), getStoreId());
         return toResponsSuccess(getCart(checkCart));
     }
 
@@ -602,38 +602,38 @@ public class ApiCartController extends ApiBaseAction {
         for (CartVo vo: checkedGoodsList) {
             if(org.apache.commons.lang.StringUtils.isEmpty(checkCart)){
                 if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_00.getItem())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                     freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice00) : freightPrice00;
                 }
                 if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                     freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice02) : freightPrice02;
                 }
                 if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                     freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice10) : freightPrice10;
                 }
                 if (vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())) {
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                     freightPrice11 = freightEntity != null ? freightEntity.getDefaultFreight().add(freightPrice11) : freightPrice11;
                 }
             }else{
                 if(Dict.orderBizType.item_11.getItem().equalsIgnoreCase(checkCart)) {
                     if (vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())) {
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                         freightPrice11 = freightEntity != null ? freightEntity.getDefaultFreight().add(freightPrice11) : freightPrice11;
                     }
                 }else{
                     if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_00.getItem())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                         freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice00) : freightPrice00;
                     }
                     if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                         freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice02) : freightPrice02;
                     }
                     if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id(), getStoreId());
                         freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice10) : freightPrice10;
                     }
                 }

+ 14 - 1
kmall-api/src/main/java/com/kmall/api/api/ApiCatalogController.java

@@ -2,8 +2,10 @@ package com.kmall.api.api;
 
 import com.kmall.api.annotation.IgnoreAuth;
 import com.kmall.api.annotation.LoginUser;
+import com.kmall.api.entity.BrandVo;
 import com.kmall.api.entity.CategoryVo;
 import com.kmall.api.entity.UserVo;
+import com.kmall.api.service.ApiBrandService;
 import com.kmall.api.service.ApiCategoryService;
 import com.kmall.api.util.ApiBaseAction;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,6 +28,8 @@ import java.util.Map;
 public class ApiCatalogController extends ApiBaseAction {
     @Autowired
     private ApiCategoryService categoryService;
+    @Autowired
+    private ApiBrandService brandService;
 
     /**
      * 获取分类栏目数据
@@ -59,9 +63,13 @@ public class ApiCatalogController extends ApiBaseAction {
             params.put("parent_id", currentCategory.getId());
             currentCategory.setSubCategoryList(categoryService.queryListByParentId(params));
         }
-
         resultObj.put("categoryList", data);
         resultObj.put("currentCategory", currentCategory);
+        Map brandMap = new HashMap();
+        brandMap.put("categoryId", currentCategory.getId());
+        List<BrandVo> brandVoList = brandService.queryList(brandMap);
+
+        resultObj.put("brandList", brandVoList);
         return toResponsSuccess(resultObj);
     }
 
@@ -83,6 +91,11 @@ public class ApiCatalogController extends ApiBaseAction {
             currentCategory.setSubCategoryList(categoryService.queryList(params));
         }
         resultObj.put("currentCategory", currentCategory);
+        Map brandMap = new HashMap();
+        brandMap.put("categoryId", currentCategory.getId());
+        List<BrandVo> brandVoList = brandService.queryList(brandMap);
+
+        resultObj.put("brandList", brandVoList);
         return toResponsSuccess(resultObj);
     }
 }

+ 33 - 11
kmall-api/src/main/java/com/kmall/api/api/ApiGoodsController.java

@@ -210,7 +210,7 @@ public class ApiGoodsController extends ApiBaseAction {
         cartMap.put("goods_id",info.getId());
         List<CartVo> cartVoList = cartService.queryList(cartMap);
 
-        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(info.getId());
+        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(info.getId(), getStoreId());
         //
         resultObj.put("info", info);
 
@@ -291,6 +291,26 @@ public class ApiGoodsController extends ApiBaseAction {
     }
 
     /**
+     *  获取品牌下的商品
+     */
+    @IgnoreAuth
+    @GetMapping("brand")
+    public Object brand(@LoginUser UserVo loginUser, Integer id) {
+        Map<String, Object> resultObj = new HashMap();
+        //
+        BrandVo currentBrand = apiBrandService.queryObject(id);
+        //
+        CategoryVo parentCategory = categoryService.queryObject(currentBrand.getCategoryId());
+        Map params = new HashMap();
+        params.put("categoryId", currentBrand.getCategoryId());
+        List<BrandVo> brandList = apiBrandService.queryList(params);
+        //
+        resultObj.put("currentBrand", currentBrand);
+        resultObj.put("brandList", brandList);
+        return toResponsSuccess(resultObj);
+    }
+
+    /**
      *   获取商品列表
      */
     @GetMapping("list")
@@ -300,13 +320,15 @@ public class ApiGoodsController extends ApiBaseAction {
                                page, @RequestParam(value = "size", defaultValue = "10") Integer size,
                        String sort, String order) {
         Map params = new HashMap();
-        try{
-            keyword = new String(keyword.getBytes("iso-8859-1"),"utf-8");
-        }catch (Exception e){
-            logger.error("error:", e);
+        if(org.apache.commons.lang3.StringUtils.isNotEmpty(keyword)){
+            try{
+                keyword = new String(keyword.getBytes("iso-8859-1"),"utf-8");
+            }catch (Exception e){
+                logger.error("error:", e);
+            }
+            params.put("keyword", keyword);
         }
         params.put("brand_id", brandId);
-        params.put("keyword", keyword);
         params.put("is_new", isNew);
         params.put("is_hot", isHot);
         params.put("page", page);
@@ -341,7 +363,7 @@ public class ApiGoodsController extends ApiBaseAction {
         rootCategory.setChecked(false);
         filterCategory.add(rootCategory);
         //
-        params.put("fields", "a.category_id");
+        params.put("fields", "psr1.category_id");
         params.put("limit", 1);
         List<GoodsVo> goodsVoList = goodsService.queryList(params);
         params.put("limit", size);
@@ -412,15 +434,15 @@ public class ApiGoodsController extends ApiBaseAction {
         rootCategory.setChecked(false);
         filterCategory.add(rootCategory);
         //
-        params.put("fields", "a.category_id");
+        params.put("fields", "psr1.category_id");
         params.put("is_hot", "1");
         params.put("store_id", store_id);
 
-        List<GoodsVo> categoryEntityList = goodsService.queryList(params);
+        List<GoodsVo> goodsEntityList = goodsService.queryList(params);
         params.remove("fields");
-        if (null != categoryEntityList && categoryEntityList.size() > 0) {
+        if (null != goodsEntityList && goodsEntityList.size() > 0) {
             List<Integer> categoryIds = new ArrayList();
-            for (GoodsVo goodsVo : categoryEntityList) {
+            for (GoodsVo goodsVo : goodsEntityList) {
                 if (null == goodsVo || null == goodsVo.getCategory_id()) {
                     continue;
                 }

+ 1 - 1
kmall-api/src/main/java/com/kmall/api/dao/ApiCartMapper.java

@@ -15,7 +15,7 @@ import java.util.Map;
  */
 @Component
 public interface ApiCartMapper extends BaseDao<CartVo> {
-    void updateCheck(@Param("productIds") String[] productIds,
+    void updateCheck(@Param("goodsIds") String[] goodsIds,
                      @Param("isChecked") Integer isChecked, @Param("user_id") Long userId, @Param("store_id") Long store_id);
 
     void deleteByProductIds(@Param("productIds") String[] productIds, @Param("store_id") Long store_id);

+ 1 - 1
kmall-api/src/main/java/com/kmall/api/dao/ApiFreightMapper.java

@@ -14,6 +14,6 @@ import org.springframework.stereotype.Component;
  */
 @Component
 public interface ApiFreightMapper extends BaseDao<FreightEntity> {
-    FreightEntity queryObjectByGoodsId(@Param("goodsId") Long goodsId);
+    FreightEntity queryObjectByGoodsId(@Param("goodsId") Long goodsId,@Param("storeId")Long storeId);
 
 }

+ 10 - 0
kmall-api/src/main/java/com/kmall/api/entity/BrandVo.java

@@ -37,6 +37,16 @@ public class BrandVo implements Serializable {
     //排序
     private Integer new_sort_order;
 
+    private Integer categoryId;
+
+    public Integer getCategoryId() {
+        return categoryId;
+    }
+
+    public void setCategoryId(Integer categoryId) {
+        this.categoryId = categoryId;
+    }
+
     public Integer getId() {
         return id;
     }

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java

@@ -117,8 +117,8 @@ public class ApiCartService {
         cartDao.deleteBatch(ids);
     }
 
-    public void updateCheck(String[] productIds, Integer isChecked, Long userId, Long storeId) {
-        cartDao.updateCheck(productIds, isChecked, userId, storeId);
+    public void updateCheck(String[] goodsIds, Integer isChecked, Long userId, Long storeId) {
+        cartDao.updateCheck(goodsIds, isChecked, userId, storeId);
     }
 
     public void deleteByProductIds(String[] productIds, Long storeId) {

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/service/ApiFreightService.java

@@ -56,7 +56,7 @@ public class ApiFreightService {
     }
 
 
-    public FreightEntity queryObjectByGoodsId(Long id) {
-        return freightDao.queryObjectByGoodsId(id);
+    public FreightEntity queryObjectByGoodsId(Long id,Long storeId) {
+        return freightDao.queryObjectByGoodsId(id,storeId);
     }
 }

+ 8 - 8
kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java

@@ -231,45 +231,45 @@ public class ApiOrderService {
             //订单业务类型:00:保税备货, 02:保税展示补货,10:保税展示跨境,11:普通商品
             if(org.apache.commons.lang.StringUtils.isEmpty(checkCart)){
                 if(Dict.orderBizType.item_11.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                     freightPrice11 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice11) : freightPrice11;//查询商品运费信息
                     isBizType11 =true;
                 }
                 if(Dict.orderBizType.item_00.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                     freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice00) : freightPrice00;//查询商品运费信息
                     isBizType00 =true;
                 }
                 if(Dict.orderBizType.item_02.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                     freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice02) : freightPrice02;//查询商品运费信息
                     isBizType02 =true;
                 }
                 if(Dict.orderBizType.item_10.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                     freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice10) : freightPrice10;//查询商品运费信息
                     isBizType10 =true;
                 }
             }else{
                 if(checkCart.equalsIgnoreCase(Dict.orderBizType.item_11.getItem())){
                     if(Dict.orderBizType.item_11.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                         freightPrice11 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice11) : freightPrice11;//查询商品运费信息
                         isBizType11 =true;
                     }
                 }else{
                     if(Dict.orderBizType.item_00.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                         freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice00) : freightPrice00;//查询商品运费信息
                         isBizType00 =true;
                     }
                     if(Dict.orderBizType.item_02.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                         freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice02) : freightPrice02;//查询商品运费信息
                         isBizType02 =true;
                     }
                     if(Dict.orderBizType.item_10.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id(), storeId);
                         freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight().add(freightPrice10) : freightPrice10;//查询商品运费信息
                         isBizType10 =true;
                     }

+ 9 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiBrandMapper.xml

@@ -17,6 +17,7 @@
         <result property="is_new" column="is_new"/>
         <result property="new_pic_url" column="new_pic_url"/>
         <result property="new_sort_order" column="new_sort_order"/>
+        <result column="category_id" property="categoryId" />
     </resultMap>
 
     <select id="queryObject" resultMap="brandMap">
@@ -31,7 +32,14 @@
         <if test="fields == null or fields == ''">
             *
         </if>
-        from mall_brand
+        from mall_brand where 1=1
+        <if test="merchSn != null and merchSn.trim() != ''">
+            AND merch_sn = #{merchSn}
+        </if>
+        <if test="categoryId != null">
+            AND category_id = #{categoryId}
+        </if>
+
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}

+ 3 - 3
kmall-api/src/main/resources/mybatis/mapper/ApiCartMapper.xml

@@ -386,9 +386,9 @@
     <update id="updateCheck">
         update mall_cart
         set `checked` = #{isChecked}
-        where product_id in
-        <foreach item="product_id" collection="productIds" open="(" separator="," close=")">
-            #{product_id}
+        where goods_id in
+        <foreach item="goods_id" collection="goodsIds" open="(" separator="," close=")">
+            #{goods_id}
         </foreach>
         and user_id = #{user_id} and store_id = #{store_id}
     </update>

+ 1 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiFreightMapper.xml

@@ -24,7 +24,7 @@
 		where id = #{id}
 	</select>
 	<select id="queryObjectByGoodsId" resultType="com.kmall.api.entity.FreightEntity">
-		select f.* from mall_freight f  inner join mall_goods g on g.freight_id = f.id where g.id=#{goodsId}
+		select f.* from mall_freight f  inner join mall_product_store_rela g  on g.freight_id = f.id  where g.goods_id=#{goodsId} and g.store_id = #{storeId}
 	</select>
 
 	<select id="queryList" resultType="com.kmall.api.entity.FreightEntity">

+ 28 - 28
kmall-api/src/main/resources/mybatis/mapper/ApiGoodsMapper.xml

@@ -52,8 +52,8 @@
     </resultMap>
 
     <sql id="Base_Column_List" >
-        id, category_id, goods_sn, sku, goods_biz_type, name, brand_id, goods_number, keywords,
-        goods_brief, is_on_sale, add_time, sort_order, is_delete, attribute_category, counter_price,
+        id,  goods_sn, sku, goods_biz_type, name,  goods_number, keywords,
+        goods_brief, is_on_sale, add_time, sort_order, is_delete, counter_price,
         extra_price, is_new, goods_unit, primary_pic_url, list_pic_url, retail_price, sell_volume,
         primary_product_id, unit_price, promotion_desc, promotion_tag, app_exclusive_price,
         is_app_exclusive, is_limited, is_hot, market_price, creater_sn, create_time, moder_sn,
@@ -62,10 +62,10 @@
 
     <select id="queryObject" resultMap="goodsMap">
 		select a.id,
-        a.category_id,
+        psr1.category_id,
         a.goods_sn,
         a.name,
-        a.brand_id,
+        psr1.brand_id,
         a.goods_number,
         a.keywords,
         a.goods_brief,
@@ -73,7 +73,7 @@
         a.add_time,
         a.sort_order,
         a.is_delete,
-        a.attribute_category,
+        psr1.attribute_category,
         a.counter_price,
         a.extra_price,
         a.is_new,
@@ -102,10 +102,10 @@
     <select id="queryObjectByStoreId" resultMap="goodsMap">
         select
         a.id,
-        a.category_id,
+        psr1.category_id,
         a.goods_sn,
         a.name,
-        a.brand_id,
+        psr1.brand_id,
         a.goods_number,
         a.keywords,
         a.goods_brief,
@@ -113,7 +113,7 @@
         a.add_time,
         a.sort_order,
         a.is_delete,
-        a.attribute_category,
+        psr1.attribute_category,
         a.counter_price,
         a.extra_price,
         a.is_new,
@@ -149,11 +149,11 @@
         <if test="fields == null or fields == ''">
             a.*
         </if>
-        ,psr1.stock_num
+        ,psr1.stock_num,psr1.category_id,psr1.brand_id,psr1.attribute_category
         from mall_goods a
         LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id and a.merch_sn = psr1.merch_sn
         LEFT JOIN mall_product b ON b.id = psr1.product_id
-        left join mall_category c on a.category_id = c.id
+        left join mall_category c on psr1.category_id = c.id
         where 1 = 1 and a.is_delete != 1 and psr1.stock_num > 0 and a.is_on_sale = 1
         <if test="is_new != null and is_new != ''">
             and a.is_new = #{is_new}
@@ -162,10 +162,10 @@
             and a.is_hot = #{is_hot}
         </if>
         <if test="brand_id != null and brand_id != ''">
-            and a.brand_id = #{brand_id}
+            and psr1.brand_id = #{brand_id}
         </if>
         <if test="category_id != null and category_id != ''">
-            and a.category_id = #{category_id}
+            and psr1.category_id = #{category_id}
         </if>
         <if test="keyword != null">
             and a.name like concat('%',#{keyword},'%')
@@ -180,13 +180,13 @@
             and a.goods_biz_type in ('00','11')
         </if>
         <if test="categoryIds != null">
-            and a.category_id in
+            and psr1.category_id in
             <foreach item="item" collection="categoryIds" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
         <if test="category_parent_id != null and category_parent_id != null">
-            and FIND_IN_SET(a.category_id, getCategoryChildLst(#{category_parent_id}))
+            and FIND_IN_SET(psr1.category_id, getCategoryChildLst(#{category_parent_id}))
         </if>
         <if test="goods_ids != null">
             and a.id in
@@ -217,7 +217,7 @@
             ${fields}
         </if>
         <if test="fields == null or fields == ''">
-            a.*,b.id as product_id
+            a.*,b.id as product_id,psr1.category_id,psr1.brand_id,psr1.attribute_category
         </if>
         from mall_goods a
         LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id and a.merch_sn = psr1.merch_sn
@@ -230,22 +230,22 @@
             and a.is_hot = #{is_hot}
         </if>
         <if test="brand_id != null and brand_id != ''">
-            and a.brand_id = #{brand_id}
+            and psr1.brand_id = #{brand_id}
         </if>
         <if test="category_id != null and category_id != ''">
-            and a.category_id = #{category_id}
+            and psr1.category_id = #{category_id}
         </if>
         <if test="keyword != null">
             and a.keywords like concat('%',#{keyword},'%')
         </if>
         <if test="categoryIds != null">
-            and a.category_id in
+            and psr1.category_id in
             <foreach item="item" collection="categoryIds" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
         <if test="category_parent_id != null and category_parent_id != null">
-            and FIND_IN_SET(a.category_id, getCategoryChildLst(#{category_parent_id}))
+            and FIND_IN_SET(psr1.category_id, getCategoryChildLst(#{category_parent_id}))
         </if>
         <if test="goods_ids != null">
             and a.id in
@@ -270,7 +270,7 @@
     </select>
 
     <select id="queryCatalogProductList" resultMap="goodsMap">
-        select a.id, a.name, a.list_pic_url, psr1.market_price, psr1.retail_price, a.goods_brief, b.id AS product_id,psr1.stock_num
+        select a.id, a.name, a.list_pic_url,psr1.category_id,psr1.brand_id,psr1.attribute_category , psr1.market_price, psr1.retail_price, a.goods_brief, b.id AS product_id,psr1.stock_num
         <if test="is_group != null and is_group == true">
            ,gg.id as group_id
         </if>
@@ -290,13 +290,13 @@
             and a.is_hot = #{is_hot}
         </if>
         <if test="brand_id != null and brand_id != ''">
-            and a.brand_id = #{brand_id}
+            and psr1.brand_id = #{brand_id}
         </if>
         <if test="name != null and name != ''">
             and a.'name' like concat('%',#{keyword},'%')
         </if>
         <if test="category_id != null and category_id != ''">
-            and a.category_id = #{category_id}
+            and psr1.category_id = #{category_id}
         </if>
         <if test="keyword != null">
             and a.keywords like concat('%',#{keyword},'%')
@@ -305,13 +305,13 @@
             and gg.id is not null
         </if>
         <if test="categoryIds != null">
-            and a.category_id in
+            and psr1.category_id in
             <foreach item="item" collection="categoryIds" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
         <if test="category_parent_id != null and category_parent_id != null">
-            and FIND_IN_SET(a.category_id, getCategoryChildLst(#{category_parent_id}))
+            and FIND_IN_SET(psr1.category_id, getCategoryChildLst(#{category_parent_id}))
         </if>
         <if test="goods_ids != null">
             and a.id in
@@ -356,10 +356,10 @@
             and a.is_hot = #{is_hot}
         </if>
         <if test="brand_id != null and brand_id != ''">
-            and a.brand_id = #{brand_id}
+            and s.brand_id = #{brand_id}
         </if>
         <if test="category_id != null and category_id != ''">
-            and a.category_id = #{category_id}
+            and s.category_id = #{category_id}
         </if>
         <if test="keyword != null">
             and a.name like concat('%',#{keyword},'%')
@@ -368,13 +368,13 @@
             and a.is_delete = #{is_delete}
         </if>
         <if test="categoryIds != null">
-            and a.category_id in
+            and s.category_id in
             <foreach item="item" collection="categoryIds" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
         <if test="category_parent_id != null and category_parent_id != null">
-            and FIND_IN_SET(a.category_id, getCategoryChildLst(#{category_parent_id}))
+            and FIND_IN_SET(s.category_id, getCategoryChildLst(#{category_parent_id}))
         </if>
         <if test="goods_ids != null">
             and a.id in