queryPriceList.md
11.2 KB
查询价格列表接口
接口名: '/product/queryProductPriceList'
方法
POST JSONRAW
入参
属性名称 | 类型 | 例子 | 说明 | 说明是否必填 | 长度限制 |
---|---|---|---|---|---|
product_skn | Number | 60000050 | 商品的skn | N | 10 |
shop_id | Number | 43 | 店铺Id | N | 5 |
brand_id | Number | 43 | 品牌id | N | 5 |
supplier_id | Number | 43 | 供应商Id | N | 5 |
is_jit | String | "N" | 是否是代销不入库 Y 或者 N | N | 1 |
is_auditing | Number | 200 | 商品状态 | N | 3 |
stock | Number | 1 | 有库存为1 无填写 0 | N | 11 |
gender | Number | 1 | 性别 1代表男性,2代表女性 3代表通用 | N | 1 |
max_sort_id | Number | 1 | 大分类的Id | N | 5 |
middle_sort_id | Number | 12 | 中分类Id | N | 5 |
small_sort_id | Number | 111 | 小分类的Id | N | 5 |
page | Number | 1 | 当前页数 从1开始 | N | 11 |
size | Number | 10 | 每页显示条数,默认10 | N | 11 |
对应SQL的操作库表
<select id="selectSknListByReq" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from product where 1 = 1
<if test="baseProduct.productSkn != null" >
And product_skn = #{baseProduct.productSkn, jdbcType=INTEGER}
</if>
<if test="baseProduct.productName != null" >
And product_name like concat('%', #{baseProduct.productName, jdbcType=VARCHAR}, '%')
</if>
<if test="baseProduct.brandId != null" >
And brand_id = #{baseProduct.brandId, jdbcType=SMALLINT}
</if>
<if test="baseProduct.isScreen != null" >
And is_screen = #{baseProduct.isScreen, jdbcType=CHAR}
</if>
<if test="baseProduct.isMeasure != null" >
And is_measure = #{baseProduct.isMeasure, jdbcType=CHAR}
</if>
<if test="baseProduct.supplierId != null" >
And supplier_id = #{baseProduct.supplierId, jdbcType=INTEGER}
</if>
<if test="baseProduct.isJit != null" >
And is_jit = #{baseProduct.isJit, jdbcType=CHAR}
</if>
<if test="baseProduct.maxSortId != null" >
And max_sort_id = #{baseProduct.maxSortId, jdbcType=SMALLINT}
</if>
<if test="baseProduct.middleSortId != null" >
And middle_sort_id = #{baseProduct.middleSortId, jdbcType=SMALLINT}
</if>
<if test="baseProduct.smallSortId != null" >
And small_sort_id = #{baseProduct.smallSortId, jdbcType=SMALLINT}
</if>
<if test="baseProduct.isOutLets != null" >
And is_outlets = #{baseProduct.isOutLets, jdbcType=CHAR}
</if>
<if test="baseProduct.isAdvance != null" >
And is_advance = #{baseProduct.isAdvance, jdbcType=CHAR}
</if>
<if test="baseProduct.gender != null" >
And gender = #{baseProduct.gender, jdbcType=CHAR}
</if>
<if test="baseProduct.isInfoMiss != null" >
And is_info_miss = #{baseProduct.isInfoMiss, jdbcType=CHAR}
</if>
<if test="baseProduct.stock != null" >
<if test="baseProduct.stock == 1" >
And stock >= #{baseProduct.stock, jdbcType=SMALLINT}
</if>
<if test="baseProduct.stock == 0" >
And (stock = 0 OR stock is null)
</if>
</if>
<if test="baseProduct.isAuditing != null" >
<if test="baseProduct.isAuditing == 200" >
And is_auditing = 200
</if>
<if test="baseProduct.isAuditing != 200" >
And is_auditing in(100, 300)
</if>
</if>
<if test="baseProduct.status != null" >
<if test="baseProduct.status == 1" >
And status = 1
</if>
<if test="baseProduct.status != 1" >
And status != 1
</if>
</if>
<if test="baseProduct.productStatusList != null" >
AND status in
<foreach collection="baseProduct.productStatusList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="baseProduct.onlyShowSknList != null" >
AND (product_skn in
<foreach collection="baseProduct.onlyShowSknList" item="item" index="index" separator="," open="(" close=")">
#{item, jdbcType=INTEGER}
</foreach> OR shop_id = #{baseProduct.shopId, jdbcType=SMALLINT} )
</if>
<if test="baseProduct.onlyShowSknList == null" >
<if test="baseProduct.shopId != null" >
And shop_id = #{baseProduct.shopId, jdbcType=SMALLINT}
</if>
</if>
<if test="baseProduct.sortFlag != null">
order by ${baseProduct.sortFlag} ${baseProduct.descFlag}
</if>
Limit #{startIndex,jdbcType=INTEGER}, #{length,jdbcType=INTEGER}
</select>
<select id="selectSknListByReqCount" resultType="java.lang.Integer" parameterType="com.yohobuy.platform.dal.product.model.BaseProductEx">
select count(0) from product where 1 = 1
<if test="baseProduct.productSkn != null" >
And product_skn = #{baseProduct.productSkn, jdbcType=INTEGER}
</if>
<if test="baseProduct.productName != null" >
And product_name like concat('%', #{baseProduct.productName, jdbcType=VARCHAR}, '%')
</if>
<if test="baseProduct.brandId != null" >
And brand_id = #{baseProduct.brandId, jdbcType=SMALLINT}
</if>
<if test="baseProduct.isScreen != null" >
And is_screen = #{baseProduct.isScreen, jdbcType=CHAR}
</if>
<if test="baseProduct.isMeasure != null" >
And is_measure = #{baseProduct.isMeasure, jdbcType=CHAR}
</if>
<if test="baseProduct.supplierId != null" >
And supplier_id = #{baseProduct.supplierId, jdbcType=INTEGER}
</if>
<if test="baseProduct.isJit != null" >
And is_jit = #{baseProduct.isJit, jdbcType=CHAR}
</if>
<if test="baseProduct.maxSortId != null" >
And max_sort_id = #{baseProduct.maxSortId, jdbcType=SMALLINT}
</if>
<if test="baseProduct.middleSortId != null" >
And middle_sort_id = #{baseProduct.middleSortId, jdbcType=SMALLINT}
</if>
<if test="baseProduct.smallSortId != null" >
And small_sort_id = #{baseProduct.smallSortId, jdbcType=SMALLINT}
</if>
<if test="baseProduct.isOutLets != null" >
And is_outlets = #{baseProduct.isOutLets, jdbcType=CHAR}
</if>
<if test="baseProduct.isAdvance != null" >
And is_advance = #{baseProduct.isAdvance, jdbcType=CHAR}
</if>
<if test="baseProduct.gender != null" >
And gender = #{baseProduct.gender, jdbcType=CHAR}
</if>
<if test="baseProduct.isInfoMiss != null" >
And is_info_miss = #{baseProduct.isInfoMiss, jdbcType=CHAR}
</if>
<if test="baseProduct.stock != null" >
<if test="baseProduct.stock == 1" >
And stock >= #{baseProduct.stock, jdbcType=SMALLINT}
</if>
<if test="baseProduct.stock == 0" >
And (stock = 0 OR stock is null)
</if>
</if>
<if test="baseProduct.isAuditing != null" >
<if test="baseProduct.isAuditing == 200" >
And is_auditing = 200
</if>
<if test="baseProduct.isAuditing != 200" >
And is_auditing in(100, 300)
</if>
</if>
<if test="baseProduct.status != null" >
<if test="baseProduct.status == 1" >
And status = 1
</if>
<if test="baseProduct.status != 1" >
And status != 1
</if>
</if>
<if test="baseProduct.productStatusList != null" >
AND status in
<foreach collection="baseProduct.productStatusList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="baseProduct.onlyShowSknList != null" >
AND (product_skn in
<foreach collection="baseProduct.onlyShowSknList" item="item" index="index" separator="," open="(" close=")">
#{item, jdbcType=INTEGER}
</foreach> OR shop_id = #{baseProduct.shopId, jdbcType=SMALLINT} )
</if>
<if test="baseProduct.onlyShowSknList == null" >
<if test="baseProduct.shopId != null" >
And shop_id = #{baseProduct.shopId, jdbcType=SMALLINT}
</if>
</if>
</select>
<select id="selectProductPriceList" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from product_price
where 1 = 1
<if test="productPrice.sysStatus != null" >
AND sys_status = #{productPrice.sysStatus, jdbcType=SMALLINT}
</if>
limit #{startIndex,jdbcType=INTEGER}, #{length,jdbcType=INTEGER}
</select>
<select id="selectProductPriceBySknList" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from product_price where product_skn in
<foreach collection="sknList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</select>
错误编码
错误码code | 消息 | 说明 |
---|---|---|
200 | 查询成功! | |
400 | 查询失败! | |
500 | 查询失败! |
返回(备注: gender ("1", "男")("2", "女")("3", "通用")
{
"code": 200,
"data": {
"list": [
{
"brand_id": 175,
"brand_name": "品牌名称",
"founder": 9278,
"max_sort_id": 10,
"max_sort_name": "创意生活",
"middle_sort_id": 101,
"middle_sort_name": "文具",
"product_name": "团一复古花纹满本图案牛皮纸笔记本",
"product_pic_url": "http://img12.static.yhbimg.com/goodsimg/2011/06/24/13/02e571a64cea3ea8e734f8f0aae790fb4f.jpg?imageView/0/w/60/h/60",
"product_skn": 50000055,
"retail_price": 29,
"return_coin": 300,
"sales_price": 29,
"small_sort_id": 111,
"small_sort_name": "本子",
"supplier_id": 0,
"supplier_name":"供应商名称",
"updateTime": "2016-02-02 10:37:43",
"vip1_price": 0,
"vip2_price": 0,
"vip3_price": 0,
"vip_discount_type": 1,
"vip_price": 0,
"shop_id":1,
"shop_name":"店铺名称",
"gender":"1",
"founderName":"操作人姓名"
},
{
"brand_id": 187,
"brand_name": "顽",
"founder": 9278,
"max_sort_id": 8,
"max_sort_name": "服配",
"middle_sort_id": 66,
"middle_sort_name": "配饰",
"product_name": "PLAY顽植物大战僵尸坚果墙挂饰",
"product_pic_url": "http://img10.static.yhbimg.com/goodsimg/2011/06/23/05/01bda4fc443c96aa3a2e9287c3c17be87a.jpg?imageView/0/w/60/h/60",
"product_skn": 50000056,
"retail_price": 18,
"return_coin": 0,
"sales_price": 18,
"small_sort_id": 305,
"small_sort_name": "挂饰",
"supplier_id": 0,
"supplier_name":"供应商名称",
"updateTime": "2016-02-02 10:37:43",
"vip1_price": 0,
"vip2_price": 0,
"vip3_price": 0,
"vip_discount_type": 1,
"vip_price": 0,
"shop_id":1,
"shop_name":"店铺名称",
"gender":"1",
"founderName":"操作人姓名"
}
],
"page": 1,
"size": 2,
"total": 2,
"totalPage": 1
},
"md5": "9a92b3c94d9676a8089169ee46ebce4a",
"message": "Product Price List."
}