| @@ -3,6 +3,7 @@ package com.simple.controller; | |||||
| import com.simple.common.ErrorCode; | import com.simple.common.ErrorCode; | ||||
| import com.simple.domain.po.WxCUser; | import com.simple.domain.po.WxCUser; | ||||
| import com.simple.domain.po.WxCouponChannel; | import com.simple.domain.po.WxCouponChannel; | ||||
| import com.simple.domain.vo.WxOrderCVo; | |||||
| import com.simple.enums.EnumCouponChannelStatus; | import com.simple.enums.EnumCouponChannelStatus; | ||||
| import com.simple.enums.EnumCouponStatus; | import com.simple.enums.EnumCouponStatus; | ||||
| import com.simple.enums.EnumOrderStatus; | import com.simple.enums.EnumOrderStatus; | ||||
| @@ -191,18 +192,26 @@ public class WxOrderController extends BaseController { | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | ||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true), | @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true), | ||||
| @ApiImplicitParam(name="orderStatus",value="订单状态0-已下单/待付款;1-已支付;2-已取消",dataType="int", paramType = "query",required=false) | |||||
| }) | }) | ||||
| public ResultData list(Integer orderStatus, Integer pageNum, Integer pageSize) { | |||||
| public ResultData list(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { | |||||
| // c端用户应该只能看到自己的订单 | // c端用户应该只能看到自己的订单 | ||||
| WxCUser user = getUser(); | |||||
| WxOrder wxOrderQ = new WxOrder(); | |||||
| wxOrderQ.setCUserId(user.getId()); | |||||
| wxOrderQ.setOrderStatus(orderStatus); | |||||
| final PageInfo<WxOrder> page = wxOrderService.listAsPage(wxOrderQ, pageNum, pageSize); | |||||
| if (wxOrder == null) wxOrder = new WxOrder(); | |||||
| wxOrder.setCUserId(getUser().getId()); | |||||
| final PageInfo<WxOrderCVo> page = wxOrderService.listCUserVoAsPage(wxOrder, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("订单详情接口") | |||||
| @GetMapping("detail") | |||||
| public ResultData list(@ModelAttribute WxOrder wxOrder) { | |||||
| // c端用户应该只能看到自己的订单细节 | |||||
| if (wxOrder == null) wxOrder = new WxOrder(); | |||||
| wxOrder.setCUserId(getUser().getId()); | |||||
| WxOrderCVo wxOrderCVo = wxOrderService.detailCUserVo(wxOrder); | |||||
| if (wxOrderCVo == null) | |||||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||||
| return new ResultData(wxOrderCVo); | |||||
| } | |||||
| @ApiOperation(value = "根据orderId查询接口", notes = "{\"orderId\":\"string\"}") | @ApiOperation(value = "根据orderId查询接口", notes = "{\"orderId\":\"string\"}") | ||||
| @GetMapping("/findById") | @GetMapping("/findById") | ||||
| public ResultData findById(@RequestBody Map<String, String> paramMap) { | public ResultData findById(@RequestBody Map<String, String> paramMap) { | ||||
| @@ -0,0 +1,404 @@ | |||||
| package com.simple.domain.vo; | |||||
| import com.simple.domain.po.WxCouponOrder; | |||||
| import com.simple.domain.po.WxOrder; | |||||
| import javax.persistence.Id; | |||||
| import javax.persistence.Transient; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| public class WxOrderCVo extends WxCouponOrder{ | |||||
| /** | |||||
| * | |||||
| */ | |||||
| private static final long serialVersionUID = 6687954932922444531L; | |||||
| @Id | |||||
| protected Long id; | |||||
| @Transient | |||||
| protected List<Long> ids; | |||||
| @Transient | |||||
| protected String sortColumns; | |||||
| public Long getId() { | |||||
| return id; | |||||
| } | |||||
| public void setId(Long id) { | |||||
| this.id = id; | |||||
| } | |||||
| public String getSortColumns() { | |||||
| return sortColumns; | |||||
| } | |||||
| public List<Long> getIds() { | |||||
| return ids; | |||||
| } | |||||
| public void setIds(List<Long> ids) { | |||||
| this.ids = ids; | |||||
| } | |||||
| /* 基础购买到的券信息 */ | |||||
| /*订单码;正反向交易保持一致。**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单码;正反向交易保持一致。",name="orderNumber") | |||||
| private Long orderNumber; | |||||
| /*租户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||||
| private String tenantId; | |||||
| /*c端用户id**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") | |||||
| private Long cUserId; | |||||
| /*商户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||||
| private Long merchantId; | |||||
| /*操作券B端小程序用户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="操作券B端小程序用户ID",name="bUserId") | |||||
| private Long bUserId; | |||||
| /*券ID-产品ID将来的产品都会放在coupon表里**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券ID",name="couponId") | |||||
| private Long couponId; | |||||
| /*0: 付款 1: 退款**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="0: 付款 1: 退款",name="paymentType") | |||||
| private Integer paymentType; | |||||
| /*支付金额(分):允许有负数,退款时为负值。**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付金额(分):允许有负数,退款时为负值。",name="payment") | |||||
| private Integer payment; | |||||
| /*支付时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") | |||||
| private Date paymentTime; | |||||
| /*订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款;4-退款失败**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款;4-退款失败",name="orderStatus") | |||||
| private Integer orderStatus; | |||||
| /*创建时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| /*更新时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| /* 券类型信息 */ | |||||
| /*商户id**/ | |||||
| /*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type") | |||||
| private Integer type; | |||||
| /*封面图**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||||
| private String coverImg; | |||||
| /*券名称**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | |||||
| private String title; | |||||
| /*副标题**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | |||||
| private String subTitle; | |||||
| /*售价(适用于类型2,3,4,5)**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice") | |||||
| private Integer salePrice; | |||||
| /*使用条件金额(适用于类型1,2,3,4)**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | |||||
| private Integer usePrice; | |||||
| /*面额**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | |||||
| private Integer price; | |||||
| /*须知**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") | |||||
| private String detail; | |||||
| /*购买须知**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") | |||||
| private String remark; | |||||
| /*发券商户信息*/ | |||||
| /*商户图片**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户图片",name="imgUrl") | |||||
| private String merchantImgUrl; | |||||
| /*商户名**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="name") | |||||
| private String merchantName; | |||||
| /*联系方式**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户联系方式",name="linkPhone") | |||||
| private String merchantLinkPhone; | |||||
| /*商户状态**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户状态1可用0停用",name="status") | |||||
| private Integer merchantStatus; | |||||
| /*地址**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="地址",name="addr") | |||||
| private String addr; | |||||
| /*百度poi(省市区县street等)**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="百度poi(省市区县street等)",name="baiduPoi") | |||||
| private String baiduPoi; | |||||
| /*商铺编号**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber") | |||||
| private String shopNumber; | |||||
| /*楼座号**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="楼座",name="buildingName") | |||||
| private String buildingName; | |||||
| /*楼层号**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="楼层",name="floorName") | |||||
| private String floorName; | |||||
| public Long getOrderNumber() { | |||||
| return orderNumber; | |||||
| } | |||||
| public void setOrderNumber(Long _orderNumber) { | |||||
| orderNumber = _orderNumber; | |||||
| } | |||||
| public String getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setTenantId(String _tenantId) { | |||||
| tenantId = _tenantId; | |||||
| } | |||||
| public Long getCUserId() { | |||||
| return cUserId; | |||||
| } | |||||
| public void setCUserId(Long _cUserId) { | |||||
| cUserId = _cUserId; | |||||
| } | |||||
| public Long getMerchantId() { | |||||
| return merchantId; | |||||
| } | |||||
| public void setMerchantId(Long _merchantId) { | |||||
| merchantId = _merchantId; | |||||
| } | |||||
| public Long getBUserId() { | |||||
| return bUserId; | |||||
| } | |||||
| public void setBUserId(Long _bUserId) { | |||||
| bUserId = _bUserId; | |||||
| } | |||||
| public Long getCouponId() { | |||||
| return couponId; | |||||
| } | |||||
| public void setCouponId(Long _couponId) { | |||||
| this.couponId = _couponId; | |||||
| } | |||||
| public Integer getPaymentType() { | |||||
| return paymentType; | |||||
| } | |||||
| public void setPaymentType(Integer _paymentType) { | |||||
| paymentType = _paymentType; | |||||
| } | |||||
| public Integer getPayment() { | |||||
| return payment; | |||||
| } | |||||
| public void setPayment(Integer _payment) { | |||||
| payment = _payment; | |||||
| } | |||||
| public Date getPaymentTime() { | |||||
| return paymentTime; | |||||
| } | |||||
| public void setPaymentTime(Date _paymentTime) { | |||||
| paymentTime = _paymentTime; | |||||
| } | |||||
| public Integer getOrderStatus() { | |||||
| return orderStatus; | |||||
| } | |||||
| public void setOrderStatus(Integer _orderStatus) { | |||||
| orderStatus = _orderStatus; | |||||
| } | |||||
| public Date getCreateDate() { | |||||
| return createDate; | |||||
| } | |||||
| public void setCreateDate(Date _createDate) { | |||||
| createDate = _createDate; | |||||
| } | |||||
| public Date getUpdateDate() { | |||||
| return updateDate; | |||||
| } | |||||
| public void setUpdateDate(Date _updateDate) { | |||||
| updateDate = _updateDate; | |||||
| } | |||||
| public Integer getType() { | |||||
| return type; | |||||
| } | |||||
| public void setType(Integer _type) { | |||||
| type = _type; | |||||
| } | |||||
| public String getCoverImg() { | |||||
| return coverImg; | |||||
| } | |||||
| public void setCoverImg(String _coverImg) { | |||||
| coverImg = _coverImg; | |||||
| } | |||||
| public String getTitle() { | |||||
| return title; | |||||
| } | |||||
| public void setTitle(String _title) { | |||||
| title = _title; | |||||
| } | |||||
| public String getSubTitle() { | |||||
| return subTitle; | |||||
| } | |||||
| public void setSubTitle(String _subTitle) { | |||||
| subTitle = _subTitle; | |||||
| } | |||||
| public Integer getSalePrice() { | |||||
| return salePrice; | |||||
| } | |||||
| public void setSalePrice(Integer _salePrice) { | |||||
| salePrice = _salePrice; | |||||
| } | |||||
| public Integer getUsePrice() { | |||||
| return usePrice; | |||||
| } | |||||
| public void setUsePrice(Integer _usePrice) { | |||||
| usePrice = _usePrice; | |||||
| } | |||||
| public String getDetail() { | |||||
| return detail; | |||||
| } | |||||
| public void setDetail(String _detail) { | |||||
| detail = _detail; | |||||
| } | |||||
| public Integer getPrice() { | |||||
| return price; | |||||
| } | |||||
| public void setPrice(Integer _price) { | |||||
| price = _price; | |||||
| } | |||||
| public String getRemark() { | |||||
| return remark; | |||||
| } | |||||
| public void setRemark(String _remark) { | |||||
| remark = _remark; | |||||
| } | |||||
| public String getBuildingName() {return buildingName; } | |||||
| public void setBuildingName(String _building) { | |||||
| buildingName = _building; | |||||
| } | |||||
| public String getFloorName() { | |||||
| return floorName; | |||||
| } | |||||
| public void setFloorName(String _floor) { | |||||
| floorName = _floor; | |||||
| } | |||||
| public String getShopNumber() { | |||||
| return shopNumber; | |||||
| } | |||||
| public void setShopNumber(String _shopNumber) { | |||||
| shopNumber = _shopNumber; | |||||
| } | |||||
| public String getBaiduPoi() { | |||||
| return baiduPoi; | |||||
| } | |||||
| public void setBaiduPoi(String _baiduPoi) { | |||||
| baiduPoi = _baiduPoi; | |||||
| } | |||||
| public String getAddr() { | |||||
| return addr; | |||||
| } | |||||
| public void setAddr(String _addr) { | |||||
| addr = _addr; | |||||
| } | |||||
| public String getMerChantImgUrl() { | |||||
| return merchantImgUrl; | |||||
| } | |||||
| public void setMerChantImgUrl(String _imgUrl) { | |||||
| merchantImgUrl = _imgUrl; | |||||
| } | |||||
| public String getMerchantName() { | |||||
| return merchantName; | |||||
| } | |||||
| public void setMerchantName(String _name) { | |||||
| merchantName = _name; | |||||
| } | |||||
| public String getMerchantLinkPhone() { | |||||
| return merchantLinkPhone; | |||||
| } | |||||
| public void setMerchantLinkPhone(String _linkPhone) { | |||||
| merchantLinkPhone = _linkPhone; | |||||
| } | |||||
| public Integer getMerchantStatus() { | |||||
| return merchantStatus; | |||||
| } | |||||
| public void setMerchantStatus(Integer status) { | |||||
| this.merchantStatus = status; | |||||
| } | |||||
| public static enum Field | |||||
| { | |||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||||
| ,OrderNumber_ASC("`orderNumber` ASC"),OrderNumber_DESC("`orderNumber` DESC") | |||||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||||
| ,CUserId_ASC("`cUserId` ASC"),CUserId_DESC("`cUserId` DESC") | |||||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||||
| ,BUserId_ASC("`bUserId` ASC"),BUserId_DESC("`bUserId` DESC") | |||||
| ,CouponId_ASC("`couponId` ASC"),CouponId_DESC("`couponId` DESC") | |||||
| ,PaymentType_ASC("`paymentType` ASC"),PaymentType_DESC("`paymentType` DESC") | |||||
| ,Payment_ASC("`payment` ASC"),Payment_DESC("`payment` DESC") | |||||
| ,PaymentTime_ASC("`paymentTime` ASC"),PaymentTime_DESC("`paymentTime` DESC") | |||||
| ,OrderStatus_ASC("`orderStatus` ASC"),OrderStatus_DESC("`orderStatus` DESC") | |||||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||||
| ,Detail_ASC("`detail` ASC"),Detail_DESC("`detail` DESC") | |||||
| ; | |||||
| private String value; | |||||
| Field(String value){ | |||||
| this.value = value; | |||||
| } | |||||
| public String getValue() { | |||||
| return value; | |||||
| } | |||||
| public void setCol(String value) { | |||||
| this.value = value; | |||||
| } | |||||
| @Override | |||||
| public String toString() { | |||||
| return this.getValue(); | |||||
| } | |||||
| } | |||||
| public void setSortColumns(WxOrder.Field... fields) | |||||
| { | |||||
| if (fields == null || fields.length == 0) { | |||||
| return; | |||||
| } | |||||
| for (int k = 0; k < fields.length; k++) { | |||||
| if (fields[k] == null) { | |||||
| return; | |||||
| } | |||||
| } | |||||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||||
| for (int k = 1; k < fields.length; k++) { | |||||
| sb.append(","); | |||||
| sb.append(fields[k].toString()); | |||||
| } | |||||
| } | |||||
| public void setSortColumns(String sortColumns) | |||||
| { | |||||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||||
| return; | |||||
| } | |||||
| if (sortColumns.contains(",")) { | |||||
| String[] cols = sortColumns.split(","); | |||||
| java.util.List<WxOrder.Field> fList = new java.util.ArrayList(); | |||||
| for (int k = 0; k < cols.length; k++) { | |||||
| fList.add(WxOrder.Field.valueOf(cols[k])); | |||||
| } | |||||
| this.setSortColumns(fList.toArray(new WxOrder.Field[fList.size()])); | |||||
| } else { | |||||
| this.setSortColumns(WxOrder.Field.valueOf(sortColumns)); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -3,6 +3,7 @@ package com.simple.mapper; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.simple.common.CommonMapper; | import com.simple.common.CommonMapper; | ||||
| import com.simple.domain.po.WxCouponOrder; | import com.simple.domain.po.WxCouponOrder; | ||||
| import com.simple.domain.vo.WxOrderCVo; | |||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| import com.simple.domain.po.WxOrder; | import com.simple.domain.po.WxOrder; | ||||
| @@ -11,4 +12,8 @@ public interface WxOrderMapper extends CommonMapper<WxOrder, Long> { | |||||
| List<WxOrder> findList(WxOrder wxOrder); | List<WxOrder> findList(WxOrder wxOrder); | ||||
| List<WxOrder> findListOfUnpaidOrderByDate(Map dateMap); | List<WxOrder> findListOfUnpaidOrderByDate(Map dateMap); | ||||
| List<WxOrderCVo> findListOfCUser(WxOrder wxOrder); | |||||
| WxOrderCVo selectDetailOfCUser(WxOrder wxOrder); | |||||
| } | } | ||||
| @@ -1,9 +1,12 @@ | |||||
| package com.simple.service; | package com.simple.service; | ||||
| import java.util.*; | import java.util.*; | ||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.domain.po.WxCUser; | import com.simple.domain.po.WxCUser; | ||||
| import com.simple.domain.po.WxOrder; | import com.simple.domain.po.WxOrder; | ||||
| import com.simple.domain.vo.WxOrderCVo; | |||||
| import com.simple.enums.EnumOrderStatus; | import com.simple.enums.EnumOrderStatus; | ||||
| public interface WxOrderService { | public interface WxOrderService { | ||||
| @@ -77,12 +80,11 @@ public interface WxOrderService { | |||||
| */ | */ | ||||
| List<WxOrder> findList(WxOrder record); | List<WxOrder> findList(WxOrder record); | ||||
| PageInfo<WxOrderCVo> listCUserVoAsPage(WxOrder record, Integer pageIndex, Integer pageSize); | |||||
| WxOrderCVo detailCUserVo(WxOrder record); | |||||
| } | } | ||||
| @@ -4,10 +4,13 @@ import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.ErrorCode; | import com.simple.common.ErrorCode; | ||||
| import com.simple.common.IdWorker; | import com.simple.common.IdWorker; | ||||
| import com.simple.common.ResultData; | |||||
| import com.simple.domain.po.WxCUser; | import com.simple.domain.po.WxCUser; | ||||
| import com.simple.domain.po.WxCoupon; | import com.simple.domain.po.WxCoupon; | ||||
| import com.simple.domain.po.WxCouponOrder; | import com.simple.domain.po.WxCouponOrder; | ||||
| import com.simple.domain.po.WxOrder; | import com.simple.domain.po.WxOrder; | ||||
| import com.simple.domain.vo.WxCouponOrderCVo; | |||||
| import com.simple.domain.vo.WxOrderCVo; | |||||
| import com.simple.enums.*; | import com.simple.enums.*; | ||||
| import com.simple.exception.MallinkException; | import com.simple.exception.MallinkException; | ||||
| import com.simple.mapper.*; | import com.simple.mapper.*; | ||||
| @@ -20,6 +23,7 @@ import org.springframework.transaction.annotation.Propagation; | |||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.HashMap; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @@ -458,5 +462,14 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| return wxOrderMapper.findList(record); | return wxOrderMapper.findList(record); | ||||
| } | } | ||||
| @Override | |||||
| public PageInfo<WxOrderCVo> listCUserVoAsPage(WxOrder record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxOrderMapper.findListOfCUser(record)); | |||||
| } | |||||
| @Override | |||||
| public WxOrderCVo detailCUserVo(WxOrder record) { | |||||
| return wxOrderMapper.selectDetailOfCUser(record); | |||||
| } | |||||
| } | } | ||||
| @@ -112,13 +112,104 @@ | |||||
| <select id="findListOfUnpaidOrderByDate" parameterType="map" resultMap="BaseResultMap"> | <select id="findListOfUnpaidOrderByDate" parameterType="map" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns" /> from wx_order | select <include refid="allColumns" /> from wx_order | ||||
| where 1=1 | |||||
| where order_status = '0' | |||||
| <if test="startDate != null"> | <if test="startDate != null"> | ||||
| AND create_date > #{startDate,jdbcType=TIMESTAMP} | AND create_date > #{startDate,jdbcType=TIMESTAMP} | ||||
| </if> | |||||
| <if test="startDate != null"> | |||||
| AND create_date < #{endDate,jdbcType=TIMESTAMP} | AND create_date < #{endDate,jdbcType=TIMESTAMP} | ||||
| </if> | </if> | ||||
| AND order_status = '0' | |||||
| </select> | </select> | ||||
| <sql id="allCUserOrderListColumns"> | |||||
| o.id,o.order_number,o.tenant_id,o.c_user_id,o.merchant_id,o.b_user_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, | |||||
| co.cover_img,co.title,co.sub_title,co.sale_price,co.use_price,co.price, | |||||
| m.name | |||||
| </sql> | |||||
| <sql id="allCUserOrderDetailColumns"> | |||||
| o.id,o.order_number,o.tenant_id,o.c_user_id,o.merchant_id,o.b_user_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, | |||||
| co.type,co.cover_img,co.title,co.sub_title,co.sale_price,co.use_price,co.price,co.detail,co.remark, | |||||
| m.img_url,m.name,m.link_phone,m.status, | |||||
| s.addr,s.shop_number,s.baidu_poi, | |||||
| mb.building_name,mf.floor_name | |||||
| </sql> | |||||
| <resultMap id="CVoResultMap" type="com.simple.domain.vo.WxOrderCVo"> | |||||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||||
| <result column="order_number" jdbcType="BIGINT" property="orderNumber" /> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> | |||||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | |||||
| <result column="coupon_id" jdbcType="BIGINT" property="couponId" /> | |||||
| <result column="b_user_id" jdbcType="BIGINT" property="bUserId" /> | |||||
| <result column="payment_type" jdbcType="INTEGER" property="paymentType" /> | |||||
| <result column="payment" jdbcType="INTEGER" property="payment" /> | |||||
| <result column="payment_time" jdbcType="TIMESTAMP" property="paymentTime" /> | |||||
| <result column="order_status" jdbcType="INTEGER" property="orderStatus" /> | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||||
| <result column="cover_img" jdbcType="VARCHAR" property="coverImg" /> | |||||
| <result column="title" jdbcType="VARCHAR" property="title" /> | |||||
| <result column="sub_title" jdbcType="VARCHAR" property="subTitle" /> | |||||
| <result column="sale_price" jdbcType="INTEGER" property="salePrice" /> | |||||
| <result column="use_price" jdbcType="INTEGER" property="usePrice" /> | |||||
| <result column="detail" jdbcType="VARCHAR" property="detail" /> | |||||
| <result column="price" jdbcType="INTEGER" property="price" /> | |||||
| <result column="remark" jdbcType="VARCHAR" property="remark" /> | |||||
| <result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl" /> | |||||
| <result column="name" jdbcType="VARCHAR" property="merchantName" /> | |||||
| <result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone" /> | |||||
| <result column="status" jdbcType="VARCHAR" property="merchantStatus" /> | |||||
| <result column="addr" jdbcType="VARCHAR" property="addr"/> | |||||
| <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/> | |||||
| <result column="building_name" jdbcType="VARCHAR" property="buildingName" /> | |||||
| <result column="floor_name" jdbcType="VARCHAR" property="floorName" /> | |||||
| <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/> | |||||
| </resultMap> | |||||
| <select id="findListOfCUser" parameterType="com.simple.domain.po.WxOrder" resultMap="CVoResultMap"> | |||||
| select <include refid="allCUserOrderListColumns" /> | |||||
| from wx_order o,wx_coupon co,wx_merchant m | |||||
| where o.coupon_id = co.id | |||||
| and co.merchant_id = m.id | |||||
| <if test="cUserId != null"> | |||||
| and o.c_user_id = #{cUserId} | |||||
| </if> | |||||
| <if test="tenantId != null"> | |||||
| and o.tenant_id = #{tenantId} | |||||
| </if> | |||||
| <if test="orderStatus != null"> | |||||
| AND o.order_status = #{orderStatus} | |||||
| </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| </select> | |||||
| <select id="selectDetailOfCUser" parameterType="com.simple.domain.po.WxOrder" resultMap="CVoResultMap"> | |||||
| select <include refid="allCUserOrderDetailColumns" /> | |||||
| from wx_order o,wx_coupon co,wx_merchant m | |||||
| left join wx_merchant_shop ms on ms.merchant_id = m.id | |||||
| left join wx_shop s on ms.shop_id = s.id | |||||
| left join wx_mall_building mb on s.building = mb.id | |||||
| left join wx_mall_floor mf on s.floor = mf.id | |||||
| where o.coupon_id = co.id | |||||
| and co.merchant_id = m.id | |||||
| <if test="cUserId != null"> | |||||
| and o.c_user_id = #{cUserId} | |||||
| </if> | |||||
| <if test="tenantId != null"> | |||||
| and o.tenant_id = #{tenantId} | |||||
| </if> | |||||
| <if test="id != null"> | |||||
| and o.id = #{id} | |||||
| </if> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||