Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/ycwl/basic/service/impl/pc/OrderServiceImpl.java
#	src/main/java/com/ycwl/basic/service/pc/OrderService.java
This commit is contained in:
songmingsong
2024-12-05 17:34:37 +08:00
29 changed files with 773 additions and 32 deletions

View File

@ -0,0 +1,50 @@
package com.ycwl.basic.controller.mobile;
import com.ycwl.basic.model.mobile.goods.GoodsPriceQueryReq;
import com.ycwl.basic.model.mobile.goods.GoodsReqQuery;
import com.ycwl.basic.model.mobile.goods.GoodsVO;
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
import com.ycwl.basic.service.mobile.GoodsService;
import com.ycwl.basic.utils.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Authorlongbinbin
* @Date2024/12/5 14:49
* 成片video和源素材source都可作为商品订单中可购买多个
*/
@RestController
@RequestMapping("/api/mobile/goods/v1")
@Api(tags = "商品相关接口")
public class AppGoodsController {
@Autowired
private GoodsService goodsService;
@ApiOperation("商品列表")
@PostMapping("/goodsList")
public ApiResponse<List<GoodsVO>> goodsList(@RequestBody GoodsReqQuery query) {
return goodsService.goodsList(query);
}
@ApiOperation("源素材(原片/照片)商品列表")
@PostMapping("/sourceGoodsList")
public ApiResponse<List<SourceRespVO>> sourceGoodsList(@RequestBody GoodsReqQuery query) {
return goodsService.sourceGoodsList(query);
}
@ApiOperation("查询价格")
@PostMapping("/queryPrice")
public ApiResponse queryPrice(@RequestBody GoodsPriceQueryReq queryPriceData) {
//TODO 处理购买逻辑
return goodsService.queryPrice(queryPriceData);
}
}

View File

@ -1,5 +1,6 @@
package com.ycwl.basic.controller.mobile; 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.OrderAddOrUpdateReq;
import com.ycwl.basic.model.pc.order.req.OrderReqQuery; import com.ycwl.basic.model.pc.order.req.OrderReqQuery;
import com.ycwl.basic.service.pc.OrderService; import com.ycwl.basic.service.pc.OrderService;
@ -9,6 +10,8 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
/** /**
* @Authorlongbinbin * @Authorlongbinbin
* @Date2024/12/4 17:16 * @Date2024/12/4 17:16
@ -23,14 +26,17 @@ public class AppOrderController {
@ApiOperation("用户端订单列表查询") @ApiOperation("用户端订单列表查询")
@PostMapping("/page") @PostMapping("/page")
@IgnoreToken
public ApiResponse pageQuery(@RequestBody OrderReqQuery orderReqQuery) { public ApiResponse pageQuery(@RequestBody OrderReqQuery orderReqQuery) {
//TODO 添加用户openid查询条件,仅查询当前用户自己的订单 //TODO 添加用户openid查询条件,仅查询当前用户自己的订单
return orderService.pageQuery(orderReqQuery);
return orderService.appPageQuery(orderReqQuery);
} }
@ApiOperation("用户端订单详情查询") @ApiOperation("用户端订单详情查询")
@GetMapping("getOrderDetails/{id}") @GetMapping("getOrderDetails/{id}")
@IgnoreToken
public ApiResponse getOrderDetails(@PathVariable("id") Long id) { public ApiResponse getOrderDetails(@PathVariable("id") Long id) {
return orderService.detail(id); return orderService.appDetail(id);
} }
@ApiOperation("用户端订单新增") @ApiOperation("用户端订单新增")
@ -46,4 +52,14 @@ public class AppOrderController {
//TODO 处理购买逻辑 //TODO 处理购买逻辑
return ApiResponse.success(""); return ApiResponse.success("");
} }
@ApiOperation("获取用户订单数量")
@GetMapping("/getUserOrderCount")
public ApiResponse getUserOrderCount() {
//TODO 获取用户信息
Long userId = 1L;
return orderService.getOrderCountByUserId(userId);
}
} }

View File

@ -1,10 +1,11 @@
package com.ycwl.basic.mapper.pc; 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.entity.OrderItemEntity;
import com.ycwl.basic.model.pc.order.req.OrderAddOrUpdateReq; 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.req.OrderReqQuery;
import com.ycwl.basic.model.pc.order.resp.OrderAppRespVO;
import com.ycwl.basic.model.pc.order.resp.OrderRespVO; import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
import com.ycwl.basic.utils.ApiResponse;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -29,4 +30,9 @@ public interface OrderMapper {
*/ */
int addOrderItems(List<OrderItemEntity> orderItems); int addOrderItems(List<OrderItemEntity> orderItems);
ApiResponse getOrderCount(OrderReqQuery query);
List<OrderAppRespVO> appList(OrderReqQuery orderReqQuery);
OrderAppRespVO appDetail(Long id);
} }

View File

@ -19,4 +19,11 @@ public interface SourceMapper {
int add(SourceEntity source); int add(SourceEntity source);
int deleteById(Long id); int deleteById(Long id);
int update(SourceEntity source); int update(SourceEntity source);
/**
*
* @param sourceReqQuery
* @return
*/
List<SourceRespVO> listGroupByType(SourceReqQuery sourceReqQuery);
} }

View File

@ -0,0 +1,20 @@
package com.ycwl.basic.model.mobile.goods;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Authorlongbinbin
* @Date2024/12/5 16:35
*/
@Data
@ApiModel("查询商品价格请求参数")
public class GoodsPriceQueryReq {
@ApiModelProperty("景区id")
private Long scenicId;
@ApiModelProperty("商品类型 1:成片vlog 2:源素材")
private Integer goodsType;
@ApiModelProperty("商品id goodsType=1时才有值")
private Long goodsId;
}

View File

@ -0,0 +1,22 @@
package com.ycwl.basic.model.mobile.goods;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Authorlongbinbin
* @Date2024/12/5 15:40
*/
@Data
@ApiModel(value = "商品查询对象")
public class GoodsReqQuery {
@ApiModelProperty("是否已购买 0否 1是")
private Integer isBuy;
@ApiModelProperty("用户id")
private Long memberId;
@ApiModelProperty("景区id")
private Long scenicId;
@ApiModelProperty("源素材商品类型 1视频 2图像")
private Integer sourceType;
}

View File

@ -0,0 +1,37 @@
package com.ycwl.basic.model.mobile.goods;
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
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;
/**
* @Authorlongbinbin
* @Date2024/12/5 15:10
*/
@Data
@ApiModel("商品")
public class GoodsVO {
@ApiModelProperty("商品名称")
private String goodsName;
@ApiModelProperty("景区id")
private Long scenicId;
@ApiModelProperty("景区名称")
private String scenicName;
@ApiModelProperty("经度")
private BigDecimal longitude;
@ApiModelProperty("纬度")
private BigDecimal latitude;
@ApiModelProperty("商品类型 1:成片视频 2:源素材")
private Integer goodsType;
@ApiModelProperty("源素材类型 1:视频 2:图片")
private Integer sourceType;
@ApiModelProperty("商品id goodsType为1时才有值")
private Long goodsId;
@ApiModelProperty("视频链接 goodsType为1时才有值")
private String videoUrl;
}

View File

@ -19,11 +19,11 @@ public class OrderItemEntity {
*/ */
private Long orderId; private Long orderId;
/** /**
* 商品类型0其他1成片2原片3模板成片 * 商品类型0其他1成片2源素材
*/ */
private Integer goodsType; private Integer goodsType;
/** /**
* 商品IDgoods_type=1关联video.id=2关联source.id=3关联template.id * 商品IDgoods_type=1关联video.id=2关联source.id
*/ */
private Long goodsId; private Long goodsId;

View File

@ -18,13 +18,13 @@ public class OrderItemDTO {
@ApiModelProperty("订单id") @ApiModelProperty("订单id")
private Long orderId; private Long orderId;
/** /**
* 商品类型0其他1成片2原片3模板成片 * 商品类型0其他1成片2原片
*/ */
@ApiModelProperty("商品类型0其他1成片2原片3模板成片") @ApiModelProperty("商品类型0其他1成片2源素材")
private Integer goodsType; private Integer goodsType;
/** /**
* 商品IDgoods_type=1关联video.id=2关联source.id=3关联template.id * 商品IDgoods_type=1关联video.id=2关联source.id
*/ */
@ApiModelProperty("商品IDgoods_type=1关联video.id=2关联source.id=3关联template.id") @ApiModelProperty("商品IDgoods_type=1关联video.id=2关联source.id")
private Long goodsId; private Long goodsId;
} }

View File

@ -17,6 +17,7 @@ import java.util.Date;
@Data @Data
@ApiModel(value = "订单查询对象") @ApiModel(value = "订单查询对象")
public class OrderReqQuery extends BaseQueryParameterReq { public class OrderReqQuery extends BaseQueryParameterReq {
private Long memberId;
@ApiModelProperty("用户昵称") @ApiModelProperty("用户昵称")
private String memberNickname; private String memberNickname;
@ApiModelProperty("用户真实名称") @ApiModelProperty("用户真实名称")

View File

@ -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;
/**
* @Authorlongbinbin
* @Date2024/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;
}

View File

@ -22,11 +22,21 @@ public class OrderItemVO {
/** /**
* 商品类型0其他1成片2原片3模板成片 * 商品类型0其他1成片2原片3模板成片
*/ */
@ApiModelProperty("商品类型0其他1成片2原片3模板成片") @ApiModelProperty("商品类型0其他1成片2源素材")
private Integer goodsType; private Integer goodsType;
/** /**
* 商品IDgoods_type=1关联video.id=2关联source.id=3关联template.id * 商品IDgoods_type=1关联video.id=2关联source.id=3关联template.id
*/ */
@ApiModelProperty("商品IDgoods_type=1关联video.id=2关联source.id=3关联template.id") @ApiModelProperty("商品IDgoods_type=1关联video.id=2关联source.id")
private Long goodsId; 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;
} }

View File

@ -2,6 +2,7 @@ package com.ycwl.basic.model.pc.scenic.entity;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -59,4 +60,8 @@ public class ScenicEntity {
private String status; private String status;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
/**
* 景区源素材价格,元
*/
private BigDecimal price;
} }

View File

@ -73,4 +73,6 @@ public class ScenicAddOrUpdateReq {
private Date updateTime; private Date updateTime;
@ApiModelProperty("景区配置") @ApiModelProperty("景区配置")
private ScenicConfigEntity scenicConfig; private ScenicConfigEntity scenicConfig;
@ApiModelProperty("景区源素材价格,元")
private BigDecimal price;
} }

View File

@ -74,4 +74,6 @@ public class ScenicRespVO {
private Date updateTime; private Date updateTime;
@ApiModelProperty("景区配置") @ApiModelProperty("景区配置")
private ScenicConfigEntity scenicConfig; private ScenicConfigEntity scenicConfig;
@ApiModelProperty("景区源素材价格,元")
private BigDecimal price;
} }

View File

@ -2,6 +2,7 @@ package com.ycwl.basic.model.pc.source.entity;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -29,10 +30,22 @@ public class SourceEntity {
* 所属用户 * 所属用户
*/ */
private Long memberId; private Long memberId;
/**
* 原素材类型1视频2图像
*/
private Integer type;
/** /**
* 文件存储地址 * 文件存储地址
*/ */
private String url; private String url;
/**
* 视频文件存储地址
*/
private String videoUrl;
/**
* 是否被购买 0未购买 1已购买
*/
private Integer isBuy;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
} }

View File

@ -35,11 +35,15 @@ public class SourceReqQuery extends BaseQueryParameterReq {
*/ */
@ApiModelProperty("所属用户") @ApiModelProperty("所属用户")
private Long memberId; private Long memberId;
@ApiModelProperty("原素材类型1视频2图像")
private Integer type;
/** /**
* 文件存储地址 * 文件存储地址
*/ */
@ApiModelProperty("文件存储地址") @ApiModelProperty("文件存储地址")
private String url; private String url;
@ApiModelProperty("是否被购买0未购买1已购买")
private Integer isBuy;
private Date startTime; private Date startTime;
private Date endTime; private Date endTime;
} }

View File

@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
@ -25,6 +26,10 @@ public class SourceRespVO {
private Long scenicId; private Long scenicId;
@ApiModelProperty("景区名称") @ApiModelProperty("景区名称")
private String scenicName; private String scenicName;
@ApiModelProperty("经度")
private BigDecimal longitude;
@ApiModelProperty("纬度")
private BigDecimal latitude;
/** /**
* 来源设备id * 来源设备id
*/ */
@ -35,11 +40,15 @@ public class SourceRespVO {
*/ */
@ApiModelProperty("所属用户") @ApiModelProperty("所属用户")
private Long memberId; private Long memberId;
@ApiModelProperty("原素材类型1视频2图像")
private Integer type;
/** /**
* 文件存储地址 * 文件存储地址
*/ */
@ApiModelProperty("文件存储地址") @ApiModelProperty("图片文件存储地址")
private String url; private String url;
@ApiModelProperty("视频文件存储地址")
private String videoUrl;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime; private Date createTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

View File

@ -2,6 +2,7 @@ package com.ycwl.basic.model.pc.video.entity;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@ -40,6 +41,10 @@ public class VideoEntity {
* 视频链接 * 视频链接
*/ */
private String videoUrl; private String videoUrl;
/**
* 是否购买 1是 0否
*/
private Integer isBuy;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
} }

View File

@ -47,6 +47,8 @@ public class VideoReqQuery extends BaseQueryParameterReq {
*/ */
@ApiModelProperty("视频链接") @ApiModelProperty("视频链接")
private String videoUrl; private String videoUrl;
@ApiModelProperty("是否购买 1是 0否")
private Integer isBuy;
private Date startTime; private Date startTime;
private Date endTime; private Date endTime;
} }

View File

@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
@ -23,6 +24,8 @@ public class VideoRespVO {
*/ */
@ApiModelProperty("景区id") @ApiModelProperty("景区id")
private Long scenicId; private Long scenicId;
@ApiModelProperty("景区名称")
private String scenicName;
/** /**
* 用户id * 用户id
*/ */
@ -33,6 +36,14 @@ public class VideoRespVO {
*/ */
@ApiModelProperty("模版id") @ApiModelProperty("模版id")
private Long templateId; private Long templateId;
@ApiModelProperty("模版名称")
private String templateName;
@ApiModelProperty("模版价格")
private BigDecimal tmplatePrice;
@ApiModelProperty("经度")
private BigDecimal longitude;
@ApiModelProperty("纬度")
private BigDecimal latitude;
/** /**
* 任务id * 任务id
*/ */
@ -48,6 +59,8 @@ public class VideoRespVO {
*/ */
@ApiModelProperty("视频链接") @ApiModelProperty("视频链接")
private String videoUrl; private String videoUrl;
@ApiModelProperty("是否购买 1是 0否")
private Integer isBuy;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime; private Date createTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

View File

@ -0,0 +1,130 @@
package com.ycwl.basic.service.impl.mobile;
import com.github.pagehelper.PageInfo;
import com.ycwl.basic.mapper.pc.ScenicMapper;
import com.ycwl.basic.mapper.pc.SourceMapper;
import com.ycwl.basic.mapper.pc.VideoMapper;
import com.ycwl.basic.model.mobile.goods.GoodsPriceQueryReq;
import com.ycwl.basic.model.mobile.goods.GoodsReqQuery;
import com.ycwl.basic.model.mobile.goods.GoodsVO;
import com.ycwl.basic.model.pc.order.resp.OrderItemVO;
import com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO;
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
import com.ycwl.basic.model.pc.video.req.VideoReqQuery;
import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
import com.ycwl.basic.service.mobile.GoodsService;
import com.ycwl.basic.utils.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* @Authorlongbinbin
* @Date2024/12/5 15:04
*/@Service
public class GoodsServiceImpl implements GoodsService {
@Autowired
private VideoMapper videoMapper;
@Autowired
private SourceMapper sourceMapper;
@Autowired
private ScenicMapper scenicMapper;
public ApiResponse<List<GoodsVO>> goodsList(GoodsReqQuery query) {
//查询原素材
List<GoodsVO> goodsList = new ArrayList<>();
VideoReqQuery videoReqQuery = new VideoReqQuery();
videoReqQuery.setScenicId(query.getScenicId());
videoReqQuery.setIsBuy(query.getIsBuy());
videoReqQuery.setMemberId(query.getMemberId());
//查询成片vlog
List<VideoRespVO> videoList = videoMapper.list(videoReqQuery);
videoList.forEach(videoRespVO -> {
GoodsVO goodsVO = new GoodsVO();
goodsVO.setGoodsName(videoRespVO.getTemplateName());
goodsVO.setScenicId(videoRespVO.getScenicId());
goodsVO.setScenicName(videoRespVO.getScenicName());
goodsVO.setLongitude(videoRespVO.getLongitude());
goodsVO.setLatitude(videoRespVO.getLatitude());
goodsVO.setGoodsType(1);
goodsVO.setGoodsId(videoRespVO.getId());
goodsVO.setVideoUrl(videoRespVO.getVideoUrl());
goodsList.add(goodsVO);
});
SourceReqQuery sourceReqQuery = new SourceReqQuery();
videoReqQuery.setScenicId(query.getScenicId());
videoReqQuery.setIsBuy(query.getIsBuy());
videoReqQuery.setMemberId(query.getMemberId());
//查询源素材
List<SourceRespVO> sourceList = sourceMapper.listGroupByType(sourceReqQuery);
sourceList.forEach(sourceRespVO -> {
GoodsVO goodsVO = new GoodsVO();
Integer type = sourceRespVO.getType();
if(type==1){
goodsVO.setGoodsName("原片集");
}else {
goodsVO.setGoodsName("照片集");
}
goodsVO.setScenicId(sourceRespVO.getScenicId());
goodsVO.setScenicName(sourceRespVO.getScenicName());
goodsVO.setLongitude(sourceRespVO.getLongitude());
goodsVO.setLatitude(sourceRespVO.getLatitude());
goodsVO.setGoodsType(2);
goodsVO.setSourceType(type);
goodsList.add(goodsVO);
});
return ApiResponse.success(goodsList);
}
@Override
public ApiResponse<List<SourceRespVO>> sourceGoodsList(GoodsReqQuery query) {
SourceReqQuery sourceReqQuery = new SourceReqQuery();
sourceReqQuery.setScenicId(query.getScenicId());
sourceReqQuery.setIsBuy(query.getIsBuy());
sourceReqQuery.setMemberId(query.getMemberId());
sourceReqQuery.setType(query.getSourceType());
List<SourceRespVO> list = sourceMapper.list(sourceReqQuery);
return ApiResponse.success(list);
}
@Override
public ApiResponse queryPrice(GoodsPriceQueryReq queryPriceData) {
Integer goodsType = queryPriceData.getGoodsType();
if(goodsType==1){//成片vlog
//成片的价格就是成片所用template的价格
Long videoId = queryPriceData.getGoodsId();
VideoRespVO videoRespVO = videoMapper.getById(videoId);
if(videoRespVO==null){
return ApiResponse.fail("该vlog不存在或已失效");
}
BigDecimal tmplatePrice = videoRespVO.getTmplatePrice();
if(tmplatePrice==null){
return ApiResponse.fail("该vlog使用的模板价格或状态异常请联系管理员");
}
return ApiResponse.success(tmplatePrice);
}else if(goodsType==2){//原素材
//原素材的价格就是原素材对应景区定的价格
Long scenicId = queryPriceData.getScenicId();
ScenicRespVO scenicRespVO = scenicMapper.getById(scenicId);
if(scenicRespVO==null){
return ApiResponse.fail("该景区不存在或状态异常,请联系管理员");
}
BigDecimal price = scenicRespVO.getPrice();
if(price==null){
return ApiResponse.fail("该景区的原片价格未设定或状态异常,请联系管理员");
}
return ApiResponse.success(price);
}
return ApiResponse.fail("不合法的商品,请联系管理员");
}
}

View File

@ -10,6 +10,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.OrderAddOrUpdateReq;
import com.ycwl.basic.model.pc.order.req.OrderItemDTO; 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.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.model.pc.order.resp.OrderRespVO;
import com.ycwl.basic.service.pc.OrderService; import com.ycwl.basic.service.pc.OrderService;
import com.ycwl.basic.utils.ApiResponse; import com.ycwl.basic.utils.ApiResponse;
@ -109,4 +111,40 @@ public class OrderServiceImpl implements OrderService {
} }
orderMapper.update(orderAddOrUpdateReq); orderMapper.update(orderAddOrUpdateReq);
} }
@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);
}
} }

View File

@ -0,0 +1,37 @@
package com.ycwl.basic.service.mobile;
import com.ycwl.basic.model.mobile.goods.GoodsPriceQueryReq;
import com.ycwl.basic.model.mobile.goods.GoodsReqQuery;
import com.ycwl.basic.model.mobile.goods.GoodsVO;
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
import com.ycwl.basic.utils.ApiResponse;
import java.util.List;
/**
* @Authorlongbinbin
* @Date2024/12/5 15:03
*/
public interface GoodsService {
/**
* 查询商品列表
* @param query 查询条件
* @return
*/
ApiResponse<List<GoodsVO>> goodsList(GoodsReqQuery query);
/**
* 查询源素材商品列表
* @param query
* @return
*/
ApiResponse<List<SourceRespVO>> sourceGoodsList(GoodsReqQuery query);
/**
* 查询订单应付价格
* @param queryPriceData
* @return
*/
ApiResponse queryPrice(GoodsPriceQueryReq queryPriceData);
}

View File

@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
import com.ycwl.basic.enums.OrderStateEnum; import com.ycwl.basic.enums.OrderStateEnum;
import com.ycwl.basic.model.pc.order.req.OrderAddOrUpdateReq; 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.req.OrderReqQuery;
import com.ycwl.basic.model.pc.order.resp.OrderAppRespVO;
import com.ycwl.basic.model.pc.order.resp.OrderRespVO; import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
import com.ycwl.basic.utils.ApiResponse; import com.ycwl.basic.utils.ApiResponse;
@ -22,4 +23,12 @@ public interface OrderService {
void updateOrderState(Long orderSn, OrderStateEnum orderStateEnum, String refundReason); void updateOrderState(Long orderSn, OrderStateEnum orderStateEnum, String refundReason);
ApiResponse getOrderCountByUserId(Long userId);
ApiResponse<PageInfo<OrderAppRespVO>> appPageQuery(OrderReqQuery orderReqQuery);
ApiResponse<OrderAppRespVO> appDetail(Long id);
} }

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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"> <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"/> <id column="id" property="id"/>
<result column="member_id" property="memberId"/> <result column="member_id" property="memberId"/>
<result column="nickname" property="memberNickname"/> <result column="nickname" property="memberNickname"/>
@ -25,6 +25,36 @@
<result column="id" property="orderId"/> <result column="id" property="orderId"/>
<result column="goods_type" property="goodsType"/> <result column="goods_type" property="goodsType"/>
<result column="goods_id" property="goodsId"/> <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> </collection>
</resultMap> </resultMap>
<insert id="add"> <insert id="add">
@ -73,12 +103,92 @@
<delete id="deleteById"> <delete id="deleteById">
delete from `order` where id = #{id} delete from `order` where id = #{id}
</delete> </delete>
<select id="list" resultMap="BaseResultMap"> <select id="list" resultMap="PCBaseResultMap">
select o.id, o.member_id,m.nickname ,m.real_name , o.openid, price, pay_price, remark, o.broker_id, o.promo_code, 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 refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,oi.id oiId, oi.goods_type, oi.goods_id
from `order` o from `order` o
left join member m on o.member_id = m.id left join member m on o.member_id = m.id
left join order_item oi on o.id = oi.order_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 &lt;= #{endCreateTime}
</if>
<if test="startPayTime!= null ">
and pay_at &gt;= #{startPayTime}
</if>
<if test="endPayTime!= null ">
and pay_at &lt;= #{endPayTime}
</if>
<if test="startRefundTime!= null ">
and refund_at &gt;= #{startRefundTime}
</if>
<if test="endRefundTime!= null ">
and refund_at &lt;= #{endRefundTime}
</if>
<if test="startCancelTime!= null ">
and cancel_at &gt;= #{startCancelTime}
</if>
<if test="endCancelTime!= null ">
and cancel_at &lt;= #{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 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 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 video vd on oi.goods_type='1' and oi.goods_id = vd.id
@ -86,6 +196,9 @@
<if test="id!= null "> <if test="id!= null ">
and o.id = #{id} and o.id = #{id}
</if> </if>
<if test="memberId!= null ">
and o.member_id = #{memberId}
</if>
<if test="memberNickname!= null and memberNickname!=''"> <if test="memberNickname!= null and memberNickname!=''">
and m.nickname like concat('%',#{memberNickname},'%') and m.nickname like concat('%',#{memberNickname},'%')
</if> </if>
@ -141,18 +254,95 @@
and cancel_at &lt;= #{endCancelTime} and cancel_at &lt;= #{endCancelTime}
</if> </if>
</where> </where>
order by o.create_at desc
</select> </select>
<select id="getById" resultMap="BaseResultMap"> <select id="appList" resultMap="AppBaseResultMap">
select o.id, o.member_id, o.openid, o.price, o.pay_price, o.remark, o.broker_id, o.promo_code, o.refund_reason, select o.id, o.member_id,m.nickname ,m.real_name , o.openid, o.price, pay_price, remark, o.broker_id, o.promo_code,
o.refund_status, o.status, o.create_at, o.update_at, o.pay_at, o.cancel_at, o.refund_at, refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at,oi.id oiId, oi.goods_type, oi.goods_id,
m.nickname , m.real_name sc.name scenicName,
from `order` o if(oi.goods_type='1',t.name,(select count(1) from order_item oi2 where oi2.order_id=o.id)) as goodsName,
left join member m on m.id = o.member_id 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 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 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 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 &lt;= #{endCreateTime}
</if>
<if test="startPayTime!= null ">
and pay_at &gt;= #{startPayTime}
</if>
<if test="endPayTime!= null ">
and pay_at &lt;= #{endPayTime}
</if>
<if test="startRefundTime!= null ">
and refund_at &gt;= #{startRefundTime}
</if>
<if test="endRefundTime!= null ">
and refund_at &lt;= #{endRefundTime}
</if>
<if test="startCancelTime!= null ">
and cancel_at &gt;= #{startCancelTime}
</if>
<if test="endCancelTime!= null ">
and cancel_at &lt;= #{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} where o.id = #{id}
</select> </select>
</mapper> </mapper>

View File

@ -107,7 +107,7 @@
</select> </select>
<select id="getById" resultMap="scenicAndConfig"> <select id="getById" resultMap="scenicAndConfig">
select s.id, `name`, introduction, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time, select s.id, `name`, introduction, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
c.start_time, c.end_time, c.is_default, c.create_time c.start_time, c.end_time, c.is_default, c.create_time,s.price
from scenic s from scenic s
left join scenic_config c on s.id = c.id left join scenic_config c on s.id = c.id
where s.id = #{id} where s.id = #{id}

View File

@ -27,6 +27,10 @@
<if test="deviceId!= null">and device_id = #{deviceId} </if> <if test="deviceId!= null">and device_id = #{deviceId} </if>
<if test="memberId!= null">and member_id = #{memberId} </if> <if test="memberId!= null">and member_id = #{memberId} </if>
<if test="url!= null">and url = #{url} </if> <if test="url!= null">and url = #{url} </if>
<if test="isBuy!=null">
and is_buy = #{isBuy}
</if>
<if test="type!=null">and so.type = #{type} </if>
<if test="startTime!= null">and so.create_time &gt;= #{startTime} </if> <if test="startTime!= null">and so.create_time &gt;= #{startTime} </if>
<if test="endTime!= null">and so.create_time &lt;= #{endTime} </if> <if test="endTime!= null">and so.create_time &lt;= #{endTime} </if>
</where> </where>
@ -35,6 +39,19 @@
select so.id, scenic_id, device_id, member_id, url, so.create_time, so.update_time,sc.`name` as scenicName select so.id, scenic_id, device_id, member_id, url, so.create_time, so.update_time,sc.`name` as scenicName
from source so from source so
left join scenic sc on sc.id = so.scenic_id left join scenic sc on sc.id = so.scenic_id
where id = #{id} where so.id = #{id}
</select>
<select id="listGroupByType" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
select so.id, scenic_id,sc.name scenicName, sc.longitude ,sc.latitude,so.type
from source so
left join scenic sc on sc.id = so.scenic_id
<where>
<if test="scenicId!= null">and scenic_id = #{scenicId} </if>
<if test="memberId!= null">and member_id = #{memberId} </if>
<if test="isBuy!=null">
and is_buy = #{isBuy}
</if>
</where>
group by so.type
</select> </select>
</mapper> </mapper>

View File

@ -21,8 +21,11 @@
delete from video where id = #{id} delete from video where id = #{id}
</delete> </delete>
<select id="list" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO"> <select id="list" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select id, scenic_id, member_id, template_id, task_id, worker_id, video_url, create_time, update_time select v.id, scenic_id, member_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
from video s.name scenicName, s.latitude, s.longitude, t.name templateName, t.price templatePrice
from video v
left join scenic s on s.id = v.scenic_id
left join template t on v.template_id = t.id
<where> <where>
<if test="scenicId!= null">and scenic_id = #{scenicId} </if> <if test="scenicId!= null">and scenic_id = #{scenicId} </if>
<if test="memberId!= null">and member_id = #{memberId} </if> <if test="memberId!= null">and member_id = #{memberId} </if>
@ -31,13 +34,18 @@
and task_id = #{taskId} and task_id = #{taskId}
</if> </if>
<if test="workerId!= null">and worker_id = #{workerId} </if> <if test="workerId!= null">and worker_id = #{workerId} </if>
<if test="startTime!= null">and create_time &gt;= #{startTime} </if> <if test="isBuy!=null">
<if test="endTime!= null">and create_time &lt;= #{endTime} </if> and is_buy = #{isBuy}
</if>
<if test="startTime!= null">and v.create_time &gt;= #{startTime} </if>
<if test="endTime!= null">and v.create_time &lt;= #{endTime} </if>
</where> </where>
</select> </select>
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO"> <select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select id, scenic_id, member_id, template_id, task_id, worker_id, video_url, create_time, update_time select v.id, scenic_id, member_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
from video t.name templateName,t.price templatePrice
where id = #{id} from video v
left join template t on v.template_id = t.id
where v.id = #{id}
</select> </select>
</mapper> </mapper>