mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 03:39:55 +08:00
新增 占桩订单相关接口
This commit is contained in:
@@ -1,7 +1,108 @@
|
||||
package com.jsowell.api.uniapp;/**
|
||||
* TODO
|
||||
package com.jsowell.api.uniapp;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.jsowell.common.annotation.Anonymous;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.OrderPileOccupy;
|
||||
import com.jsowell.pile.dto.GenerateOccupyOrderDTO;
|
||||
import com.jsowell.pile.service.OrderPileOccupyService;
|
||||
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 占桩订单controller
|
||||
*
|
||||
* @Date 2023/8/18 8:55
|
||||
* @author Lemon
|
||||
*/public class OccupyOrderController {
|
||||
* @Date 2023/8/18 8:55
|
||||
*/
|
||||
@Anonymous
|
||||
@RestController
|
||||
@RequestMapping("/uniapp/occupyOrder")
|
||||
public class OccupyOrderController extends BaseController {
|
||||
@Autowired
|
||||
private OrderPileOccupyService orderPileOccupyService;
|
||||
|
||||
/**
|
||||
* 查询站点占桩费率
|
||||
* @param stationId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getStationOccupyFee/{stationId}")
|
||||
public RestApiResponse<?> getStationOccupyFee(@PathVariable("stationId") String stationId) {
|
||||
logger.info("查询站点占桩费率 params:{}", stationId);
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("查询站点占桩费率 error,", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("查询站点占桩费率 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成占桩订单
|
||||
* https://api.jsowellcloud.com/uniapp/occupyOrder/generateOccupyOrder
|
||||
* @param request
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/generateOccupyOrder")
|
||||
public RestApiResponse<?> generateOccupyOrder(HttpServletRequest request, @RequestBody GenerateOccupyOrderDTO dto) {
|
||||
logger.info("生成占桩订单 params:{}", JSON.toJSONString(dto));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
// 获取memberId
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
if (StringUtils.isEmpty(memberId)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_TOKEN_ERROR);
|
||||
}
|
||||
dto.setMemberId(memberId);
|
||||
String occupyOrderCode = orderPileOccupyService.generateOccupyPileOrder(dto);
|
||||
if (StringUtils.isNotBlank(occupyOrderCode)) {
|
||||
response = new RestApiResponse<>(ImmutableMap.of("occupyOrderCode", occupyOrderCode));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("生成占桩订单 error,", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("生成占桩订单 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
// 查询占桩订单列表页
|
||||
@GetMapping("/getOccupyOrderInfo")
|
||||
public RestApiResponse<?> getOccupyOrderInfo(HttpServletRequest request) {
|
||||
// 获取memberId
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
if (StringUtils.isEmpty(memberId)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_TOKEN_ERROR);
|
||||
}
|
||||
logger.info("查询占桩订单列表页 memberId:{}", memberId);
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
List<OrderPileOccupyVO> orderInfoList = orderPileOccupyService.getOccupyOrderInfo(memberId);
|
||||
response = new RestApiResponse<>(orderInfoList);
|
||||
} catch (Exception e) {
|
||||
logger.error("查询占桩订单列表页 error, ", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("查询占桩订单列表页 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 查询占桩订单详情页
|
||||
}
|
||||
|
||||
@@ -208,7 +208,12 @@ public class SpringBootTestController {
|
||||
String memberId = "67569684";
|
||||
String pileSn = "88230000000135";
|
||||
String connectorCode = "01";
|
||||
orderPileOccupyService.generateOccupyPileOrder(memberId, pileSn, connectorCode);
|
||||
GenerateOccupyOrderDTO dto = new GenerateOccupyOrderDTO();
|
||||
dto.setMemberId(memberId);
|
||||
dto.setPileSn(pileSn);
|
||||
dto.setConnectorCode(connectorCode);
|
||||
|
||||
orderPileOccupyService.generateOccupyPileOrder(dto);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.jsowell.common.enums.uniapp;
|
||||
|
||||
/**
|
||||
* 占桩订单支付状态enum
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/8/18 9:49
|
||||
*/
|
||||
public enum OrderPileOccupyPayStatusEnum {
|
||||
UN_PAY("0", "未支付"),
|
||||
PAYMENT_COMPLETION("1", "未支付"),
|
||||
NO_PAYMENT_REQUIRED("2", "无需支付"),
|
||||
;
|
||||
|
||||
private String code;
|
||||
private String value;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
OrderPileOccupyPayStatusEnum(String code, String value) {
|
||||
this.code = code;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取value
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public static String getValueByCode(String code) {
|
||||
for (OrderPileOccupyPayStatusEnum item : OrderPileOccupyPayStatusEnum.values()) {
|
||||
if (item.getCode().equals(code)) {
|
||||
return item.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.jsowell.common.enums.uniapp;
|
||||
|
||||
/**
|
||||
* 占桩订单enum
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/8/18 9:41
|
||||
*/
|
||||
public enum OrderPileOccupyStatusEnum {
|
||||
OCCUPIED("0", "占桩中"),
|
||||
ORDER_COMPLETE("1", "订单完成"),
|
||||
ORDER_HANG_UP("2", "订单挂起"),
|
||||
;
|
||||
|
||||
private String code;
|
||||
private String value;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
OrderPileOccupyStatusEnum(String code, String value) {
|
||||
this.code = code;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取value
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public static String getValueByCode(String code) {
|
||||
for (OrderPileOccupyStatusEnum item : OrderPileOccupyStatusEnum.values()) {
|
||||
if (item.getCode().equals(code)) {
|
||||
return item.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,24 @@
|
||||
package com.jsowell.pile.dto;/**
|
||||
* TODO
|
||||
package com.jsowell.pile.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 生成占桩订单DTO
|
||||
*
|
||||
* @Date 2023/8/18 9:00
|
||||
* @author Lemon
|
||||
*/public class GenerateOccupyOrderDTO {
|
||||
* @Date 2023/8/18 9:00
|
||||
*/
|
||||
@Data
|
||||
public class GenerateOccupyOrderDTO {
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 桩号
|
||||
*/
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 枪口号
|
||||
*/
|
||||
private String connectorCode;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.OrderPileOccupy;
|
||||
import com.jsowell.pile.dto.QueryOccupyOrderDTO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -83,4 +84,11 @@ public interface OrderPileOccupyMapper {
|
||||
* @return
|
||||
*/
|
||||
List<OrderPileOccupy> queryUnPayOrderByMemberId(@Param("memberId") String memberId);
|
||||
|
||||
/**
|
||||
* 查询占桩订单列表
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
List<OrderPileOccupyVO> getOccupyOrderInfo(String memberId);
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.pile.domain.OrderPileOccupy;
|
||||
import com.jsowell.pile.dto.GenerateOccupyOrderDTO;
|
||||
import com.jsowell.pile.dto.QueryOccupyOrderDTO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
|
||||
|
||||
import java.util.List;
|
||||
public interface OrderPileOccupyService{
|
||||
@@ -34,7 +36,7 @@ public interface OrderPileOccupyService{
|
||||
/**
|
||||
* 生成占桩订单
|
||||
*/
|
||||
void generateOccupyPileOrder(String memberId, String pileSn, String connectorCode);
|
||||
String generateOccupyPileOrder(GenerateOccupyOrderDTO dto);
|
||||
|
||||
/**
|
||||
* 停止并计算占桩订单
|
||||
@@ -49,4 +51,11 @@ public interface OrderPileOccupyService{
|
||||
* @return
|
||||
*/
|
||||
List<OrderPileOccupy> queryUnPayOrderByMemberId(String memberId);
|
||||
|
||||
/**
|
||||
* 查询占桩订单列表
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
List<OrderPileOccupyVO> getOccupyOrderInfo(String memberId);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,14 @@ package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.enums.DelFlagEnum;
|
||||
import com.jsowell.common.enums.uniapp.OrderPileOccupyPayStatusEnum;
|
||||
import com.jsowell.common.enums.uniapp.OrderPileOccupyStatusEnum;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.PageUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.id.IdUtils;
|
||||
import com.jsowell.pile.domain.OrderPileOccupy;
|
||||
import com.jsowell.pile.dto.GenerateOccupyOrderDTO;
|
||||
import com.jsowell.pile.dto.QueryOccupyOrderDTO;
|
||||
import com.jsowell.pile.dto.QueryOrderDTO;
|
||||
import com.jsowell.pile.mapper.OrderPileOccupyMapper;
|
||||
@@ -14,6 +18,7 @@ import com.jsowell.pile.service.IPileBasicInfoService;
|
||||
import com.jsowell.pile.service.IPileBillingTemplateService;
|
||||
import com.jsowell.pile.service.OrderPileOccupyService;
|
||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
|
||||
import com.jsowell.pile.vo.web.BillingTemplateVO;
|
||||
import com.jsowell.pile.vo.web.OrderListVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -121,12 +126,13 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService{
|
||||
/**
|
||||
* 生成占桩订单
|
||||
* 在会员操作降地锁后,就生成占桩订单
|
||||
* @param memberId 会员id
|
||||
* @param pileSn 充电桩编号
|
||||
* @param connectorCode 充电桩枪口号
|
||||
* @param dto 会员id 充电桩编号 充电桩枪口号
|
||||
*/
|
||||
@Override
|
||||
public void generateOccupyPileOrder(String memberId, String pileSn, String connectorCode) {
|
||||
public String generateOccupyPileOrder(GenerateOccupyOrderDTO dto) {
|
||||
String memberId = dto.getMemberId();
|
||||
String pileSn = dto.getPileSn();
|
||||
String connectorCode = dto.getConnectorCode();
|
||||
// 创建占桩订单
|
||||
OrderPileOccupy orderPileOccupy = new OrderPileOccupy();
|
||||
String occupyCode = "OP" + IdUtils.getOrderCode();
|
||||
@@ -144,6 +150,8 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService{
|
||||
orderPileOccupy.setStartTime(DateUtils.getNowDate());
|
||||
orderPileOccupy.setDelFlag(DelFlagEnum.NORMAL.getValue());
|
||||
orderPileOccupyMapper.insertSelective(orderPileOccupy);
|
||||
|
||||
return orderPileOccupy.getOccupyCode();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -260,5 +268,24 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService{
|
||||
return orderPileOccupyMapper.queryUnPayOrderByMemberId(memberId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询占桩订单列表
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<OrderPileOccupyVO> getOccupyOrderInfo(String memberId) {
|
||||
// 分页
|
||||
PageUtils.startPage();
|
||||
List<OrderPileOccupyVO> list = orderPileOccupyMapper.getOccupyOrderInfo(memberId);
|
||||
for (OrderPileOccupyVO orderPileOccupyVO : list) {
|
||||
// 订单状态
|
||||
orderPileOccupyVO.setStatus(OrderPileOccupyStatusEnum.getValueByCode(orderPileOccupyVO.getStatus()));
|
||||
// 支付状态
|
||||
orderPileOccupyVO.setPayStatus(OrderPileOccupyPayStatusEnum.getValueByCode(orderPileOccupyVO.getPayStatus()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("通过站点id查询当前时间的收费详情 stationId:{}, result:{}", stationId, JSON.toJSONString(result));
|
||||
// log.info("通过站点id查询当前时间的收费详情 stationId:{}, result:{}", stationId, JSON.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.jsowell.pile.vo.uniapp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 占桩订单列表VO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/8/18 9:34
|
||||
*/
|
||||
@Data
|
||||
public class OrderPileOccupyVO {
|
||||
/**
|
||||
* 占桩订单编号
|
||||
*/
|
||||
private String occupyCode;
|
||||
|
||||
/**
|
||||
* 状态(0-占桩中;1-订单完成; 2-订单挂起)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 站点名称
|
||||
*/
|
||||
private String stationName;
|
||||
|
||||
/**
|
||||
* 占桩开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 占桩结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 支付状态(0-未支付;1-支付完成;2-无需支付)
|
||||
*/
|
||||
private String payStatus;
|
||||
|
||||
/**
|
||||
* 占桩订单金额
|
||||
*/
|
||||
private String orderAmount;
|
||||
|
||||
}
|
||||
@@ -4,62 +4,79 @@
|
||||
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.OrderPileOccupy">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table order_pile_occupy-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="occupy_code" jdbcType="VARCHAR" property="occupyCode" />
|
||||
<result column="status" jdbcType="CHAR" property="status" />
|
||||
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
|
||||
<result column="station_id" jdbcType="VARCHAR" property="stationId" />
|
||||
<result column="order_code" jdbcType="VARCHAR" property="orderCode" />
|
||||
<result column="transaction_code" jdbcType="VARCHAR" property="transactionCode" />
|
||||
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
||||
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
||||
<result column="pay_status" jdbcType="VARCHAR" property="payStatus" />
|
||||
<result column="order_amount" jdbcType="DECIMAL" property="orderAmount" />
|
||||
<result column="pile_sn" jdbcType="VARCHAR" property="pileSn" />
|
||||
<result column="connector_code" jdbcType="VARCHAR" property="connectorCode" />
|
||||
<result column="pile_connector_code" jdbcType="VARCHAR" property="pileConnectorCode" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
<result column="del_flag" jdbcType="CHAR" property="delFlag" />
|
||||
<id column="id" jdbcType="INTEGER" property="id"/>
|
||||
<result column="occupy_code" jdbcType="VARCHAR" property="occupyCode"/>
|
||||
<result column="status" jdbcType="CHAR" property="status"/>
|
||||
<result column="member_id" jdbcType="VARCHAR" property="memberId"/>
|
||||
<result column="station_id" jdbcType="VARCHAR" property="stationId"/>
|
||||
<result column="order_code" jdbcType="VARCHAR" property="orderCode"/>
|
||||
<result column="transaction_code" jdbcType="VARCHAR" property="transactionCode"/>
|
||||
<result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
|
||||
<result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
|
||||
<result column="pay_status" jdbcType="VARCHAR" property="payStatus"/>
|
||||
<result column="order_amount" jdbcType="DECIMAL" property="orderAmount"/>
|
||||
<result column="pile_sn" jdbcType="VARCHAR" property="pileSn"/>
|
||||
<result column="connector_code" jdbcType="VARCHAR" property="connectorCode"/>
|
||||
<result column="pile_connector_code" jdbcType="VARCHAR" property="pileConnectorCode"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
|
||||
<result column="del_flag" jdbcType="CHAR" property="delFlag"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, occupy_code, `status`, member_id, station_id, order_code, transaction_code, start_time,
|
||||
end_time, pay_status, order_amount, pile_sn, connector_code, pile_connector_code,
|
||||
create_time, create_by, update_time, update_by, del_flag
|
||||
id,
|
||||
occupy_code,
|
||||
`status`,
|
||||
member_id,
|
||||
station_id,
|
||||
order_code,
|
||||
transaction_code,
|
||||
start_time,
|
||||
end_time,
|
||||
pay_status,
|
||||
order_amount,
|
||||
pile_sn,
|
||||
connector_code,
|
||||
pile_connector_code,
|
||||
create_time,
|
||||
create_by,
|
||||
update_time,
|
||||
update_by,
|
||||
del_flag
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--@mbg.generated-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
<include refid="Base_Column_List"/>
|
||||
from order_pile_occupy
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<!--@mbg.generated-->
|
||||
delete from order_pile_occupy
|
||||
delete
|
||||
from order_pile_occupy
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderPileOccupy" useGeneratedKeys="true">
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderPileOccupy"
|
||||
useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into order_pile_occupy (occupy_code, `status`, member_id,
|
||||
station_id, order_code, transaction_code,
|
||||
start_time, end_time, pay_status,
|
||||
order_amount, pile_sn, connector_code,
|
||||
pile_connector_code, create_time, create_by,
|
||||
update_time, update_by, del_flag
|
||||
)
|
||||
update_time, update_by, del_flag)
|
||||
values (#{occupyCode,jdbcType=VARCHAR}, #{status,jdbcType=CHAR}, #{memberId,jdbcType=VARCHAR},
|
||||
#{stationId,jdbcType=VARCHAR}, #{orderCode,jdbcType=VARCHAR}, #{transactionCode,jdbcType=VARCHAR},
|
||||
#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{payStatus,jdbcType=VARCHAR},
|
||||
#{orderAmount,jdbcType=DECIMAL}, #{pileSn,jdbcType=VARCHAR}, #{connectorCode,jdbcType=VARCHAR},
|
||||
#{pileConnectorCode,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR},
|
||||
#{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR}
|
||||
)
|
||||
#{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderPileOccupy" useGeneratedKeys="true">
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderPileOccupy"
|
||||
useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into order_pile_occupy
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -504,15 +521,20 @@
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.occupyCode,jdbcType=VARCHAR}, #{item.status,jdbcType=CHAR}, #{item.memberId,jdbcType=VARCHAR},
|
||||
#{item.stationId,jdbcType=VARCHAR}, #{item.orderCode,jdbcType=VARCHAR}, #{item.transactionCode,jdbcType=VARCHAR},
|
||||
#{item.startTime,jdbcType=TIMESTAMP}, #{item.endTime,jdbcType=TIMESTAMP}, #{item.payStatus,jdbcType=VARCHAR},
|
||||
#{item.orderAmount,jdbcType=DECIMAL}, #{item.pileSn,jdbcType=VARCHAR}, #{item.connectorCode,jdbcType=VARCHAR},
|
||||
#{item.stationId,jdbcType=VARCHAR}, #{item.orderCode,jdbcType=VARCHAR},
|
||||
#{item.transactionCode,jdbcType=VARCHAR},
|
||||
#{item.startTime,jdbcType=TIMESTAMP}, #{item.endTime,jdbcType=TIMESTAMP},
|
||||
#{item.payStatus,jdbcType=VARCHAR},
|
||||
#{item.orderAmount,jdbcType=DECIMAL}, #{item.pileSn,jdbcType=VARCHAR},
|
||||
#{item.connectorCode,jdbcType=VARCHAR},
|
||||
#{item.pileConnectorCode,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
|
||||
#{item.createBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR},
|
||||
#{item.createBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
|
||||
#{item.updateBy,jdbcType=VARCHAR},
|
||||
#{item.delFlag,jdbcType=CHAR})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderPileOccupy" useGeneratedKeys="true">
|
||||
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderPileOccupy"
|
||||
useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into order_pile_occupy
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -587,7 +609,8 @@
|
||||
del_flag = #{delFlag,jdbcType=CHAR},
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderPileOccupy" useGeneratedKeys="true">
|
||||
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id"
|
||||
parameterType="com.jsowell.pile.domain.OrderPileOccupy" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into order_pile_occupy
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -773,7 +796,7 @@
|
||||
|
||||
<select id="queryByOccupyCode" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
<include refid="Base_Column_List"/>
|
||||
from order_pile_occupy
|
||||
where del_flag = '0'
|
||||
and occupy_code = #{occupyCode,jdbcType=VARCHAR}
|
||||
@@ -781,7 +804,7 @@
|
||||
|
||||
<select id="queryOccupyOrderList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
<include refid="Base_Column_List"/>
|
||||
from order_pile_occupy
|
||||
where del_flag = '0'
|
||||
<if test="dto.memberId != null and dto.memberId != ''">
|
||||
@@ -797,7 +820,7 @@
|
||||
|
||||
<select id="queryOccupiedOrder" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
<include refid="Base_Column_List"/>
|
||||
from order_pile_occupy
|
||||
where del_flag = '0'
|
||||
and status = '0'
|
||||
@@ -808,12 +831,27 @@
|
||||
|
||||
<select id="queryUnPayOrderByMemberId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from
|
||||
order_pile_occupy
|
||||
where
|
||||
del_flag = '0'
|
||||
<include refid="Base_Column_List"/>
|
||||
from order_pile_occupy
|
||||
where del_flag = '0'
|
||||
and status = '2'
|
||||
and member_id = #{memberId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
<select id="getOccupyOrderInfo" resultType="com.jsowell.pile.vo.uniapp.OrderPileOccupyVO">
|
||||
select
|
||||
t1.occupy_code as occupyCode,
|
||||
t1.status,
|
||||
t1.station_id as stationId,
|
||||
t2.station_name as stationName,
|
||||
t1.start_time as startime,
|
||||
t1.end_time as endTime,
|
||||
t1.pay_status as payStatus,
|
||||
t1.order_amount as orderAmount
|
||||
from
|
||||
order_pile_occupy t1
|
||||
left join pile_station_info t2 on t1.station_id = t2.id
|
||||
where
|
||||
member_id = #{memberId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user