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
8ef1fcc9
Commit
8ef1fcc9
authored
Nov 06, 2018
by
zhh
Browse files
优惠券、首页品牌、首页新品接口添加
parent
616c4d33
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
document/pdm/mall.pdb
View file @
8ef1fcc9
This diff is collapsed.
Click to expand it.
document/pdm/mall.pdm
View file @
8ef1fcc9
This diff is collapsed.
Click to expand it.
mall-admin/src/main/java/com/macro/mall/controller/SmsCouponController.java
View file @
8ef1fcc9
...
...
@@ -62,7 +62,7 @@ public class SmsCouponController {
@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
)
{
@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/controller/SmsCouponHistoryController.java
0 → 100644
View file @
8ef1fcc9
package
com.macro.mall.controller
;
import
com.macro.mall.dto.CommonResult
;
import
com.macro.mall.model.SmsCouponHistory
;
import
com.macro.mall.service.SmsCouponHistoryService
;
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.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
/**
* 优惠券领取记录管理Controller
* Created by macro on 2018/11/6.
*/
@Controller
@Api
(
tags
=
"SmsCouponHistoryController"
,
description
=
"优惠券领取记录管理"
)
@RequestMapping
(
"/couponHistory"
)
public
class
SmsCouponHistoryController
{
@Autowired
private
SmsCouponHistoryService
historyService
;
@ApiOperation
(
"根据优惠券id,使用状态,订单编号分页获取领取记录"
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Object
list
(
@RequestParam
(
value
=
"couponId"
,
required
=
false
)
Long
couponId
,
@RequestParam
(
value
=
"useStatus"
,
required
=
false
)
Integer
useStatus
,
@RequestParam
(
value
=
"orderSn"
,
required
=
false
)
String
orderSn
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"5"
)
Integer
pageSize
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
){
List
<
SmsCouponHistory
>
historyList
=
historyService
.
list
(
couponId
,
useStatus
,
orderSn
,
pageSize
,
pageNum
);
return
new
CommonResult
().
pageSuccess
(
historyList
);
}
}
mall-admin/src/main/java/com/macro/mall/controller/SmsHomeBrandController.java
0 → 100644
View file @
8ef1fcc9
package
com.macro.mall.controller
;
import
com.macro.mall.dto.CommonResult
;
import
com.macro.mall.model.SmsHomeBrand
;
import
com.macro.mall.service.SmsHomeBrandService
;
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/11/6.
*/
@Controller
@Api
(
tags
=
"SmsHomeBrandController"
,
description
=
"首页品牌管理"
)
@RequestMapping
(
"/home/brand"
)
public
class
SmsHomeBrandController
{
@Autowired
private
SmsHomeBrandService
homeBrandService
;
@ApiOperation
(
"添加首页推荐品牌"
)
@RequestMapping
(
value
=
"/create"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
create
(
@RequestBody
List
<
SmsHomeBrand
>
homeBrandList
)
{
int
count
=
homeBrandService
.
create
(
homeBrandList
);
if
(
count
>
0
){
return
new
CommonResult
().
success
(
count
);
}
return
new
CommonResult
().
failed
();
}
@ApiOperation
(
"修改品牌排序"
)
@RequestMapping
(
value
=
"/update/sort/{id}"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
updateSort
(
@PathVariable
Long
id
,
Integer
sort
)
{
int
count
=
homeBrandService
.
updateSort
(
id
,
sort
);
if
(
count
>
0
){
return
new
CommonResult
().
success
(
count
);
}
return
new
CommonResult
().
failed
();
}
@ApiOperation
(
"批量删除推荐品牌"
)
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
int
count
=
homeBrandService
.
delete
(
ids
);
if
(
count
>
0
){
return
new
CommonResult
().
success
(
count
);
}
return
new
CommonResult
().
failed
();
}
@ApiOperation
(
"批量修改推荐状态"
)
@RequestMapping
(
value
=
"/update/recommendStatus"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
updateRecommendStatus
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
,
@RequestParam
Integer
recommendStatus
)
{
int
count
=
homeBrandService
.
updateRecommendStatus
(
ids
,
recommendStatus
);
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
=
"brandName"
,
required
=
false
)
String
brandName
,
@RequestParam
(
value
=
"recommendStatus"
,
required
=
false
)
Integer
recommendStatus
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"5"
)
Integer
pageSize
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
)
{
List
<
SmsHomeBrand
>
homeBrandList
=
homeBrandService
.
list
(
brandName
,
recommendStatus
,
pageSize
,
pageNum
);
return
new
CommonResult
().
pageSuccess
(
homeBrandList
);
}
}
mall-admin/src/main/java/com/macro/mall/controller/SmsHomeNewProductController.java
0 → 100644
View file @
8ef1fcc9
package
com.macro.mall.controller
;
import
com.macro.mall.dto.CommonResult
;
import
com.macro.mall.model.SmsHomeNewProduct
;
import
com.macro.mall.service.SmsHomeNewProductService
;
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/11/6.
*/
@Controller
@Api
(
tags
=
"SmsHomeNewProductController"
,
description
=
"首页新品管理"
)
@RequestMapping
(
"/home/newProduct"
)
public
class
SmsHomeNewProductController
{
@Autowired
private
SmsHomeNewProductService
homeNewProductService
;
@ApiOperation
(
"添加首页推荐品牌"
)
@RequestMapping
(
value
=
"/create"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
create
(
@RequestBody
List
<
SmsHomeNewProduct
>
homeBrandList
)
{
int
count
=
homeNewProductService
.
create
(
homeBrandList
);
if
(
count
>
0
){
return
new
CommonResult
().
success
(
count
);
}
return
new
CommonResult
().
failed
();
}
@ApiOperation
(
"修改推荐排序"
)
@RequestMapping
(
value
=
"/update/sort/{id}"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
updateSort
(
@PathVariable
Long
id
,
Integer
sort
)
{
int
count
=
homeNewProductService
.
updateSort
(
id
,
sort
);
if
(
count
>
0
){
return
new
CommonResult
().
success
(
count
);
}
return
new
CommonResult
().
failed
();
}
@ApiOperation
(
"批量删除推荐"
)
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
int
count
=
homeNewProductService
.
delete
(
ids
);
if
(
count
>
0
){
return
new
CommonResult
().
success
(
count
);
}
return
new
CommonResult
().
failed
();
}
@ApiOperation
(
"批量修改推荐状态"
)
@RequestMapping
(
value
=
"/update/recommendStatus"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
updateRecommendStatus
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
,
@RequestParam
Integer
recommendStatus
)
{
int
count
=
homeNewProductService
.
updateRecommendStatus
(
ids
,
recommendStatus
);
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
=
"productName"
,
required
=
false
)
String
productName
,
@RequestParam
(
value
=
"recommendStatus"
,
required
=
false
)
Integer
recommendStatus
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"5"
)
Integer
pageSize
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
)
{
List
<
SmsHomeNewProduct
>
homeBrandList
=
homeNewProductService
.
list
(
productName
,
recommendStatus
,
pageSize
,
pageNum
);
return
new
CommonResult
().
pageSuccess
(
homeBrandList
);
}
}
mall-admin/src/main/java/com/macro/mall/service/SmsCouponHistoryService.java
0 → 100644
View file @
8ef1fcc9
package
com.macro.mall.service
;
import
com.macro.mall.model.SmsCouponHistory
;
import
java.util.List
;
/**
* 优惠券领取记录管理Service
* Created by macro on 2018/11/6.
*/
public
interface
SmsCouponHistoryService
{
/**
* 分页查询优惠券领取记录
* @param couponId 优惠券id
* @param useStatus 使用状态
* @param orderSn 使用订单号码
*/
List
<
SmsCouponHistory
>
list
(
Long
couponId
,
Integer
useStatus
,
String
orderSn
,
Integer
pageSize
,
Integer
pageNum
);
}
mall-admin/src/main/java/com/macro/mall/service/SmsHomeBrandService.java
0 → 100644
View file @
8ef1fcc9
package
com.macro.mall.service
;
import
com.macro.mall.model.SmsHomeBrand
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
/**
* 首页品牌管理Service
* Created by macro on 2018/11/6.
*/
public
interface
SmsHomeBrandService
{
/**
* 添加首页品牌推荐
*/
@Transactional
int
create
(
List
<
SmsHomeBrand
>
homeBrandList
);
/**
* 修改品牌推荐排序
*/
int
updateSort
(
Long
id
,
Integer
sort
);
/**
* 批量删除品牌推荐
*/
int
delete
(
List
<
Long
>
ids
);
/**
* 更新推荐状态
*/
int
updateRecommendStatus
(
List
<
Long
>
ids
,
Integer
recommendStatus
);
/**
* 分页查询品牌推荐
*/
List
<
SmsHomeBrand
>
list
(
String
brandName
,
Integer
recommendStatus
,
Integer
pageSize
,
Integer
pageNum
);
}
mall-admin/src/main/java/com/macro/mall/service/SmsHomeNewProductService.java
0 → 100644
View file @
8ef1fcc9
package
com.macro.mall.service
;
import
com.macro.mall.model.SmsHomeNewProduct
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
/**
* 首页新品管理Service
* Created by macro on 2018/11/6.
*/
public
interface
SmsHomeNewProductService
{
/**
* 添加首页推荐
*/
@Transactional
int
create
(
List
<
SmsHomeNewProduct
>
homeBrandList
);
/**
* 修改推荐排序
*/
int
updateSort
(
Long
id
,
Integer
sort
);
/**
* 批量删除推荐
*/
int
delete
(
List
<
Long
>
ids
);
/**
* 更新推荐状态
*/
int
updateRecommendStatus
(
List
<
Long
>
ids
,
Integer
recommendStatus
);
/**
* 分页查询推荐
*/
List
<
SmsHomeNewProduct
>
list
(
String
productName
,
Integer
recommendStatus
,
Integer
pageSize
,
Integer
pageNum
);
}
mall-admin/src/main/java/com/macro/mall/service/impl/SmsCouponHistoryServiceImpl.java
0 → 100644
View file @
8ef1fcc9
package
com.macro.mall.service.impl
;
import
com.github.pagehelper.PageHelper
;
import
com.macro.mall.mapper.SmsCouponHistoryMapper
;
import
com.macro.mall.model.SmsCouponHistory
;
import
com.macro.mall.model.SmsCouponHistoryExample
;
import
com.macro.mall.service.SmsCouponHistoryService
;
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/11/6.
*/
@Service
public
class
SmsCouponHistoryServiceImpl
implements
SmsCouponHistoryService
{
@Autowired
private
SmsCouponHistoryMapper
historyMapper
;
@Override
public
List
<
SmsCouponHistory
>
list
(
Long
couponId
,
Integer
useStatus
,
String
orderSn
,
Integer
pageSize
,
Integer
pageNum
)
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
SmsCouponHistoryExample
example
=
new
SmsCouponHistoryExample
();
SmsCouponHistoryExample
.
Criteria
criteria
=
example
.
createCriteria
();
if
(
couponId
!=
null
){
criteria
.
andCouponIdEqualTo
(
couponId
);
}
if
(
useStatus
!=
null
){
criteria
.
andUseStatusEqualTo
(
useStatus
);
}
if
(!
StringUtils
.
isEmpty
(
orderSn
)){
criteria
.
andOrderSnEqualTo
(
orderSn
);
}
return
historyMapper
.
selectByExample
(
example
);
}
}
mall-admin/src/main/java/com/macro/mall/service/impl/SmsHomeBrandServiceImpl.java
0 → 100644
View file @
8ef1fcc9
package
com.macro.mall.service.impl
;
import
com.github.pagehelper.PageHelper
;
import
com.macro.mall.mapper.SmsHomeBrandMapper
;
import
com.macro.mall.model.SmsHomeBrand
;
import
com.macro.mall.model.SmsHomeBrandExample
;
import
com.macro.mall.service.SmsHomeBrandService
;
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/11/6.
*/
@Service
public
class
SmsHomeBrandServiceImpl
implements
SmsHomeBrandService
{
@Autowired
private
SmsHomeBrandMapper
homeBrandMapper
;
@Override
public
int
create
(
List
<
SmsHomeBrand
>
homeBrandList
)
{
for
(
SmsHomeBrand
smsHomeBrand
:
homeBrandList
)
{
smsHomeBrand
.
setRecommendStatus
(
1
);
smsHomeBrand
.
setSort
(
0
);
homeBrandMapper
.
insert
(
smsHomeBrand
);
}
return
homeBrandList
.
size
();
}
@Override
public
int
updateSort
(
Long
id
,
Integer
sort
)
{
SmsHomeBrand
homeBrand
=
new
SmsHomeBrand
();
homeBrand
.
setId
(
id
);
homeBrand
.
setSort
(
sort
);
return
homeBrandMapper
.
updateByPrimaryKeySelective
(
homeBrand
);
}
@Override
public
int
delete
(
List
<
Long
>
ids
)
{
SmsHomeBrandExample
example
=
new
SmsHomeBrandExample
();
example
.
createCriteria
().
andIdIn
(
ids
);
return
homeBrandMapper
.
deleteByExample
(
example
);
}
@Override
public
int
updateRecommendStatus
(
List
<
Long
>
ids
,
Integer
recommendStatus
)
{
SmsHomeBrandExample
example
=
new
SmsHomeBrandExample
();
example
.
createCriteria
().
andIdIn
(
ids
);
SmsHomeBrand
record
=
new
SmsHomeBrand
();
record
.
setRecommendStatus
(
recommendStatus
);
return
homeBrandMapper
.
updateByExampleSelective
(
record
,
example
);
}
@Override
public
List
<
SmsHomeBrand
>
list
(
String
brandName
,
Integer
recommendStatus
,
Integer
pageSize
,
Integer
pageNum
)
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
SmsHomeBrandExample
example
=
new
SmsHomeBrandExample
();
SmsHomeBrandExample
.
Criteria
criteria
=
example
.
createCriteria
();
if
(!
StringUtils
.
isEmpty
(
brandName
)){
criteria
.
andBrandNameLike
(
"%"
+
brandName
+
"%"
);
}
if
(
recommendStatus
!=
null
){
criteria
.
andRecommendStatusEqualTo
(
recommendStatus
);
}
example
.
setOrderByClause
(
"sort desc"
);
return
homeBrandMapper
.
selectByExample
(
example
);
}
}
mall-admin/src/main/java/com/macro/mall/service/impl/SmsHomeNewProductServiceImpl.java
0 → 100644
View file @
8ef1fcc9
package
com.macro.mall.service.impl
;
import
com.github.pagehelper.PageHelper
;
import
com.macro.mall.mapper.SmsHomeNewProductMapper
;
import
com.macro.mall.model.SmsHomeNewProduct
;
import
com.macro.mall.model.SmsHomeNewProductExample
;
import
com.macro.mall.service.SmsHomeNewProductService
;
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/11/6.
*/
@Service
public
class
SmsHomeNewProductServiceImpl
implements
SmsHomeNewProductService
{
@Autowired
private
SmsHomeNewProductMapper
homeNewProductMapper
;
@Override
public
int
create
(
List
<
SmsHomeNewProduct
>
homeNewProductList
)
{
for
(
SmsHomeNewProduct
SmsHomeNewProduct
:
homeNewProductList
)
{
SmsHomeNewProduct
.
setRecommendStatus
(
1
);
SmsHomeNewProduct
.
setSort
(
0
);
homeNewProductMapper
.
insert
(
SmsHomeNewProduct
);
}
return
homeNewProductList
.
size
();
}
@Override
public
int
updateSort
(
Long
id
,
Integer
sort
)
{
SmsHomeNewProduct
homeNewProduct
=
new
SmsHomeNewProduct
();
homeNewProduct
.
setId
(
id
);
homeNewProduct
.
setSort
(
sort
);
return
homeNewProductMapper
.
updateByPrimaryKeySelective
(
homeNewProduct
);
}
@Override
public
int
delete
(
List
<
Long
>
ids
)
{
SmsHomeNewProductExample
example
=
new
SmsHomeNewProductExample
();
example
.
createCriteria
().
andIdIn
(
ids
);
return
homeNewProductMapper
.
deleteByExample
(
example
);
}
@Override
public
int
updateRecommendStatus
(
List
<
Long
>
ids
,
Integer
recommendStatus
)
{
SmsHomeNewProductExample
example
=
new
SmsHomeNewProductExample
();
example
.
createCriteria
().
andIdIn
(
ids
);
SmsHomeNewProduct
record
=
new
SmsHomeNewProduct
();
record
.
setRecommendStatus
(
recommendStatus
);
return
homeNewProductMapper
.
updateByExampleSelective
(
record
,
example
);
}
@Override
public
List
<
SmsHomeNewProduct
>
list
(
String
productName
,
Integer
recommendStatus
,
Integer
pageSize
,
Integer
pageNum
)
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
SmsHomeNewProductExample
example
=
new
SmsHomeNewProductExample
();
SmsHomeNewProductExample
.
Criteria
criteria
=
example
.
createCriteria
();
if
(!
StringUtils
.
isEmpty
(
productName
)){
criteria
.
andProductNameLike
(
"%"
+
productName
+
"%"
);
}
if
(
recommendStatus
!=
null
){
criteria
.
andRecommendStatusEqualTo
(
recommendStatus
);
}
example
.
setOrderByClause
(
"sort desc"
);
return
homeNewProductMapper
.
selectByExample
(
example
);
}
}
mall-mbg/src/main/java/com/macro/mall/model/SmsCoupon.java
View file @
8ef1fcc9
...
...
@@ -111,6 +111,13 @@ public class SmsCoupon implements Serializable {
*/
private
Integer
memberLevel
;
/**
* 发行数量:0->表示无限制
*
* @mbggenerated
*/
private
Integer
distributionCount
;
private
static
final
long
serialVersionUID
=
1L
;
public
Long
getId
()
{
...
...
@@ -257,6 +264,14 @@ public class SmsCoupon implements Serializable {
this
.
memberLevel
=
memberLevel
;
}
public
Integer
getDistributionCount
()
{
return
distributionCount
;
}
public
void
setDistributionCount
(
Integer
distributionCount
)
{
this
.
distributionCount
=
distributionCount
;
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
...
...
@@ -281,6 +296,7 @@ public class SmsCoupon implements Serializable {
sb
.
append
(
", enableTime="
).
append
(
enableTime
);
sb
.
append
(
", code="
).
append
(
code
);
sb
.
append
(
", memberLevel="
).
append
(
memberLevel
);
sb
.
append
(
", distributionCount="
).
append
(
distributionCount
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
...
...
mall-mbg/src/main/java/com/macro/mall/model/SmsCouponExample.java
View file @
8ef1fcc9
...
...
@@ -1215,6 +1215,66 @@ public class SmsCouponExample {
addCriterion
(
"member_level not between"
,
value1
,
value2
,
"memberLevel"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDistributionCountIsNull
()
{
addCriterion
(
"distribution_count is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDistributionCountIsNotNull
()
{
addCriterion
(
"distribution_count is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDistributionCountEqualTo
(
Integer
value
)
{
addCriterion
(
"distribution_count ="
,
value
,
"distributionCount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDistributionCountNotEqualTo
(
Integer
value
)
{
addCriterion
(
"distribution_count <>"
,
value
,
"distributionCount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDistributionCountGreaterThan
(
Integer
value
)
{
addCriterion
(
"distribution_count >"
,
value
,
"distributionCount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDistributionCountGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"distribution_count >="
,
value
,
"distributionCount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDistributionCountLessThan
(
Integer
value
)
{
addCriterion
(
"distribution_count <"
,
value
,
"distributionCount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDistributionCountLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"distribution_count <="
,
value
,
"distributionCount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDistributionCountIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"distribution_count in"
,
values
,
"distributionCount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDistributionCountNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"distribution_count not in"
,
values
,
"distributionCount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDistributionCountBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"distribution_count between"
,
value1
,
value2
,
"distributionCount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDistributionCountNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"distribution_count not between"
,
value1
,
value2
,
"distributionCount"
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
...
...
mall-mbg/src/main/java/com/macro/mall/model/SmsCouponHistory.java
View file @
8ef1fcc9
...
...
@@ -47,7 +47,14 @@ public class SmsCouponHistory implements Serializable {
*
* @mbggenerated
*/
private
String
orderId
;
private
Long
orderId
;
/**
* 订单号码
*
* @mbggenerated
*/
private
String
orderSn
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -123,14 +130,22 @@ public class SmsCouponHistory implements Serializable {
this
.
useTime
=
useTime
;
}
public
Stri
ng
getOrderId
()
{
public
Lo
ng
getOrderId
()
{
return
orderId
;
}
public
void
setOrderId
(
Stri
ng
orderId
)
{
public
void
setOrderId
(
Lo
ng
orderId
)
{
this
.
orderId
=
orderId
;
}
public
String
getOrderSn
()
{
return
orderSn
;
}
public
void
setOrderSn
(
String
orderSn
)
{
this
.
orderSn
=
orderSn
;
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
...
...
@@ -147,6 +162,7 @@ public class SmsCouponHistory implements Serializable {
sb
.
append
(
", useStatus="
).
append
(
useStatus
);
sb
.
append
(
", useTime="
).
append
(
useTime
);
sb
.
append
(
", orderId="
).
append
(
orderId
);
sb
.
append
(
", orderSn="
).
append
(
orderSn
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
...
...
mall-mbg/src/main/java/com/macro/mall/model/SmsCouponHistoryExample.java
View file @
8ef1fcc9
...
...
@@ -675,63 +675,123 @@ public class SmsCouponHistoryExample {
return
(
Criteria
)
this
;
}
public
Criteria
andOrderIdEqualTo
(
Stri
ng
value
)
{
public
Criteria
andOrderIdEqualTo
(
Lo
ng
value
)
{
addCriterion
(
"order_id ="
,
value
,
"orderId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderIdNotEqualTo
(
Stri
ng
value
)
{
public
Criteria
andOrderIdNotEqualTo
(
Lo
ng
value
)
{
addCriterion
(
"order_id <>"
,
value
,
"orderId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderIdGreaterThan
(
Stri
ng
value
)
{
public
Criteria
andOrderIdGreaterThan
(
Lo
ng
value
)
{
addCriterion
(
"order_id >"
,
value
,
"orderId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderIdGreaterThanOrEqualTo
(
Stri
ng
value
)
{
public
Criteria
andOrderIdGreaterThanOrEqualTo
(
Lo
ng
value
)
{
addCriterion
(
"order_id >="
,
value
,
"orderId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderIdLessThan
(
Stri
ng
value
)
{
public
Criteria
andOrderIdLessThan
(
Lo
ng
value
)
{
addCriterion
(
"order_id <"
,
value
,
"orderId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderIdLessThanOrEqualTo
(
Stri
ng
value
)
{
public
Criteria
andOrderIdLessThanOrEqualTo
(
Lo
ng
value
)
{
addCriterion
(
"order_id <="
,
value
,
"orderId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderId
Like
(
Stri
ng
value
)
{
addCriterion
(
"order_id
like
"
,
value
,
"orderId"
);
public
Criteria
andOrderId
In
(
List
<
Lo
ng
>
value
s
)
{
addCriterion
(
"order_id
in
"
,
value
s
,
"orderId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderIdNot
Like
(
Stri
ng
value
)
{
addCriterion
(
"order_id not
like
"
,
value
,
"orderId"
);
public
Criteria
andOrderIdNot
In
(
List
<
Lo
ng
>
value
s
)
{
addCriterion
(
"order_id not
in
"
,
value
s
,
"orderId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderId
In
(
List
<
Stri
ng
>
value
s
)
{
addCriterion
(
"order_id
i
n"
,
value
s
,
"orderId"
);
public
Criteria
andOrderId
Between
(
Lo
ng
value
1
,
Long
value2
)
{
addCriterion
(
"order_id
betwee
n"
,
value
1
,
value2
,
"orderId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderIdNot
In
(
List
<
Stri
ng
>
value
s
)
{
addCriterion
(
"order_id not
i
n"
,
value
s
,
"orderId"
);
public
Criteria
andOrderIdNot
Between
(
Lo
ng
value
1
,
Long
value2
)
{
addCriterion
(
"order_id not
betwee
n"
,
value
1
,
value2
,
"orderId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrder
IdBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"order_
id between"
,
value1
,
value2
,
"orderId
"
);
public
Criteria
andOrder
SnIsNull
(
)
{
addCriterion
(
"order_
sn is null
"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderIdNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"order_id not between"
,
value1
,
value2
,
"orderId"
);
public
Criteria
andOrderSnIsNotNull
()
{
addCriterion
(
"order_sn is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderSnEqualTo
(
String
value
)
{
addCriterion
(
"order_sn ="
,
value
,
"orderSn"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderSnNotEqualTo
(
String
value
)
{
addCriterion
(
"order_sn <>"
,
value
,
"orderSn"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderSnGreaterThan
(
String
value
)
{
addCriterion
(
"order_sn >"
,
value
,
"orderSn"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderSnGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"order_sn >="
,
value
,
"orderSn"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderSnLessThan
(
String
value
)
{
addCriterion
(
"order_sn <"
,
value
,
"orderSn"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderSnLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"order_sn <="
,
value
,
"orderSn"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderSnLike
(
String
value
)
{
addCriterion
(
"order_sn like"
,
value
,
"orderSn"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderSnNotLike
(
String
value
)
{
addCriterion
(
"order_sn not like"
,
value
,
"orderSn"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderSnIn
(
List
<
String
>
values
)
{
addCriterion
(
"order_sn in"
,
values
,
"orderSn"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderSnNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"order_sn not in"
,
values
,
"orderSn"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderSnBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"order_sn between"
,
value1
,
value2
,
"orderSn"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOrderSnNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"order_sn not between"
,
value1
,
value2
,
"orderSn"
);
return
(
Criteria
)
this
;
}
}
...
...
mall-mbg/src/main/resources/com/macro/mall/mapper/SmsCouponHistoryMapper.xml
View file @
8ef1fcc9
...
...
@@ -11,7 +11,8 @@
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"use_status"
jdbcType=
"INTEGER"
property=
"useStatus"
/>
<result
column=
"use_time"
jdbcType=
"TIMESTAMP"
property=
"useTime"
/>
<result
column=
"order_id"
jdbcType=
"CHAR"
property=
"orderId"
/>
<result
column=
"order_id"
jdbcType=
"BIGINT"
property=
"orderId"
/>
<result
column=
"order_sn"
jdbcType=
"VARCHAR"
property=
"orderSn"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
...
...
@@ -73,7 +74,7 @@
</sql>
<sql
id=
"Base_Column_List"
>
id, coupon_id, member_id, coupon_code, member_nickname, get_type, create_time, use_status,
use_time, order_id
use_time, order_id
, order_sn
</sql>
<select
id=
"selectByExample"
parameterType=
"com.macro.mall.model.SmsCouponHistoryExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -111,12 +112,12 @@
</selectKey>
insert into sms_coupon_history (coupon_id, member_id, coupon_code,
member_nickname, get_type, create_time,
use_status, use_time, order_id
)
use_status, use_time, order_id
,
order_sn
)
values (#{couponId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT}, #{couponCode,jdbcType=VARCHAR},
#{memberNickname,jdbcType=VARCHAR}, #{getType,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{useStatus,jdbcType=INTEGER}, #{useTime,jdbcType=TIMESTAMP}, #{orderId,jdbcType=
CHAR}
)
#{useStatus,jdbcType=INTEGER}, #{useTime,jdbcType=TIMESTAMP}, #{orderId,jdbcType=
BIGINT},
#{orderSn,jdbcType=VARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.macro.mall.model.SmsCouponHistory"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
...
...
@@ -151,6 +152,9 @@
<if
test=
"orderId != null"
>
order_id,
</if>
<if
test=
"orderSn != null"
>
order_sn,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"couponId != null"
>
...
...
@@ -178,7 +182,10 @@
#{useTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"orderId != null"
>
#{orderId,jdbcType=CHAR},
#{orderId,jdbcType=BIGINT},
</if>
<if
test=
"orderSn != null"
>
#{orderSn,jdbcType=VARCHAR},
</if>
</trim>
</insert>
...
...
@@ -219,7 +226,10 @@
use_time = #{record.useTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.orderId != null"
>
order_id = #{record.orderId,jdbcType=CHAR},
order_id = #{record.orderId,jdbcType=BIGINT},
</if>
<if
test=
"record.orderSn != null"
>
order_sn = #{record.orderSn,jdbcType=VARCHAR},
</if>
</set>
<if
test=
"_parameter != null"
>
...
...
@@ -237,7 +247,8 @@
create_time = #{record.createTime,jdbcType=TIMESTAMP},
use_status = #{record.useStatus,jdbcType=INTEGER},
use_time = #{record.useTime,jdbcType=TIMESTAMP},
order_id = #{record.orderId,jdbcType=CHAR}
order_id = #{record.orderId,jdbcType=BIGINT},
order_sn = #{record.orderSn,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -270,7 +281,10 @@
use_time = #{useTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"orderId != null"
>
order_id = #{orderId,jdbcType=CHAR},
order_id = #{orderId,jdbcType=BIGINT},
</if>
<if
test=
"orderSn != null"
>
order_sn = #{orderSn,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
...
...
@@ -285,7 +299,8 @@
create_time = #{createTime,jdbcType=TIMESTAMP},
use_status = #{useStatus,jdbcType=INTEGER},
use_time = #{useTime,jdbcType=TIMESTAMP},
order_id = #{orderId,jdbcType=CHAR}
order_id = #{orderId,jdbcType=BIGINT},
order_sn = #{orderSn,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
mall-mbg/src/main/resources/com/macro/mall/mapper/SmsCouponMapper.xml
View file @
8ef1fcc9
...
...
@@ -20,6 +20,7 @@
<result
column=
"enable_time"
jdbcType=
"TIMESTAMP"
property=
"enableTime"
/>
<result
column=
"code"
jdbcType=
"VARCHAR"
property=
"code"
/>
<result
column=
"member_level"
jdbcType=
"INTEGER"
property=
"memberLevel"
/>
<result
column=
"distribution_count"
jdbcType=
"INTEGER"
property=
"distributionCount"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
...
...
@@ -81,7 +82,8 @@
</sql>
<sql
id=
"Base_Column_List"
>
id, type, name, platform, count, amount, per_limit, min_point, start_time, end_time,
use_type, note, publish_count, use_count, receive_count, enable_time, code, member_level
use_type, note, publish_count, use_count, receive_count, enable_time, code, member_level,
distribution_count
</sql>
<select
id=
"selectByExample"
parameterType=
"com.macro.mall.model.SmsCouponExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -122,13 +124,15 @@
min_point, start_time, end_time,
use_type, note, publish_count,
use_count, receive_count, enable_time,
code, member_level)
code, member_level, distribution_count
)
values (#{type,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{platform,jdbcType=INTEGER},
#{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},
#{useCount,jdbcType=INTEGER}, #{receiveCount,jdbcType=INTEGER}, #{enableTime,jdbcType=TIMESTAMP},
#{code,jdbcType=VARCHAR}, #{memberLevel,jdbcType=INTEGER})
#{code,jdbcType=VARCHAR}, #{memberLevel,jdbcType=INTEGER}, #{distributionCount,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.macro.mall.model.SmsCoupon"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
...
...
@@ -187,6 +191,9 @@
<if
test=
"memberLevel != null"
>
member_level,
</if>
<if
test=
"distributionCount != null"
>
distribution_count,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"type != null"
>
...
...
@@ -240,6 +247,9 @@
<if
test=
"memberLevel != null"
>
#{memberLevel,jdbcType=INTEGER},
</if>
<if
test=
"distributionCount != null"
>
#{distributionCount,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.macro.mall.model.SmsCouponExample"
resultType=
"java.lang.Integer"
>
...
...
@@ -305,6 +315,9 @@
<if
test=
"record.memberLevel != null"
>
member_level = #{record.memberLevel,jdbcType=INTEGER},
</if>
<if
test=
"record.distributionCount != null"
>
distribution_count = #{record.distributionCount,jdbcType=INTEGER},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -329,7 +342,8 @@
receive_count = #{record.receiveCount,jdbcType=INTEGER},
enable_time = #{record.enableTime,jdbcType=TIMESTAMP},
code = #{record.code,jdbcType=VARCHAR},
member_level = #{record.memberLevel,jdbcType=INTEGER}
member_level = #{record.memberLevel,jdbcType=INTEGER},
distribution_count = #{record.distributionCount,jdbcType=INTEGER}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -388,6 +402,9 @@
<if
test=
"memberLevel != null"
>
member_level = #{memberLevel,jdbcType=INTEGER},
</if>
<if
test=
"distributionCount != null"
>
distribution_count = #{distributionCount,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
...
...
@@ -409,7 +426,8 @@
receive_count = #{receiveCount,jdbcType=INTEGER},
enable_time = #{enableTime,jdbcType=TIMESTAMP},
code = #{code,jdbcType=VARCHAR},
member_level = #{memberLevel,jdbcType=INTEGER}
member_level = #{memberLevel,jdbcType=INTEGER},
distribution_count = #{distributionCount,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</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