菠萝派接口- 添加查询商品方法
正在显示
2 个修改的文件
包含
25 行增加
和
7 行删除
... | @@ -50,6 +50,13 @@ public interface PineappleDao { | ... | @@ -50,6 +50,13 @@ public interface PineappleDao { |
50 | 50 | ||
51 | 51 | ||
52 | /** | 52 | /** |
53 | * 根据条件查询商品 | ||
54 | * @param params | ||
55 | * @return | ||
56 | */ | ||
57 | DownloadProductBean getDownloadProductBeanByMap(Map<String,Object> params); | ||
58 | |||
59 | /** | ||
53 | * 根据商品ID获取该商品的所有SKU | 60 | * 根据商品ID获取该商品的所有SKU |
54 | * @param productId | 61 | * @param productId |
55 | * @return | 62 | * @return | ... | ... |
... | @@ -105,7 +105,7 @@ | ... | @@ -105,7 +105,7 @@ |
105 | <!-- 商品下载实体--> | 105 | <!-- 商品下载实体--> |
106 | <resultMap id="downloadProductBean" type="com.sibu.orderHelper.integral.model.DownloadProductBean"> | 106 | <resultMap id="downloadProductBean" type="com.sibu.orderHelper.integral.model.DownloadProductBean"> |
107 | <result column="id" property="PlatProductID"/> | 107 | <result column="id" property="PlatProductID"/> |
108 | <result column="name" property="name"/> | 108 | <result column="productName" property="name"/> |
109 | <result column="outerID" property="OuterID"/> | 109 | <result column="outerID" property="OuterID"/> |
110 | <result column="price" property="price"/> | 110 | <result column="price" property="price"/> |
111 | <result column="num" property="num"/> | 111 | <result column="num" property="num"/> |
... | @@ -115,10 +115,10 @@ | ... | @@ -115,10 +115,10 @@ |
115 | <!-- 商品下载 --> | 115 | <!-- 商品下载 --> |
116 | <select id="downloadProductListByMap" parameterType="java.util.Map" resultMap="downloadProductBean"> | 116 | <select id="downloadProductListByMap" parameterType="java.util.Map" resultMap="downloadProductBean"> |
117 | SELECT p.id,p.product_code AS outerID,p.name1 AS productName,p.product_stock AS num,p.master_img AS pictureurl, | 117 | SELECT p.id,p.product_code AS outerID,p.name1 AS productName,p.product_stock AS num,p.master_img AS pictureurl, |
118 | p.mall_pc_price AS price | 118 | p.mal_mobile_price AS price |
119 | FROM product p WHERE p.seller_id = #{sellerId} | 119 | FROM product p WHERE p.seller_id = #{sellerId} |
120 | <if test="productId !=null and productId !=''"> | 120 | <if test="productId !=null and productId !=''"> |
121 | AND (p.id = #{productId} or p.product_code = #{productId} | 121 | AND (p.id = #{productId} or p.product_code = #{productId}) |
122 | </if> | 122 | </if> |
123 | <if test="state !=null and state !='' and state != -1"> | 123 | <if test="state !=null and state !='' and state != -1"> |
124 | AND p.state = #{state} | 124 | AND p.state = #{state} |
... | @@ -127,16 +127,26 @@ | ... | @@ -127,16 +127,26 @@ |
127 | AND p.state IN ('6','7') | 127 | AND p.state IN ('6','7') |
128 | </if> | 128 | </if> |
129 | <if test="productName !=null and productName !=''"> | 129 | <if test="productName !=null and productName !=''"> |
130 | AND p.state = #{productName} | 130 | AND p.name1 = #{productName} |
131 | </if> | 131 | </if> |
132 | ORDER BY p.im_product_id DESC | 132 | ORDER BY p.im_product_id DESC |
133 | limit ${PageIndex}, ${PageSize} | 133 | limit ${PageIndex}, ${PageSize} |
134 | </select> | 134 | </select> |
135 | 135 | ||
136 | <!-- 根据条件查询商品 --> | ||
137 | <select id="getDownloadProductBeanByMap" parameterType="java.util.Map" resultMap="downloadProductBean"> | ||
138 | SELECT p.id,p.product_code AS outerID,p.name1 AS productName,p.product_stock AS num,p.master_img AS pictureurl, | ||
139 | p.mal_mobile_price AS price | ||
140 | FROM product p WHERE p.seller_id = #{sellerId} | ||
141 | <if test="productId !=null and productId !=''"> | ||
142 | AND p.id = #{productId} | ||
143 | </if> | ||
144 | </select> | ||
145 | |||
136 | <!-- 商品sku实体 --> | 146 | <!-- 商品sku实体 --> |
137 | <resultMap id="downloadSku" type="com.sibu.orderHelper.integral.model.DownloadProductSkuBean"> | 147 | <resultMap id="downloadSku" type="com.sibu.orderHelper.integral.model.DownloadProductSkuBean"> |
138 | <result column="skuId" property="SkuID"/> | 148 | <result column="skuId" property="SkuID"/> |
139 | <result column="skuOuterID" property="skuOuterID"/> | 149 | <result column="skuId" property="skuOuterID"/> |
140 | <result column="skuprice" property="skuprice"/> | 150 | <result column="skuprice" property="skuprice"/> |
141 | <result column="skuQuantity" property="skuQuantity"/> | 151 | <result column="skuQuantity" property="skuQuantity"/> |
142 | <result column="skuname" property="skuname"/> | 152 | <result column="skuname" property="skuname"/> |
... | @@ -145,8 +155,9 @@ | ... | @@ -145,8 +155,9 @@ |
145 | 155 | ||
146 | <!-- 获取商品sku --> | 156 | <!-- 获取商品sku --> |
147 | <select id="downloadSkuByProductId" resultType="java.lang.String" resultMap="downloadSku"> | 157 | <select id="downloadSkuByProductId" resultType="java.lang.String" resultMap="downloadSku"> |
148 | select g.sku AS skuId,g.sku AS skuOuterID,g.mall_pc_price AS skuprice,g.product_stock AS skuQuantity, | 158 | select g.sku AS skuId,g.mall_mobile_price AS skuprice,g.product_stock AS skuQuantity, |
149 | g.norm_name AS skuname ,g.images AS skupictureurl FROM product_goods g WHERE g.product_id = #{productId} | 159 | g.norm_name AS skuname ,g.images AS skupictureurl FROM product_goods g |
160 | WHERE g.product_id = #{productId} | ||
150 | </select> | 161 | </select> |
151 | 162 | ||
152 | <!-- 更新SKU库存--> | 163 | <!-- 更新SKU库存--> | ... | ... |
-
请 注册 或 登录 后发表评论