实现移动端订单列表和订单详情接口
This commit is contained in:
parent
4822174c5e
commit
3114fc7046
@ -1,5 +1,6 @@
|
||||
package com.ycwl.basic.controller.mobile;
|
||||
|
||||
import com.ycwl.basic.annotation.IgnoreToken;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderAddOrUpdateReq;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderReqQuery;
|
||||
import com.ycwl.basic.service.pc.OrderService;
|
||||
@ -23,14 +24,17 @@ public class AppOrderController {
|
||||
|
||||
@ApiOperation("用户端订单列表查询")
|
||||
@PostMapping("/page")
|
||||
@IgnoreToken
|
||||
public ApiResponse pageQuery(@RequestBody OrderReqQuery orderReqQuery) {
|
||||
//TODO 添加用户openid查询条件,仅查询当前用户自己的订单
|
||||
return orderService.pageQuery(orderReqQuery);
|
||||
|
||||
return orderService.appPageQuery(orderReqQuery);
|
||||
}
|
||||
@ApiOperation("用户端订单详情查询")
|
||||
@GetMapping("getOrderDetails/{id}")
|
||||
@IgnoreToken
|
||||
public ApiResponse getOrderDetails(@PathVariable("id") Long id) {
|
||||
return orderService.detail(id);
|
||||
return orderService.appDetail(id);
|
||||
}
|
||||
|
||||
@ApiOperation("用户端订单新增")
|
||||
@ -46,4 +50,13 @@ public class AppOrderController {
|
||||
//TODO 处理购买逻辑
|
||||
return ApiResponse.success("");
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户订单数量")
|
||||
@GetMapping("/getUserOrderCount")
|
||||
public ApiResponse getUserOrderCount() {
|
||||
//TODO 获取用户信息
|
||||
Long userId = 1L;
|
||||
|
||||
return orderService.getOrderCountByUserId(userId);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
package com.ycwl.basic.mapper.pc;
|
||||
|
||||
import com.ycwl.basic.model.pc.order.entity.OrderEntity;
|
||||
import com.ycwl.basic.model.pc.order.entity.OrderItemEntity;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderAddOrUpdateReq;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderReqQuery;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderAppRespVO;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
@ -29,4 +30,9 @@ public interface OrderMapper {
|
||||
*/
|
||||
int addOrderItems(List<OrderItemEntity> orderItems);
|
||||
|
||||
ApiResponse getOrderCount(OrderReqQuery query);
|
||||
|
||||
List<OrderAppRespVO> appList(OrderReqQuery orderReqQuery);
|
||||
|
||||
OrderAppRespVO appDetail(Long id);
|
||||
}
|
||||
|
@ -19,11 +19,11 @@ public class OrderItemEntity {
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 商品类型,0其他,1成片,2原片,3模板成片
|
||||
* 商品类型,0其他,1成片,,2源素材
|
||||
*/
|
||||
private Integer goodsType;
|
||||
/**
|
||||
* 商品ID,goods_type=1关联video.id,=2关联source.id,=3关联template.id
|
||||
* 商品ID,goods_type=1关联video.id,=2关联source.id
|
||||
*/
|
||||
private Long goodsId;
|
||||
|
||||
|
@ -18,13 +18,13 @@ public class OrderItemDTO {
|
||||
@ApiModelProperty("订单id")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 商品类型,0其他,1成片,2原片,3模板成片
|
||||
* 商品类型,0其他,1成片,2原片
|
||||
*/
|
||||
@ApiModelProperty("商品类型,0其他,1成片,2原片,3模板成片")
|
||||
@ApiModelProperty("商品类型,0其他,1成片,,2源素材")
|
||||
private Integer goodsType;
|
||||
/**
|
||||
* 商品ID,goods_type=1关联video.id,=2关联source.id,=3关联template.id
|
||||
* 商品ID,goods_type=1关联video.id,=2关联source.id
|
||||
*/
|
||||
@ApiModelProperty("商品ID,goods_type=1关联video.id,=2关联source.id,=3关联template.id")
|
||||
@ApiModelProperty("商品ID,goods_type=1关联video.id,=2关联source.id")
|
||||
private Long goodsId;
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import java.util.Date;
|
||||
@Data
|
||||
@ApiModel(value = "订单查询对象")
|
||||
public class OrderReqQuery extends BaseQueryParameterReq {
|
||||
private Long memberId;
|
||||
@ApiModelProperty("用户昵称")
|
||||
private String memberNickname;
|
||||
@ApiModelProperty("用户真实名称")
|
||||
|
@ -0,0 +1,88 @@
|
||||
package com.ycwl.basic.model.pc.order.resp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/11/29 15:59
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("移动端订单信息响应类")
|
||||
public class OrderAppRespVO {
|
||||
private Long id;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@ApiModelProperty("价格")
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 实际支付价格
|
||||
*/
|
||||
@ApiModelProperty("实际支付价格")
|
||||
private BigDecimal payPrice;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 退款原因
|
||||
*/
|
||||
@ApiModelProperty("退款原因")
|
||||
private String refundReason;
|
||||
/**
|
||||
* 退款状态,0未提出,1已通过,2待审核
|
||||
*/
|
||||
@ApiModelProperty("退款状态,0未提出,1已通过,2待审核")
|
||||
private Integer refundStatus;
|
||||
/**
|
||||
* 状态,0未支付,1已支付,2已退款,9已取消
|
||||
*/
|
||||
@ApiModelProperty("状态,0未支付,1已支付,2已退款,9已取消")
|
||||
private Integer status;
|
||||
/**
|
||||
* 订单创建时间
|
||||
*/
|
||||
@ApiModelProperty("订单创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createAt;
|
||||
/**
|
||||
* 订单更新时间
|
||||
*/
|
||||
@ApiModelProperty("订单更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateAt;
|
||||
/**
|
||||
* 订单支付时间
|
||||
*/
|
||||
@ApiModelProperty("订单支付时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date payAt;
|
||||
/**
|
||||
* 订单取消时间
|
||||
*/
|
||||
@ApiModelProperty("订单取消时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date cancelAt;
|
||||
/**
|
||||
* 订单退款时间
|
||||
*/
|
||||
@ApiModelProperty("订单退款时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date refundAt;
|
||||
@ApiModelProperty("景区名称")
|
||||
private String scenicName;
|
||||
@ApiModelProperty("商品名称")
|
||||
private String goodsName;
|
||||
@ApiModelProperty("拍摄时间")
|
||||
private Date shootingTime;
|
||||
@ApiModelProperty("订单明细")
|
||||
private List<OrderItemVO> orderItemList;
|
||||
}
|
@ -22,11 +22,21 @@ public class OrderItemVO {
|
||||
/**
|
||||
* 商品类型,0其他,1成片,2原片,3模板成片
|
||||
*/
|
||||
@ApiModelProperty("商品类型,0其他,1成片,2原片,3模板成片")
|
||||
@ApiModelProperty("商品类型,0其他,1成片,2源素材")
|
||||
private Integer goodsType;
|
||||
/**
|
||||
* 商品ID,goods_type=1关联video.id,=2关联source.id,=3关联template.id
|
||||
*/
|
||||
@ApiModelProperty("商品ID,goods_type=1关联video.id,=2关联source.id,=3关联template.id")
|
||||
@ApiModelProperty("商品ID,goods_type=1关联video.id,=2关联source.id")
|
||||
private Long goodsId;
|
||||
@ApiModelProperty("景区名称")
|
||||
private String scenicName;
|
||||
@ApiModelProperty("商品名称 模版名称/原片x个/照片x个")
|
||||
private String goodsName;
|
||||
@ApiModelProperty("视频链接")
|
||||
private String videoUrl;
|
||||
@ApiModelProperty("图片存储地址")
|
||||
private String imgUrl;
|
||||
@ApiModelProperty("原素材类型:1视频,2图像")
|
||||
private Integer sourceType;
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ import com.ycwl.basic.model.pc.order.entity.OrderItemEntity;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderAddOrUpdateReq;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderItemDTO;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderReqQuery;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderAppRespVO;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderItemVO;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
|
||||
import com.ycwl.basic.service.pc.OrderService;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
@ -82,4 +84,39 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
return ApiResponse.success(update);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse getOrderCountByUserId(Long userId) {
|
||||
OrderReqQuery query = new OrderReqQuery();
|
||||
query.setMemberId(userId);
|
||||
return orderMapper.getOrderCount(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<PageInfo<OrderAppRespVO>> appPageQuery(OrderReqQuery orderReqQuery) {
|
||||
PageHelper.startPage(orderReqQuery.getPageNum(), orderReqQuery.getPageSize());
|
||||
List<OrderAppRespVO> list = orderMapper.appList(orderReqQuery);
|
||||
for (OrderAppRespVO appRespVO : list) {
|
||||
List<OrderItemVO> orderItemList = appRespVO.getOrderItemList();
|
||||
if(orderItemList!= null && orderItemList.size() > 0){
|
||||
OrderItemVO itemVO = orderItemList.get(0);
|
||||
appRespVO.setScenicName(itemVO.getScenicName());
|
||||
appRespVO.setGoodsName(itemVO.getGoodsName());
|
||||
}
|
||||
}
|
||||
PageInfo<OrderAppRespVO> pageInfo = new PageInfo<>(list);
|
||||
return ApiResponse.success(pageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<OrderAppRespVO> appDetail(Long id) {
|
||||
OrderAppRespVO orderAppRespVO=orderMapper.appDetail(id);
|
||||
List<OrderItemVO> orderItemList = orderAppRespVO.getOrderItemList();
|
||||
if(orderItemList!= null && orderItemList.size() > 0){
|
||||
OrderItemVO itemVO = orderItemList.get(0);
|
||||
orderAppRespVO.setScenicName(itemVO.getScenicName());
|
||||
orderAppRespVO.setGoodsName(itemVO.getGoodsName());
|
||||
}
|
||||
return ApiResponse.success(orderAppRespVO);
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
|
||||
import com.ycwl.basic.model.pc.order.entity.OrderEntity;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderAddOrUpdateReq;
|
||||
import com.ycwl.basic.model.pc.order.req.OrderReqQuery;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderAppRespVO;
|
||||
import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
|
||||
@ -19,4 +20,10 @@ public interface OrderService {
|
||||
ApiResponse<OrderRespVO> detail(Long orderId);
|
||||
ApiResponse<Integer> add(OrderAddOrUpdateReq query);
|
||||
ApiResponse<Integer> update(OrderAddOrUpdateReq query);
|
||||
|
||||
ApiResponse getOrderCountByUserId(Long userId);
|
||||
|
||||
ApiResponse<PageInfo<OrderAppRespVO>> appPageQuery(OrderReqQuery orderReqQuery);
|
||||
|
||||
ApiResponse<OrderAppRespVO> appDetail(Long id);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ycwl.basic.mapper.pc.OrderMapper">
|
||||
<resultMap id="BaseResultMap" type="com.ycwl.basic.model.pc.order.resp.OrderRespVO">
|
||||
<resultMap id="PCBaseResultMap" type="com.ycwl.basic.model.pc.order.resp.OrderRespVO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="member_id" property="memberId"/>
|
||||
<result column="nickname" property="memberNickname"/>
|
||||
@ -25,6 +25,36 @@
|
||||
<result column="id" property="orderId"/>
|
||||
<result column="goods_type" property="goodsType"/>
|
||||
<result column="goods_id" property="goodsId"/>
|
||||
<result column="scenicName" property="scenicName"/>
|
||||
<result column="goodsName" property="goodsName"/>
|
||||
<result column="videoUrl" property="videoUrl"/>
|
||||
<result column="imgUrl" property="imgUrl"/>
|
||||
<result column="sourceType" property="sourceType"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<resultMap id="AppBaseResultMap" type="com.ycwl.basic.model.pc.order.resp.OrderAppRespVO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="price" property="price"/>
|
||||
<result column="pay_price" property="payPrice"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="refund_reason" property="refundReason"/>
|
||||
<result column="refund_status" property="refundStatus"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="refund_at" property="refundAt"/>
|
||||
<result column="pay_at" property="payAt"/>
|
||||
<result column="cancel_at" property="cancelAt"/>
|
||||
<result column="create_at" property="createAt"/>
|
||||
<result column="update_at" property="updateAt"/>
|
||||
<collection property="orderItemList" ofType="com.ycwl.basic.model.pc.order.resp.OrderItemVO">
|
||||
<result column="oiId" property="id"/>
|
||||
<result column="id" property="orderId"/>
|
||||
<result column="goods_type" property="goodsType"/>
|
||||
<result column="goods_id" property="goodsId"/>
|
||||
<result column="scenicName" property="scenicName"/>
|
||||
<result column="goodsName" property="goodsName"/>
|
||||
<result column="videoUrl" property="videoUrl"/>
|
||||
<result column="imgUrl" property="imgUrl"/>
|
||||
<result column="sourceType" property="sourceType"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<insert id="add">
|
||||
@ -73,12 +103,92 @@
|
||||
<delete id="deleteById">
|
||||
delete from `order` where id = #{id}
|
||||
</delete>
|
||||
<select id="list" resultMap="BaseResultMap">
|
||||
select o.id, o.member_id,m.nickname ,m.real_name , o.openid, price, pay_price, remark, o.broker_id, o.promo_code,
|
||||
<select id="list" resultMap="PCBaseResultMap">
|
||||
select o.id, o.member_id,m.nickname ,m.real_name , o.openid, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
||||
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,oi.id oiId, oi.goods_type, oi.goods_id
|
||||
from `order` o
|
||||
left join member m on o.member_id = m.id
|
||||
left join order_item oi on o.id = oi.order_id
|
||||
left join source sr on oi.goods_type='2' and oi.goods_id = sr.id
|
||||
left join video vd on oi.goods_type='1' and oi.goods_id = vd.id
|
||||
<where>
|
||||
<if test="id!= null ">
|
||||
and o.id = #{id}
|
||||
</if>
|
||||
<if test="memberNickname!= null and memberNickname!=''">
|
||||
and m.nickname like concat('%',#{memberNickname},'%')
|
||||
</if>
|
||||
<if test="memberRealName!= null and memberRealName!=''">
|
||||
and m.real_name like concat('%',#{memberRealName},'%')
|
||||
</if>
|
||||
<if test="price!= null ">
|
||||
and o.price = #{price}
|
||||
</if>
|
||||
<if test="payPrice!= null ">
|
||||
and pay_price = #{payPrice}
|
||||
</if>
|
||||
<if test="remark!= null and remark!= ''">
|
||||
and remark like concat('%',#{remark},'%')
|
||||
</if>
|
||||
<if test="brokerId!= null ">
|
||||
and o.broker_id = #{brokerId}
|
||||
</if>
|
||||
<if test="promoCode!= null and promoCode!= ''">
|
||||
and o.promo_code like concat('%',#{promoCode},'%')
|
||||
</if>
|
||||
<if test="refundReason!= null and refundReason!= ''">
|
||||
and refund_reason like concat('%',#{refundReason},'%')
|
||||
</if>
|
||||
<if test="refundStatus!= null ">
|
||||
and refund_status = #{refundStatus}
|
||||
</if>
|
||||
<if test="status!= null ">
|
||||
and o.`status` = #{status}
|
||||
</if>
|
||||
<if test="startCreateTime!= null ">
|
||||
and o.create_at >= #{startCreateTime}
|
||||
</if>
|
||||
<if test="endCreateTime!= null ">
|
||||
and o.create_at <= #{endCreateTime}
|
||||
</if>
|
||||
<if test="startPayTime!= null ">
|
||||
and pay_at >= #{startPayTime}
|
||||
</if>
|
||||
<if test="endPayTime!= null ">
|
||||
and pay_at <= #{endPayTime}
|
||||
</if>
|
||||
<if test="startRefundTime!= null ">
|
||||
and refund_at >= #{startRefundTime}
|
||||
</if>
|
||||
<if test="endRefundTime!= null ">
|
||||
and refund_at <= #{endRefundTime}
|
||||
</if>
|
||||
<if test="startCancelTime!= null ">
|
||||
and cancel_at >= #{startCancelTime}
|
||||
</if>
|
||||
<if test="endCancelTime!= null ">
|
||||
and cancel_at <= #{endCancelTime}
|
||||
</if>
|
||||
</where>
|
||||
order by o.create_at desc
|
||||
</select>
|
||||
<select id="getById" resultMap="PCBaseResultMap">
|
||||
select o.id, o.member_id, o.openid, o.price, o.pay_price, o.remark, o.broker_id, o.promo_code, o.refund_reason,
|
||||
o.refund_status, o.status, o.create_at, o.update_at, o.pay_at, o.cancel_at, o.refund_at,
|
||||
m.nickname , m.real_name
|
||||
from `order` o
|
||||
left join member m on m.id = o.member_id
|
||||
left join order_item oi on o.id = oi.order_id
|
||||
left join template t on oi.goods_type='3' and oi.goods_id = t.id
|
||||
left join source sr on oi.goods_type='2' and oi.goods_id = sr.id
|
||||
left join video vd on oi.goods_type='1' and oi.goods_id = vd.id
|
||||
where o.id = #{id}
|
||||
</select>
|
||||
<select id="getOrderCount" resultType="com.ycwl.basic.utils.ApiResponse">
|
||||
select count(1) num
|
||||
from `order` o
|
||||
left join member m on o.member_id = m.id
|
||||
left join order_item oi on o.id = oi.order_id
|
||||
left join template t on oi.goods_type='3' and oi.goods_id = t.id
|
||||
left join source sr on oi.goods_type='2' and oi.goods_id = sr.id
|
||||
left join video vd on oi.goods_type='1' and oi.goods_id = vd.id
|
||||
@ -86,6 +196,9 @@
|
||||
<if test="id!= null ">
|
||||
and o.id = #{id}
|
||||
</if>
|
||||
<if test="memberId!= null ">
|
||||
and o.member_id = #{memberId}
|
||||
</if>
|
||||
<if test="memberNickname!= null and memberNickname!=''">
|
||||
and m.nickname like concat('%',#{memberNickname},'%')
|
||||
</if>
|
||||
@ -141,18 +254,95 @@
|
||||
and cancel_at <= #{endCancelTime}
|
||||
</if>
|
||||
</where>
|
||||
order by o.create_at desc
|
||||
</select>
|
||||
<select id="getById" resultMap="BaseResultMap">
|
||||
select o.id, o.member_id, o.openid, o.price, o.pay_price, o.remark, o.broker_id, o.promo_code, o.refund_reason,
|
||||
o.refund_status, o.status, o.create_at, o.update_at, o.pay_at, o.cancel_at, o.refund_at,
|
||||
m.nickname , m.real_name
|
||||
from `order` o
|
||||
left join member m on m.id = o.member_id
|
||||
<select id="appList" resultMap="AppBaseResultMap">
|
||||
select o.id, o.member_id,m.nickname ,m.real_name , o.openid, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
||||
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,oi.id oiId, oi.goods_type, oi.goods_id,
|
||||
sc.name scenicName,
|
||||
if(oi.goods_type='1',t.name,(select count(1) from order_item oi2 where oi2.order_id=o.id)) as goodsName,
|
||||
if(oi.goods_type='1',vd.video_url,sr.video_url) videoUrl,
|
||||
if(oi.goods_type='2',sr.url,null) imgUrl,
|
||||
if(oi.goods_type='2',sr.type,null) sourceType
|
||||
from `order` o
|
||||
left join member m on o.member_id = m.id
|
||||
left join order_item oi on o.id = oi.order_id
|
||||
left join template t on oi.goods_type='3' and oi.goods_id = t.id
|
||||
left join source sr on oi.goods_type='2' and oi.goods_id = sr.id
|
||||
left join video vd on oi.goods_type='1' and oi.goods_id = vd.id
|
||||
left join template t on oi.goods_type='1' and vd.template_id=t.id
|
||||
left join scenic sc on (oi.goods_type='1' and vd.scenic_id=sc.id) or (oi.goods_type='2' and sr.scenic_id=sc.id)
|
||||
<where>
|
||||
<if test="memberNickname!= null and memberNickname!=''">
|
||||
and m.nickname like concat('%',#{memberNickname},'%')
|
||||
</if>
|
||||
<if test="memberRealName!= null and memberRealName!=''">
|
||||
and m.real_name like concat('%',#{memberRealName},'%')
|
||||
</if>
|
||||
<if test="price!= null ">
|
||||
and o.price = #{price}
|
||||
</if>
|
||||
<if test="payPrice!= null ">
|
||||
and pay_price = #{payPrice}
|
||||
</if>
|
||||
<if test="remark!= null and remark!= ''">
|
||||
and remark like concat('%',#{remark},'%')
|
||||
</if>
|
||||
<if test="brokerId!= null ">
|
||||
and o.broker_id = #{brokerId}
|
||||
</if>
|
||||
<if test="promoCode!= null and promoCode!= ''">
|
||||
and o.promo_code like concat('%',#{promoCode},'%')
|
||||
</if>
|
||||
<if test="refundReason!= null and refundReason!= ''">
|
||||
and refund_reason like concat('%',#{refundReason},'%')
|
||||
</if>
|
||||
<if test="refundStatus!= null ">
|
||||
and refund_status = #{refundStatus}
|
||||
</if>
|
||||
<if test="status!= null ">
|
||||
and o.`status` = #{status}
|
||||
</if>
|
||||
<if test="startCreateTime!= null ">
|
||||
and o.create_at >= #{startCreateTime}
|
||||
</if>
|
||||
<if test="endCreateTime!= null ">
|
||||
and o.create_at <= #{endCreateTime}
|
||||
</if>
|
||||
<if test="startPayTime!= null ">
|
||||
and pay_at >= #{startPayTime}
|
||||
</if>
|
||||
<if test="endPayTime!= null ">
|
||||
and pay_at <= #{endPayTime}
|
||||
</if>
|
||||
<if test="startRefundTime!= null ">
|
||||
and refund_at >= #{startRefundTime}
|
||||
</if>
|
||||
<if test="endRefundTime!= null ">
|
||||
and refund_at <= #{endRefundTime}
|
||||
</if>
|
||||
<if test="startCancelTime!= null ">
|
||||
and cancel_at >= #{startCancelTime}
|
||||
</if>
|
||||
<if test="endCancelTime!= null ">
|
||||
and cancel_at <= #{endCancelTime}
|
||||
</if>
|
||||
</where>
|
||||
order by o.create_at desc
|
||||
</select>
|
||||
<select id="appDetail" resultMap="AppBaseResultMap">
|
||||
select o.id, o.member_id,m.nickname ,m.real_name , o.openid, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
||||
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,oi.id oiId, oi.goods_type, oi.goods_id,
|
||||
sc.name scenicName,
|
||||
if(oi.goods_type='1',t.name,(select count(1) from order_item oi2 where oi2.order_id=o.id)) as goodsName,
|
||||
if(oi.goods_type='1',vd.video_url,sr.video_url) videoUrl,
|
||||
if(oi.goods_type='2',sr.url,null) imgUrl,
|
||||
if(oi.goods_type='2',sr.type,null) sourceType
|
||||
from `order` o
|
||||
left join member m on o.member_id = m.id
|
||||
left join order_item oi on o.id = oi.order_id
|
||||
left join source sr on oi.goods_type='2' and oi.goods_id = sr.id
|
||||
left join video vd on oi.goods_type='1' and oi.goods_id = vd.id
|
||||
left join template t on oi.goods_type='1' and vd.template_id=t.id
|
||||
left join scenic sc on (oi.goods_type='1' and vd.scenic_id=sc.id) or (oi.goods_type='2' and sr.scenic_id=sc.id)
|
||||
where o.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user