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
201b405a
Commit
201b405a
authored
Aug 28, 2018
by
zhh
Browse files
添加优惠券管理接口
parent
a5faaf15
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
document/pdm/mall.pdb
View file @
201b405a
This diff is collapsed.
Click to expand it.
document/pdm/mall.pdm
View file @
201b405a
<?xml version="1.0" encoding="UTF-8"?>
<?PowerDesigner AppLocale="UTF16" ID="{7BB41C87-EFE8-409A-A86E-B1C3FCE34F8C}" Label="" LastModificationDate="15354
39531
" Name="mall" Objects="102
2
" Symbols="127" 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="15354
45907
" Name="mall" Objects="102
3
" Symbols="127" 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">
...
...
@@ -4739,8 +4739,8 @@ DESTINATION 0 新宋体,8,N</a:FontList>
<o:ReferenceSymbol Id="o90">
<a:CreationDate>1522215975</a:CreationDate>
<a:ModificationDate>1522398810</a:ModificationDate>
<a:Rect>((62000,15458
2
), (65163,15583
2
))</a:Rect>
<a:ListOfPoints>((62400,1552
07
),(64763,1552
07
))</a:ListOfPoints>
<a:Rect>((62000,15458
6
), (65163,15583
6
))</a:Rect>
<a:ListOfPoints>((62400,1552
11
),(64763,1552
11
))</a:ListOfPoints>
<a:CornerStyle>1</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>12615680</a:LineColor>
...
...
@@ -4783,8 +4783,8 @@ DESTINATION 0 新宋体,8,N</a:FontList>
<o:ReferenceSymbol Id="o96">
<a:CreationDate>1522216251</a:CreationDate>
<a:ModificationDate>1522398808</a:ModificationDate>
<a:Rect>((62486,14499
5
), (65163,14624
5
))</a:Rect>
<a:ListOfPoints>((62886,1456
20
),(64763,1456
20
))</a:ListOfPoints>
<a:Rect>((62486,14499
2
), (65163,14624
2
))</a:Rect>
<a:ListOfPoints>((62886,1456
17
),(64763,1456
17
))</a:ListOfPoints>
<a:CornerStyle>1</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>12615680</a:LineColor>
...
...
@@ -4827,8 +4827,8 @@ DESTINATION 0 新宋体,8,N</a:FontList>
<o:ReferenceSymbol Id="o101">
<a:CreationDate>1522220508</a:CreationDate>
<a:ModificationDate>1522398822</a:ModificationDate>
<a:Rect>((77597,15120
4
), (82750,15245
4
))</a:Rect>
<a:ListOfPoints>((82350,1518
29
),(77997,1518
29
))</a:ListOfPoints>
<a:Rect>((77597,15120
5
), (82750,15245
5
))</a:Rect>
<a:ListOfPoints>((82350,1518
30
),(77997,1518
30
))</a:ListOfPoints>
<a:CornerStyle>1</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>12615680</a:LineColor>
...
...
@@ -5356,8 +5356,8 @@ DESTINATION 0 新宋体,8,N</a:FontList>
<o:ReferenceSymbol Id="o170">
<a:CreationDate>1522724329</a:CreationDate>
<a:ModificationDate>1522724329</a:ModificationDate>
<a:Rect>((-100297,77071), (65163,15316
5
))</a:Rect>
<a:ListOfPoints>((-99897,102538),(-99897,77471),(35821,77471),(35821,15254
0
),(64763,15254
0
))</a:ListOfPoints>
<a:Rect>((-100297,77071), (65163,15316
6
))</a:Rect>
<a:ListOfPoints>((-99897,102538),(-99897,77471),(35821,77471),(35821,15254
1
),(64763,15254
1
))</a:ListOfPoints>
<a:CornerStyle>1</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>12615680</a:LineColor>
...
...
@@ -6285,7 +6285,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1522215010</a:CreationDate>
<a:ModificationDate>1535438727</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((64763,14088
6
), (77997,15715
8
))</a:Rect>
<a:Rect>((64763,14088
5
), (77997,15715
9
))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
...
...
@@ -11041,7 +11041,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Code>sms_coupon</a:Code>
<a:CreationDate>1522215010</a:CreationDate>
<a:Creator>zhenghong</a:Creator>
<a:ModificationDate>15354
39531
</a:ModificationDate>
<a:ModificationDate>15354
44414
</a:ModificationDate>
<a:Modifier>zhenghong</a:Modifier>
<a:Comment>优惠卷表</a:Comment>
<a:TotalSavingCurrency/>
...
...
@@ -11087,10 +11087,10 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Code>platform</a:Code>
<a:CreationDate>1522215086</a:CreationDate>
<a:Creator>zhenghong</a:Creator>
<a:ModificationDate>15
22215279
</a:ModificationDate>
<a:ModificationDate>15
35445907
</a:ModificationDate>
<a:Modifier>zhenghong</a:Modifier>
<a:Comment>使用平台:0->全部;1->移动;2->PC</a:Comment>
<a:DataType>
varchar
(1)</a:DataType>
<a:DataType>
int
(1)</a:DataType>
<a:Length>1</a:Length>
</o:Column>
<o:Column Id="o559">
...
...
@@ -11301,9 +11301,9 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Code>coupon_id</a:Code>
<a:CreationDate>1522215975</a:CreationDate>
<a:Creator>zhenghong</a:Creator>
<a:ModificationDate>15
22215991
</a:ModificationDate>
<a:ModificationDate>15
35445127
</a:ModificationDate>
<a:Modifier>zhenghong</a:Modifier>
<a:DataType>int</a:DataType>
<a:DataType>
big
int</a:DataType>
</o:Column>
<o:Column Id="o576">
<a:ObjectID>39E7492F-B104-48BA-9460-88C66C6B971E</a:ObjectID>
...
...
mall-admin/src/main/java/com/macro/mall/controller/PmsProductController.java
View file @
201b405a
...
...
@@ -5,7 +5,6 @@ import com.macro.mall.dto.PmsProductParam;
import
com.macro.mall.dto.PmsProductQueryParam
;
import
com.macro.mall.dto.PmsProductResult
;
import
com.macro.mall.model.PmsProduct
;
import
com.macro.mall.model.PmsProductVertifyRecord
;
import
com.macro.mall.service.PmsProductService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -60,7 +59,7 @@ public class PmsProductController {
}
@ApiOperation
(
"查询商品"
)
@RequestMapping
(
value
=
"list"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"
/
list"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Object
getList
(
PmsProductQueryParam
productQueryParam
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"5"
)
Integer
pageSize
,
...
...
mall-admin/src/main/java/com/macro/mall/controller/SmsCouponController.java
0 → 100644
View file @
201b405a
package
com.macro.mall.controller
;
import
com.macro.mall.dto.CommonResult
;
import
com.macro.mall.dto.SmsCouponParam
;
import
com.macro.mall.model.SmsCoupon
;
import
com.macro.mall.service.SmsCouponService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 优惠券管理Controller
* Created by macro on 2018/8/28.
*/
@Controller
@Api
(
tags
=
"SmsCouponController"
,
description
=
"优惠券管理"
)
@RequestMapping
(
"/coupon"
)
public
class
SmsCouponController
{
@Autowired
private
SmsCouponService
couponService
;
@ApiOperation
(
"添加优惠券"
)
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
add
(
@RequestBody
SmsCouponParam
couponParam
)
{
int
count
=
couponService
.
add
(
couponParam
);
if
(
count
>
0
){
return
new
CommonResult
().
success
(
count
);
}
return
new
CommonResult
().
failed
();
}
@ApiOperation
(
"删除优惠券"
)
@RequestMapping
(
value
=
"/delete/{id}"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
delete
(
@PathVariable
Long
id
)
{
int
count
=
couponService
.
delete
(
id
);
if
(
count
>
0
){
return
new
CommonResult
().
success
(
count
);
}
return
new
CommonResult
().
failed
();
}
@ApiOperation
(
"修改优惠券"
)
@RequestMapping
(
value
=
"/update/{id}"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
update
(
@PathVariable
Long
id
,
@RequestBody
SmsCouponParam
couponParam
)
{
int
count
=
couponService
.
update
(
id
,
couponParam
);
if
(
count
>
0
){
return
new
CommonResult
().
success
(
count
);
}
return
new
CommonResult
().
failed
();
}
@ApiOperation
(
"根据优惠券名称和类型分页获取优惠券列表"
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Object
list
(
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
value
=
"type"
,
required
=
false
)
Integer
type
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"5"
)
Integer
pageSize
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
)
{
List
<
SmsCoupon
>
couponList
=
couponService
.
list
(
name
,
type
,
pageSize
,
pageNum
);
return
new
CommonResult
().
pageSuccess
(
couponList
);
}
}
mall-admin/src/main/java/com/macro/mall/dao/SmsCouponProductCategoryRelationDao.java
0 → 100644
View file @
201b405a
package
com.macro.mall.dao
;
import
com.macro.mall.model.SmsCouponProductCategoryRelation
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 优惠券和商品分类关系自定义Dao
* Created by macro on 2018/8/28.
*/
public
interface
SmsCouponProductCategoryRelationDao
{
int
insertList
(
@Param
(
"list"
)
List
<
SmsCouponProductCategoryRelation
>
productCategoryRelationList
);
}
mall-admin/src/main/java/com/macro/mall/dao/SmsCouponProductRelationDao.java
0 → 100644
View file @
201b405a
package
com.macro.mall.dao
;
import
com.macro.mall.model.SmsCouponProductRelation
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 优惠券和产品关系自定义Dao
* Created by macro on 2018/8/28.
*/
public
interface
SmsCouponProductRelationDao
{
int
insertList
(
@Param
(
"list"
)
List
<
SmsCouponProductRelation
>
productRelationList
);
}
mall-admin/src/main/java/com/macro/mall/dto/SmsCouponParam.java
0 → 100644
View file @
201b405a
package
com.macro.mall.dto
;
import
com.macro.mall.model.SmsCoupon
;
import
com.macro.mall.model.SmsCouponProductCategoryRelation
;
import
com.macro.mall.model.SmsCouponProductRelation
;
import
java.util.List
;
/**
* 优惠券信息封装,包括绑定商品和绑定分类
* Created by macro on 2018/8/28.
*/
public
class
SmsCouponParam
extends
SmsCoupon
{
//优惠券绑定的商品
private
List
<
SmsCouponProductRelation
>
productRelationList
;
//优惠券绑定的商品分类
private
List
<
SmsCouponProductCategoryRelation
>
productCategoryRelationList
;
public
List
<
SmsCouponProductRelation
>
getProductRelationList
()
{
return
productRelationList
;
}
public
void
setProductRelationList
(
List
<
SmsCouponProductRelation
>
productRelationList
)
{
this
.
productRelationList
=
productRelationList
;
}
public
List
<
SmsCouponProductCategoryRelation
>
getProductCategoryRelationList
()
{
return
productCategoryRelationList
;
}
public
void
setProductCategoryRelationList
(
List
<
SmsCouponProductCategoryRelation
>
productCategoryRelationList
)
{
this
.
productCategoryRelationList
=
productCategoryRelationList
;
}
}
mall-admin/src/main/java/com/macro/mall/service/SmsCouponService.java
0 → 100644
View file @
201b405a
package
com.macro.mall.service
;
import
com.macro.mall.dto.SmsCouponParam
;
import
com.macro.mall.model.SmsCoupon
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
/**
* 优惠券管理Service
* Created by macro on 2018/8/28.
*/
public
interface
SmsCouponService
{
/**
* 添加优惠券
*/
@Transactional
int
add
(
SmsCouponParam
couponParam
);
/**
* 根据优惠券id删除优惠券
*/
@Transactional
int
delete
(
Long
id
);
/**
* 根据优惠券id更新优惠券信息
*/
@Transactional
int
update
(
Long
id
,
SmsCouponParam
couponParam
);
/**
* 分页获取优惠券列表
*/
List
<
SmsCoupon
>
list
(
String
name
,
Integer
type
,
Integer
pageSize
,
Integer
pageNum
);
}
mall-admin/src/main/java/com/macro/mall/service/impl/SmsCouponServiceImpl.java
0 → 100644
View file @
201b405a
package
com.macro.mall.service.impl
;
import
com.github.pagehelper.PageHelper
;
import
com.macro.mall.dao.SmsCouponProductCategoryRelationDao
;
import
com.macro.mall.dao.SmsCouponProductRelationDao
;
import
com.macro.mall.dto.SmsCouponParam
;
import
com.macro.mall.mapper.SmsCouponMapper
;
import
com.macro.mall.mapper.SmsCouponProductCategoryRelationMapper
;
import
com.macro.mall.mapper.SmsCouponProductRelationMapper
;
import
com.macro.mall.model.*
;
import
com.macro.mall.service.SmsCouponService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.List
;
/**
* 优惠券管理Service实现类
* Created by macro on 2018/8/28.
*/
@Service
public
class
SmsCouponServiceImpl
implements
SmsCouponService
{
@Autowired
private
SmsCouponMapper
couponMapper
;
@Autowired
private
SmsCouponProductRelationMapper
productRelationMapper
;
@Autowired
private
SmsCouponProductCategoryRelationMapper
productCategoryRelationMapper
;
@Autowired
private
SmsCouponProductRelationDao
productRelationDao
;
@Autowired
private
SmsCouponProductCategoryRelationDao
productCategoryRelationDao
;
@Override
public
int
add
(
SmsCouponParam
couponParam
)
{
//插入优惠券表
// TODO: 2018/8/28 生成优惠券条码
int
count
=
couponMapper
.
insert
(
couponParam
);
//插入优惠券和商品关系表
if
(
couponParam
.
getUseType
().
equals
(
2
)){
for
(
SmsCouponProductRelation
productRelation:
couponParam
.
getProductRelationList
()){
productRelation
.
setCouponId
(
couponParam
.
getId
());
}
productRelationDao
.
insertList
(
couponParam
.
getProductRelationList
());
}
//插入优惠券和商品分类关系表
if
(
couponParam
.
getUseType
().
equals
(
1
)){
for
(
SmsCouponProductCategoryRelation
couponProductCategoryRelation
:
couponParam
.
getProductCategoryRelationList
())
{
couponProductCategoryRelation
.
setCouponId
(
couponParam
.
getId
());
}
productCategoryRelationDao
.
insertList
(
couponParam
.
getProductCategoryRelationList
());
}
return
count
;
}
@Override
public
int
delete
(
Long
id
)
{
//删除优惠券
int
count
=
couponMapper
.
deleteByPrimaryKey
(
id
);
//删除商品关联
deleteProductRelation
(
id
);
//删除商品分类关联
deleteProductCategoryRelation
(
id
);
return
count
;
}
private
void
deleteProductCategoryRelation
(
Long
id
)
{
SmsCouponProductCategoryRelationExample
productCategoryRelationExample
=
new
SmsCouponProductCategoryRelationExample
();
productCategoryRelationExample
.
createCriteria
().
andCouponIdEqualTo
(
id
);
productCategoryRelationMapper
.
deleteByExample
(
productCategoryRelationExample
);
}
private
void
deleteProductRelation
(
Long
id
)
{
SmsCouponProductRelationExample
productRelationExample
=
new
SmsCouponProductRelationExample
();
productRelationExample
.
createCriteria
().
andCouponIdEqualTo
(
id
);
productRelationMapper
.
deleteByExample
(
productRelationExample
);
}
@Override
public
int
update
(
Long
id
,
SmsCouponParam
couponParam
)
{
couponParam
.
setId
(
id
);
int
count
=
couponMapper
.
updateByPrimaryKey
(
couponParam
);
//删除后插入优惠券和商品关系表
if
(
couponParam
.
getUseType
().
equals
(
2
)){
for
(
SmsCouponProductRelation
productRelation:
couponParam
.
getProductRelationList
()){
productRelation
.
setCouponId
(
couponParam
.
getId
());
}
deleteProductRelation
(
id
);
productRelationDao
.
insertList
(
couponParam
.
getProductRelationList
());
}
//删除后插入优惠券和商品分类关系表
if
(
couponParam
.
getUseType
().
equals
(
1
)){
for
(
SmsCouponProductCategoryRelation
couponProductCategoryRelation
:
couponParam
.
getProductCategoryRelationList
())
{
couponProductCategoryRelation
.
setCouponId
(
couponParam
.
getId
());
}
deleteProductCategoryRelation
(
id
);
productCategoryRelationDao
.
insertList
(
couponParam
.
getProductCategoryRelationList
());
}
return
count
;
}
@Override
public
List
<
SmsCoupon
>
list
(
String
name
,
Integer
type
,
Integer
pageSize
,
Integer
pageNum
)
{
SmsCouponExample
example
=
new
SmsCouponExample
();
SmsCouponExample
.
Criteria
criteria
=
example
.
createCriteria
();
if
(!
StringUtils
.
isEmpty
(
name
)){
criteria
.
andNameLike
(
"%"
+
name
+
"%"
);
}
if
(
type
!=
null
){
criteria
.
andTypeEqualTo
(
type
);
}
PageHelper
.
startPage
(
pageNum
,
pageSize
);
return
couponMapper
.
selectByExample
(
example
);
}
}
mall-admin/src/main/resources/dao/SmsCouponProductCategoryRelationDao.xml
0 → 100644
View file @
201b405a
<?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.SmsCouponProductCategoryRelationDao"
>
<insert
id=
"insertList"
>
INSERT INTO sms_coupon_product_category_relation (product_category_id,coupon_id) VALUES
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{item.productCategoryId,jdbcType=BIGINT},
#{item.couponId,jdbcType=INTEGER})
</foreach>
</insert>
</mapper>
\ No newline at end of file
mall-admin/src/main/resources/dao/SmsCouponProductRelationDao.xml
0 → 100644
View file @
201b405a
<?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.SmsCouponProductRelationDao"
>
<insert
id=
"insertList"
>
INSERT INTO sms_coupon_product_relation (product_id,coupon_id) VALUES
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{item.productId,jdbcType=BIGINT},
#{item.couponId,jdbcType=INTEGER})
</foreach>
</insert>
</mapper>
\ No newline at end of file
mall-mbg/src/main/java/com/macro/mall/model/SmsCoupon.java
View file @
201b405a
...
...
@@ -21,7 +21,7 @@ public class SmsCoupon implements Serializable {
*
* @mbggenerated
*/
private
String
platform
;
private
Integer
platform
;
/**
* 数量
...
...
@@ -137,11 +137,11 @@ public class SmsCoupon implements Serializable {
this
.
name
=
name
;
}
public
String
getPlatform
()
{
public
Integer
getPlatform
()
{
return
platform
;
}
public
void
setPlatform
(
String
platform
)
{
public
void
setPlatform
(
Integer
platform
)
{
this
.
platform
=
platform
;
}
...
...
mall-mbg/src/main/java/com/macro/mall/model/SmsCouponExample.java
View file @
201b405a
...
...
@@ -306,62 +306,52 @@ public class SmsCouponExample {
return
(
Criteria
)
this
;
}
public
Criteria
andPlatformEqualTo
(
String
value
)
{
public
Criteria
andPlatformEqualTo
(
Integer
value
)
{
addCriterion
(
"platform ="
,
value
,
"platform"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPlatformNotEqualTo
(
String
value
)
{
public
Criteria
andPlatformNotEqualTo
(
Integer
value
)
{
addCriterion
(
"platform <>"
,
value
,
"platform"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPlatformGreaterThan
(
String
value
)
{
public
Criteria
andPlatformGreaterThan
(
Integer
value
)
{
addCriterion
(
"platform >"
,
value
,
"platform"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPlatformGreaterThanOrEqualTo
(
String
value
)
{
public
Criteria
andPlatformGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"platform >="
,
value
,
"platform"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPlatformLessThan
(
String
value
)
{
public
Criteria
andPlatformLessThan
(
Integer
value
)
{
addCriterion
(
"platform <"
,
value
,
"platform"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPlatformLessThanOrEqualTo
(
String
value
)
{
public
Criteria
andPlatformLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"platform <="
,
value
,
"platform"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPlatformLike
(
String
value
)
{
addCriterion
(
"platform like"
,
value
,
"platform"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPlatformNotLike
(
String
value
)
{
addCriterion
(
"platform not like"
,
value
,
"platform"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPlatformIn
(
List
<
String
>
values
)
{
public
Criteria
andPlatformIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"platform in"
,
values
,
"platform"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPlatformNotIn
(
List
<
String
>
values
)
{
public
Criteria
andPlatformNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"platform not in"
,
values
,
"platform"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPlatformBetween
(
String
value1
,
String
value2
)
{
public
Criteria
andPlatformBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"platform between"
,
value1
,
value2
,
"platform"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPlatformNotBetween
(
String
value1
,
String
value2
)
{
public
Criteria
andPlatformNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"platform not between"
,
value1
,
value2
,
"platform"
);
return
(
Criteria
)
this
;
}
...
...
mall-mbg/src/main/java/com/macro/mall/model/SmsCouponProductRelation.java
View file @
201b405a
...
...
@@ -5,7 +5,7 @@ import java.io.Serializable;
public
class
SmsCouponProductRelation
implements
Serializable
{
private
Long
id
;
private
Integer
couponId
;
private
Long
couponId
;
private
Long
productId
;
...
...
@@ -19,11 +19,11 @@ public class SmsCouponProductRelation implements Serializable {
this
.
id
=
id
;
}
public
Integer
getCouponId
()
{
public
Long
getCouponId
()
{
return
couponId
;
}
public
void
setCouponId
(
Integer
couponId
)
{
public
void
setCouponId
(
Long
couponId
)
{
this
.
couponId
=
couponId
;
}
...
...
mall-mbg/src/main/java/com/macro/mall/model/SmsCouponProductRelationExample.java
View file @
201b405a
...
...
@@ -174,52 +174,52 @@ public class SmsCouponProductRelationExample {
return
(
Criteria
)
this
;
}
public
Criteria
andCouponIdEqualTo
(
Integer
value
)
{
public
Criteria
andCouponIdEqualTo
(
Long
value
)
{
addCriterion
(
"coupon_id ="
,
value
,
"couponId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCouponIdNotEqualTo
(
Integer
value
)
{
public
Criteria
andCouponIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"coupon_id <>"
,
value
,
"couponId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCouponIdGreaterThan
(
Integer
value
)
{
public
Criteria
andCouponIdGreaterThan
(
Long
value
)
{
addCriterion
(
"coupon_id >"
,
value
,
"couponId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCouponIdGreaterThanOrEqualTo
(
Integer
value
)
{
public
Criteria
andCouponIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"coupon_id >="
,
value
,
"couponId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCouponIdLessThan
(
Integer
value
)
{
public
Criteria
andCouponIdLessThan
(
Long
value
)
{
addCriterion
(
"coupon_id <"
,
value
,
"couponId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCouponIdLessThanOrEqualTo
(
Integer
value
)
{
public
Criteria
andCouponIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"coupon_id <="
,
value
,
"couponId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCouponIdIn
(
List
<
Integer
>
values
)
{
public
Criteria
andCouponIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"coupon_id in"
,
values
,
"couponId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCouponIdNotIn
(
List
<
Integer
>
values
)
{
public
Criteria
andCouponIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"coupon_id not in"
,
values
,
"couponId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCouponIdBetween
(
Integer
value1
,
Integer
value2
)
{
public
Criteria
andCouponIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"coupon_id between"
,
value1
,
value2
,
"couponId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCouponIdNotBetween
(
Integer
value1
,
Integer
value2
)
{
public
Criteria
andCouponIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"coupon_id not between"
,
value1
,
value2
,
"couponId"
);
return
(
Criteria
)
this
;
}
...
...
mall-mbg/src/main/resources/com/macro/mall/mapper/SmsCouponMapper.xml
View file @
201b405a
...
...
@@ -5,7 +5,7 @@
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"type"
jdbcType=
"INTEGER"
property=
"type"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"platform"
jdbcType=
"
VARCHA
R"
property=
"platform"
/>
<result
column=
"platform"
jdbcType=
"
INTEGE
R"
property=
"platform"
/>
<result
column=
"count"
jdbcType=
"INTEGER"
property=
"count"
/>
<result
column=
"amount"
jdbcType=
"DECIMAL"
property=
"amount"
/>
<result
column=
"per_limit"
jdbcType=
"INTEGER"
property=
"perLimit"
/>
...
...
@@ -123,7 +123,7 @@
use_type, note, publish_count,
use_count, receive_count, enable_time,
code, member_level)
values (#{type,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{platform,jdbcType=
VARCHA
R},
values (#{type,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{platform,jdbcType=
INTEGE
R},
#{count,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, #{perLimit,jdbcType=INTEGER},
#{minPoint,jdbcType=DECIMAL}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
#{useType,jdbcType=INTEGER}, #{note,jdbcType=VARCHAR}, #{publishCount,jdbcType=INTEGER},
...
...
@@ -196,7 +196,7 @@
#{name,jdbcType=VARCHAR},
</if>
<if
test=
"platform != null"
>
#{platform,jdbcType=
VARCHA
R},
#{platform,jdbcType=
INTEGE
R},
</if>
<if
test=
"count != null"
>
#{count,jdbcType=INTEGER},
...
...
@@ -261,7 +261,7 @@
name = #{record.name,jdbcType=VARCHAR},
</if>
<if
test=
"record.platform != null"
>
platform = #{record.platform,jdbcType=
VARCHA
R},
platform = #{record.platform,jdbcType=
INTEGE
R},
</if>
<if
test=
"record.count != null"
>
count = #{record.count,jdbcType=INTEGER},
...
...
@@ -315,7 +315,7 @@
set id = #{record.id,jdbcType=BIGINT},
type = #{record.type,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR},
platform = #{record.platform,jdbcType=
VARCHA
R},
platform = #{record.platform,jdbcType=
INTEGE
R},
count = #{record.count,jdbcType=INTEGER},
amount = #{record.amount,jdbcType=DECIMAL},
per_limit = #{record.perLimit,jdbcType=INTEGER},
...
...
@@ -344,7 +344,7 @@
name = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"platform != null"
>
platform = #{platform,jdbcType=
VARCHA
R},
platform = #{platform,jdbcType=
INTEGE
R},
</if>
<if
test=
"count != null"
>
count = #{count,jdbcType=INTEGER},
...
...
@@ -395,7 +395,7 @@
update sms_coupon
set type = #{type,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
platform = #{platform,jdbcType=
VARCHA
R},
platform = #{platform,jdbcType=
INTEGE
R},
count = #{count,jdbcType=INTEGER},
amount = #{amount,jdbcType=DECIMAL},
per_limit = #{perLimit,jdbcType=INTEGER},
...
...
mall-mbg/src/main/resources/com/macro/mall/mapper/SmsCouponProductRelationMapper.xml
View file @
201b405a
...
...
@@ -3,7 +3,7 @@
<mapper
namespace=
"com.macro.mall.mapper.SmsCouponProductRelationMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.macro.mall.model.SmsCouponProductRelation"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"coupon_id"
jdbcType=
"INT
EGER
"
property=
"couponId"
/>
<result
column=
"coupon_id"
jdbcType=
"
BIG
INT"
property=
"couponId"
/>
<result
column=
"product_id"
jdbcType=
"BIGINT"
property=
"productId"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
...
...
@@ -102,7 +102,7 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into sms_coupon_product_relation (coupon_id, product_id)
values (#{couponId,jdbcType=INT
EGER
}, #{productId,jdbcType=BIGINT})
values (#{couponId,jdbcType=
BIG
INT}, #{productId,jdbcType=BIGINT})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.macro.mall.model.SmsCouponProductRelation"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
...
...
@@ -119,7 +119,7 @@
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"couponId != null"
>
#{couponId,jdbcType=INT
EGER
},
#{couponId,jdbcType=
BIG
INT},
</if>
<if
test=
"productId != null"
>
#{productId,jdbcType=BIGINT},
...
...
@@ -139,7 +139,7 @@
id = #{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.couponId != null"
>
coupon_id = #{record.couponId,jdbcType=INT
EGER
},
coupon_id = #{record.couponId,jdbcType=
BIG
INT},
</if>
<if
test=
"record.productId != null"
>
product_id = #{record.productId,jdbcType=BIGINT},
...
...
@@ -152,7 +152,7 @@
<update
id=
"updateByExample"
parameterType=
"map"
>
update sms_coupon_product_relation
set id = #{record.id,jdbcType=BIGINT},
coupon_id = #{record.couponId,jdbcType=INT
EGER
},
coupon_id = #{record.couponId,jdbcType=
BIG
INT},
product_id = #{record.productId,jdbcType=BIGINT}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -162,7 +162,7 @@
update sms_coupon_product_relation
<set>
<if
test=
"couponId != null"
>
coupon_id = #{couponId,jdbcType=INT
EGER
},
coupon_id = #{couponId,jdbcType=
BIG
INT},
</if>
<if
test=
"productId != null"
>
product_id = #{productId,jdbcType=BIGINT},
...
...
@@ -172,7 +172,7 @@
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.macro.mall.model.SmsCouponProductRelation"
>
update sms_coupon_product_relation
set coupon_id = #{couponId,jdbcType=INT
EGER
},
set coupon_id = #{couponId,jdbcType=
BIG
INT},
product_id = #{productId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
...
...
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