perf:拉取芬玩岛数据信息,更新座位信息
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
package com.xiang.xservice.fwd.entity.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-07-25 10:36
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class FPerformSeatInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 座位计划id
|
||||
*/
|
||||
private Long seatPlanId;
|
||||
|
||||
/**
|
||||
* 座位计划名称
|
||||
*/
|
||||
private String seatPlanName;
|
||||
|
||||
/**
|
||||
* 演出id
|
||||
*/
|
||||
private Long performId;
|
||||
|
||||
/**
|
||||
* 演出名称
|
||||
*/
|
||||
private String performName;
|
||||
|
||||
/**
|
||||
* 停止销售
|
||||
*/
|
||||
private Integer stopSale;
|
||||
|
||||
/**
|
||||
* shelf_status
|
||||
*/
|
||||
private Integer shelfStatus;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 折扣价
|
||||
*/
|
||||
private BigDecimal discountPrice;
|
||||
|
||||
/**
|
||||
* sub_status
|
||||
*/
|
||||
private Integer subStatus;
|
||||
|
||||
/**
|
||||
* quantity
|
||||
*/
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* status
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* max_sell_stock
|
||||
*/
|
||||
private Integer maxSellStock;
|
||||
|
||||
/**
|
||||
* sold_stock
|
||||
*/
|
||||
private Integer soldStock;
|
||||
|
||||
/**
|
||||
* left_stock
|
||||
*/
|
||||
private Integer leftStock;
|
||||
|
||||
/**
|
||||
* able_sale_quantity
|
||||
*/
|
||||
private Integer ableSaleQuantity;
|
||||
|
||||
/**
|
||||
* ash_show
|
||||
*/
|
||||
private Integer ashShow;
|
||||
|
||||
/**
|
||||
* ash_show_desc
|
||||
*/
|
||||
private Integer ashShowDesc;
|
||||
|
||||
/**
|
||||
* selectable
|
||||
*/
|
||||
private Integer selectable;
|
||||
|
||||
/**
|
||||
* display
|
||||
*/
|
||||
private Integer display;
|
||||
|
||||
/**
|
||||
* available_ticket_quantity
|
||||
*/
|
||||
private Integer availableTicketQuantity;
|
||||
|
||||
/**
|
||||
* available_all_ticket_quantity
|
||||
*/
|
||||
private Integer availableAllTicketQuantity;
|
||||
|
||||
/**
|
||||
* sale_time
|
||||
*/
|
||||
private LocalDateTime saleTime;
|
||||
|
||||
/**
|
||||
* 演出id(总)
|
||||
*/
|
||||
private Long projectId;
|
||||
}
|
||||
@@ -1,7 +1,14 @@
|
||||
package com.xiang.xservice.fwd.entity.resp.http.perform;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PerformDetail {
|
||||
private Long id;
|
||||
private String name;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.xiang.xservice.fwd.entity.resp.http.perform;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-07-25 10:13
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Tags {
|
||||
private int type;
|
||||
|
||||
private String tag;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.xiang.xservice.fwd.mapper;
|
||||
|
||||
import com.xiang.xservice.fwd.entity.pojo.FPerformSeatInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-07-25 10:53
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface FwdPerformSeatInfoMapper {
|
||||
int batchSave(List<FPerformSeatInfo> fPerformSeatInfos);
|
||||
|
||||
int update(FPerformSeatInfo fPerformSeatInfo);
|
||||
|
||||
List<FPerformSeatInfo> getPerformSeatInfoBySeatIds(@Param("list") List<Long> seatIds);
|
||||
|
||||
FPerformSeatInfo getPerformSeatInfoBySeatIdAndPerformIdAndProjectId(
|
||||
@Param("seatId") Long seatId, @Param("performId") Long performId, @Param("projectId") Long projectId);
|
||||
}
|
||||
@@ -1,14 +1,24 @@
|
||||
package com.xiang.xservice.fwd.schedule;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.xiang.xservice.basic.config.MyThreadFactory;
|
||||
import com.xiang.xservice.basic.utils.DateUtils;
|
||||
import com.xiang.xservice.fwd.entity.pojo.FPerformProjectInfo;
|
||||
import com.xiang.xservice.fwd.entity.pojo.FPerformSeatInfo;
|
||||
import com.xiang.xservice.fwd.entity.resp.http.perform.Perform;
|
||||
import com.xiang.xservice.fwd.entity.resp.http.perform.PerformDetail;
|
||||
import com.xiang.xservice.fwd.entity.resp.http.perform.PerformInfo;
|
||||
import com.xiang.xservice.fwd.entity.resp.http.perform.ProjectInfoResp;
|
||||
import com.xiang.xservice.fwd.entity.resp.http.perform.ProjectList;
|
||||
import com.xiang.xservice.fwd.entity.resp.http.perform.ProjectsResp;
|
||||
import com.xiang.xservice.fwd.entity.resp.http.perform.SeatPlan;
|
||||
import com.xiang.xservice.fwd.mapper.FwdPerformProjectInfoMapper;
|
||||
import com.xiang.xservice.fwd.mapper.FwdPerformSeatInfoMapper;
|
||||
import com.xiang.xservice.fwd.service.IPerformServiceHttp;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -16,6 +26,11 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 芬玩岛拉取数据定时任务
|
||||
@@ -31,6 +46,17 @@ public class PullDataFromFWDJob {
|
||||
|
||||
private final IPerformServiceHttp performServiceHttp;
|
||||
private final FwdPerformProjectInfoMapper performProjectInfoMapper;
|
||||
private final FwdPerformSeatInfoMapper performSeatInfoMapper;
|
||||
|
||||
private final ExecutorService es =
|
||||
new ThreadPoolExecutor(
|
||||
5,
|
||||
10,
|
||||
1000,
|
||||
TimeUnit.MILLISECONDS,
|
||||
new LinkedBlockingQueue<>(),
|
||||
new MyThreadFactory("fwd-pull-data-http", Boolean.TRUE),
|
||||
new ThreadPoolExecutor.AbortPolicy());
|
||||
|
||||
/**
|
||||
* 定时任务 每日2点爬取芬玩岛数据演出列表数据
|
||||
@@ -43,9 +69,13 @@ public class PullDataFromFWDJob {
|
||||
return;
|
||||
}
|
||||
List<ProjectList> projectList = showProjectsFromHttp.getList();
|
||||
|
||||
List<CompletableFuture> futureList = Lists.newArrayList();
|
||||
for (ProjectList project : projectList) {
|
||||
CompletableFuture future = CompletableFuture.runAsync(() -> {
|
||||
ProjectInfoResp projectInfoFromHttp = performServiceHttp.getProjectInfoFromHttp(project.getProjectId());
|
||||
if (Objects.nonNull(projectInfoFromHttp)) {
|
||||
Perform performsByProjectIdFromHttp = performServiceHttp.getPerformsByProjectIdFromHttp(project.getProjectId());
|
||||
if (Objects.nonNull(projectInfoFromHttp) && Objects.nonNull(performsByProjectIdFromHttp)) {
|
||||
FPerformProjectInfo projectInfo = performProjectInfoMapper.getProjectByProjectId(project.getProjectId());
|
||||
if (Objects.nonNull(projectInfo)) {
|
||||
// 更新projectInfo的信息
|
||||
@@ -66,8 +96,55 @@ public class PullDataFromFWDJob {
|
||||
projectInfo.setShortCity(project.getShortCity());
|
||||
projectInfo.setVenueName(project.getVenueName());
|
||||
projectInfo.setLowestPrice(project.getLowestPrice());
|
||||
// projectInfo.setProjectPrice(StringUtils.isBlank(projectInfoFromHttp.getProjectPrice()) ? BigDecimal.ZERO : new BigDecimal(projectInfoFromHttp.getProjectPrice()));
|
||||
performProjectInfoMapper.update(projectInfo);
|
||||
List<FPerformSeatInfo> fPerformSeatInfoInsertList = Lists.newArrayList();
|
||||
for (PerformInfo performInfo : performsByProjectIdFromHttp.getPerformInfos()) {
|
||||
if (CollectionUtils.isNotEmpty(performInfo.getPerformInfo())) {
|
||||
for (PerformDetail performDetail : performInfo.getPerformInfo()) {
|
||||
if (CollectionUtils.isNotEmpty(performDetail.getSeatPlans())) {
|
||||
for (SeatPlan seatPlan : performDetail.getSeatPlans()) {
|
||||
FPerformSeatInfo fPerformSeatInfo = new FPerformSeatInfo();
|
||||
fPerformSeatInfo.setSeatPlanId(seatPlan.getSeatPlanId());
|
||||
fPerformSeatInfo.setSeatPlanName(seatPlan.getSeatPlanName());
|
||||
fPerformSeatInfo.setPerformId(seatPlan.getPerformId());
|
||||
fPerformSeatInfo.setPerformName(seatPlan.getPerformName());
|
||||
fPerformSeatInfo.setStopSale(seatPlan.getStopSale());
|
||||
fPerformSeatInfo.setShelfStatus(seatPlan.getShelfStatus());
|
||||
fPerformSeatInfo.setPrice(seatPlan.getPrice());
|
||||
fPerformSeatInfo.setDiscountPrice(seatPlan.getDiscountPrice());
|
||||
fPerformSeatInfo.setSubStatus(seatPlan.getSubStatus());
|
||||
fPerformSeatInfo.setQuantity(seatPlan.getQuantity());
|
||||
fPerformSeatInfo.setStatus(seatPlan.getStatus());
|
||||
fPerformSeatInfo.setMaxSellStock(seatPlan.getMaxSellStock());
|
||||
fPerformSeatInfo.setSoldStock(seatPlan.getSoldStock());
|
||||
fPerformSeatInfo.setLeftStock(seatPlan.getLeftStock());
|
||||
fPerformSeatInfo.setAbleSaleQuantity(seatPlan.getAbleSaleQuantity());
|
||||
fPerformSeatInfo.setAshShow(seatPlan.getAshShow());
|
||||
fPerformSeatInfo.setAshShowDesc(seatPlan.getAshShow());
|
||||
fPerformSeatInfo.setSelectable(seatPlan.getSelectable());
|
||||
fPerformSeatInfo.setDisplay(seatPlan.getDisplay());
|
||||
fPerformSeatInfo.setAvailableTicketQuantity(seatPlan.getAvailableTicketQuantity());
|
||||
fPerformSeatInfo.setAvailableAllTicketQuantity(seatPlan.getAvailableAllTicketQuantity());
|
||||
if (StringUtils.isNotBlank(seatPlan.getSaleTime())) {
|
||||
fPerformSeatInfo.setSaleTime(DateUtils.getTimeFromStr(seatPlan.getSaleTime()));
|
||||
}
|
||||
fPerformSeatInfo.setProjectId(project.getProjectId());
|
||||
FPerformSeatInfo seatInfo = performSeatInfoMapper.getPerformSeatInfoBySeatIdAndPerformIdAndProjectId(fPerformSeatInfo.getSeatPlanId(), fPerformSeatInfo.getPerformId(), project.getProjectId());
|
||||
if (Objects.nonNull(seatInfo)) {
|
||||
fPerformSeatInfo.setId(seatInfo.getId());
|
||||
performSeatInfoMapper.update(fPerformSeatInfo);
|
||||
} else {
|
||||
fPerformSeatInfoInsertList.add(fPerformSeatInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(fPerformSeatInfoInsertList)) {
|
||||
performSeatInfoMapper.batchSave(fPerformSeatInfoInsertList);
|
||||
}
|
||||
} else {
|
||||
// 新增projectInfo的信息
|
||||
FPerformProjectInfo fPerformProjectInfo = new FPerformProjectInfo();
|
||||
@@ -90,10 +167,54 @@ public class PullDataFromFWDJob {
|
||||
fPerformProjectInfo.setShortCity(project.getShortCity());
|
||||
fPerformProjectInfo.setVenueName(project.getVenueName());
|
||||
fPerformProjectInfo.setLowestPrice(project.getLowestPrice());
|
||||
// fPerformProjectInfo.setProjectPrice(StringUtils.isBlank(projectInfoFromHttp.getProjectPrice()) ? BigDecimal.ZERO : new BigDecimal(projectInfoFromHttp.getProjectPrice()));
|
||||
performProjectInfoMapper.insert(fPerformProjectInfo);
|
||||
|
||||
List<FPerformSeatInfo> fPerformSeatInfos = Lists.newArrayList();
|
||||
for (PerformInfo performInfo : performsByProjectIdFromHttp.getPerformInfos()) {
|
||||
if (CollectionUtils.isNotEmpty(performInfo.getPerformInfo())) {
|
||||
for (PerformDetail performDetail : performInfo.getPerformInfo()) {
|
||||
if (CollectionUtils.isNotEmpty(performDetail.getSeatPlans())) {
|
||||
for (SeatPlan seatPlan : performDetail.getSeatPlans()) {
|
||||
FPerformSeatInfo fPerformSeatInfo = new FPerformSeatInfo();
|
||||
fPerformSeatInfo.setSeatPlanId(seatPlan.getSeatPlanId());
|
||||
fPerformSeatInfo.setSeatPlanName(seatPlan.getSeatPlanName());
|
||||
fPerformSeatInfo.setPerformId(seatPlan.getPerformId());
|
||||
fPerformSeatInfo.setPerformName(seatPlan.getPerformName());
|
||||
fPerformSeatInfo.setStopSale(seatPlan.getStopSale());
|
||||
fPerformSeatInfo.setShelfStatus(seatPlan.getShelfStatus());
|
||||
fPerformSeatInfo.setPrice(seatPlan.getPrice());
|
||||
fPerformSeatInfo.setDiscountPrice(seatPlan.getDiscountPrice());
|
||||
fPerformSeatInfo.setSubStatus(seatPlan.getSubStatus());
|
||||
fPerformSeatInfo.setQuantity(seatPlan.getQuantity());
|
||||
fPerformSeatInfo.setStatus(seatPlan.getStatus());
|
||||
fPerformSeatInfo.setMaxSellStock(seatPlan.getMaxSellStock());
|
||||
fPerformSeatInfo.setSoldStock(seatPlan.getSoldStock());
|
||||
fPerformSeatInfo.setLeftStock(seatPlan.getLeftStock());
|
||||
fPerformSeatInfo.setAbleSaleQuantity(seatPlan.getAbleSaleQuantity());
|
||||
fPerformSeatInfo.setAshShow(seatPlan.getAshShow());
|
||||
fPerformSeatInfo.setAshShowDesc(seatPlan.getAshShow());
|
||||
fPerformSeatInfo.setSelectable(seatPlan.getSelectable());
|
||||
fPerformSeatInfo.setDisplay(seatPlan.getDisplay());
|
||||
fPerformSeatInfo.setAvailableTicketQuantity(seatPlan.getAvailableTicketQuantity());
|
||||
fPerformSeatInfo.setAvailableAllTicketQuantity(seatPlan.getAvailableAllTicketQuantity());
|
||||
if (StringUtils.isNotBlank(seatPlan.getSaleTime())) {
|
||||
fPerformSeatInfo.setSaleTime(DateUtils.getTimeFromStr(seatPlan.getSaleTime()));
|
||||
}
|
||||
fPerformSeatInfo.setProjectId(project.getProjectId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(fPerformSeatInfos)) {
|
||||
performSeatInfoMapper.batchSave(fPerformSeatInfos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, es);
|
||||
futureList.add(future);
|
||||
}
|
||||
CompletableFuture[] futureArr = futureList.toArray(futureList.toArray(new CompletableFuture[0]));
|
||||
CompletableFuture.allOf(futureArr).join();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,5 +34,4 @@ public interface IPerformServiceHttp {
|
||||
* @return
|
||||
*/
|
||||
Perform getPerformsByProjectIdFromHttp(Long projectId);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql:///xservice-script?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||
url: jdbc:mysql://120.27.153.87:3306/xservice-script-test?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||
username: root
|
||||
password: 12345678
|
||||
password: 123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@@ -0,0 +1,273 @@
|
||||
<?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.xiang.xservice.fwd.mapper.FwdPerformSeatInfoMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.xiang.xservice.fwd.entity.pojo.FPerformSeatInfo" >
|
||||
<result column="id" property="id"/>
|
||||
<result column="seat_plan_id" property="seatPlanId" />
|
||||
<result column="seat_plan_name" property="seatPlanName" />
|
||||
<result column="perform_id" property="performId" />
|
||||
<result column="perform_name" property="performName" />
|
||||
<result column="stop_sale" property="stopSale" />
|
||||
<result column="shelf_status" property="shelfStatus" />
|
||||
<result column="price" property="price" />
|
||||
<result column="discount_price" property="discountPrice" />
|
||||
<result column="sub_status" property="subStatus" />
|
||||
<result column="quantity" property="quantity" />
|
||||
<result column="status" property="status" />
|
||||
<result column="max_sell_stock" property="maxSellStock" />
|
||||
<result column="sold_stock" property="soldStock" />
|
||||
<result column="left_stock" property="leftStock" />
|
||||
<result column="able_sale_quantity" property="ableSaleQuantity" />
|
||||
<result column="ash_show" property="ashShow" />
|
||||
<result column="ash_show_desc" property="ashShowDesc" />
|
||||
<result column="selectable" property="selectable" />
|
||||
<result column="display" property="display" />
|
||||
<result column="available_ticket_quantity" property="availableTicketQuantity" />
|
||||
<result column="available_all_ticket_quantity" property="availableAllTicketQuantity" />
|
||||
<result column="sale_time" property="saleTime" />
|
||||
<result column="project_id" property="projectId" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, seat_plan_id,
|
||||
seat_plan_name,
|
||||
perform_id,
|
||||
perform_name,
|
||||
stop_sale,
|
||||
shelf_status,
|
||||
price,
|
||||
discount_price,
|
||||
sub_status,
|
||||
quantity,
|
||||
status,
|
||||
max_sell_stock,
|
||||
sold_stock,
|
||||
left_stock,
|
||||
able_sale_quantity,
|
||||
ash_show,
|
||||
ash_show_desc,
|
||||
selectable,
|
||||
display,
|
||||
available_ticket_quantity,
|
||||
available_all_ticket_quantity,
|
||||
sale_time,
|
||||
project_id
|
||||
</sql>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.xiang.xservice.fwd.entity.pojo.FPerformSeatInfo">
|
||||
INSERT INTO fwd_perform_seat_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="null != seatPlanId ">
|
||||
seat_plan_id,
|
||||
</if>
|
||||
<if test="null != seatPlanName ">
|
||||
seat_plan_name,
|
||||
</if>
|
||||
<if test="null != performId ">
|
||||
perform_id,
|
||||
</if>
|
||||
<if test="null != performName and '' != performName">
|
||||
perform_name,
|
||||
</if>
|
||||
<if test="null != stopSale ">
|
||||
stop_sale,
|
||||
</if>
|
||||
<if test="null != shelfStatus ">
|
||||
shelf_status,
|
||||
</if>
|
||||
<if test="null != price ">
|
||||
price,
|
||||
</if>
|
||||
<if test="null != discountPrice ">
|
||||
discount_price,
|
||||
</if>
|
||||
<if test="null != subStatus ">
|
||||
sub_status,
|
||||
</if>
|
||||
<if test="null != quantity ">
|
||||
quantity,
|
||||
</if>
|
||||
<if test="null != status ">
|
||||
status,
|
||||
</if>
|
||||
<if test="null != maxSellStock ">
|
||||
max_sell_stock,
|
||||
</if>
|
||||
<if test="null != soldStock ">
|
||||
sold_stock,
|
||||
</if>
|
||||
<if test="null != leftStock ">
|
||||
left_stock,
|
||||
</if>
|
||||
<if test="null != ableSaleQuantity ">
|
||||
able_sale_quantity,
|
||||
</if>
|
||||
<if test="null != ashShow ">
|
||||
ash_show,
|
||||
</if>
|
||||
<if test="null != ashShowDesc ">
|
||||
ash_show_desc,
|
||||
</if>
|
||||
<if test="null != selectable ">
|
||||
selectable,
|
||||
</if>
|
||||
<if test="null != display ">
|
||||
display,
|
||||
</if>
|
||||
<if test="null != availableTicketQuantity ">
|
||||
available_ticket_quantity,
|
||||
</if>
|
||||
<if test="null != availableAllTicketQuantity ">
|
||||
available_all_ticket_quantity,
|
||||
</if>
|
||||
<if test="null != saleTime ">
|
||||
sale_time,
|
||||
</if>
|
||||
<if test="null != projectId ">
|
||||
project_id
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="null != seatPlanId ">
|
||||
#{seatPlanId},
|
||||
</if>
|
||||
<if test="null != seatPlanName ">
|
||||
#{seatPlanName},
|
||||
</if>
|
||||
<if test="null != performId ">
|
||||
#{performId},
|
||||
</if>
|
||||
<if test="null != performName and '' != performName">
|
||||
#{performName},
|
||||
</if>
|
||||
<if test="null != stopSale ">
|
||||
#{stopSale},
|
||||
</if>
|
||||
<if test="null != shelfStatus ">
|
||||
#{shelfStatus},
|
||||
</if>
|
||||
<if test="null != price ">
|
||||
#{price},
|
||||
</if>
|
||||
<if test="null != discountPrice ">
|
||||
#{discountPrice},
|
||||
</if>
|
||||
<if test="null != subStatus ">
|
||||
#{subStatus},
|
||||
</if>
|
||||
<if test="null != quantity ">
|
||||
#{quantity},
|
||||
</if>
|
||||
<if test="null != status ">
|
||||
#{status},
|
||||
</if>
|
||||
<if test="null != maxSellStock ">
|
||||
#{maxSellStock},
|
||||
</if>
|
||||
<if test="null != soldStock ">
|
||||
#{soldStock},
|
||||
</if>
|
||||
<if test="null != leftStock ">
|
||||
#{leftStock},
|
||||
</if>
|
||||
<if test="null != ableSaleQuantity ">
|
||||
#{ableSaleQuantity},
|
||||
</if>
|
||||
<if test="null != ashShow ">
|
||||
#{ashShow},
|
||||
</if>
|
||||
<if test="null != ashShowDesc ">
|
||||
#{ashShowDesc},
|
||||
</if>
|
||||
<if test="null != selectable ">
|
||||
#{selectable},
|
||||
</if>
|
||||
<if test="null != display ">
|
||||
#{display},
|
||||
</if>
|
||||
<if test="null != availableTicketQuantity ">
|
||||
#{availableTicketQuantity},
|
||||
</if>
|
||||
<if test="null != availableAllTicketQuantity ">
|
||||
#{availableAllTicketQuantity},
|
||||
</if>
|
||||
<if test="null != saleTime ">
|
||||
#{saleTime},
|
||||
</if>
|
||||
<if test="null != projectId ">
|
||||
#{projectId}
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="batchSave">
|
||||
INSERT INTO fwd_perform_seat_info
|
||||
(
|
||||
seat_plan_id, seat_plan_name, perform_id, perform_name, stop_sale,
|
||||
shelf_status, price, discount_price, sub_status, quantity,
|
||||
status, max_sell_stock, sold_stock, left_stock, able_sale_quantity,
|
||||
ash_show, ash_show_desc, selectable, display,
|
||||
available_ticket_quantity, available_all_ticket_quantity,
|
||||
sale_time, project_id
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.seatPlanId}, #{item.seatPlanName}, #{item.performId}, #{item.performName}, #{item.stopSale},
|
||||
#{item.shelfStatus}, #{item.price}, #{item.discountPrice}, #{item.subStatus}, #{item.quantity},
|
||||
#{item.status}, #{item.maxSellStock}, #{item.soldStock}, #{item.leftStock}, #{item.ableSaleQuantity},
|
||||
#{item.ashShow}, #{item.ashShowDesc}, #{item.selectable}, #{item.display},
|
||||
#{item.availableTicketQuantity}, #{item.availableAllTicketQuantity},
|
||||
#{item.saleTime}, #{item.projectId}
|
||||
)
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="update" parameterType="com.xiang.xservice.fwd.entity.pojo.FPerformSeatInfo">
|
||||
UPDATE fwd_perform_seat_info
|
||||
<set>
|
||||
<if test="null != seatPlanId ">seat_plan_id = #{seatPlanId},</if>
|
||||
<if test="null != seatPlanName ">seat_plan_name = #{seatPlanName},</if>
|
||||
<if test="null != performId ">perform_id = #{performId},</if>
|
||||
<if test="null != performName and '' != performName">perform_name = #{performName},</if>
|
||||
<if test="null != stopSale ">stop_sale = #{stopSale},</if>
|
||||
<if test="null != shelfStatus ">shelf_status = #{shelfStatus},</if>
|
||||
<if test="null != price ">price = #{price},</if>
|
||||
<if test="null != discountPrice ">discount_price = #{discountPrice},</if>
|
||||
<if test="null != subStatus ">sub_status = #{subStatus},</if>
|
||||
<if test="null != quantity ">quantity = #{quantity},</if>
|
||||
<if test="null != status ">status = #{status},</if>
|
||||
<if test="null != maxSellStock ">max_sell_stock = #{maxSellStock},</if>
|
||||
<if test="null != soldStock ">sold_stock = #{soldStock},</if>
|
||||
<if test="null != leftStock ">left_stock = #{leftStock},</if>
|
||||
<if test="null != ableSaleQuantity ">able_sale_quantity = #{ableSaleQuantity},</if>
|
||||
<if test="null != ashShow ">ash_show = #{ashShow},</if>
|
||||
<if test="null != ashShowDesc ">ash_show_desc = #{ashShowDesc},</if>
|
||||
<if test="null != selectable ">selectable = #{selectable},</if>
|
||||
<if test="null != display ">display = #{display},</if>
|
||||
<if test="null != availableTicketQuantity ">available_ticket_quantity = #{availableTicketQuantity},</if>
|
||||
<if test="null != availableAllTicketQuantity ">available_all_ticket_quantity = #{availableAllTicketQuantity},</if>
|
||||
<if test="null != saleTime ">sale_time = #{saleTime},</if>
|
||||
<if test="null != projectId ">project_id = #{projectId}</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<select id="getPerformSeatInfoBySeatIds" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List"/>
|
||||
from fwd_perform_seat_info
|
||||
where seat_plan_id in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="getPerformSeatInfoBySeatIdAndPerformIdAndProjectId"
|
||||
resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List"/>
|
||||
from fwd_perform_seat_info
|
||||
where seat_plan_id = #{seatId} and perform_id = #{performId} and project_id = #{projectId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user