补充全免费逻辑
This commit is contained in:
parent
079f0c4268
commit
c27665e513
@ -3,6 +3,7 @@ package com.ycwl.basic.controller.task;
|
||||
import com.ycwl.basic.annotation.IgnoreToken;
|
||||
import com.ycwl.basic.model.pc.template.resp.TemplateRespVO;
|
||||
import com.ycwl.basic.model.task.req.TaskReqVo;
|
||||
import com.ycwl.basic.model.task.req.TaskSuccessReqVo;
|
||||
import com.ycwl.basic.model.task.req.WorkerAuthReqVo;
|
||||
import com.ycwl.basic.model.task.resp.TaskSyncRespVo;
|
||||
import com.ycwl.basic.service.task.TaskService;
|
||||
@ -49,7 +50,7 @@ public class TaskTaskController {
|
||||
}
|
||||
|
||||
@PostMapping("/{taskId}/success")
|
||||
public ApiResponse taskSuccess(@PathVariable Long taskId, @RequestBody WorkerAuthReqVo req) {
|
||||
public ApiResponse taskSuccess(@PathVariable Long taskId, @RequestBody TaskSuccessReqVo req) {
|
||||
taskService.taskSuccess(taskId, req);
|
||||
return ApiResponse.success("OK");
|
||||
}
|
||||
|
@ -26,7 +26,11 @@ public class OrderEntity {
|
||||
*/
|
||||
private String openId;
|
||||
/**
|
||||
* 价格
|
||||
* 划线价
|
||||
*/
|
||||
private BigDecimal slashPrice;
|
||||
/**
|
||||
* 优惠价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
|
@ -31,6 +31,8 @@ public class ScenicAddOrUpdateReq {
|
||||
*/
|
||||
@ApiModelProperty("景区介绍")
|
||||
private String introduction;
|
||||
private String logoUrl;
|
||||
|
||||
@ApiModelProperty("封面图")
|
||||
private String coverUrl;
|
||||
/**
|
||||
|
@ -38,6 +38,7 @@ public class ScenicRespVO {
|
||||
*/
|
||||
@ApiModelProperty("景区介绍")
|
||||
private String introduction;
|
||||
private String logoUrl;
|
||||
@ApiModelProperty("封面图")
|
||||
private String coverUrl;
|
||||
/**
|
||||
|
@ -35,6 +35,7 @@ public class SourceRespVO {
|
||||
*/
|
||||
@ApiModelProperty("来源设备id")
|
||||
private Long deviceId;
|
||||
private String deviceName;
|
||||
private Long faceId;
|
||||
@ApiModelProperty("原素材类型:1视频,2图像")
|
||||
private Integer type;
|
||||
|
@ -25,10 +25,9 @@ public class VideoRespVO {
|
||||
@ApiModelProperty("景区名称")
|
||||
private String scenicName;
|
||||
/**
|
||||
* 用户id
|
||||
* 人脸ID
|
||||
*/
|
||||
@ApiModelProperty("用户id")
|
||||
private Long memberId;
|
||||
@ApiModelProperty("人脸ID")
|
||||
private Long faceId;
|
||||
/**
|
||||
* 模版id
|
||||
|
@ -0,0 +1,10 @@
|
||||
package com.ycwl.basic.model.task.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class TaskSuccessReqVo extends WorkerAuthReqVo {
|
||||
private VideoInfoReq videoInfo;
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.ycwl.basic.model.task.req;
|
||||
|
||||
public class VideoInfoReq {
|
||||
private Integer height;
|
||||
private Integer width;
|
||||
private Float duration;
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.ycwl.basic.profitsharing.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ProfitSharingConfig {
|
||||
private boolean enabled;
|
||||
private Long scenicId;
|
||||
private List<ProfitSharingUser> profitSharingList;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.ycwl.basic.profitsharing.entity;
|
||||
|
||||
import com.ycwl.basic.profitsharing.enums.ProfitSharingUserType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ProfitSharingUser {
|
||||
private ProfitSharingUserType type;
|
||||
private Integer amount;
|
||||
private String description;
|
||||
private BigDecimal wxRate;
|
||||
private BigDecimal realRate;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.ycwl.basic.profitsharing.enums;
|
||||
|
||||
public enum ProfitSharingUserType {
|
||||
MERCHANT("MERCHANT_ID", "商户号"),
|
||||
PERSON_SUB("PERSONAL_SUB_OPENID", "子商户个人"),
|
||||
PERSON_PARENT("PERSONAL_OPENID", "父商户个人");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
ProfitSharingUserType(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
@ -2,18 +2,21 @@ package com.ycwl.basic.service.impl.mobile;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ycwl.basic.biz.OrderBiz;
|
||||
import com.ycwl.basic.constant.BaseContextHandler;
|
||||
import com.ycwl.basic.mapper.*;
|
||||
import com.ycwl.basic.model.mobile.goods.*;
|
||||
import com.ycwl.basic.model.mobile.order.IsBuyRespVO;
|
||||
import com.ycwl.basic.model.mobile.order.PriceObj;
|
||||
import com.ycwl.basic.model.pc.face.resp.FaceRespVO;
|
||||
import com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity;
|
||||
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.task.entity.TaskEntity;
|
||||
import com.ycwl.basic.model.pc.video.entity.MemberVideoEntity;
|
||||
import com.ycwl.basic.model.pc.video.req.VideoReqQuery;
|
||||
import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
|
||||
import com.ycwl.basic.repository.OrderRepository;
|
||||
import com.ycwl.basic.repository.ScenicRepository;
|
||||
import com.ycwl.basic.repository.VideoTaskRepository;
|
||||
import com.ycwl.basic.service.mobile.GoodsService;
|
||||
@ -54,6 +57,10 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
private TaskService taskTaskService;
|
||||
@Autowired
|
||||
private ScenicRepository scenicRepository;
|
||||
@Autowired
|
||||
private OrderRepository orderRepository;
|
||||
@Autowired
|
||||
private OrderBiz orderBiz;
|
||||
|
||||
public ApiResponse<List<GoodsPageVO>> goodsList(GoodsReqQuery query) {
|
||||
//查询原素材
|
||||
@ -174,39 +181,6 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
return ApiResponse.success(goodsDetailVOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<BigDecimal> queryPrice(GoodsPriceQueryReq queryPriceData) {
|
||||
Integer goodsType = queryPriceData.getGoodsType();
|
||||
|
||||
if (goodsType == 0) {//成片vlog
|
||||
//成片的价格就是成片所用template的价格
|
||||
Long videoId = queryPriceData.getGoodsId();
|
||||
VideoRespVO videoRespVO = videoMapper.getById(videoId);
|
||||
if (videoRespVO == null) {
|
||||
return ApiResponse.fail("该vlog不存在或已失效");
|
||||
}
|
||||
BigDecimal templatePrice = videoRespVO.getTemplatePrice();
|
||||
if (templatePrice == null) {
|
||||
return ApiResponse.fail("该vlog使用的模板价格或状态异常,请联系管理员");
|
||||
}
|
||||
return ApiResponse.success(templatePrice);
|
||||
|
||||
} else if (goodsType == 1 || 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("不合法的商品,请联系管理员");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<VideoGoodsDetailVO> videoGoodsDetail(Long userId, Long videoId) {
|
||||
VideoGoodsDetailVO goodsDetailVO = new VideoGoodsDetailVO();
|
||||
@ -222,21 +196,31 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
goodsDetailVO.setVideoUrl(videoRespVO.getVideoUrl());
|
||||
goodsDetailVO.setTemplateCoverUrl(videoRespVO.getTemplateCoverUrl());
|
||||
goodsDetailVO.setCreateTime(videoRespVO.getCreateTime());
|
||||
MemberVideoEntity entity = videoMapper.queryUserVideo(userId, videoId);
|
||||
if (entity == null) {
|
||||
if (userId == null) {
|
||||
goodsDetailVO.setIsBuy(0);
|
||||
goodsDetailVO.setShare(true);
|
||||
goodsDetailVO.setPrice("未登录");
|
||||
} else if (entity.getIsBuy() == 1) {
|
||||
goodsDetailVO.setIsBuy(1);
|
||||
} else {
|
||||
goodsDetailVO.setIsBuy(0);
|
||||
BigDecimal templatePrice = videoRespVO.getTemplatePrice();
|
||||
BigDecimal slashPrice = videoRespVO.getSlashPrice();
|
||||
// 使用DecimalFormat格式化输出
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
goodsDetailVO.setPrice(templatePrice == null ? "" : df.format(templatePrice.setScale(2, RoundingMode.HALF_UP)));
|
||||
goodsDetailVO.setSlashPrice(slashPrice == null ? null : df.format(slashPrice.setScale(2, RoundingMode.HALF_UP)));
|
||||
MemberVideoEntity entity = videoMapper.queryUserVideo(userId, videoId);
|
||||
if (entity == null) {
|
||||
goodsDetailVO.setIsBuy(0);
|
||||
goodsDetailVO.setShare(true);
|
||||
goodsDetailVO.setPrice("未登录");
|
||||
} else {
|
||||
goodsDetailVO.setShare(false);
|
||||
goodsDetailVO.setFaceId(entity.getFaceId());
|
||||
goodsDetailVO.setIsBuy(entity.getIsBuy());
|
||||
if (Integer.valueOf(0).equals(entity.getIsBuy())) {
|
||||
PriceObj priceObj = orderBiz.queryPrice(videoRespVO.getScenicId(), 0, videoId);
|
||||
if (priceObj.isFree()) {
|
||||
goodsDetailVO.setIsBuy(1);
|
||||
} else {
|
||||
goodsDetailVO.setIsBuy(0);
|
||||
goodsDetailVO.setPrice(priceObj.getPrice().toString());
|
||||
goodsDetailVO.setSlashPrice(priceObj.getSlashPrice().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
TaskEntity task = videoTaskRepository.getTaskById(videoRespVO.getTaskId());
|
||||
JSONObject paramJson = JSON.parseObject(task.getTaskParams());
|
||||
@ -248,9 +232,6 @@ public class GoodsServiceImpl implements GoodsService {
|
||||
deviceCount = paramJson.keySet().stream().filter(StringUtils::isNumeric).count();
|
||||
}
|
||||
goodsDetailVO.setLensNum((int) deviceCount);
|
||||
if (entity != null) {
|
||||
goodsDetailVO.setFaceId(entity.getFaceId());
|
||||
}
|
||||
return ApiResponse.success(goodsDetailVO);
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ import com.ycwl.basic.constant.NumberConstant;
|
||||
import com.ycwl.basic.enums.*;
|
||||
import com.ycwl.basic.exception.AppException;
|
||||
import com.ycwl.basic.mapper.*;
|
||||
import com.ycwl.basic.model.mobile.order.IsBuyRespVO;
|
||||
import com.ycwl.basic.model.mobile.order.OrderAppPageReq;
|
||||
import com.ycwl.basic.model.mobile.order.PriceObj;
|
||||
import com.ycwl.basic.model.mobile.order.RefundOrderReq;
|
||||
@ -267,6 +268,10 @@ public class OrderServiceImpl implements OrderService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ApiResponse<WxPayRespVO> createOrder(Long userId, CreateOrderReqVO createOrderReqVO) throws Exception {
|
||||
IsBuyRespVO isBuy = orderBiz.isBuy(userId, createOrderReqVO.getScenicId(), createOrderReqVO.getGoodsType(), createOrderReqVO.getGoodsId());
|
||||
if (isBuy.isBuy()) {
|
||||
return ApiResponse.fail("您已购买此内容,无需重复购买!");
|
||||
}
|
||||
OrderEntity order = new OrderEntity();
|
||||
Long orderId = SnowFlakeUtil.getLongId();
|
||||
order.setId(orderId);
|
||||
@ -281,11 +286,17 @@ public class OrderServiceImpl implements OrderService {
|
||||
orderItem.setOrderId(orderId);
|
||||
orderItems.add(orderItem);
|
||||
PriceObj priceObj = orderBiz.queryPrice(order.getScenicId(), createOrderReqVO.getGoodsType(), createOrderReqVO.getGoodsId());
|
||||
order.setSlashPrice(priceObj.getSlashPrice());
|
||||
order.setPrice(priceObj.getPrice());
|
||||
// promo code
|
||||
// coupon
|
||||
order.setPayPrice(priceObj.getPrice());
|
||||
order.setStatus(OrderStateEnum.UNPAID.getState());
|
||||
if (order.getPayPrice().equals(BigDecimal.ZERO)) {
|
||||
order.setStatus(OrderStateEnum.PAID.getState());
|
||||
order.setPayAt(new Date());
|
||||
} else {
|
||||
order.setStatus(OrderStateEnum.UNPAID.getState());
|
||||
}
|
||||
orderMapper.add(order);
|
||||
int addOrderItems = orderMapper.addOrderItems(orderItems);
|
||||
if (addOrderItems == NumberConstant.ZERO) {
|
||||
|
@ -33,6 +33,7 @@ import com.ycwl.basic.model.pc.video.entity.MemberVideoEntity;
|
||||
import com.ycwl.basic.model.pc.video.entity.VideoEntity;
|
||||
import com.ycwl.basic.model.task.req.ClientStatusReqVo;
|
||||
import com.ycwl.basic.model.task.req.TaskReqVo;
|
||||
import com.ycwl.basic.model.task.req.TaskSuccessReqVo;
|
||||
import com.ycwl.basic.model.task.req.WorkerAuthReqVo;
|
||||
import com.ycwl.basic.model.task.resp.TaskSyncRespVo;
|
||||
import com.ycwl.basic.notify.NotifyFactory;
|
||||
@ -345,7 +346,7 @@ public class TaskTaskServiceImpl implements TaskService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void taskSuccess(@NonNull Long taskId, @NonNull WorkerAuthReqVo req) {
|
||||
public void taskSuccess(@NonNull Long taskId, @NonNull TaskSuccessReqVo req) {
|
||||
TaskRespVO task = taskMapper.getById(taskId);
|
||||
if (task == null) {
|
||||
return;
|
||||
|
@ -3,7 +3,6 @@ package com.ycwl.basic.service.mobile;
|
||||
import com.ycwl.basic.model.mobile.goods.*;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -28,13 +27,6 @@ public interface GoodsService {
|
||||
*/
|
||||
ApiResponse<List<GoodsDetailVO>> sourceGoodsList(Long userId, GoodsReqQuery query);
|
||||
|
||||
/**
|
||||
* 查询订单应付价格
|
||||
* @param queryPriceData
|
||||
* @return
|
||||
*/
|
||||
ApiResponse<BigDecimal> queryPrice(GoodsPriceQueryReq queryPriceData);
|
||||
|
||||
/**
|
||||
* @param userId 商品(vlog)id
|
||||
* @param videoId
|
||||
|
@ -2,6 +2,7 @@ package com.ycwl.basic.service.task;
|
||||
|
||||
import com.ycwl.basic.model.pc.template.resp.TemplateRespVO;
|
||||
import com.ycwl.basic.model.task.req.TaskReqVo;
|
||||
import com.ycwl.basic.model.task.req.TaskSuccessReqVo;
|
||||
import com.ycwl.basic.model.task.req.WorkerAuthReqVo;
|
||||
import com.ycwl.basic.model.task.resp.TaskSyncRespVo;
|
||||
|
||||
@ -17,7 +18,7 @@ public interface TaskService {
|
||||
|
||||
void createTaskByFaceIdAndTempalteId(Long faceId, Long templateId, int automatic);
|
||||
|
||||
void taskSuccess(Long taskId, WorkerAuthReqVo req);
|
||||
void taskSuccess(Long taskId, TaskSuccessReqVo req);
|
||||
|
||||
void taskFail(Long taskId, WorkerAuthReqVo req);
|
||||
|
||||
|
@ -111,8 +111,8 @@
|
||||
</select>
|
||||
|
||||
<insert id="add">
|
||||
insert into `order`(id, member_id, openid, price, pay_price, remark, broker_id, promo_code, scenic_id)
|
||||
VALUES (#{id}, #{memberId}, #{openId}, #{price}, #{payPrice}, #{remark}, #{brokerId}, #{promoCode}, #{scenicId})
|
||||
insert into `order`(id, member_id, openid, slash_price, price, pay_price, remark, broker_id, promo_code, scenic_id, status)
|
||||
VALUES (#{id}, #{memberId}, #{openId}, #{slashPrice}, #{price}, #{payPrice}, #{remark}, #{brokerId}, #{promoCode}, #{scenicId}, #{status})
|
||||
</insert>
|
||||
<insert id="addOrderItems">
|
||||
insert into order_item(order_id,goods_type, goods_id) VALUES
|
||||
@ -343,5 +343,6 @@
|
||||
and oi.goods_id = #{goodsId}
|
||||
and oi.goods_type = #{goodsType}
|
||||
and o.status = 1
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
@ -2,8 +2,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.ScenicMapper">
|
||||
<insert id="add">
|
||||
insert into scenic(id, `name`, introduction, phone, cover_url, longitude, latitude, radius, province, city, area, address, price, kf_code_url, kf_phone)
|
||||
values (#{id}, #{name}, #{introduction}, #{phone}, #{coverUrl},#{longitude}, #{latitude}, #{radius}, #{province}, #{city}, #{area}, #{address}, #{price}, #{kfCodeUrl}, #{kfPhone})
|
||||
insert into scenic(id, `name`, introduction, phone, cover_url, longitude, latitude, radius, province, city, area, address, price, kf_code_url, kf_phone, logo_url)
|
||||
values (#{id}, #{name}, #{introduction}, #{phone}, #{coverUrl},#{longitude}, #{latitude}, #{radius}, #{province}, #{city}, #{area}, #{address}, #{price}, #{kfCodeUrl}, #{kfPhone}, #{logoUrl})
|
||||
</insert>
|
||||
<insert id="addConfig">
|
||||
insert into scenic_config(id, scenic_id, create_time)
|
||||
@ -46,12 +46,15 @@
|
||||
<if test="address!=null and address!=''">
|
||||
address=#{address},
|
||||
</if>
|
||||
<if test="kfCodeUrl!=null and kfCodeUrl!=''">
|
||||
<if test="kfCodeUrl!=null">
|
||||
kf_code_url=#{kfCodeUrl},
|
||||
</if>
|
||||
<if test="kfPhone!=null and kfPhone!=''">
|
||||
<if test="kfPhone!=null">
|
||||
kf_phone=#{kfPhone},
|
||||
</if>
|
||||
<if test="logoUrl!=null">
|
||||
logo_url=#{logoUrl},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -96,7 +99,7 @@
|
||||
delete from scenic_config where scenic_id = #{scenicId}
|
||||
</delete>
|
||||
<select id="list" resultMap="scenic">
|
||||
select s.id, `name`, `phone`, introduction,cover_url, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||
select s.id, `name`, `phone`, introduction,logo_url,cover_url, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||
(select scenic_account.account from scenic_account where scenic_account.scenic_id = s.id and scenic_account.is_super = 1 limit 1) as account,
|
||||
s.price
|
||||
from scenic s
|
||||
@ -125,7 +128,7 @@
|
||||
</where>
|
||||
</select>
|
||||
<select id="getById" resultMap="scenic">
|
||||
select s.id, `name`, `phone`, introduction,cover_url, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||
select s.id, `name`, `phone`, introduction, logo_url,cover_url, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||
s.price
|
||||
from scenic s
|
||||
where s.id = #{id}
|
||||
@ -155,7 +158,7 @@
|
||||
</if>
|
||||
</select>
|
||||
<select id="getAppById" resultType="com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO">
|
||||
select s.id, `name`, `phone`, introduction,cover_url, longitude, latitude, radius, province, city, area, address, kf_code_url, kf_phone
|
||||
select s.id, `name`, `phone`, introduction, logo_url,cover_url, longitude, latitude, radius, province, city, area, address, kf_code_url, kf_phone
|
||||
from scenic s
|
||||
where `status` = 1 and s.id = #{id}
|
||||
</select>
|
||||
@ -202,6 +205,7 @@
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="account" column="account"/>
|
||||
<result property="introduction" column="introduction"/>
|
||||
<result property="logoUrl" column="logo_url"/>
|
||||
<result property="coverUrl" column="cover_url"/>
|
||||
<result property="longitude" column="longitude"/>
|
||||
<result property="latitude" column="latitude"/>
|
||||
|
@ -43,11 +43,12 @@
|
||||
</delete>
|
||||
|
||||
<select id="list" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
|
||||
select so.id, scenic_id, device_id, url, so.create_time, so.update_time,sc.`name` as scenicName, so.video_url, so.`type`, so.face_sample_id
|
||||
select so.id, so.scenic_id, de.name as deviceName, device_id, url, so.create_time, so.update_time,sc.`name` as scenicName, so.video_url, so.`type`, so.face_sample_id
|
||||
from source so
|
||||
left join scenic sc on sc.id = so.scenic_id
|
||||
left join device de on de.id = so.device_id
|
||||
<where>
|
||||
<if test="scenicId!= null">and scenic_id = #{scenicId} </if>
|
||||
<if test="scenicId!= null">and so.scenic_id = #{scenicId} </if>
|
||||
<if test="deviceId!= null">and device_id = #{deviceId} </if>
|
||||
<if test="url!= null">and url = #{url} </if>
|
||||
<if test="isBuy!=null">
|
||||
|
@ -2,8 +2,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.VideoMapper">
|
||||
<insert id="add">
|
||||
insert into video(id, scenic_id, member_id, template_id, task_id, worker_id, video_url)
|
||||
values (#{id}, #{scenicId}, #{memberId}, #{templateId}, #{taskId}, #{workerId}, #{videoUrl})
|
||||
insert into video(id, scenic_id, template_id, task_id, worker_id, video_url)
|
||||
values (#{id}, #{scenicId}, #{templateId}, #{taskId}, #{workerId}, #{videoUrl})
|
||||
</insert>
|
||||
<insert id="addRelation">
|
||||
replace member_video(member_id, scenic_id, face_id, template_id, task_id, video_id, is_buy, order_id)
|
||||
@ -20,12 +20,10 @@
|
||||
update video
|
||||
<set>
|
||||
<if test="scenicId!= null">scenic_id = #{scenicId}, </if>
|
||||
<if test="memberId!= null">member_id = #{memberId}, </if>
|
||||
<if test="templateId!= null">template_id = #{templateId}, </if>
|
||||
<if test="taskId!= null">task_id = #{taskId}, </if>
|
||||
<if test="workerId!= null">worker_id = #{workerId}, </if>
|
||||
<if test="videoUrl!= null">video_url = #{videoUrl}, </if>
|
||||
<if test="isBuy!= null">is_buy = #{isBuy}, </if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -46,22 +44,16 @@
|
||||
delete from video where id = #{id}
|
||||
</delete>
|
||||
<select id="list" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||
select v.id, v.scenic_id, member_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
|
||||
s.name scenicName, s.latitude, s.longitude, t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl,v.is_buy
|
||||
select v.id, v.scenic_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
|
||||
s.name scenicName, s.latitude, s.longitude, t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl
|
||||
from video v
|
||||
left join scenic s on s.id = v.scenic_id
|
||||
left join template t on v.template_id = t.id
|
||||
<where>
|
||||
<if test="scenicId!= null">and v.scenic_id = #{scenicId} </if>
|
||||
<if test="memberId!= null">and member_id = #{memberId} </if>
|
||||
<if test="templateId!= null">and template_id = #{templateId} </if>
|
||||
<if test="taskId!=null">
|
||||
and task_id = #{taskId}
|
||||
</if>
|
||||
<if test="taskId!=null">and task_id = #{taskId}</if>
|
||||
<if test="workerId!= null">and worker_id = #{workerId} </if>
|
||||
<if test="isBuy!=null">
|
||||
and is_buy = #{isBuy}
|
||||
</if>
|
||||
<if test="startTime!= null">and v.create_time >= #{startTime} </if>
|
||||
<if test="endTime!= null">and v.create_time <= #{endTime} </if>
|
||||
<if test="faceId!= null">
|
||||
@ -73,7 +65,7 @@
|
||||
order by v.create_time desc
|
||||
</select>
|
||||
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||
select v.id, v.scenic_id, member_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
|
||||
select v.id, v.scenic_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
|
||||
t.name templateName,t.price templatePrice, t.cover_url templateCoverUrl, t.slash_price slashPrice,
|
||||
s.name scenicName
|
||||
from video v
|
||||
|
Loading…
x
Reference in New Issue
Block a user