Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
oms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
oms
Commits
ddf81802
提交
ddf81802
authored
3月 30, 2024
作者:
刘明祎-运维用途
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
积分商品订单
上级
4c145798
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
221 行增加
和
195 行删除
+221
-195
PointsMallController.java
...ava/com/mmc/oms/controller/mall/PointsMallController.java
+41
-5
PointsMallDao.java
src/main/java/com/mmc/oms/dao/mall/PointsMallDao.java
+2
-1
PointsOrderDao.java
src/main/java/com/mmc/oms/dao/mall/PointsOrderDao.java
+6
-0
PointsMallDO.java
src/main/java/com/mmc/oms/entity/mall/PointsMallDO.java
+5
-0
PointsOrderDO.java
src/main/java/com/mmc/oms/entity/mall/PointsOrderDO.java
+16
-165
UserAppApi.java
src/main/java/com/mmc/oms/feign/UserAppApi.java
+3
-0
UserAppApiHystrix.java
...ain/java/com/mmc/oms/feign/hystrix/UserAppApiHystrix.java
+9
-0
PointsMallOrderQO.java
src/main/java/com/mmc/oms/model/qo/PointsMallOrderQO.java
+36
-0
PointMallService.java
src/main/java/com/mmc/oms/service/mall/PointMallService.java
+10
-0
PointsMallServiceImpl.java
.../com/mmc/oms/service/mall/impl/PointsMallServiceImpl.java
+53
-2
application-local.yml
src/main/resources/application-local.yml
+1
-2
PointsMallDao.xml
src/main/resources/mapper/PointsMallDao.xml
+11
-9
PointsOrderDao.xml
src/main/resources/mapper/PointsOrderDao.xml
+28
-11
没有找到文件。
src/main/java/com/mmc/oms/controller/mall/PointsMallController.java
浏览文件 @
ddf81802
package
com
.
mmc
.
oms
.
controller
.
mall
;
import
com.mmc.oms.common.result.ResultBody
;
import
com.mmc.oms.controller.BaseController
;
import
com.mmc.oms.entity.mall.PointsMallDO
;
import
com.mmc.oms.entity.mall.PointsOrderDO
;
import
com.mmc.oms.model.dto.mall.MallOrderPageDTO
;
import
com.mmc.oms.model.dto.user.BaseAccountDTO
;
import
com.mmc.oms.model.qo.GeneralQO
;
import
com.mmc.oms.model.qo.PointsMallOrderQO
;
import
com.mmc.oms.model.qo.mall.MallOrderQO
;
import
com.mmc.oms.service.mall.MallOrderService
;
import
com.mmc.oms.service.mall.PointMallService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
io.swagger.annotations.*
;
import
lombok.AllArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -25,7 +26,7 @@ import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping
(
"/pointsMall/"
)
@AllArgsConstructor
public
class
PointsMallController
{
public
class
PointsMallController
extends
BaseController
{
private
final
PointMallService
pointMallService
;
...
...
@@ -35,6 +36,12 @@ public class PointsMallController {
public
ResultBody
insertMall
(
@RequestBody
PointsMallDO
param
,
HttpServletRequest
request
)
{
return
pointMallService
.
insertMall
(
param
);
}
@ApiOperation
(
value
=
"后台——删除积分商品"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)
})
@GetMapping
(
"deleteMall"
)
public
ResultBody
deleteMall
(
@RequestParam
(
"id"
)
Integer
id
)
{
return
pointMallService
.
deleteMall
(
id
);
}
@ApiOperation
(
value
=
"后台——修改积分商品"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)
})
@PostMapping
(
"updateMall"
)
...
...
@@ -57,4 +64,33 @@ public class PointsMallController {
@ApiOperation
(
value
=
"小程序——购买积分商品"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)
})
@PostMapping
(
"buyGoods"
)
public
ResultBody
buyGoods
(
@RequestBody
PointsOrderDO
pointsOrderDO
,
HttpServletRequest
request
)
{
Integer
userAccountId
=
this
.
getCurrentAccount
(
request
).
getUserAccountId
();
pointsOrderDO
.
setUserId
(
userAccountId
);
return
pointMallService
.
insertPointsOrder
(
pointsOrderDO
,
request
);
}
@ApiOperation
(
value
=
"积分商品订单列表"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)
})
@PostMapping
(
"mallOrderList"
)
public
ResultBody
mallOrderList
(
@RequestBody
PointsMallOrderQO
qo
,
HttpServletRequest
request
)
{
Integer
userAccountId
=
this
.
getCurrentAccount
(
request
).
getUserAccountId
();
if
(
qo
.
getIsAdmin
()
==
0
){
qo
.
setUserId
(
userAccountId
);
}
return
pointMallService
.
getOrderList
(
qo
);
}
@ApiOperation
(
value
=
"修改商品订单"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)
})
@PostMapping
(
"updateGoodsOrder"
)
public
ResultBody
updateGoodsOrder
(
@RequestBody
PointsOrderDO
param
)
{
return
pointMallService
.
updateGoodsOrder
(
param
);
}
}
src/main/java/com/mmc/oms/dao/mall/PointsMallDao.java
浏览文件 @
ddf81802
...
...
@@ -16,7 +16,8 @@ import java.util.List;
@Mapper
public
interface
PointsMallDao
{
int
deleteByPrimaryKey
(
Long
id
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
PointsMallDO
record
);
...
...
src/main/java/com/mmc/oms/dao/mall/PointsOrderDao.java
浏览文件 @
ddf81802
package
com
.
mmc
.
oms
.
dao
.
mall
;
import
com.mmc.oms.entity.mall.PointsOrderDO
;
import
com.mmc.oms.model.qo.GeneralQO
;
import
com.mmc.oms.model.qo.PointsMallOrderQO
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* @author Admin
* @description 针对表【points_order】的数据库操作Mapper
...
...
@@ -25,4 +29,6 @@ public interface PointsOrderDao {
int
updateByPrimaryKey
(
PointsOrderDO
record
);
List
<
PointsOrderDO
>
getOrderList
(
PointsMallOrderQO
qo
);
int
countOrderList
(
PointsMallOrderQO
qo
);
}
src/main/java/com/mmc/oms/entity/mall/PointsMallDO.java
浏览文件 @
ddf81802
package
com
.
mmc
.
oms
.
entity
.
mall
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
...
...
@@ -18,21 +19,25 @@ public class PointsMallDO implements Serializable {
/**
*
*/
@ApiModelProperty
(
value
=
"积分商品id"
)
private
Integer
id
;
/**
* 所需积分
*/
@ApiModelProperty
(
value
=
"所需积分"
)
private
Integer
needPoints
;
/**
* 商品名字
*/
@ApiModelProperty
(
value
=
"商品名字"
)
private
String
goods
;
/**
* 商品图片
*/
@ApiModelProperty
(
value
=
"商品图片"
)
private
String
goodsUrl
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
src/main/java/com/mmc/oms/entity/mall/PointsOrderDO.java
浏览文件 @
ddf81802
package
com
.
mmc
.
oms
.
entity
.
mall
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
...
...
@@ -7,215 +12,62 @@ import java.util.Date;
*
* @TableName points_order
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
PointsOrderDO
implements
Serializable
{
/**
*
*/
private
Integer
id
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
/**
* 购买积分商品的用户id
*/
@ApiModelProperty
(
value
=
"购买积分商品的用户id"
)
private
Integer
userId
;
/**
* 积分商城id
*/
@ApiModelProperty
(
value
=
"积分商城id "
)
private
Integer
pointsMallId
;
/**
* 快递地址
*/
@ApiModelProperty
(
value
=
"快递地址"
)
private
String
address
;
/**
* 快递单号
*/
@ApiModelProperty
(
value
=
"快递单号"
)
private
String
trackingNumber
;
/**
* 收货姓名
*/
@ApiModelProperty
(
value
=
"收货姓名"
)
private
String
userName
;
/**
* 收货电话
*/
@ApiModelProperty
(
value
=
"收货电话"
)
private
String
userPhone
;
/**
* 快递公司
*/
@ApiModelProperty
(
value
=
"快递公司"
)
private
String
trackintCompany
;
/**
* 是否发货
*/
@ApiModelProperty
(
value
=
"是否发货 1发货 0没"
)
private
Integer
sendStatus
;
private
static
final
long
serialVersionUID
=
1L
;
/**
*
*/
public
Integer
getId
()
{
return
id
;
}
/**
*
*/
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
/**
*
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
*
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
*
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/**
*
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 购买积分商品的用户id
*/
public
Integer
getUserId
()
{
return
userId
;
}
/**
* 购买积分商品的用户id
*/
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
/**
* 积分商城id
*/
public
Integer
getPointsMallId
()
{
return
pointsMallId
;
}
/**
* 积分商城id
*/
public
void
setPointsMallId
(
Integer
pointsMallId
)
{
this
.
pointsMallId
=
pointsMallId
;
}
/**
* 快递地址
*/
public
String
getAddress
()
{
return
address
;
}
/**
* 快递地址
*/
public
void
setAddress
(
String
address
)
{
this
.
address
=
address
;
}
/**
* 快递单号
*/
public
String
getTrackingNumber
()
{
return
trackingNumber
;
}
/**
* 快递单号
*/
public
void
setTrackingNumber
(
String
trackingNumber
)
{
this
.
trackingNumber
=
trackingNumber
;
}
/**
* 收货姓名
*/
public
String
getUserName
()
{
return
userName
;
}
/**
* 收货姓名
*/
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
/**
* 收货电话
*/
public
String
getUserPhone
()
{
return
userPhone
;
}
/**
* 收货电话
*/
public
void
setUserPhone
(
String
userPhone
)
{
this
.
userPhone
=
userPhone
;
}
/**
* 快递公司
*/
public
String
getTrackintCompany
()
{
return
trackintCompany
;
}
/**
* 快递公司
*/
public
void
setTrackintCompany
(
String
trackintCompany
)
{
this
.
trackintCompany
=
trackintCompany
;
}
/**
* 是否发货
*/
public
Integer
getSendStatus
()
{
return
sendStatus
;
}
/**
* 是否发货
*/
public
void
setSendStatus
(
Integer
sendStatus
)
{
this
.
sendStatus
=
sendStatus
;
}
}
\ No newline at end of file
src/main/java/com/mmc/oms/feign/UserAppApi.java
浏览文件 @
ddf81802
...
...
@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiResponses;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
/**
...
...
@@ -72,4 +73,6 @@ public interface UserAppApi {
@PostMapping
(
"/back-user/feignListBAccountPage"
)
List
<
UserAccountSimpleDTO
>
feignListBAccountPage
(
@ApiParam
(
value
=
"账号查询QO"
,
required
=
true
)
@RequestBody
BUserAccountQO
bUserAccountQO
,
@RequestHeader
(
"token"
)
String
token
);
@GetMapping
(
"/userPoint/feignChangeUserPoints"
)
ResultBody
feignChangeUserPoints
(
@RequestHeader
(
"token"
)
String
token
,
@RequestHeader
HttpServletRequest
request
,
@RequestParam
int
changePoint
,
@RequestParam
String
reason
);
}
src/main/java/com/mmc/oms/feign/hystrix/UserAppApiHystrix.java
浏览文件 @
ddf81802
...
...
@@ -12,6 +12,7 @@ import com.mmc.oms.model.vo.uav.PayUavWalletVO;
import
com.mmc.oms.model.vo.wallet.TopUpOrderVO
;
import
lombok.extern.slf4j.Slf4j
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
/**
...
...
@@ -80,4 +81,12 @@ public class UserAppApiHystrix implements UserAppApi {
log
.
error
(
"熔断:UserAppApiHystrix.feignListBAccountPage==error==>param:{}"
,
JSONObject
.
toJSONString
(
bUserAccountQO
));
return
null
;
}
@Override
public
ResultBody
feignChangeUserPoints
(
String
token
,
HttpServletRequest
request
,
int
changePoint
,
String
reason
)
{
log
.
error
(
"熔断:UserAppApiHystrix.feignChangeUserPoints==error==>param:{}"
,
JSONObject
.
toJSONString
(
changePoint
));
return
null
;
}
}
src/main/java/com/mmc/oms/model/qo/PointsMallOrderQO.java
0 → 100644
浏览文件 @
ddf81802
package
com
.
mmc
.
oms
.
model
.
qo
;
import
com.mmc.oms.common.publicinterface.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
PointsMallOrderQO
{
@ApiModelProperty
(
"是否管理员 0不是 1是"
)
private
int
isAdmin
;
private
Integer
userId
;
@ApiModelProperty
(
value
=
"页码"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"页码不能为空"
,
groups
=
{
Page
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"每页显示数"
,
required
=
true
,
example
=
"10"
)
@NotNull
(
message
=
"每页显示数不能为空"
,
groups
=
{
Page
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
public
void
buildCurrentPage
()
{
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
}
src/main/java/com/mmc/oms/service/mall/PointMallService.java
浏览文件 @
ddf81802
...
...
@@ -2,7 +2,11 @@ package com.mmc.oms.service.mall;
import
com.mmc.oms.common.result.ResultBody
;
import
com.mmc.oms.entity.mall.PointsMallDO
;
import
com.mmc.oms.entity.mall.PointsOrderDO
;
import
com.mmc.oms.model.qo.GeneralQO
;
import
com.mmc.oms.model.qo.PointsMallOrderQO
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author Admin
...
...
@@ -15,6 +19,8 @@ public interface PointMallService {
* @return {@link ResultBody}
*/
ResultBody
insertMall
(
PointsMallDO
pointsMallDO
);
ResultBody
deleteMall
(
Integer
id
);
/**
* 修改商品
...
...
@@ -37,5 +43,9 @@ public interface PointMallService {
*/
ResultBody
getMallList
(
GeneralQO
qo
);
ResultBody
insertPointsOrder
(
PointsOrderDO
pointsOrderDO
,
HttpServletRequest
request
);
ResultBody
getOrderList
(
PointsMallOrderQO
qo
);
ResultBody
updateGoodsOrder
(
PointsOrderDO
param
);
}
src/main/java/com/mmc/oms/service/mall/impl/PointsMallServiceImpl.java
浏览文件 @
ddf81802
...
...
@@ -5,15 +5,20 @@ import com.mmc.oms.common.result.ResultBody;
import
com.mmc.oms.dao.mall.PointsMallDao
;
import
com.mmc.oms.dao.mall.PointsOrderDao
;
import
com.mmc.oms.entity.mall.PointsMallDO
;
import
com.mmc.oms.entity.mall.PointsOrderDO
;
import
com.mmc.oms.feign.UserAppApi
;
import
com.mmc.oms.model.qo.GeneralQO
;
import
com.mmc.oms.model.qo.PointsMallOrderQO
;
import
com.mmc.oms.service.mall.PointMallService
;
import
lombok.AllArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
/**
...
...
@@ -27,6 +32,7 @@ public class PointsMallServiceImpl implements PointMallService {
private
PointsMallDao
pointsMallDao
;
private
PointsOrderDao
pointsOrderDao
;
private
UserAppApi
userAppApi
;
@Override
public
ResultBody
insertMall
(
PointsMallDO
pointsMallDO
)
{
...
...
@@ -35,6 +41,12 @@ public class PointsMallServiceImpl implements PointMallService {
}
@Override
public
ResultBody
deleteMall
(
Integer
id
)
{
pointsMallDao
.
deleteByPrimaryKey
(
id
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
updateMall
(
PointsMallDO
pointsMallDO
)
{
pointsMallDao
.
updateByPrimaryKeySelective
(
pointsMallDO
);
return
ResultBody
.
success
();
...
...
@@ -60,9 +72,48 @@ public class PointsMallServiceImpl implements PointMallService {
*/
@Override
public
ResultBody
getMallList
(
GeneralQO
qo
)
{
int
count
=
pointsMallDao
.
count
();
Integer
pageNo
=
qo
.
getPageNo
();
if
(
count
==
0
){
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
qo
.
getPageSize
(),
count
,
null
));
}
qo
.
buildCurrentPage
();
List
<
PointsMallDO
>
pointsMallDOS
=
pointsMallDao
.
selectAll
(
qo
);
int
count
=
pointsMallDao
.
count
();
return
ResultBody
.
success
(
PageResult
.
buildPage
(
qo
.
getPageNo
(),
qo
.
getPageSize
(),
count
,
pointsMallDOS
));
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
qo
.
getPageSize
(),
count
,
pointsMallDOS
));
}
@Override
public
ResultBody
insertPointsOrder
(
PointsOrderDO
pointsOrderDO
,
HttpServletRequest
request
)
{
PointsMallDO
pointsMallDO
=
pointsMallDao
.
selectByPrimaryKey
(
pointsOrderDO
.
getPointsMallId
());
int
changePoint
=
-
pointsMallDO
.
getNeedPoints
();
ResultBody
resultBody
=
userAppApi
.
feignChangeUserPoints
(
request
.
getHeader
(
"token"
),
request
,
changePoint
,
"购买积分商品"
);
if
(!
"200"
.
equals
(
resultBody
.
getCode
())){
return
resultBody
;
}
pointsOrderDao
.
insert
(
pointsOrderDO
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
getOrderList
(
PointsMallOrderQO
qo
)
{
int
count
=
pointsOrderDao
.
countOrderList
(
qo
);
if
(
count
==
0
){
return
ResultBody
.
success
(
PageResult
.
buildPage
(
qo
.
getPageNo
(),
qo
.
getPageSize
(),
count
,
null
));
}
Integer
pageNo
=
qo
.
getPageNo
();
qo
.
buildCurrentPage
();
List
<
PointsOrderDO
>
orderList
=
pointsOrderDao
.
getOrderList
(
qo
);
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
qo
.
getPageSize
(),
count
,
orderList
));
}
@Override
public
ResultBody
updateGoodsOrder
(
PointsOrderDO
param
)
{
int
i
=
pointsOrderDao
.
updateByPrimaryKeySelective
(
param
);
if
(
i
==
0
){
return
ResultBody
.
error
(
"更新失败"
);
}
return
ResultBody
.
success
();
}
}
src/main/resources/application-local.yml
浏览文件 @
ddf81802
...
...
@@ -7,9 +7,8 @@ spring:
password
:
IUAV_DEV@2023&MYSQL
redis
:
database
:
1
host
:
r-wz9ke310fs684hacn1pd.redis.rds.aliyuncs.com
host
:
127.0.0.1
port
:
6379
password
:
MMC@2022&REDIS
jedis
:
pool
:
max-active
:
2
...
...
src/main/resources/mapper/PointsMallDao.xml
浏览文件 @
ddf81802
...
...
@@ -20,20 +20,22 @@
select
<include
refid=
"Base_Column_List"
/>
from points_mall
where id = #{id,jdbcType=INTEGER}
where is_delete = 0 and
id = #{id,jdbcType=INTEGER}
</select>
<select
id=
"selectAll"
resultType=
"com.mmc.oms.entity.mall.PointsMallDO"
>
select id,need_points,goods,goods_url from points_mall
limit #{pageNo},#{pageSize}
where is_delete = 0
limit #{pageNo},#{pageSize}
</select>
<select
id=
"count"
resultType=
"java.lang.Integer"
>
select count(1) from points_mall
select count(1) from points_mall
where is_delete = 0
</select>
<
delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long
"
>
delete from
points_mall
where id = #{id,jdbcType=INTEGER}
</
dele
te>
<
update
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer
"
>
update
points_mall
set is_delete = 1 where id = #{id,jdbcType=INTEGER}
</
upda
te>
<insert
id=
"insert"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.mmc.oms.entity.mall.PointsMallDO"
useGeneratedKeys=
"true"
>
insert into points_mall
( id
...
...
@@ -75,7 +77,7 @@
goods_url = #{goodsUrl,jdbcType=VARCHAR},
</if>
</set>
where
id = #{id,jdbcType=INTEGER}
where
is_delete = 0 and id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.mmc.oms.entity.mall.PointsMallDO"
>
update points_mall
...
...
@@ -85,6 +87,6 @@
need_points = #{needPoints,jdbcType=INTEGER},
goods = #{goods,jdbcType=VARCHAR},
goods_url = #{goodsUrl,jdbcType=VARCHAR}
where
id = #{id,jdbcType=INTEGER}
where
is_delete = 0 and id = #{id,jdbcType=INTEGER}
</update>
</mapper>
src/main/resources/mapper/PointsOrderDao.xml
浏览文件 @
ddf81802
...
...
@@ -19,7 +19,7 @@
</resultMap>
<sql
id=
"Base_Column_List"
>
id,
create_time,update_time,
id,
user_id,points_mall_id,address,
tracking_number,user_name,user_phone,
trackint_company,send_status
...
...
@@ -31,6 +31,25 @@
from points_order
where id = #{id,jdbcType=INTEGER}
</select>
<select
id=
"getOrderList"
resultType=
"com.mmc.oms.entity.mall.PointsOrderDO"
>
select
<include
refid=
"Base_Column_List"
/>
from points_order
where 1=1
<if
test=
"userId != null"
>
and user_id = #{userId,jdbcType=INTEGER}
</if>
order by create_time desc
limit #{pageNo},#{pageSize}
</select>
<select
id=
"countOrderList"
resultType=
"java.lang.Integer"
>
select count(1)
from points_order
where 1=1
<if
test=
"userId != null"
>
and user_id = #{userId,jdbcType=INTEGER}
</if>
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from points_order
...
...
@@ -38,14 +57,14 @@
</delete>
<insert
id=
"insert"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.mmc.oms.entity.mall.PointsOrderDO"
useGeneratedKeys=
"true"
>
insert into points_order
( id
,create_time,update_time
( id
,user_id,points_mall_id,address
,tracking_number,user_name,user_phone
,trackint_company,send_status)
values (#{id,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}
,
#{userId,jdbcType=INTEGER},#{pointsMallId,jdbcType=INTEGER},#{address,jdbcType=VARCHAR}
values (#{id,jdbcType=INTEGER},
#{userId,jdbcType=INTEGER},#{pointsMallId,jdbcType=INTEGER},#{address,jdbcType=VARCHAR}
,#{trackingNumber,jdbcType=VARCHAR},#{userName,jdbcType=VARCHAR},#{userPhone,jdbcType=CHAR}
,#{trackintCompany,jdbcType=VARCHAR},
#{sendStatus,jdbcType=INTEGER}
)
,#{trackintCompany,jdbcType=VARCHAR},
0
)
</insert>
<insert
id=
"insertSelective"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.mmc.oms.entity.mall.PointsOrderDO"
useGeneratedKeys=
"true"
>
insert into points_order
...
...
@@ -79,12 +98,10 @@
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.mmc.oms.entity.mall.PointsOrderDO"
>
update points_order
<set>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
update_time = NOW(),
<if
test=
"userId != null"
>
user_id = #{userId,jdbcType=INTEGER},
</if>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论