1. 使用优惠券
This commit is contained in:
parent
0e90db14f2
commit
ab5cab863d
|
@ -1391,4 +1391,21 @@ public class AppVerifyController extends BaseController
|
||||||
}
|
}
|
||||||
return toAjax(asDeviceService.refreshDeviceBySn(sn));
|
return toAjax(asDeviceService.refreshDeviceBySn(sn));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用优惠券
|
||||||
|
*/
|
||||||
|
@Log(title = "使用优惠券", businessType = BusinessType.USECOUPON)
|
||||||
|
@PostMapping("/useCoupon")
|
||||||
|
public AjaxResult useCoupon(String orderNo, Long logId)
|
||||||
|
{
|
||||||
|
logger.info("使用优惠券:【orderNo="+orderNo+"】,【logId="+logId+"】");
|
||||||
|
if (StrUtil.isBlank(orderNo)){
|
||||||
|
throw new ServiceException("未传orderNo");
|
||||||
|
}
|
||||||
|
if (logId == null){
|
||||||
|
throw new ServiceException("未传logId");
|
||||||
|
}
|
||||||
|
return toAjax(etOrderService.useCoupon(orderNo,logId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,4 +201,9 @@ public enum BusinessType
|
||||||
* 解绑系统用户
|
* 解绑系统用户
|
||||||
*/
|
*/
|
||||||
UNBANDSYSUSER,
|
UNBANDSYSUSER,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用优惠券
|
||||||
|
*/
|
||||||
|
USECOUPON,
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,10 @@ public class EtOrder extends BaseEntity
|
||||||
@Excel(name = "优惠券id")
|
@Excel(name = "优惠券id")
|
||||||
private Long couponId;
|
private Long couponId;
|
||||||
|
|
||||||
|
/** 用户优惠卡id */
|
||||||
|
@Excel(name = "用户优惠卡id")
|
||||||
|
private Long logId;
|
||||||
|
|
||||||
/** 套餐对象 */
|
/** 套餐对象 */
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private EtFeeRule rule;
|
private EtFeeRule rule;
|
||||||
|
@ -304,4 +308,8 @@ public class EtOrder extends BaseEntity
|
||||||
@Excel(name = "封顶金额")
|
@Excel(name = "封顶金额")
|
||||||
private BigDecimal cappedAmount;
|
private BigDecimal cappedAmount;
|
||||||
|
|
||||||
|
/** 优惠券对象*/
|
||||||
|
@Excel(name = "优惠券对象")
|
||||||
|
private EtCoupon coupon;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,4 +263,9 @@ public interface IEtOrderService
|
||||||
* 首页统计-排行榜
|
* 首页统计-排行榜
|
||||||
*/
|
*/
|
||||||
List<LeaderboardVo> leaderboard(String type,String timeLimit);
|
List<LeaderboardVo> leaderboard(String type,String timeLimit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用优惠券
|
||||||
|
*/
|
||||||
|
int useCoupon(String orderNo, Long logId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,12 +114,6 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
||||||
@Resource
|
@Resource
|
||||||
private EtLocationLogMapper etLocationLogMapper;
|
private EtLocationLogMapper etLocationLogMapper;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private EtCouponMapper etCouponMapper;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private EtCouponClaimLogMapper etCouponClaimLogMapper;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AsUserMapper asUserMapper;
|
private AsUserMapper asUserMapper;
|
||||||
|
|
||||||
|
@ -1793,11 +1787,6 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
||||||
}
|
}
|
||||||
/** 3. 计算订单费用,保存订单总金额*/
|
/** 3. 计算订单费用,保存订单总金额*/
|
||||||
order = calculateOrderFee(order,isInParkingArea);
|
order = calculateOrderFee(order,isInParkingArea);
|
||||||
/** 4. 优惠券计算价格
|
|
||||||
* order中有couponId则有使用优惠券 */
|
|
||||||
if(ObjectUtil.isNotNull(order.getCouponId())){
|
|
||||||
order = calculateCoupon(order);
|
|
||||||
}
|
|
||||||
/** 6.计算行车距离*/
|
/** 6.计算行车距离*/
|
||||||
String tripRouteStr = order.getTripRouteStr();
|
String tripRouteStr = order.getTripRouteStr();
|
||||||
if(StrUtil.isNotBlank(tripRouteStr)){
|
if(StrUtil.isNotBlank(tripRouteStr)){
|
||||||
|
@ -1913,74 +1902,6 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
||||||
//// }
|
//// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/**
|
|
||||||
* 使用优惠券后的价格
|
|
||||||
* 1. 先判断是否过期?并且是否是未使用的状态
|
|
||||||
* 2. 再判断是哪种类型的优惠券,
|
|
||||||
* 如果是
|
|
||||||
* 时间卡:骑行价格直接改成0
|
|
||||||
* 贵宾卡:所有价格改成0
|
|
||||||
* 折扣卡:总金额 * 折扣比例 次数减一
|
|
||||||
* 抵用券:总金额 - 抵用金额 次数减一
|
|
||||||
*/
|
|
||||||
private EtOrder calculateCoupon(EtOrder order) {
|
|
||||||
Long couponId = order.getCouponId();
|
|
||||||
EtCoupon etCoupon = etCouponMapper.selectEtCouponByCouponId(couponId);
|
|
||||||
Long userId = order.getUserId();
|
|
||||||
AsUser asUser = asUserMapper.selectUserById(userId);
|
|
||||||
|
|
||||||
EtCouponUserLog etCouponUserLog = new EtCouponUserLog();
|
|
||||||
etCouponUserLog.setUserId(userId);
|
|
||||||
etCouponUserLog.setCouponId(couponId);
|
|
||||||
etCouponUserLog.setStatus(ServiceConstants.COUPON_STATUS_UNUSED);
|
|
||||||
List<EtCouponUserLog> etCouponUserLogs = etCouponClaimLogMapper.selectEtCouponClaimLogList(etCouponUserLog);
|
|
||||||
EtCouponUserLog etCouponUserLog1 = null;
|
|
||||||
if(etCouponUserLogs !=null && etCouponUserLogs.size()>0){
|
|
||||||
etCouponUserLog1 = etCouponUserLogs.get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(etCoupon.getType().equals(asUser.getVipType()) || asUser.getExpirationTime().compareTo(new Date()) < 0){
|
|
||||||
throw new ServiceException("会员已过期");
|
|
||||||
}
|
|
||||||
|
|
||||||
if((etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_DISCOUNT_CARD) || etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_VOUCHER))
|
|
||||||
&& isCouponExpired(etCouponUserLog1)){
|
|
||||||
throw new ServiceException("优惠券已过期");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(etCouponUserLog1.getLimitNum() == 0){
|
|
||||||
throw new ServiceException("可用次数不足");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_TIME_CARD)){
|
|
||||||
order.setPayFee(order.getTotalFee().subtract(order.getRidingFee()));//会员
|
|
||||||
order.setRidingFee(BigDecimal.ZERO);
|
|
||||||
}else if(etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_VIP_CARD)){//贵宾卡
|
|
||||||
order.setPayFee(BigDecimal.ZERO);
|
|
||||||
}else if(etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_DISCOUNT_CARD)){//折扣卡
|
|
||||||
order.setPayFee(order.getTotalFee().multiply(etCoupon.getDiscountPercent()).setScale(2, RoundingMode.HALF_UP));
|
|
||||||
}else if(etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_VOUCHER)){//抵用券
|
|
||||||
order.setPayFee(order.getTotalFee().subtract(etCoupon.getDiscountAmount()));
|
|
||||||
}else{
|
|
||||||
throw new ServiceException("优惠券类型错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 扣除一次使用次数
|
|
||||||
if(etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_DISCOUNT_CARD) || etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_VOUCHER) && etCouponUserLog1.getLimitNum() > 0){
|
|
||||||
etCouponClaimLogMapper.deductLimitNum(etCouponUserLog1.getLogId());
|
|
||||||
}
|
|
||||||
return order;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 判断优惠券是否过期 */
|
|
||||||
private boolean isCouponExpired(EtCouponUserLog etCouponUserLog) {
|
|
||||||
if(etCouponUserLog!=null){
|
|
||||||
return etCouponUserLog.getExpirationTime().compareTo(new Date()) < 0;
|
|
||||||
}else{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算订单费用
|
* 计算订单费用
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -121,6 +121,12 @@ public class EtOrderServiceImpl implements IEtOrderService
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysOperLogService operLogService;
|
private ISysOperLogService operLogService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private EtCouponMapper etCouponMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private EtCouponClaimLogMapper etCouponClaimLogMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单
|
* 查询订单
|
||||||
*
|
*
|
||||||
|
@ -1803,6 +1809,10 @@ public class EtOrderServiceImpl implements IEtOrderService
|
||||||
if(ObjectUtil.isNotNull(etFeeRule)){
|
if(ObjectUtil.isNotNull(etFeeRule)){
|
||||||
order.setRule(etFeeRule);
|
order.setRule(etFeeRule);
|
||||||
}
|
}
|
||||||
|
EtCoupon etCoupon = etCouponMapper.selectEtCouponByCouponId(order.getCouponId());
|
||||||
|
if(ObjectUtil.isNotNull(etCoupon)){
|
||||||
|
order.setCoupon(etCoupon);
|
||||||
|
}
|
||||||
// 骑行结束并且订单金额等于0,并且未支付
|
// 骑行结束并且订单金额等于0,并且未支付
|
||||||
if(ServiceConstants.ORDER_STATUS_RIDING_END.equals(order.getStatus()) && order.getTotalFee().compareTo(BigDecimal.ZERO) == 0 && order.getPaid().equals(ServiceConstants.ORDER_PAY_STATUS_NON_PAYMENT)){
|
if(ServiceConstants.ORDER_STATUS_RIDING_END.equals(order.getStatus()) && order.getTotalFee().compareTo(BigDecimal.ZERO) == 0 && order.getPaid().equals(ServiceConstants.ORDER_PAY_STATUS_NON_PAYMENT)){
|
||||||
order.setPaid(ServiceConstants.ORDER_PAY_STATUS_PAID);
|
order.setPaid(ServiceConstants.ORDER_PAY_STATUS_PAID);
|
||||||
|
@ -1977,4 +1987,96 @@ public class EtOrderServiceImpl implements IEtOrderService
|
||||||
if(!execute)throw new ServiceException("换车开锁失败");
|
if(!execute)throw new ServiceException("换车开锁失败");
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用优惠券
|
||||||
|
* 1. 查询订单,
|
||||||
|
* 2. 计算使用优惠券后的金额,
|
||||||
|
* 3. 更新优惠券状态
|
||||||
|
* 4. 更新订单状态
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int useCoupon(String orderNo, Long logId) {
|
||||||
|
EtOrder order = etOrderMapper.selectEtOrderByOrderNo(orderNo);
|
||||||
|
if(ObjectUtil.isNotNull(order)){
|
||||||
|
order = calculateCoupon(order,logId);
|
||||||
|
}else{
|
||||||
|
throw new ServiceException("订单不存在");
|
||||||
|
}
|
||||||
|
order.setLogId(logId);
|
||||||
|
int updateEtOrder = etOrderMapper.updateEtOrder(order);
|
||||||
|
log.info("【使用优惠券】更新订单状态成功");
|
||||||
|
return updateEtOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用优惠券后的价格
|
||||||
|
* 1. 先判断是否过期?并且是否是未使用的状态
|
||||||
|
* 2. 再判断是哪种类型的优惠券,
|
||||||
|
* 如果是
|
||||||
|
* 时间卡:骑行价格直接改成0
|
||||||
|
* 贵宾卡:所有价格改成0
|
||||||
|
* 折扣卡:总金额 * 折扣比例 次数减一
|
||||||
|
* 抵用券:总金额 - 抵用金额 次数减一
|
||||||
|
*/
|
||||||
|
private EtOrder calculateCoupon(EtOrder order,Long logId) {
|
||||||
|
Long couponId = order.getCouponId();
|
||||||
|
EtCoupon etCoupon = etCouponMapper.selectEtCouponByCouponId(couponId);
|
||||||
|
Long userId = order.getUserId();
|
||||||
|
AsUser asUser = asUserMapper.selectUserById(userId);
|
||||||
|
|
||||||
|
EtCouponUserLog etCouponUserLog1 = etCouponClaimLogMapper.selectEtCouponClaimLogByLogId(logId);
|
||||||
|
|
||||||
|
if(etCoupon.getType().equals(asUser.getVipType()) || asUser.getExpirationTime().compareTo(new Date()) < 0){
|
||||||
|
throw new ServiceException("会员已过期");
|
||||||
|
}
|
||||||
|
|
||||||
|
if((etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_DISCOUNT_CARD) || etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_VOUCHER))
|
||||||
|
&& isCouponExpired(etCouponUserLog1)){
|
||||||
|
throw new ServiceException("优惠券已过期");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(etCouponUserLog1.getLimitNum() == 0){
|
||||||
|
throw new ServiceException("可用次数不足");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_TIME_CARD)){
|
||||||
|
order.setPayFee(formatPayFee(order.getTotalFee().subtract(order.getRidingFee())));//会员
|
||||||
|
order.setRidingFee(BigDecimal.ZERO);
|
||||||
|
}else if(etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_VIP_CARD)){//贵宾卡
|
||||||
|
order.setPayFee(BigDecimal.ZERO);
|
||||||
|
}else if(etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_DISCOUNT_CARD)){//折扣卡
|
||||||
|
order.setPayFee(formatPayFee(order.getTotalFee().multiply(etCoupon.getDiscountPercent()).setScale(2, RoundingMode.HALF_UP)));
|
||||||
|
}else if(etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_VOUCHER)){//抵用券
|
||||||
|
order.setPayFee(formatPayFee(order.getTotalFee().subtract(etCoupon.getDiscountAmount())));
|
||||||
|
}else{
|
||||||
|
throw new ServiceException("优惠券类型错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 扣除一次使用次数
|
||||||
|
if(etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_DISCOUNT_CARD) || etCoupon.getType().equals(ServiceConstants.COUPON_TYPE_VOUCHER) && etCouponUserLog1.getLimitNum() > 0){
|
||||||
|
etCouponClaimLogMapper.deductLimitNum(etCouponUserLog1.getLogId());
|
||||||
|
}
|
||||||
|
return order;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化金额方法:保留两位小数,如果金额为负数则返回0.
|
||||||
|
*
|
||||||
|
* @param amount 需要格式化的金额
|
||||||
|
* @return 格式化后的金额
|
||||||
|
*/
|
||||||
|
public static BigDecimal formatPayFee(BigDecimal amount) {
|
||||||
|
return amount.max(BigDecimal.ZERO).setScale(2, RoundingMode.HALF_UP);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 判断优惠券是否过期 */
|
||||||
|
private boolean isCouponExpired(EtCouponUserLog etCouponUserLog) {
|
||||||
|
if(etCouponUserLog!=null){
|
||||||
|
return etCouponUserLog.getExpirationTime().compareTo(new Date()) < 0;
|
||||||
|
}else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="gainMethod" column="gain_method" />
|
<result property="gainMethod" column="gain_method" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
<result property="expirationTime" column="expiration_time" />
|
<result property="expirationTime" column="expiration_time" />
|
||||||
|
<result property="limitNum" column="limit_num" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectEtCouponClaimLogVo">
|
<sql id="selectEtCouponClaimLogVo">
|
||||||
select log_id, area_id, user_id, coupon_id, create_time, gain_method, status, expiration_time from et_coupon_user_log
|
select log_id, area_id, user_id, coupon_id, create_time, gain_method, status, expiration_time,limit_num from et_coupon_user_log
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectEtCouponClaimLogList" parameterType="EtCouponUserLog" resultMap="EtCouponClaimLogResult">
|
<select id="selectEtCouponClaimLogList" parameterType="EtCouponUserLog" resultMap="EtCouponClaimLogResult">
|
||||||
|
@ -36,7 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
c.retail_price retailPrice,
|
c.retail_price retailPrice,
|
||||||
c.validity_value validityValue,
|
c.validity_value validityValue,
|
||||||
c.validity_unit validityUnit,
|
c.validity_unit validityUnit,
|
||||||
c.type couponType
|
c.type couponType,
|
||||||
|
l.limit_num limitNum
|
||||||
from et_coupon_user_log l
|
from et_coupon_user_log l
|
||||||
left join et_operating_area a on a.area_id = l.area_id
|
left join et_operating_area a on a.area_id = l.area_id
|
||||||
left join et_user u on u.user_id = l.user_id
|
left join et_user u on u.user_id = l.user_id
|
||||||
|
@ -102,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="gainMethod != null">gain_method,</if>
|
<if test="gainMethod != null">gain_method,</if>
|
||||||
<if test="status != null">status,</if>
|
<if test="status != null">status,</if>
|
||||||
<if test="expirationTime != null">expiration_time,</if>
|
<if test="expirationTime != null">expiration_time,</if>
|
||||||
|
<if test="limitNum != null">limit_num,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="areaId != null">#{areaId},</if>
|
<if test="areaId != null">#{areaId},</if>
|
||||||
|
@ -111,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="gainMethod != null">#{gainMethod},</if>
|
<if test="gainMethod != null">#{gainMethod},</if>
|
||||||
<if test="status != null">#{status},</if>
|
<if test="status != null">#{status},</if>
|
||||||
<if test="expirationTime != null">#{expirationTime},</if>
|
<if test="expirationTime != null">#{expirationTime},</if>
|
||||||
|
<if test="limitNum != null">#{limitNum},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@ -124,12 +128,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="gainMethod != null">gain_method = #{gainMethod},</if>
|
<if test="gainMethod != null">gain_method = #{gainMethod},</if>
|
||||||
<if test="status != null">status = #{status},</if>
|
<if test="status != null">status = #{status},</if>
|
||||||
<if test="expirationTime != null">expiration_time = #{expirationTime},</if>
|
<if test="expirationTime != null">expiration_time = #{expirationTime},</if>
|
||||||
|
<if test="limitNum != null">limit_num = #{limitNum},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where log_id = #{logId}
|
where log_id = #{logId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="deductLimitNum">
|
<update id="deductLimitNum">
|
||||||
update et_coupon
|
update et_coupon_user_log
|
||||||
set limit_num = limit_num - 1
|
set limit_num = limit_num - 1
|
||||||
where log_id = #{logId} and limit_num > 0
|
where log_id = #{logId} and limit_num > 0
|
||||||
</update>
|
</update>
|
||||||
|
|
|
@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="userId" column="user_id" />
|
<result property="userId" column="user_id" />
|
||||||
<result property="ruleId" column="rule_id" />
|
<result property="ruleId" column="rule_id" />
|
||||||
<result property="couponId" column="coupon_id" />
|
<result property="couponId" column="coupon_id" />
|
||||||
|
<result property="logId" column="log_id" />
|
||||||
<result property="deviceMac" column="device_mac" />
|
<result property="deviceMac" column="device_mac" />
|
||||||
<result property="sn" column="sn" />
|
<result property="sn" column="sn" />
|
||||||
<result property="vehicleNum" column="vehicle_num" />
|
<result property="vehicleNum" column="vehicle_num" />
|
||||||
|
@ -59,7 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectEtOrderVo">
|
<sql id="selectEtOrderVo">
|
||||||
select order_id, area_id, order_no, out_trade_no, user_id, rule_id, coupon_id,
|
select order_id, area_id, order_no, out_trade_no, user_id, rule_id, coupon_id,log_id
|
||||||
device_mac, sn, pay_time, paid, pay_type, type, total_fee, pay_fee, dispatch_fee,
|
device_mac, sn, pay_time, paid, pay_type, type, total_fee, pay_fee, dispatch_fee,
|
||||||
manage_fee, riding_fee, appointment_fee, mark, duration, distance, status,
|
manage_fee, riding_fee, appointment_fee, mark, duration, distance, status,
|
||||||
create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time,
|
create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time,
|
||||||
|
@ -69,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="selectEtOrderVoNoRoute">
|
<sql id="selectEtOrderVoNoRoute">
|
||||||
select order_id, area_id, order_no, out_trade_no, user_id, rule_id, coupon_id,
|
select order_id, area_id, order_no, out_trade_no, user_id, rule_id, coupon_id,log_id
|
||||||
device_mac, sn, pay_time, paid, pay_type, type, total_fee, pay_fee, dispatch_fee,
|
device_mac, sn, pay_time, paid, pay_type, type, total_fee, pay_fee, dispatch_fee,
|
||||||
manage_fee, riding_fee, appointment_fee, mark, duration, distance, status,
|
manage_fee, riding_fee, appointment_fee, mark, duration, distance, status,
|
||||||
create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time,
|
create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time,
|
||||||
|
@ -91,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
o.user_id,
|
o.user_id,
|
||||||
o.rule_id,
|
o.rule_id,
|
||||||
o.coupon_id,
|
o.coupon_id,
|
||||||
|
o.log_id,
|
||||||
o.device_mac,
|
o.device_mac,
|
||||||
o.sn,
|
o.sn,
|
||||||
de.vehicle_num,
|
de.vehicle_num,
|
||||||
|
@ -186,6 +188,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
o.user_id,
|
o.user_id,
|
||||||
o.rule_id,
|
o.rule_id,
|
||||||
o.coupon_id,
|
o.coupon_id,
|
||||||
|
o.log_id,
|
||||||
o.device_mac,
|
o.device_mac,
|
||||||
o.sn,
|
o.sn,
|
||||||
de.vehicle_num,
|
de.vehicle_num,
|
||||||
|
@ -276,6 +279,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
u.phonenumber AS phonenumber,
|
u.phonenumber AS phonenumber,
|
||||||
o.rule_id,
|
o.rule_id,
|
||||||
o.coupon_id,
|
o.coupon_id,
|
||||||
|
o.log_id,
|
||||||
o.device_mac,
|
o.device_mac,
|
||||||
o.sn,
|
o.sn,
|
||||||
o.pay_time,
|
o.pay_time,
|
||||||
|
@ -729,6 +733,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
o.user_id,
|
o.user_id,
|
||||||
o.rule_id,
|
o.rule_id,
|
||||||
o.coupon_id,
|
o.coupon_id,
|
||||||
|
o.log_id,
|
||||||
o.device_mac,
|
o.device_mac,
|
||||||
o.sn,
|
o.sn,
|
||||||
o.pay_time,
|
o.pay_time,
|
||||||
|
@ -807,6 +812,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="userId != null">user_id,</if>
|
<if test="userId != null">user_id,</if>
|
||||||
<if test="ruleId != null">rule_id,</if>
|
<if test="ruleId != null">rule_id,</if>
|
||||||
<if test="couponId != null">coupon_id,</if>
|
<if test="couponId != null">coupon_id,</if>
|
||||||
|
<if test="logId != null">log_id,</if>
|
||||||
<if test="deviceMac != null">device_mac,</if>
|
<if test="deviceMac != null">device_mac,</if>
|
||||||
<if test="sn != null">sn,</if>
|
<if test="sn != null">sn,</if>
|
||||||
<if test="payTime != null">pay_time,</if>
|
<if test="payTime != null">pay_time,</if>
|
||||||
|
@ -850,6 +856,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="userId != null">#{userId},</if>
|
<if test="userId != null">#{userId},</if>
|
||||||
<if test="ruleId != null">#{ruleId},</if>
|
<if test="ruleId != null">#{ruleId},</if>
|
||||||
<if test="couponId != null">#{couponId},</if>
|
<if test="couponId != null">#{couponId},</if>
|
||||||
|
<if test="logId != null">#{logId},</if>
|
||||||
<if test="deviceMac != null">#{deviceMac},</if>
|
<if test="deviceMac != null">#{deviceMac},</if>
|
||||||
<if test="sn != null">#{sn},</if>
|
<if test="sn != null">#{sn},</if>
|
||||||
<if test="payTime != null">#{payTime},</if>
|
<if test="payTime != null">#{payTime},</if>
|
||||||
|
@ -896,6 +903,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="userId != null">user_id = #{userId},</if>
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
<if test="ruleId != null">rule_id = #{ruleId},</if>
|
<if test="ruleId != null">rule_id = #{ruleId},</if>
|
||||||
<if test="couponId != null">coupon_id = #{couponId},</if>
|
<if test="couponId != null">coupon_id = #{couponId},</if>
|
||||||
|
<if test="logId != null">log_id = #{logId},</if>
|
||||||
<if test="deviceMac != null">device_mac = #{deviceMac},</if>
|
<if test="deviceMac != null">device_mac = #{deviceMac},</if>
|
||||||
<if test="sn != null">sn = #{sn},</if>
|
<if test="sn != null">sn = #{sn},</if>
|
||||||
<if test="payTime != null">pay_time = #{payTime},</if>
|
<if test="payTime != null">pay_time = #{payTime},</if>
|
||||||
|
@ -950,6 +958,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="outTradeNo != null and outTradeNo != ''">out_trade_no = #{outTradeNo},</if>
|
<if test="outTradeNo != null and outTradeNo != ''">out_trade_no = #{outTradeNo},</if>
|
||||||
<if test="ruleId != null">rule_id = #{ruleId},</if>
|
<if test="ruleId != null">rule_id = #{ruleId},</if>
|
||||||
<if test="couponId != null">coupon_id = #{couponId},</if>
|
<if test="couponId != null">coupon_id = #{couponId},</if>
|
||||||
|
<if test="logId != null">log_id = #{logId},</if>
|
||||||
<if test="deviceMac != null">device_mac = #{deviceMac},</if>
|
<if test="deviceMac != null">device_mac = #{deviceMac},</if>
|
||||||
<if test="sn != null">sn = #{sn},</if>
|
<if test="sn != null">sn = #{sn},</if>
|
||||||
<if test="payTime != null">pay_time = #{payTime},</if>
|
<if test="payTime != null">pay_time = #{payTime},</if>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user