Commit 81caf6da by 吕明尚

订单表增加商户订单号字段,增加验券逻辑

parent 589e0cb7
...@@ -6,8 +6,11 @@ import org.springframework.web.bind.annotation.*; ...@@ -6,8 +6,11 @@ import org.springframework.web.bind.annotation.*;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.system.domain.SConsumer;
import share.system.domain.SConsumerCoupon; import share.system.domain.SConsumerCoupon;
import share.system.domain.vo.FrontTokenComponent;
import share.system.service.ISConsumerCouponService; import share.system.service.ISConsumerCouponService;
import java.util.List; import java.util.List;
/** /**
...@@ -18,8 +21,7 @@ import java.util.List; ...@@ -18,8 +21,7 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping("/front/consumerCoupon") @RequestMapping("/front/consumerCoupon")
public class SConsumerCouponController extends BaseController public class SConsumerCouponController extends BaseController {
{
@Autowired @Autowired
private ISConsumerCouponService sConsumerCouponService; private ISConsumerCouponService sConsumerCouponService;
...@@ -28,8 +30,9 @@ public class SConsumerCouponController extends BaseController ...@@ -28,8 +30,9 @@ public class SConsumerCouponController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:coupon:list')") @PreAuthorize("@ss.hasPermi('system:coupon:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SConsumerCoupon sConsumerCoupon) public TableDataInfo list(SConsumerCoupon sConsumerCoupon) {
{ SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
sConsumerCoupon.setConsumerId(user.getId());
startPage(); startPage();
List<SConsumerCoupon> list = sConsumerCouponService.selectSConsumerCouponList(sConsumerCoupon); List<SConsumerCoupon> list = sConsumerCouponService.selectSConsumerCouponList(sConsumerCoupon);
return getDataTable(list); return getDataTable(list);
...@@ -40,9 +43,18 @@ public class SConsumerCouponController extends BaseController ...@@ -40,9 +43,18 @@ public class SConsumerCouponController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:coupon:query')") @PreAuthorize("@ss.hasPermi('system:coupon:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return success(sConsumerCouponService.selectSConsumerCouponById(id)); return success(sConsumerCouponService.selectSConsumerCouponById(id));
} }
@PreAuthorize("@ss.hasPermi('system:coupon:list')")
@GetMapping("/query")
public List<SConsumerCoupon> query(SConsumerCoupon sConsumerCoupon) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
sConsumerCoupon.setConsumerId(user.getId());
return sConsumerCouponService.selectSConsumerCouponList(sConsumerCoupon);
}
} }
...@@ -2,6 +2,8 @@ package share.web.controller.system; ...@@ -2,6 +2,8 @@ package share.web.controller.system;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -16,6 +18,8 @@ import share.common.annotation.Log; ...@@ -16,6 +18,8 @@ import share.common.annotation.Log;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType; import share.common.enums.BusinessType;
import share.common.enums.RoomType;
import share.common.enums.StoreType;
import share.system.domain.SCoupon; import share.system.domain.SCoupon;
import share.system.service.ISCouponService; import share.system.service.ISCouponService;
import share.common.utils.poi.ExcelUtil; import share.common.utils.poi.ExcelUtil;
...@@ -77,6 +81,12 @@ public class SCouponController extends BaseController ...@@ -77,6 +81,12 @@ public class SCouponController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody SCoupon sCoupon) public AjaxResult add(@RequestBody SCoupon sCoupon)
{ {
if (StringUtils.isNotBlank(sCoupon.getRoomType())){
sCoupon.setRoomType(String.valueOf(RoomType.getCodeList()));
}
if (StringUtils.isNotBlank(sCoupon.getStoreType())){
sCoupon.setStoreType(String.valueOf(StoreType.getCodeList()));
}
return toAjax(sCouponService.insertSCoupon(sCoupon)); return toAjax(sCouponService.insertSCoupon(sCoupon));
} }
......
...@@ -22,18 +22,29 @@ import javax.validation.constraints.NotBlank; ...@@ -22,18 +22,29 @@ import javax.validation.constraints.NotBlank;
* @date 2023-10-09 * @date 2023-10-09
*/ */
@Data @Data
public class SOrder extends BaseEntity public class SOrder extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 订单ID */ /**
* 订单ID
*/
private Long id; private Long id;
/** 订单流水号 */ /**
* 订单流水号
*/
@Excel(name = "订单编号") @Excel(name = "订单编号")
private String orderNo; private String orderNo;
/** 订单类型(0:订房订单,1:续房订单,2:充值订单) */ /**
* 订单流水号
*/
@Excel(name = "订单编号")
private String outTradeNo;
/**
* 订单类型(0:订房订单,1:续房订单,2:充值订单)
*/
@Excel(name = "订单类型(0:订房订单,1:续房订单,2:充值订单)") @Excel(name = "订单类型(0:订房订单,1:续房订单,2:充值订单)")
private Integer orderType; private Integer orderType;
...@@ -49,15 +60,21 @@ public class SOrder extends BaseEntity ...@@ -49,15 +60,21 @@ public class SOrder extends BaseEntity
@Excel(name = "房间ID") @Excel(name = "房间ID")
private Long roomId; private Long roomId;
/** 用户ID */ /**
* 用户ID
*/
@Excel(name = "用户ID") @Excel(name = "用户ID")
private Long consumerId; private Long consumerId;
/** 用户名称 */ /**
* 用户名称
*/
@Excel(name = "用户名称") @Excel(name = "用户名称")
private String consumerName; private String consumerName;
/** 用户手机号 */ /**
* 用户手机号
*/
@Excel(name = "用户手机号") @Excel(name = "用户手机号")
private String consumerPhone; private String consumerPhone;
...@@ -67,7 +84,9 @@ public class SOrder extends BaseEntity ...@@ -67,7 +84,9 @@ public class SOrder extends BaseEntity
@ApiModelProperty(value = "套餐金额") @ApiModelProperty(value = "套餐金额")
private BigDecimal packPrice; private BigDecimal packPrice;
/** 优惠券id */ /**
* 优惠券id
*/
@Excel(name = "优惠券id") @Excel(name = "优惠券id")
private String couponId; private String couponId;
...@@ -86,27 +105,37 @@ public class SOrder extends BaseEntity ...@@ -86,27 +105,37 @@ public class SOrder extends BaseEntity
@Excel(name = "订单时长(H)") @Excel(name = "订单时长(H)")
private String timeLong; private String timeLong;
/** 预约开始时间 */ /**
* 预约开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@Excel(name = "预约开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm") @Excel(name = "预约开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
private Date preStartDate; private Date preStartDate;
/** 预约结束时间 */ /**
* 预约结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@Excel(name = "预约结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm") @Excel(name = "预约结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
private Date preEndDate; private Date preEndDate;
/** 开始时间 */ /**
* 开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm") @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
private Date startDate; private Date startDate;
/** 结束时间 */ /**
* 结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm") @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
private Date endDate; private Date endDate;
/** 订单状态(0:待使用/已预约,1:使用中,2:已使用,3:已取消预约/退款中) */ /**
* 订单状态(0:待使用/已预约,1:使用中,2:已使用,3:已取消预约/退款中)
*/
@Excel(name = "订单状态(0:待使用/已预约,1:使用中,2:已使用)") @Excel(name = "订单状态(0:待使用/已预约,1:使用中,2:已使用)")
private Integer status; private Integer status;
......
...@@ -15,8 +15,10 @@ import com.meituan.sdk.model.tuangouNg.coupon.queryCouponById.QueryCouponByIdRes ...@@ -15,8 +15,10 @@ import com.meituan.sdk.model.tuangouNg.coupon.queryCouponById.QueryCouponByIdRes
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.system.domain.SConsumer;
import share.system.domain.SConsumerCoupon; import share.system.domain.SConsumerCoupon;
import share.system.domain.SCoupon; import share.system.domain.SCoupon;
import share.system.domain.vo.FrontTokenComponent;
import share.system.service.ISConsumerCouponService; import share.system.service.ISConsumerCouponService;
import share.system.service.ISCouponService; import share.system.service.ISCouponService;
import share.system.service.MTService; import share.system.service.MTService;
...@@ -39,16 +41,17 @@ public class MTServiceImpl implements MTService { ...@@ -39,16 +41,17 @@ public class MTServiceImpl implements MTService {
//执行验券 //执行验券
@Override @Override
public MeituanResponse verificationVouchers(String code, int num) { public MeituanResponse verificationVouchers(String code, int num) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
//验券准备 //验券准备
MeituanResponse preparation = preparation(code); MeituanResponse preparation = preparation(code);
//验券准备失败 //验券准备失败
if(!preparation.isSuccess()){ if (!preparation.isSuccess()) {
throw new RuntimeException(preparation.getMsg()); throw new RuntimeException(preparation.getMsg());
} }
//返回验券准备数据 //返回验券准备数据
MsSuperPrepareResponse data = (MsSuperPrepareResponse)preparation.getData(); MsSuperPrepareResponse data = (MsSuperPrepareResponse) preparation.getData();
SCoupon sCoupon = isCouponService.selectSCouponByName(data.getDealTitle()); SCoupon sCoupon = isCouponService.selectSCouponByName(data.getDealTitle());
if(sCoupon == null){ if (sCoupon == null) {
throw new RuntimeException("未找到对应的优惠券"); throw new RuntimeException("未找到对应的优惠券");
} }
//执行验券 //执行验券
...@@ -65,12 +68,28 @@ public class MTServiceImpl implements MTService { ...@@ -65,12 +68,28 @@ public class MTServiceImpl implements MTService {
} catch (MtSdkException e) { } catch (MtSdkException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
if (response.isSuccess()){ //验券成功
if (response.isSuccess()) {
SConsumerCoupon sConsumerCoupon = new SConsumerCoupon(); SConsumerCoupon sConsumerCoupon = new SConsumerCoupon();
sConsumerCoupon.setConsumerId(user.getId());
sConsumerCoupon.setCouponId(sCoupon.getId());
sConsumerCoupon.setCouponCode(code);
sConsumerCoupon.setName(sCoupon.getName());
sConsumerCoupon.setCouponType(String.valueOf(sCoupon.getCouponType()));
sConsumerCoupon.setStoreType(sCoupon.getStoreType()); sConsumerCoupon.setStoreType(sCoupon.getStoreType());
sConsumerCoupon.setRoomType(sCoupon.getRoomType()); sConsumerCoupon.setRoomType(sCoupon.getRoomType());
sConsumerCoupon.setMinDuration(sCoupon.getMinDuration());
sConsumerCoupon.setMaxDuration(sCoupon.getMaxDuration());
sConsumerCoupon.setDuration(sCoupon.getDuration());
sConsumerCoupon.setMinPrice(sCoupon.getMinPrice());
sConsumerCoupon.setSubPrice(sCoupon.getSubPrice());
sConsumerCoupon.setSourceType("3");
sConsumerCoupon.setPlatformType("2");
sConsumerCoupon.setStartDate(sCoupon.getStartDate());
sConsumerCoupon.setEndDate(sCoupon.getEndDate());
sConsumerCoupon.setCreateBy(String.valueOf(user.getId()));
isConsumerCouponService.insertSConsumerCoupon(sConsumerCoupon); isConsumerCouponService.insertSConsumerCoupon(sConsumerCoupon);
}else{ } else {
return response; return response;
} }
return response; return response;
...@@ -79,7 +98,7 @@ public class MTServiceImpl implements MTService { ...@@ -79,7 +98,7 @@ public class MTServiceImpl implements MTService {
//撤销验券 //撤销验券
@Override @Override
public MeituanResponse revoke(String ERPId, String ERPName, String couponCode) { public MeituanResponse revoke(String ERPId, String ERPName, String couponCode) {
MeituanClient meituanClient = DefaultMeituanClient.builder(developerId,signKey).build(); MeituanClient meituanClient = DefaultMeituanClient.builder(developerId, signKey).build();
CouponCancelRequest couponCancelRequest = new CouponCancelRequest(); CouponCancelRequest couponCancelRequest = new CouponCancelRequest();
couponCancelRequest.setEId(ERPId); couponCancelRequest.setEId(ERPId);
couponCancelRequest.setEName(ERPName); couponCancelRequest.setEName(ERPName);
...@@ -102,7 +121,7 @@ public class MTServiceImpl implements MTService { ...@@ -102,7 +121,7 @@ public class MTServiceImpl implements MTService {
msSuperPrepareRequest.setCode(code); msSuperPrepareRequest.setCode(code);
MeituanResponse<MsSuperPrepareResponse> response = null; MeituanResponse<MsSuperPrepareResponse> response = null;
try { try {
response = meituanClient.invokeApi(msSuperPrepareRequest,appAuthToken); response = meituanClient.invokeApi(msSuperPrepareRequest, appAuthToken);
} catch (MtSdkException e) { } catch (MtSdkException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
......
...@@ -5,91 +5,119 @@ ...@@ -5,91 +5,119 @@
<mapper namespace="share.system.mapper.SOrderMapper"> <mapper namespace="share.system.mapper.SOrderMapper">
<resultMap type="SOrder" id="SOrderResult"> <resultMap type="SOrder" id="SOrderResult">
<result property="id" column="id" /> <result property="id" column="id"/>
<result property="orderNo" column="order_no" /> <result property="orderNo" column="order_no"/>
<result property="orderType" column="order_type" /> <result property="outTradeNo" column="out_trade_no"/>
<result property="payType" column="pay_type" /> <result property="orderType" column="order_type"/>
<result property="payStatus" column="pay_status" /> <result property="payType" column="pay_type"/>
<result property="storeId" column="store_id" /> <result property="payStatus" column="pay_status"/>
<result property="roomId" column="room_id" /> <result property="storeId" column="store_id"/>
<result property="consumerId" column="consumer_id" /> <result property="roomId" column="room_id"/>
<result property="consumerName" column="consumer_name" /> <result property="consumerId" column="consumer_id"/>
<result property="consumerPhone" column="consumer_phone" /> <result property="consumerName" column="consumer_name"/>
<result property="packId" column="pack_id" /> <result property="consumerPhone" column="consumer_phone"/>
<result property="packPrice" column="pack_price" /> <result property="packId" column="pack_id"/>
<result property="couponId" column="coupon_id" /> <result property="packPrice" column="pack_price"/>
<result property="couponPrice" column="coupon_price" /> <result property="couponId" column="coupon_id"/>
<result property="totalPrice" column="total_price" /> <result property="couponPrice" column="coupon_price"/>
<result property="payPrice" column="pay_price" /> <result property="totalPrice" column="total_price"/>
<result property="payTime" column="pay_time" /> <result property="payPrice" column="pay_price"/>
<result property="timeLong" column="time_long" /> <result property="payTime" column="pay_time"/>
<result property="preStartDate" column="pre_start_date" /> <result property="timeLong" column="time_long"/>
<result property="preEndDate" column="pre_end_date" /> <result property="preStartDate" column="pre_start_date"/>
<result property="startDate" column="start_date" /> <result property="preEndDate" column="pre_end_date"/>
<result property="endDate" column="end_date" /> <result property="startDate" column="start_date"/>
<result property="status" column="status" /> <result property="endDate" column="end_date"/>
<result property="refundStatus" column="refund_status" /> <result property="status" column="status"/>
<result property="refundReason" column="refund_reason" /> <result property="refundStatus" column="refund_status"/>
<result property="refundReasonTime" column="refund_reason_time" /> <result property="refundReason" column="refund_reason"/>
<result property="refundPrice" column="refund_price" /> <result property="refundReasonTime" column="refund_reason_time"/>
<result property="isDelete" column="is_delete" /> <result property="refundPrice" column="refund_price"/>
<result property="createBy" column="create_by" /> <result property="isDelete" column="is_delete"/>
<result property="createTime" column="create_time" /> <result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by" /> <result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time" /> <result property="updateBy" column="update_by"/>
<result property="remark" column="remark" /> <result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap> </resultMap>
<sql id="selectSOrderVo"> <sql id="selectSOrderVo">
select id, order_no, order_type, select id,
pay_type, pay_status, store_id, order_no,
room_id, consumer_id, consumer_name, out_trade_no,
consumer_phone, pack_id, pack_price, order_type,
coupon_id, coupon_price, total_price, pay_type,
pay_price, pay_time, time_long, pay_status,
pre_start_date, pre_end_date, start_date, store_id,
end_date, status, refund_status, room_id,
refund_reason, refund_reason_time, refund_price, consumer_id,
is_delete, create_by, create_time, consumer_name,
update_by, update_time, remark from s_order consumer_phone,
pack_id,
pack_price,
coupon_id,
coupon_price,
total_price,
pay_price,
pay_time,
time_long,
pre_start_date,
pre_end_date,
start_date,
end_date,
status,
refund_status,
refund_reason,
refund_reason_time,
refund_price,
is_delete,
create_by,
create_time,
update_by,
update_time,
remark
from s_order
</sql> </sql>
<select id="selectSOrderList" parameterType="SOrder" resultMap="SOrderResult"> <select id="selectSOrderList" parameterType="SOrder" resultMap="SOrderResult">
<include refid="selectSOrderVo"/> <include refid="selectSOrderVo"/>
<where> <where>
1=1 1=1
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if> <if test="orderNo != null and orderNo != ''">and order_no = #{orderNo},</if>
<if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if> <if test="outTradeNo != null and outTradeNo != ''">and out_trade_no = #{outTradeNo},</if>
<if test="payType != null and payType != ''"> and pay_type = #{payType}</if> <if test="orderType != null and orderType != ''">and order_type = #{orderType},</if>
<if test="payStatus != null and payStatus != ''"> and pay_status = #{payStatus},</if> <if test="payType != null and payType != ''">and pay_type = #{payType},</if>
<if test="storeId != null and storeId != ''"> and store_id = #{storeId},</if> <if test="payStatus != null and payStatus != ''">and pay_status = #{payStatus},</if>
<if test="roomId != null and roomId != ''"> and room_id = #{roomId},</if> <if test="storeId != null and storeId != ''">and store_id = #{storeId},</if>
<if test="consumerId != null and consumerId != ''"> and consumer_id = #{consumerId},</if> <if test="roomId != null and roomId != ''">and room_id = #{roomId},</if>
<if test="consumerName != null and consumerName != ''"> and consumer_name = #{consumerName},</if> <if test="consumerId != null and consumerId != ''">and consumer_id = #{consumerId},</if>
<if test="consumerPhone != null and consumerPhone != ''"> and consumer_phone = #{consumerPhone},</if> <if test="consumerName != null and consumerName != ''">and consumer_name = #{consumerName},</if>
<if test="packId != null and packId != ''"> and pack_id = #{packId},</if> <if test="consumerPhone != null and consumerPhone != ''">and consumer_phone = #{consumerPhone},</if>
<if test="packPrice != null and packPrice != ''"> and pack_price = #{packPrice},</if> <if test="packId != null and packId != ''">and pack_id = #{packId},</if>
<if test="couponId != null and couponId != ''"> and coupon_id = #{couponId},</if> <if test="packPrice != null and packPrice != ''">and pack_price = #{packPrice},</if>
<if test="couponPrice != null and couponPrice != ''"> and coupon_price = #{couponPrice},</if> <if test="couponId != null and couponId != ''">and coupon_id = #{couponId},</if>
<if test="totalPrice != null and totalPrice != ''"> and total_price = #{totalPrice},</if> <if test="couponPrice != null and couponPrice != ''">and coupon_price = #{couponPrice},</if>
<if test="payPrice != null and payPrice != ''"> and pay_price = #{payPrice},</if> <if test="totalPrice != null and totalPrice != ''">and total_price = #{totalPrice},</if>
<if test="payTime != null and payTime != ''"> and pay_time = #{payTime},</if> <if test="payPrice != null and payPrice != ''">and pay_price = #{payPrice},</if>
<if test="timeLong != null and timeLong != ''"> and time_long = #{timeLong},</if> <if test="payTime != null and payTime != ''">and pay_time = #{payTime},</if>
<if test="preStartDate != null and preStartDate != ''"> and pre_start_date = #{preStartDate},</if> <if test="timeLong != null and timeLong != ''">and time_long = #{timeLong},</if>
<if test="preEndDate != null and preEndDate != ''"> and pre_end_date = #{preEndDate},</if> <if test="preStartDate != null and preStartDate != ''">and pre_start_date = #{preStartDate},</if>
<if test="startDate != null and startDate != ''"> and start_date = #{startDate},</if> <if test="preEndDate != null and preEndDate != ''">and pre_end_date = #{preEndDate},</if>
<if test="endDate != null and endDate != ''"> and end_date = #{endDate},</if> <if test="startDate != null and startDate != ''">and start_date = #{startDate},</if>
<if test="status != null and status != ''"> and status = #{status},</if> <if test="endDate != null and endDate != ''">and end_date = #{endDate},</if>
<if test="refundStatus != null and refundStatus != ''"> and refund_status = #{refundStatus},</if> <if test="status != null and status != ''">and status = #{status},</if>
<if test="refundReason != null and refundReason != ''"> and refund_reason = #{refundReason},</if> <if test="refundStatus != null and refundStatus != ''">and refund_status = #{refundStatus},</if>
<if test="refundReasonTime != null and refundReasonTime != ''"> and refund_reason_time = #{refundReasonTime},</if> <if test="refundReason != null and refundReason != ''">and refund_reason = #{refundReason},</if>
<if test="refundPrice != null and refundPrice != ''"> and refund_price = #{refundPrice},</if> <if test="refundReasonTime != null and refundReasonTime != ''">and refund_reason_time =
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete},</if> #{refundReasonTime},
<if test="createBy != null and createBy != ''"> and create_by = #{createBy},</if> </if>
<if test="createTime != null and createTime != ''"> and create_time = #{createTime},</if> <if test="refundPrice != null and refundPrice != ''">and refund_price = #{refundPrice},</if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy},</if> <if test="isDelete != null and isDelete != ''">and is_delete = #{isDelete},</if>
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime},</if> <if test="createBy != null and createBy != ''">and create_by = #{createBy},</if>
<if test="remark != null and remark != ''"> and remark = #{remark},</if> <if test="createTime != null and createTime != ''">and create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy},</if>
<if test="updateTime != null and updateTime != ''">and update_time = #{updateTime},</if>
<if test="remark != null and remark != ''">and remark = #{remark},</if>
</where> </where>
</select> </select>
...@@ -101,107 +129,112 @@ ...@@ -101,107 +129,112 @@
<insert id="insertSOrder" parameterType="SOrder" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSOrder" parameterType="SOrder" useGeneratedKeys="true" keyProperty="id">
insert into s_order insert into s_order
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderNo != null and orderNo != ''"> order_no,</if> <if test="orderNo != null and orderNo != ''">order_no,</if>
<if test="orderType != null and orderType != ''"> order_type,</if> <if test="outTradeNo != null and outTradeNo != ''">out_trade_no,</if>
<if test="payType != null and payType != ''"> pay_type,</if> <if test="orderType != null and orderType != ''">order_type,</if>
<if test="payStatus != null and payStatus != ''"> pay_status,</if> <if test="payType != null and payType != ''">pay_type,</if>
<if test="storeId != null and storeId != ''"> store_id,</if> <if test="payStatus != null and payStatus != ''">pay_status,</if>
<if test="roomId != null and roomId != ''"> room_id,</if> <if test="storeId != null and storeId != ''">store_id,</if>
<if test="consumerId != null and consumerId != ''"> consumer_id,</if> <if test="roomId != null and roomId != ''">room_id,</if>
<if test="consumerName != null and consumerName != ''"> consumer_name,</if> <if test="consumerId != null and consumerId != ''">consumer_id,</if>
<if test="consumerPhone != null and consumerPhone != ''"> consumer_phone,</if> <if test="consumerName != null and consumerName != ''">consumer_name,</if>
<if test="packId != null and packId != ''"> pack_id,</if> <if test="consumerPhone != null and consumerPhone != ''">consumer_phone,</if>
<if test="packPrice != null and packPrice != ''"> pack_price,</if> <if test="packId != null and packId != ''">pack_id,</if>
<if test="couponId != null and couponId != ''"> coupon_id,</if> <if test="packPrice != null and packPrice != ''">pack_price,</if>
<if test="couponPrice != null and couponPrice != ''"> coupon_price,</if> <if test="couponId != null and couponId != ''">coupon_id,</if>
<if test="totalPrice != null and totalPrice != ''"> total_price,</if> <if test="couponPrice != null and couponPrice != ''">coupon_price,</if>
<if test="payPrice != null and payPrice != ''"> pay_price,</if> <if test="totalPrice != null and totalPrice != ''">total_price,</if>
<if test="payTime != null and payTime != ''"> pay_time,</if> <if test="payPrice != null and payPrice != ''">pay_price,</if>
<if test="timeLong != null and timeLong != ''"> time_long,</if> <if test="payTime != null and payTime != ''">pay_time,</if>
<if test="preStartDate != null and preStartDate != ''"> pre_start_date,</if> <if test="timeLong != null and timeLong != ''">time_long,</if>
<if test="preEndDate != null and preEndDate != ''"> pre_end_date,</if> <if test="preStartDate != null and preStartDate != ''">pre_start_date,</if>
<if test="startDate != null and startDate != ''"> start_date,</if> <if test="preEndDate != null and preEndDate != ''">pre_end_date,</if>
<if test="endDate != null and endDate != ''"> end_date,</if> <if test="startDate != null and startDate != ''">start_date,</if>
<if test="status != null and status != ''"> status,</if> <if test="endDate != null and endDate != ''">end_date,</if>
<if test="refundStatus != null and refundStatus != ''"> refund_status,</if> <if test="status != null and status != ''">status,</if>
<if test="refundReason != null and refundReason != ''"> refund_reason,</if> <if test="refundStatus != null and refundStatus != ''">refund_status,</if>
<if test="refundReasonTime != null and refundReasonTime != ''"> refund_reason_time,</if> <if test="refundReason != null and refundReason != ''">refund_reason,</if>
<if test="refundPrice != null and refundPrice != ''"> refund_price,</if> <if test="refundReasonTime != null and refundReasonTime != ''">refund_reason_time,</if>
<if test="isDelete != null and isDelete != ''"> is_delete,</if> <if test="refundPrice != null and refundPrice != ''">refund_price,</if>
<if test="createBy != null and createBy != ''"> create_by,</if> <if test="isDelete != null and isDelete != ''">is_delete,</if>
<if test="createTime != null and createTime != ''"> create_time,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null and createTime != ''">create_time,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNo != null"> #{orderNo},</if> <if test="orderNo != null">#{orderNo},</if>
<if test="orderType != null"> #{orderType},</if> <if test="outTradeNo != null ">#{outTradeNo},</if>
<if test="payType != null"> #{payType},</if> <if test="orderType != null">#{orderType},</if>
<if test="payStatus != null"> #{payStatus},</if> <if test="payType != null">#{payType},</if>
<if test="storeId != null"> #{storeId},</if> <if test="payStatus != null">#{payStatus},</if>
<if test="roomId != null"> #{roomId},</if> <if test="storeId != null">#{storeId},</if>
<if test="consumerId != null"> #{consumerId},</if> <if test="roomId != null">#{roomId},</if>
<if test="consumerName != null"> #{consumerName},</if> <if test="consumerId != null">#{consumerId},</if>
<if test="consumerPhone != null"> #{consumerPhone},</if> <if test="consumerName != null">#{consumerName},</if>
<if test="packId != null"> #{packId},</if> <if test="consumerPhone != null">#{consumerPhone},</if>
<if test="packPrice != null"> #{packPrice},</if> <if test="packId != null">#{packId},</if>
<if test="couponId != null"> #{couponId},</if> <if test="packPrice != null">#{packPrice},</if>
<if test="couponPrice != null"> #{couponPrice},</if> <if test="couponId != null">#{couponId},</if>
<if test="totalPrice != null"> #{totalPrice},</if> <if test="couponPrice != null">#{couponPrice},</if>
<if test="payPrice != null"> #{payPrice},</if> <if test="totalPrice != null">#{totalPrice},</if>
<if test="payTime != null"> #{payTime},</if> <if test="payPrice != null">#{payPrice},</if>
<if test="timeLong != null"> #{timeLong},</if> <if test="payTime != null">#{payTime},</if>
<if test="preStartDate != null"> #{preStartDate},</if> <if test="timeLong != null">#{timeLong},</if>
<if test="preEndDate != null"> #{preEndDate},</if> <if test="preStartDate != null">#{preStartDate},</if>
<if test="startDate != null"> #{startDate},</if> <if test="preEndDate != null">#{preEndDate},</if>
<if test="endDate != null"> #{endDate},</if> <if test="startDate != null">#{startDate},</if>
<if test="status != null"> #{status},</if> <if test="endDate != null">#{endDate},</if>
<if test="refundStatus != null"> #{refundStatus},</if> <if test="status != null">#{status},</if>
<if test="refundReason != null"> #{refundReason},</if> <if test="refundStatus != null">#{refundStatus},</if>
<if test="refundReasonTime != null"> #{refundReasonTime},</if> <if test="refundReason != null">#{refundReason},</if>
<if test="refundPrice != null"> #{refundPrice},</if> <if test="refundReasonTime != null">#{refundReasonTime},</if>
<if test="isDelete != null"> 0,</if> <if test="refundPrice != null">#{refundPrice},</if>
<if test="createBy != null"> #{createBy},</if> <if test="isDelete != null">0,</if>
<if test="createTime != null"> #{createTime},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim> </trim>
</insert> </insert>
<update id="updateSOrder" parameterType="SOrder"> <update id="updateSOrder" parameterType="SOrder">
update s_order update s_order
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="orderNo != null"> order_no = #{orderNo},</if> <if test="orderNo != null">order_no = #{orderNo},</if>
<if test="orderType != null"> order_type = #{orderType},</if> <if test="outTradeNo != null">out_trade_no = #{outTradeNo},</if>
<if test="payType != null"> pay_type = #{payType},</if> <if test="orderType != null">order_type = #{orderType},</if>
<if test="payStatus != null"> pay_status = #{payStatus},</if> <if test="payType != null">pay_type = #{payType},</if>
<if test="storeId != null"> store_id = #{storeId},</if> <if test="payStatus != null">pay_status = #{payStatus},</if>
<if test="roomId != null"> room_id = #{roomId},</if> <if test="storeId != null">store_id = #{storeId},</if>
<if test="consumerId != null"> consumer_id = #{consumerId},</if> <if test="roomId != null">room_id = #{roomId},</if>
<if test="consumerName != null"> consumer_name = #{consumerName},</if> <if test="consumerId != null">consumer_id = #{consumerId},</if>
<if test="consumerPhone != null"> consumer_phone = #{consumerPhone},</if> <if test="consumerName != null">consumer_name = #{consumerName},</if>
<if test="packId != null"> pack_id = #{packId},</if> <if test="consumerPhone != null">consumer_phone = #{consumerPhone},</if>
<if test="packPrice != null"> pack_price = #{packPrice},</if> <if test="packId != null">pack_id = #{packId},</if>
<if test="couponId != null"> coupon_id = #{couponId},</if> <if test="packPrice != null">pack_price = #{packPrice},</if>
<if test="couponPrice != null"> coupon_price = #{couponPrice},</if> <if test="couponId != null">coupon_id = #{couponId},</if>
<if test="totalPrice != null"> total_price = #{totalPrice},</if> <if test="couponPrice != null">coupon_price = #{couponPrice},</if>
<if test="payPrice != null"> pay_price = #{payPrice},</if> <if test="totalPrice != null">total_price = #{totalPrice},</if>
<if test="payTime != null"> pay_time = #{payTime},</if> <if test="payPrice != null">pay_price = #{payPrice},</if>
<if test="timeLong != null"> time_long = #{timeLong},</if> <if test="payTime != null">pay_time = #{payTime},</if>
<if test="preStartDate != null"> pre_start_date = #{preStartDate},</if> <if test="timeLong != null">time_long = #{timeLong},</if>
<if test="preEndDate != null"> pre_end_date = #{preEndDate},</if> <if test="preStartDate != null">pre_start_date = #{preStartDate},</if>
<if test="startDate != null"> start_date = #{startDate},</if> <if test="preEndDate != null">pre_end_date = #{preEndDate},</if>
<if test="endDate != null"> end_date = #{endDate},</if> <if test="startDate != null">start_date = #{startDate},</if>
<if test="status != null"> status = #{status},</if> <if test="endDate != null">end_date = #{endDate},</if>
<if test="refundStatus != null"> refund_status = #{refundStatus},</if> <if test="status != null">status = #{status},</if>
<if test="refundReason != null"> refund_reason = #{refundReason},</if> <if test="refundStatus != null">refund_status = #{refundStatus},</if>
<if test="refundReasonTime != null"> refund_reason_time = #{refundReasonTime},</if> <if test="refundReason != null">refund_reason = #{refundReason},</if>
<if test="refundPrice != null"> refund_price = #{refundPrice},</if> <if test="refundReasonTime != null">refund_reason_time = #{refundReasonTime},</if>
<if test="isDelete != null"> is_delete = #{isDelete},</if> <if test="refundPrice != null">refund_price = #{refundPrice},</if>
<if test="updateBy != null"> update_by = #{updateBy},</if> <if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="updateTime != null"> update_time = NOW(),</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = NOW(),</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteSOrderById" parameterType="Long"> <delete id="deleteSOrderById" parameterType="Long">
delete from s_order where id = #{id} delete
from s_order
where id = #{id}
</delete> </delete>
<delete id="deleteSOrderByIds" parameterType="String"> <delete id="deleteSOrderByIds" parameterType="String">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment