764f6bba 刘嘉

菠萝派接口- 添加查询商品方法

1 个父辈 5ae8e917
......@@ -50,6 +50,13 @@ public interface PineappleDao {
/**
* 根据条件查询商品
* @param params
* @return
*/
DownloadProductBean getDownloadProductBeanByMap(Map<String,Object> params);
/**
* 根据商品ID获取该商品的所有SKU
* @param productId
* @return
......
......@@ -105,7 +105,7 @@
<!-- 商品下载实体-->
<resultMap id="downloadProductBean" type="com.sibu.orderHelper.integral.model.DownloadProductBean">
<result column="id" property="PlatProductID"/>
<result column="name" property="name"/>
<result column="productName" property="name"/>
<result column="outerID" property="OuterID"/>
<result column="price" property="price"/>
<result column="num" property="num"/>
......@@ -115,10 +115,10 @@
<!-- 商品下载 -->
<select id="downloadProductListByMap" parameterType="java.util.Map" resultMap="downloadProductBean">
SELECT p.id,p.product_code AS outerID,p.name1 AS productName,p.product_stock AS num,p.master_img AS pictureurl,
p.mall_pc_price AS price
p.mal_mobile_price AS price
FROM product p WHERE p.seller_id = #{sellerId}
<if test="productId !=null and productId !=''">
AND (p.id = #{productId} or p.product_code = #{productId}
AND (p.id = #{productId} or p.product_code = #{productId})
</if>
<if test="state !=null and state !='' and state != -1">
AND p.state = #{state}
......@@ -127,16 +127,26 @@
AND p.state IN ('6','7')
</if>
<if test="productName !=null and productName !=''">
AND p.state = #{productName}
AND p.name1 = #{productName}
</if>
ORDER BY p.im_product_id DESC
limit ${PageIndex}, ${PageSize}
</select>
<!-- 根据条件查询商品 -->
<select id="getDownloadProductBeanByMap" parameterType="java.util.Map" resultMap="downloadProductBean">
SELECT p.id,p.product_code AS outerID,p.name1 AS productName,p.product_stock AS num,p.master_img AS pictureurl,
p.mal_mobile_price AS price
FROM product p WHERE p.seller_id = #{sellerId}
<if test="productId !=null and productId !=''">
AND p.id = #{productId}
</if>
</select>
<!-- 商品sku实体 -->
<resultMap id="downloadSku" type="com.sibu.orderHelper.integral.model.DownloadProductSkuBean">
<result column="skuId" property="SkuID"/>
<result column="skuOuterID" property="skuOuterID"/>
<result column="skuId" property="skuOuterID"/>
<result column="skuprice" property="skuprice"/>
<result column="skuQuantity" property="skuQuantity"/>
<result column="skuname" property="skuname"/>
......@@ -145,8 +155,9 @@
<!-- 获取商品sku -->
<select id="downloadSkuByProductId" resultType="java.lang.String" resultMap="downloadSku">
select g.sku AS skuId,g.sku AS skuOuterID,g.mall_pc_price AS skuprice,g.product_stock AS skuQuantity,
g.norm_name AS skuname ,g.images AS skupictureurl FROM product_goods g WHERE g.product_id = #{productId}
select g.sku AS skuId,g.mall_mobile_price AS skuprice,g.product_stock AS skuQuantity,
g.norm_name AS skuname ,g.images AS skupictureurl FROM product_goods g
WHERE g.product_id = #{productId}
</select>
<!-- 更新SKU库存-->
......