Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
2b0372f4
Commit
2b0372f4
authored
Jun 06, 2018
by
zhh
Browse files
商品接口修改
parent
a97a2fe7
Changes
2
Hide whitespace changes
Inline
Side-by-side
mall-admin/src/main/java/com/macro/mall/dto/PmsProductResult.java
View file @
2b0372f4
package
com.macro.mall.dto
;
import
com.macro.mall.model.CmsPrefrenceArea
;
import
com.macro.mall.model.CmsSubject
;
import
java.util.List
;
/**
* 查询单个产品进行修改时返回的结果
* Created by macro on 2018/4/26.
*/
public
class
PmsProductResult
extends
PmsProductParam
{
public
class
PmsProductResult
extends
PmsProductParam
{
//商品所选分类的父id
private
Long
cateParentId
;
private
String
productAttributeCategoryName
;
private
List
<
CmsSubject
>
subjectList
;
private
List
<
CmsPrefrenceArea
>
prefrenceAreaList
;
public
String
getProductAttributeCategoryName
()
{
return
productAttributeCategoryName
;
}
public
void
setProductAttributeCategoryName
(
String
productAttributeCategoryName
)
{
this
.
productAttributeCategoryName
=
productAttributeCategoryName
;
}
public
List
<
CmsSubject
>
getSubjectList
()
{
return
subjectList
;
}
public
void
setSubjectList
(
List
<
CmsSubject
>
subjectList
)
{
this
.
subjectList
=
subjectList
;
}
public
List
<
CmsPrefrenceArea
>
getPrefrenceAreaList
()
{
return
prefrenceAreaList
;
}
public
void
setPrefrenceAreaList
(
List
<
CmsPrefrenceArea
>
prefrenceAreaList
)
{
this
.
prefrenceAreaList
=
prefrenceAreaList
;
}
public
Long
getCateParentId
()
{
return
cateParentId
;
...
...
mall-admin/src/main/resources/dao/PmsProductDao.xml
View file @
2b0372f4
...
...
@@ -13,17 +13,14 @@
</collection>
<collection
property=
"productAttributeValueList"
columnPrefix=
"attribute_"
resultMap=
"com.macro.mall.mapper.PmsProductAttributeValueMapper.BaseResultMap"
>
</collection>
<collection
property=
"subjectList"
column=
"{productId=id}"
select=
"selectSubjectByProductId"
>
</collection>
<collection
property=
"prefrenceAreaList"
column=
"{productId=id}"
select=
"selectPrefrenceAreaByProductId"
>
</collection>
<collection
property=
"subjectProductRelationList"
column=
"{productId=id}"
select=
"selectSubjectProductRelationByProductId"
/>
<collection
property=
"prefrenceAreaProductRelationList"
column=
"{productId=id}"
select=
"selectPrefrenceAreaProductRelationByProductId"
/>
</resultMap>
<select
id=
"getUpdateInfo"
resultMap=
"updateInfoMap"
>
SELECT *,
pc.parent_id cateParentId,
ac.name productAttributeCategoryName,
l.id ladder_id,l.product_id ladder_product_id,l.discount ladder_discount,l.count ladder_count,l.price ladder_price,
pf.id full_id,pf.product_id full_product_id,pf.full_price full_full_price,pf.reduce_price full_reduce_price,
m.id member_id,m.product_id member_product_id,m.member_level_id member_member_level_id,m.member_price member_member_price,m.member_level_name member_member_level_name,
...
...
@@ -31,7 +28,6 @@
a.id attribute_id,a.product_id attribute_product_id,a.product_attribute_id attribute_product_attribute_id,a.value attribute_value
FROM pms_product p
LEFT JOIN pms_product_category pc on pc.id = p.product_category_id
LEFT JOIN pms_product_attribute_category ac ON p.product_attribute_category_id= ac.id
LEFT JOIN pms_product_ladder l ON p.id = l.product_id
LEFT JOIN pms_product_full_reduction pf ON pf.product_id=p.id
LEFT JOIN pms_member_price m ON m.product_id = p.id
...
...
@@ -39,16 +35,11 @@
LEFT JOIN pms_product_attribute_value a ON a.product_id=p.id
WHERE p.id=#{id};
</select>
<select
id=
"selectSubjectByProductId"
resultMap=
"com.macro.mall.mapper.CmsSubjectMapper.BaseResultMap"
>
SELECT s.*
FROM cms_subject_product_relation spr
LEFT JOIN cms_subject s ON spr.subject_id = s.id
WHERE spr.product_id = #{productId}
<select
id=
"selectSubjectProductRelationByProductId"
resultMap=
"com.macro.mall.mapper.CmsSubjectProductRelationMapper.BaseResultMap"
>
select * from cms_subject_product_relation where product_id=#{productId}
</select>
<select
id=
"selectPrefrenceAreaByProductId"
resultMap=
"com.macro.mall.mapper.CmsPrefrenceAreaMapper.BaseResultMap"
>
SELECT p.*
FROM cms_prefrence_area_product_relation ppr
LEFT JOIN cms_prefrence_area p ON ppr.prefrence_area_id=p.id
WHERE ppr.product_id=#{productId}
<select
id=
"selectPrefrenceAreaProductRelationByProductId"
resultMap=
"com.macro.mall.mapper.CmsPrefrenceAreaProductRelationMapper.BaseResultMap"
>
select * from cms_prefrence_area_product_relation where product_id=#{productId}
</select>
</mapper>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment