|  | @@ -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
 |