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
edc71542
Commit
edc71542
authored
Apr 26, 2018
by
zhh
Browse files
添加创建产品功能
parent
f603ca62
Changes
83
Hide whitespace changes
Inline
Side-by-side
document/pdm/mall.pdb
View file @
edc71542
<?xml version="1.0" encoding="UTF-8"?>
<?PowerDesigner AppLocale="UTF16" ID="{7BB41C87-EFE8-409A-A86E-B1C3FCE34F8C}" Label="" LastModificationDate="152
2747822
" Name="mall" Objects="9
84
" Symbols="123" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
<?PowerDesigner AppLocale="UTF16" ID="{7BB41C87-EFE8-409A-A86E-B1C3FCE34F8C}" Label="" LastModificationDate="152
4721741
" Name="mall" Objects="9
72
" Symbols="123" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
<!-- do not edit this file -->
<Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
...
...
@@ -7562,9 +7562,9 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Code>promotion_type</a:Code>
<a:CreationDate>1522721953</a:CreationDate>
<a:Creator>zhenghong</a:Creator>
<a:ModificationDate>152
2722061
</a:ModificationDate>
<a:ModificationDate>152
4633114
</a:ModificationDate>
<a:Modifier>zhenghong</a:Modifier>
<a:Comment>促销类型:0->使用促销价;
1
->使用会员价;
2
->使用阶梯价格;
3
->使用满减价格</a:Comment>
<a:Comment>促销类型:0->
没有促销使用原价;1->
使用促销价;
2
->使用会员价;
3
->使用阶梯价格;
4
->使用满减价格</a:Comment>
<a:DataType>int(1)</a:DataType>
<a:Length>1</a:Length>
</o:Column>
...
...
@@ -8675,9 +8675,9 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Code>id</a:Code>
<a:CreationDate>1521792488</a:CreationDate>
<a:Creator>zhenghong</a:Creator>
<a:ModificationDate>152
1792502
</a:ModificationDate>
<a:ModificationDate>152
4721741
</a:ModificationDate>
<a:Modifier>zhenghong</a:Modifier>
<a:DataType>int</a:DataType>
<a:DataType>
big
int</a:DataType>
<a:Identity>1</a:Identity>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
...
...
@@ -9004,21 +9004,21 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
<o:Column Id="o400">
<a:ObjectID>A73883DF-2D36-497D-8D90-9EB0F5CF3C5B</a:ObjectID>
<a:Name>
pms_
product_id</a:Name>
<a:Code>
pms_
product_id</a:Code>
<a:Name>product_id</a:Name>
<a:Code>product_id</a:Code>
<a:CreationDate>1522046451</a:CreationDate>
<a:Creator>zhenghong</a:Creator>
<a:ModificationDate>152
2046492
</a:ModificationDate>
<a:ModificationDate>152
4710981
</a:ModificationDate>
<a:Modifier>zhenghong</a:Modifier>
<a:DataType>bigint</a:DataType>
</o:Column>
<o:Column Id="o401">
<a:ObjectID>92ACF804-9722-47C3-826B-A2611338F2F6</a:ObjectID>
<a:Name>
pms_
product_attribute_id</a:Name>
<a:Code>
pms_
product_attribute_id</a:Code>
<a:Name>product_attribute_id</a:Name>
<a:Code>product_attribute_id</a:Code>
<a:CreationDate>1522046456</a:CreationDate>
<a:Creator>zhenghong</a:Creator>
<a:ModificationDate>152
2046492
</a:ModificationDate>
<a:ModificationDate>152
4710981
</a:ModificationDate>
<a:Modifier>zhenghong</a:Modifier>
<a:DataType>bigint</a:DataType>
</o:Column>
...
...
@@ -9911,9 +9911,10 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Code>id</a:Code>
<a:CreationDate>1522138235</a:CreationDate>
<a:Creator>zhenghong</a:Creator>
<a:ModificationDate>152
2138607
</a:ModificationDate>
<a:ModificationDate>152
4711592
</a:ModificationDate>
<a:Modifier>zhenghong</a:Modifier>
<a:DataType>bigint</a:DataType>
<a:Identity>1</a:Identity>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o468">
...
...
document/pdm/mall.pdm
View file @
edc71542
<?xml version="1.0" encoding="UTF-8"?>
<?PowerDesigner AppLocale="UTF16" ID="{7BB41C87-EFE8-409A-A86E-B1C3FCE34F8C}" Label="" LastModificationDate="1524
633114
" Name="mall" Objects="972" Symbols="123" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
<?PowerDesigner AppLocale="UTF16" ID="{7BB41C87-EFE8-409A-A86E-B1C3FCE34F8C}" Label="" LastModificationDate="1524
721741
" Name="mall" Objects="972" Symbols="123" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
<!-- do not edit this file -->
<Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
...
...
@@ -8675,9 +8675,9 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Code>id</a:Code>
<a:CreationDate>1521792488</a:CreationDate>
<a:Creator>zhenghong</a:Creator>
<a:ModificationDate>152
1792502
</a:ModificationDate>
<a:ModificationDate>152
4721741
</a:ModificationDate>
<a:Modifier>zhenghong</a:Modifier>
<a:DataType>int</a:DataType>
<a:DataType>
big
int</a:DataType>
<a:Identity>1</a:Identity>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
...
...
@@ -9004,21 +9004,21 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
<o:Column Id="o400">
<a:ObjectID>A73883DF-2D36-497D-8D90-9EB0F5CF3C5B</a:ObjectID>
<a:Name>
pms_
product_id</a:Name>
<a:Code>
pms_
product_id</a:Code>
<a:Name>product_id</a:Name>
<a:Code>product_id</a:Code>
<a:CreationDate>1522046451</a:CreationDate>
<a:Creator>zhenghong</a:Creator>
<a:ModificationDate>152
2046492
</a:ModificationDate>
<a:ModificationDate>152
4710981
</a:ModificationDate>
<a:Modifier>zhenghong</a:Modifier>
<a:DataType>bigint</a:DataType>
</o:Column>
<o:Column Id="o401">
<a:ObjectID>92ACF804-9722-47C3-826B-A2611338F2F6</a:ObjectID>
<a:Name>
pms_
product_attribute_id</a:Name>
<a:Code>
pms_
product_attribute_id</a:Code>
<a:Name>product_attribute_id</a:Name>
<a:Code>product_attribute_id</a:Code>
<a:CreationDate>1522046456</a:CreationDate>
<a:Creator>zhenghong</a:Creator>
<a:ModificationDate>152
2046492
</a:ModificationDate>
<a:ModificationDate>152
4710981
</a:ModificationDate>
<a:Modifier>zhenghong</a:Modifier>
<a:DataType>bigint</a:DataType>
</o:Column>
...
...
@@ -9911,9 +9911,10 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Code>id</a:Code>
<a:CreationDate>1522138235</a:CreationDate>
<a:Creator>zhenghong</a:Creator>
<a:ModificationDate>152
2138607
</a:ModificationDate>
<a:ModificationDate>152
4711592
</a:ModificationDate>
<a:Modifier>zhenghong</a:Modifier>
<a:DataType>bigint</a:DataType>
<a:Identity>1</a:Identity>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o468">
...
...
mall-admin/src/main/java/com/macro/mall/MallAdminApplication.java
View file @
edc71542
...
...
@@ -3,6 +3,7 @@ package com.macro.mall;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
/**
* 应用启动入口
...
...
@@ -10,6 +11,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
*/
@SpringBootApplication
@MapperScan
({
"com.macro.mall.mapper"
,
"com.macro.mall.dao"
})
@EnableTransactionManagement
public
class
MallAdminApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
MallAdminApplication
.
class
,
args
);
...
...
mall-admin/src/main/java/com/macro/mall/dao/CmsPrefrenceAreaProductRelationDao.java
0 → 100644
View file @
edc71542
package
com.macro.mall.dao
;
import
com.macro.mall.model.CmsPrefrenceAreaProductRelation
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 自定义优选和商品关系操作
* Created by macro on 2018/4/26.
*/
public
interface
CmsPrefrenceAreaProductRelationDao
{
int
insertList
(
@Param
(
"list"
)
List
<
CmsPrefrenceAreaProductRelation
>
prefrenceAreaProductRelationList
);
}
mall-admin/src/main/java/com/macro/mall/dao/CmsSubjectProductRelationDao.java
0 → 100644
View file @
edc71542
package
com.macro.mall.dao
;
import
com.macro.mall.model.CmsSubjectProductRelation
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 自定义商品和专题关系操作
* Created by macro on 2018/4/26.
*/
public
interface
CmsSubjectProductRelationDao
{
int
insertList
(
@Param
(
"list"
)
List
<
CmsSubjectProductRelation
>
subjectProductRelationList
);
}
mall-admin/src/main/java/com/macro/mall/dao/PmsProductAttributeValueDao.java
0 → 100644
View file @
edc71542
package
com.macro.mall.dao
;
import
com.macro.mall.model.PmsProductAttributeValue
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 商品参数,商品自定义规格属性Dao
* Created by macro on 2018/4/26.
*/
public
interface
PmsProductAttributeValueDao
{
int
insertList
(
@Param
(
"list"
)
List
<
PmsProductAttributeValue
>
productAttributeValueList
);
}
mall-admin/src/main/java/com/macro/mall/dto/PmsProductParam.java
View file @
edc71542
...
...
@@ -17,13 +17,13 @@ public class PmsProductParam {
@ApiModelProperty
(
"商品阶梯价格设置"
)
private
List
<
PmsProductLadder
>
productLadderList
;
@ApiModelProperty
(
"商品满减价格设置"
)
private
List
<
PmsProductFullReduction
>
p
msP
roductFullReductionList
;
private
List
<
PmsProductFullReduction
>
productFullReductionList
;
@ApiModelProperty
(
"商品会员价格设置"
)
private
List
<
PmsMemberPrice
>
pmsM
emberPriceList
;
private
List
<
PmsMemberPrice
>
m
emberPriceList
;
@ApiModelProperty
(
"商品的sku库存信息"
)
private
List
<
PmsSkuStock
>
skuStockList
;
@ApiModelProperty
(
"商品参数及自定义规格属性"
)
private
List
<
PmsProductAttributeValue
>
p
msP
roductAttributeValueList
;
private
List
<
PmsProductAttributeValue
>
productAttributeValueList
;
@ApiModelProperty
(
"专题和商品关系"
)
private
List
<
CmsSubjectProductRelation
>
subjectProductRelationList
;
@ApiModelProperty
(
"优选专区和商品的关系"
)
...
...
@@ -45,20 +45,20 @@ public class PmsProductParam {
this
.
productLadderList
=
productLadderList
;
}
public
List
<
PmsProductFullReduction
>
getP
msP
roductFullReductionList
()
{
return
p
msP
roductFullReductionList
;
public
List
<
PmsProductFullReduction
>
getProductFullReductionList
()
{
return
productFullReductionList
;
}
public
void
setP
msP
roductFullReductionList
(
List
<
PmsProductFullReduction
>
p
msP
roductFullReductionList
)
{
this
.
p
msP
roductFullReductionList
=
p
msP
roductFullReductionList
;
public
void
setProductFullReductionList
(
List
<
PmsProductFullReduction
>
productFullReductionList
)
{
this
.
productFullReductionList
=
productFullReductionList
;
}
public
List
<
PmsMemberPrice
>
get
Pms
MemberPriceList
()
{
return
pmsM
emberPriceList
;
public
List
<
PmsMemberPrice
>
getMemberPriceList
()
{
return
m
emberPriceList
;
}
public
void
set
Pms
MemberPriceList
(
List
<
PmsMemberPrice
>
pmsM
emberPriceList
)
{
this
.
pmsM
emberPriceList
=
pmsM
emberPriceList
;
public
void
setMemberPriceList
(
List
<
PmsMemberPrice
>
m
emberPriceList
)
{
this
.
m
emberPriceList
=
m
emberPriceList
;
}
public
List
<
PmsSkuStock
>
getSkuStockList
()
{
...
...
@@ -69,12 +69,12 @@ public class PmsProductParam {
this
.
skuStockList
=
skuStockList
;
}
public
List
<
PmsProductAttributeValue
>
getP
msP
roductAttributeValueList
()
{
return
p
msP
roductAttributeValueList
;
public
List
<
PmsProductAttributeValue
>
getProductAttributeValueList
()
{
return
productAttributeValueList
;
}
public
void
setP
msP
roductAttributeValueList
(
List
<
PmsProductAttributeValue
>
p
msP
roductAttributeValueList
)
{
this
.
p
msP
roductAttributeValueList
=
p
msP
roductAttributeValueList
;
public
void
setProductAttributeValueList
(
List
<
PmsProductAttributeValue
>
productAttributeValueList
)
{
this
.
productAttributeValueList
=
productAttributeValueList
;
}
public
List
<
CmsSubjectProductRelation
>
getSubjectProductRelationList
()
{
...
...
mall-admin/src/main/java/com/macro/mall/service/PmsProductCategoryService.java
View file @
edc71542
...
...
@@ -2,6 +2,9 @@ package com.macro.mall.service;
import
com.macro.mall.dto.PmsProductCategoryParam
;
import
com.macro.mall.model.PmsProductCategory
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
...
...
mall-admin/src/main/java/com/macro/mall/service/PmsProductService.java
View file @
edc71542
package
com.macro.mall.service
;
import
com.macro.mall.dto.PmsProductParam
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* 商品管理Service
...
...
@@ -10,5 +13,6 @@ public interface PmsProductService {
/**
* 创建商品
*/
@Transactional
(
isolation
=
Isolation
.
DEFAULT
,
propagation
=
Propagation
.
REQUIRED
)
int
create
(
PmsProductParam
productParam
);
}
mall-admin/src/main/java/com/macro/mall/service/impl/PmsProductServiceImpl.java
View file @
edc71542
package
com.macro.mall.service.impl
;
import
com.macro.mall.dao.PmsMemberPriceDao
;
import
com.macro.mall.dao.PmsProductFullReductionDao
;
import
com.macro.mall.dao.PmsProductLadderDao
;
import
com.macro.mall.dao.*
;
import
com.macro.mall.dto.PmsProductParam
;
import
com.macro.mall.mapper.PmsProductMapper
;
import
com.macro.mall.model.PmsMemberPrice
;
import
com.macro.mall.model.PmsProduct
;
import
com.macro.mall.model.PmsProductFullReduction
;
import
com.macro.mall.model.PmsProductLadder
;
import
com.macro.mall.model.*
;
import
com.macro.mall.service.PmsProductService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.lang.reflect.Method
;
import
java.util.List
;
/**
* 商品管理Service实现类
* Created by macro on 2018/4/26.
*/
@Service
public
class
PmsProductServiceImpl
implements
PmsProductService
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
PmsProductServiceImpl
.
class
);
@Autowired
private
PmsProductMapper
productMapper
;
@Autowired
...
...
@@ -29,6 +29,14 @@ public class PmsProductServiceImpl implements PmsProductService {
private
PmsProductLadderDao
productLadderDao
;
@Autowired
private
PmsProductFullReductionDao
productFullReductionDao
;
@Autowired
private
PmsSkuStockDao
skuStockDao
;
@Autowired
private
PmsProductAttributeValueDao
productAttributeValueDao
;
@Autowired
private
CmsSubjectProductRelationDao
subjectProductRelationDao
;
@Autowired
private
CmsPrefrenceAreaProductRelationDao
prefrenceAreaProductRelationDao
;
@Override
public
int
create
(
PmsProductParam
productParam
)
{
...
...
@@ -40,7 +48,37 @@ public class PmsProductServiceImpl implements PmsProductService {
//根据促销类型设置价格:、阶梯价格、满减价格
Long
productId
=
product
.
getId
();
//会员价格
List
<
PmsMemberPrice
>
memberPriceList
=
productParam
.
getPmsMemberPriceList
();
relateAndInsertList
(
memberPriceDao
,
productParam
.
getMemberPriceList
(),
productId
);
//阶梯价格
relateAndInsertList
(
productLadderDao
,
productParam
.
getProductLadderList
(),
productId
);
//满减价格
relateAndInsertList
(
productFullReductionDao
,
productParam
.
getProductFullReductionList
(),
productId
);
//添加sku库存信息
relateAndInsertList
(
skuStockDao
,
productParam
.
getSkuStockList
(),
productId
);
//添加商品参数,添加自定义商品规格
relateAndInsertList
(
productAttributeValueDao
,
productParam
.
getProductAttributeValueList
(),
productId
);
//关联专题
relateAndInsertList
(
subjectProductRelationDao
,
productParam
.
getSubjectProductRelationList
(),
productId
);
//关联优选
relateAndInsertList
(
prefrenceAreaProductRelationDao
,
productParam
.
getPrefrenceAreaProductRelationList
(),
productId
);
count
=
1
;
return
count
;
}
/**
* @deprecated
* 旧版创建
*/
public
int
createOld
(
PmsProductParam
productParam
)
{
int
count
;
//创建商品
PmsProduct
product
=
productParam
.
getProduct
();
product
.
setId
(
null
);
productMapper
.
insertSelective
(
product
);
//根据促销类型设置价格:、阶梯价格、满减价格
Long
productId
=
product
.
getId
();
//会员价格
List
<
PmsMemberPrice
>
memberPriceList
=
productParam
.
getMemberPriceList
();
if
(!
CollectionUtils
.
isEmpty
(
memberPriceList
))
{
for
(
PmsMemberPrice
pmsMemberPrice
:
memberPriceList
)
{
pmsMemberPrice
.
setId
(
null
);
...
...
@@ -58,7 +96,7 @@ public class PmsProductServiceImpl implements PmsProductService {
productLadderDao
.
insertList
(
productLadderList
);
}
//满减价格
List
<
PmsProductFullReduction
>
productFullReductionList
=
productParam
.
getP
msP
roductFullReductionList
();
List
<
PmsProductFullReduction
>
productFullReductionList
=
productParam
.
getProductFullReductionList
();
if
(!
CollectionUtils
.
isEmpty
(
productFullReductionList
))
{
for
(
PmsProductFullReduction
productFullReduction
:
productFullReductionList
)
{
productFullReduction
.
setId
(
null
);
...
...
@@ -67,11 +105,52 @@ public class PmsProductServiceImpl implements PmsProductService {
productFullReductionDao
.
insertList
(
productFullReductionList
);
}
//添加sku库存信息
//添加商品参数
//添加自定义商品规格
List
<
PmsSkuStock
>
skuStockList
=
productParam
.
getSkuStockList
();
if
(!
CollectionUtils
.
isEmpty
(
skuStockList
)){
for
(
PmsSkuStock
skuStock
:
skuStockList
)
{
skuStock
.
setId
(
null
);
skuStock
.
setProductId
(
productId
);
}
skuStockDao
.
insertList
(
skuStockList
);
}
//添加商品参数,添加自定义商品规格
List
<
PmsProductAttributeValue
>
productAttributeValueList
=
productParam
.
getProductAttributeValueList
();
if
(!
CollectionUtils
.
isEmpty
(
productAttributeValueList
)){
for
(
PmsProductAttributeValue
productAttributeValue
:
productAttributeValueList
)
{
productAttributeValue
.
setId
(
null
);
productAttributeValue
.
setProductId
(
productId
);
}
productAttributeValueDao
.
insertList
(
productAttributeValueList
);
}
//关联专题
relateAndInsertList
(
subjectProductRelationDao
,
productParam
.
getSubjectProductRelationList
(),
productId
);
//关联优选
relateAndInsertList
(
prefrenceAreaProductRelationDao
,
productParam
.
getPrefrenceAreaProductRelationList
(),
productId
);
count
=
1
;
return
count
;
}
/**
* 建立和插入关系表操作
*
* @param dao 可以操作的dao
* @param dataList 要插入的数据
* @param productId 建立关系的id
*/
private
void
relateAndInsertList
(
Object
dao
,
List
dataList
,
Long
productId
)
{
try
{
if
(
CollectionUtils
.
isEmpty
(
dataList
))
return
;
for
(
Object
item
:
dataList
)
{
Method
setId
=
item
.
getClass
().
getMethod
(
"setId"
,
Long
.
class
);
setId
.
invoke
(
item
,
(
Long
)
null
);
Method
setProductId
=
item
.
getClass
().
getMethod
(
"setProductId"
,
Long
.
class
);
setProductId
.
invoke
(
item
,
productId
);
}
Method
insertList
=
dao
.
getClass
().
getMethod
(
"insertList"
,
List
.
class
);
insertList
.
invoke
(
dao
,
dataList
);
}
catch
(
Exception
e
)
{
LOGGER
.
warn
(
"创建产品出错:{}"
,
e
.
getMessage
());
throw
new
RuntimeException
(
e
.
getMessage
());
}
}
}
mall-admin/src/main/resources/dao/CmsPrefrenceAreaProductRelationDao.xml
0 → 100644
View file @
edc71542
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.macro.mall.dao.CmsPrefrenceAreaProductRelationDao"
>
<insert
id=
"insertList"
>
insert into cms_prefrence_area_product_relation (prefrence_area_id, product_id) values
<foreach
collection=
"list"
item=
"item"
separator=
","
index=
"index"
>
(#{item.prefrenceAreaId,jdbcType=BIGINT},
#{item.productId,jdbcType=BIGINT})
</foreach>
</insert>
</mapper>
\ No newline at end of file
mall-admin/src/main/resources/dao/CmsSubjectProductRelationDao.xml
0 → 100644
View file @
edc71542
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.macro.mall.dao.CmsSubjectProductRelationDao"
>
<insert
id=
"insertList"
>
insert into cms_subject_product_relation (subject_id, product_id) values
<foreach
collection=
"list"
item=
"item"
separator=
","
index=
"index"
>
(#{item.subjectId,jdbcType=BIGINT},
#{item.productId,jdbcType=BIGINT})
</foreach>
</insert>
</mapper>
\ No newline at end of file
mall-admin/src/main/resources/dao/PmsProductAttributeValueDao.xml
0 → 100644
View file @
edc71542
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.macro.mall.dao.PmsProductAttributeValueDao"
>
<insert
id=
"insertList"
>
insert into pms_product_attribute_value (product_id,product_attribute_id,value) values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{item.productId,jdbcType=BIGINT},
#{item.productAttributeId,jdbcType=BIGINT},
#{item.value,jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>
\ No newline at end of file
mall-admin/src/main/resources/dao/PmsProductFullReductionDao.xml
View file @
edc71542
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.macro.mall.dao.Pms
MemberPrice
Dao"
>
<mapper
namespace=
"com.macro.mall.dao.Pms
ProductFullReduction
Dao"
>
<insert
id=
"insertList"
>
INSERT INTO pms_product_full_reduction (product_id, full_price, reduce_price) VALUES
<foreach
collection=
"list"
separator=
","
item=
"item"
index=
"index"
>
...
...
mall-admin/src/main/resources/dao/PmsSkuStockDao.xml
0 → 100644
View file @
edc71542
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.macro.mall.dao.PmsSkuStockDao"
>
<insert
id=
"insertList"
>
INSERT INTO pms_sku_stock (product_id, sku_code, price, stock, low_stock, sp1, sp2, sp3, pic, sale) VALUES
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{item.productId,jdbcType=BIGINT},
#{item.skuCode,jdbcType=VARCHAR},
#{item.price,jdbcType=DECIMAL},
#{item.stock,jdbcType=INTEGER},
#{item.lowStock,jdbcType=INTEGER},
#{item.sp1,jdbcType=VARCHAR},
#{item.sp2,jdbcType=VARCHAR},
#{item.sp3,jdbcType=VARCHAR},
#{item.pic,jdbcType=VARCHAR},
#{item.sale,jdbcType=INTEGER})
</foreach>
</insert>
</mapper>
\ No newline at end of file
mall-mbg/src/main/java/com/macro/mall/mapper/PmsProductFullReductionMapper.java
View file @
edc71542
...
...
@@ -10,7 +10,7 @@ public interface PmsProductFullReductionMapper {
int
deleteByExample
(
PmsProductFullReductionExample
example
);
int
deleteByPrimaryKey
(
Integer
id
);
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
PmsProductFullReduction
record
);
...
...
@@ -18,7 +18,7 @@ public interface PmsProductFullReductionMapper {
List
<
PmsProductFullReduction
>
selectByExample
(
PmsProductFullReductionExample
example
);
PmsProductFullReduction
selectByPrimaryKey
(
Integer
id
);
PmsProductFullReduction
selectByPrimaryKey
(
Long
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
PmsProductFullReduction
record
,
@Param
(
"example"
)
PmsProductFullReductionExample
example
);
...
...
mall-mbg/src/main/java/com/macro/mall/model/PmsProductAttributeValue.java
View file @
edc71542
...
...
@@ -5,9 +5,9 @@ import java.io.Serializable;
public
class
PmsProductAttributeValue
implements
Serializable
{
private
Long
id
;
private
Long
p
msP
roductId
;
private
Long
productId
;
private
Long
p
msP
roductAttributeId
;
private
Long
productAttributeId
;
/**
* 存储的值
...
...
@@ -26,20 +26,20 @@ public class PmsProductAttributeValue implements Serializable {
this
.
id
=
id
;
}
public
Long
getP
msP
roductId
()
{
return
p
msP
roductId
;
public
Long
getProductId
()
{
return
productId
;
}
public
void
setP
msP
roductId
(
Long
p
msP
roductId
)
{
this
.
p
msP
roductId
=
p
msP
roductId
;
public
void
setProductId
(
Long
productId
)
{
this
.
productId
=
productId
;
}
public
Long
getP
msP
roductAttributeId
()
{
return
p
msP
roductAttributeId
;
public
Long
getProductAttributeId
()
{
return
productAttributeId
;
}
public
void
setP
msP
roductAttributeId
(
Long
p
msP
roductAttributeId
)
{
this
.
p
msP
roductAttributeId
=
p
msP
roductAttributeId
;
public
void
setProductAttributeId
(
Long
productAttributeId
)
{
this
.
productAttributeId
=
productAttributeId
;
}
public
String
getValue
()
{
...
...
@@ -57,8 +57,8 @@ public class PmsProductAttributeValue implements Serializable {
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", p
msP
roductId="
).
append
(
p
msP
roductId
);
sb
.
append
(
", p
msP
roductAttributeId="
).
append
(
p
msP
roductAttributeId
);
sb
.
append
(
", productId="
).
append
(
productId
);
sb
.
append
(
", productAttributeId="
).
append
(
productAttributeId
);
sb
.
append
(
", value="
).
append
(
value
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
...
...
mall-mbg/src/main/java/com/macro/mall/model/PmsProductAttributeValueExample.java
View file @
edc71542
...
...
@@ -164,123 +164,123 @@ public class PmsProductAttributeValueExample {
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductIdIsNull
()
{
addCriterion
(
"
pms_
product_id is null"
);
public
Criteria
andProductIdIsNull
()
{
addCriterion
(
"product_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductIdIsNotNull
()
{
addCriterion
(
"
pms_
product_id is not null"
);
public
Criteria
andProductIdIsNotNull
()
{
addCriterion
(
"product_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductIdEqualTo
(
Long
value
)
{
addCriterion
(
"
pms_
product_id ="
,
value
,
"p
msP
roductId"
);
public
Criteria
andProductIdEqualTo
(
Long
value
)
{
addCriterion
(
"product_id ="
,
value
,
"productId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"
pms_
product_id <>"
,
value
,
"p
msP
roductId"
);
public
Criteria
andProductIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"product_id <>"
,
value
,
"productId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductIdGreaterThan
(
Long
value
)
{
addCriterion
(
"
pms_
product_id >"
,
value
,
"p
msP
roductId"
);
public
Criteria
andProductIdGreaterThan
(
Long
value
)
{
addCriterion
(
"product_id >"
,
value
,
"productId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
pms_
product_id >="
,
value
,
"p
msP
roductId"
);
public
Criteria
andProductIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"product_id >="
,
value
,
"productId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductIdLessThan
(
Long
value
)
{
addCriterion
(
"
pms_
product_id <"
,
value
,
"p
msP
roductId"
);
public
Criteria
andProductIdLessThan
(
Long
value
)
{
addCriterion
(
"product_id <"
,
value
,
"productId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
pms_
product_id <="
,
value
,
"p
msP
roductId"
);
public
Criteria
andProductIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"product_id <="
,
value
,
"productId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
pms_
product_id in"
,
values
,
"p
msP
roductId"
);
public
Criteria
andProductIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"product_id in"
,
values
,
"productId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
pms_
product_id not in"
,
values
,
"p
msP
roductId"
);
public
Criteria
andProductIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"product_id not in"
,
values
,
"productId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
pms_
product_id between"
,
value1
,
value2
,
"p
msP
roductId"
);
public
Criteria
andProductIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"product_id between"
,
value1
,
value2
,
"productId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
pms_
product_id not between"
,
value1
,
value2
,
"p
msP
roductId"
);
public
Criteria
andProductIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"product_id not between"
,
value1
,
value2
,
"productId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductAttributeIdIsNull
()
{
addCriterion
(
"
pms_
product_attribute_id is null"
);
public
Criteria
andProductAttributeIdIsNull
()
{
addCriterion
(
"product_attribute_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductAttributeIdIsNotNull
()
{
addCriterion
(
"
pms_
product_attribute_id is not null"
);
public
Criteria
andProductAttributeIdIsNotNull
()
{
addCriterion
(
"product_attribute_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductAttributeIdEqualTo
(
Long
value
)
{
addCriterion
(
"
pms_
product_attribute_id ="
,
value
,
"p
msP
roductAttributeId"
);
public
Criteria
andProductAttributeIdEqualTo
(
Long
value
)
{
addCriterion
(
"product_attribute_id ="
,
value
,
"productAttributeId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductAttributeIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"
pms_
product_attribute_id <>"
,
value
,
"p
msP
roductAttributeId"
);
public
Criteria
andProductAttributeIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"product_attribute_id <>"
,
value
,
"productAttributeId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductAttributeIdGreaterThan
(
Long
value
)
{
addCriterion
(
"
pms_
product_attribute_id >"
,
value
,
"p
msP
roductAttributeId"
);
public
Criteria
andProductAttributeIdGreaterThan
(
Long
value
)
{
addCriterion
(
"product_attribute_id >"
,
value
,
"productAttributeId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductAttributeIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
pms_
product_attribute_id >="
,
value
,
"p
msP
roductAttributeId"
);
public
Criteria
andProductAttributeIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"product_attribute_id >="
,
value
,
"productAttributeId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductAttributeIdLessThan
(
Long
value
)
{
addCriterion
(
"
pms_
product_attribute_id <"
,
value
,
"p
msP
roductAttributeId"
);
public
Criteria
andProductAttributeIdLessThan
(
Long
value
)
{
addCriterion
(
"product_attribute_id <"
,
value
,
"productAttributeId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductAttributeIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
pms_
product_attribute_id <="
,
value
,
"p
msP
roductAttributeId"
);
public
Criteria
andProductAttributeIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"product_attribute_id <="
,
value
,
"productAttributeId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductAttributeIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
pms_
product_attribute_id in"
,
values
,
"p
msP
roductAttributeId"
);
public
Criteria
andProductAttributeIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"product_attribute_id in"
,
values
,
"productAttributeId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductAttributeIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
pms_
product_attribute_id not in"
,
values
,
"p
msP
roductAttributeId"
);
public
Criteria
andProductAttributeIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"product_attribute_id not in"
,
values
,
"productAttributeId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductAttributeIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
pms_
product_attribute_id between"
,
value1
,
value2
,
"p
msP
roductAttributeId"
);
public
Criteria
andProductAttributeIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"product_attribute_id between"
,
value1
,
value2
,
"productAttributeId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andP
msP
roductAttributeIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
pms_
product_attribute_id not between"
,
value1
,
value2
,
"p
msP
roductAttributeId"
);
public
Criteria
andProductAttributeIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"product_attribute_id not between"
,
value1
,
value2
,
"productAttributeId"
);
return
(
Criteria
)
this
;
}
...
...
mall-mbg/src/main/java/com/macro/mall/model/PmsProductFullReduction.java
View file @
edc71542
...
...
@@ -4,7 +4,7 @@ import java.io.Serializable;
import
java.math.BigDecimal
;
public
class
PmsProductFullReduction
implements
Serializable
{
private
Integer
id
;
private
Long
id
;
private
Long
productId
;
...
...
@@ -14,11 +14,11 @@ public class PmsProductFullReduction implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
public
Integer
getId
()
{
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
...
...
mall-mbg/src/main/java/com/macro/mall/model/PmsProductFullReductionExample.java
View file @
edc71542
...
...
@@ -115,52 +115,52 @@ public class PmsProductFullReductionExample {
return
(
Criteria
)
this
;
}
public
Criteria
andIdEqualTo
(
Integer
value
)
{
public
Criteria
andIdEqualTo
(
Long
value
)
{
addCriterion
(
"id ="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotEqualTo
(
Integer
value
)
{
public
Criteria
andIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"id <>"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThan
(
Integer
value
)
{
public
Criteria
andIdGreaterThan
(
Long
value
)
{
addCriterion
(
"id >"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThanOrEqualTo
(
Integer
value
)
{
public
Criteria
andIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id >="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThan
(
Integer
value
)
{
public
Criteria
andIdLessThan
(
Long
value
)
{
addCriterion
(
"id <"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThanOrEqualTo
(
Integer
value
)
{
public
Criteria
andIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id <="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIn
(
List
<
Integer
>
values
)
{
public
Criteria
andIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotIn
(
List
<
Integer
>
values
)
{
public
Criteria
andIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id not in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdBetween
(
Integer
value1
,
Integer
value2
)
{
public
Criteria
andIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotBetween
(
Integer
value1
,
Integer
value2
)
{
public
Criteria
andIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id not between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
...
...
Prev
1
2
3
4
5
Next
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