mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-04 01:50:17 +08:00
预约充电
This commit is contained in:
@@ -16,7 +16,7 @@ import lombok.experimental.SuperBuilder;
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PileReservedInfo {
|
||||
public class PileReservationInfo {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.PileReservationInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface PileReservationInfoMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(PileReservationInfo record);
|
||||
|
||||
int insertOrUpdate(PileReservationInfo record);
|
||||
|
||||
int insertOrUpdateSelective(PileReservationInfo record);
|
||||
|
||||
int insertSelective(PileReservationInfo record);
|
||||
|
||||
PileReservationInfo selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(PileReservationInfo record);
|
||||
|
||||
int updateByPrimaryKey(PileReservationInfo record);
|
||||
|
||||
int updateBatch(List<PileReservationInfo> list);
|
||||
|
||||
int updateBatchSelective(List<PileReservationInfo> list);
|
||||
|
||||
int batchInsert(@Param("list") List<PileReservationInfo> list);
|
||||
|
||||
List<PileReservationInfo> findByMemberIdAndPileSnAndStatus(@Param("memberId") String memberId, @Param("pileSn") String pileSn, @Param("status") String status);
|
||||
|
||||
List<PileReservationInfo> findByMemberIdAndPileSn(@Param("memberId") String memberId, @Param("pileSn") String pileSn);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.PileReservedInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface PileReservedInfoMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(PileReservedInfo record);
|
||||
|
||||
int insertOrUpdate(PileReservedInfo record);
|
||||
|
||||
int insertOrUpdateSelective(PileReservedInfo record);
|
||||
|
||||
int insertSelective(PileReservedInfo record);
|
||||
|
||||
PileReservedInfo selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(PileReservedInfo record);
|
||||
|
||||
int updateByPrimaryKey(PileReservedInfo record);
|
||||
|
||||
int updateBatch(List<PileReservedInfo> list);
|
||||
|
||||
int updateBatchSelective(List<PileReservedInfo> list);
|
||||
|
||||
int batchInsert(@Param("list") List<PileReservedInfo> list);
|
||||
|
||||
List<PileReservedInfo> findByMemberIdAndPileSnAndStatus(@Param("memberId") String memberId, @Param("pileSn") String pileSn, @Param("status") String status);
|
||||
|
||||
List<PileReservedInfo> findByMemberIdAndPileSn(@Param("memberId") String memberId, @Param("pileSn") String pileSn);
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.dto.PileReservedDTO;
|
||||
import com.jsowell.pile.domain.PileReservationInfo;
|
||||
|
||||
public interface PileReservationInfoService {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(PileReservationInfo record);
|
||||
|
||||
int insertOrUpdate(PileReservationInfo record);
|
||||
|
||||
int insertOrUpdateSelective(PileReservationInfo record);
|
||||
|
||||
int insertSelective(PileReservationInfo record);
|
||||
|
||||
PileReservationInfo selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(PileReservationInfo record);
|
||||
|
||||
int updateByPrimaryKey(PileReservationInfo record);
|
||||
|
||||
int updateBatch(List<PileReservationInfo> list);
|
||||
|
||||
int batchInsert(List<PileReservationInfo> list);
|
||||
|
||||
int updateBatchSelective(List<PileReservationInfo> list);
|
||||
|
||||
List<PileReservationInfo> getReservationsByMemberIdAndPileSn(String memberId, String pileSn);
|
||||
|
||||
/**
|
||||
* 启动预约
|
||||
* @param dto
|
||||
*/
|
||||
void activateReserved(PileReservedDTO dto);
|
||||
|
||||
/**
|
||||
* 关闭预约
|
||||
* @param dto
|
||||
*/
|
||||
void deactivateReserved(PileReservedDTO dto);
|
||||
|
||||
/**
|
||||
* 根据充电枪口编号发送预约指令
|
||||
* @param pileConnectorCode
|
||||
*/
|
||||
void pushReservedByPileConnectorCode(String pileConnectorCode);
|
||||
|
||||
/**
|
||||
* 拔枪时,根据充电桩枪口编号关闭仅一次的预约
|
||||
* @param pileConnectorCode
|
||||
*/
|
||||
void cancelOneTimeReservation(String pileConnectorCode);
|
||||
}
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.dto.PileReservedDTO;
|
||||
import com.jsowell.pile.domain.PileReservedInfo;
|
||||
|
||||
public interface PileReservedInfoService {
|
||||
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(PileReservedInfo record);
|
||||
|
||||
int insertOrUpdate(PileReservedInfo record);
|
||||
|
||||
int insertOrUpdateSelective(PileReservedInfo record);
|
||||
|
||||
int insertSelective(PileReservedInfo record);
|
||||
|
||||
PileReservedInfo selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(PileReservedInfo record);
|
||||
|
||||
int updateByPrimaryKey(PileReservedInfo record);
|
||||
|
||||
int updateBatch(List<PileReservedInfo> list);
|
||||
|
||||
int batchInsert(List<PileReservedInfo> list);
|
||||
|
||||
int updateBatchSelective(List<PileReservedInfo> list);
|
||||
|
||||
List<PileReservedInfo> getReservationsByMemberIdAndPileSn(String memberId, String pileSn);
|
||||
|
||||
/**
|
||||
* 启动预约
|
||||
* @param dto
|
||||
*/
|
||||
void activateReserved(PileReservedDTO dto);
|
||||
|
||||
/**
|
||||
* 关闭预约
|
||||
* @param dto
|
||||
*/
|
||||
void deactivateReserved(PileReservedDTO dto);
|
||||
|
||||
/**
|
||||
* 根据充电枪口编号发送预约指令
|
||||
* @param pileConnectorCode
|
||||
*/
|
||||
void pushReservedByPileConnectorCode(String pileConnectorCode);
|
||||
|
||||
void cancelOneTimeReservation(String pileConnectorCode);
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@ import com.jsowell.pile.dto.IndexQueryDTO;
|
||||
import com.jsowell.pile.dto.QueryPileDTO;
|
||||
import com.jsowell.pile.dto.ReplaceMerchantStationDTO;
|
||||
import com.jsowell.pile.mapper.PileBasicInfoMapper;
|
||||
import com.jsowell.pile.mapper.PileMerchantInfoMapper;
|
||||
import com.jsowell.pile.mapper.PileSimInfoMapper;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.thirdparty.ConnectorInfo;
|
||||
import com.jsowell.pile.thirdparty.EquipmentInfo;
|
||||
@@ -89,7 +87,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
private String BASE_URL_PREFIX;
|
||||
|
||||
@Autowired
|
||||
private PileReservedInfoService pileReservedInfoService;
|
||||
private PileReservationInfoService pileReservationInfoService;
|
||||
|
||||
/**
|
||||
* 查询设备管理
|
||||
@@ -465,7 +463,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
@Override
|
||||
public void firstPlugInCharger(String pileConnectorCode) {
|
||||
// 下发预约指令
|
||||
pileReservedInfoService.pushReservedByPileConnectorCode(pileConnectorCode);
|
||||
pileReservationInfoService.pushReservedByPileConnectorCode(pileConnectorCode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -476,7 +474,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
@Override
|
||||
public void firstUnplugCharger(String pileConnectorCode) {
|
||||
// 关闭仅执行一次的预约
|
||||
pileReservedInfoService.cancelOneTimeReservation(pileConnectorCode);
|
||||
pileReservationInfoService.cancelOneTimeReservation(pileConnectorCode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.dto.PileReservedDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.sql.Time;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.mapper.PileReservationInfoMapper;
|
||||
import com.jsowell.pile.domain.PileReservationInfo;
|
||||
import com.jsowell.pile.service.PileReservationInfoService;
|
||||
|
||||
@Service
|
||||
public class PileReservationInfoServiceImpl implements PileReservationInfoService {
|
||||
|
||||
@Resource
|
||||
private PileReservationInfoMapper pileReservationInfoMapper;
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
return pileReservationInfoMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(PileReservationInfo record) {
|
||||
return pileReservationInfoMapper.insert(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertOrUpdate(PileReservationInfo record) {
|
||||
return pileReservationInfoMapper.insertOrUpdate(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertOrUpdateSelective(PileReservationInfo record) {
|
||||
return pileReservationInfoMapper.insertOrUpdateSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertSelective(PileReservationInfo record) {
|
||||
return pileReservationInfoMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PileReservationInfo selectByPrimaryKey(Integer id) {
|
||||
return pileReservationInfoMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKeySelective(PileReservationInfo record) {
|
||||
return pileReservationInfoMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKey(PileReservationInfo record) {
|
||||
return pileReservationInfoMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBatch(List<PileReservationInfo> list) {
|
||||
return pileReservationInfoMapper.updateBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsert(List<PileReservationInfo> list) {
|
||||
return pileReservationInfoMapper.batchInsert(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBatchSelective(List<PileReservationInfo> list) {
|
||||
return pileReservationInfoMapper.updateBatchSelective(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PileReservationInfo> getReservationsByMemberIdAndPileSn(String memberId, String pileSn) {
|
||||
return pileReservationInfoMapper.findByMemberIdAndPileSn(memberId, pileSn);
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用预约
|
||||
*/
|
||||
@Override
|
||||
public void activateReserved(PileReservedDTO dto) {
|
||||
PileReservationInfo pileReservationInfo = pileReservationInfoMapper.selectByPrimaryKey(Integer.parseInt(dto.getReservedId()));
|
||||
if (pileReservationInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (!StringUtils.equals(dto.getMemberId(), pileReservationInfo.getMemberId())) {
|
||||
return;
|
||||
}
|
||||
pileReservationInfo.setStatus(Constants.ONE);
|
||||
// 保存之前,校验时间是否重叠
|
||||
saveReservation(pileReservationInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用预约
|
||||
*/
|
||||
@Override
|
||||
public void deactivateReserved(PileReservedDTO dto) {
|
||||
PileReservationInfo pileReservationInfo = pileReservationInfoMapper.selectByPrimaryKey(Integer.parseInt(dto.getReservedId()));
|
||||
if (pileReservationInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (!StringUtils.equals(dto.getMemberId(), pileReservationInfo.getMemberId())) {
|
||||
return;
|
||||
}
|
||||
// 校验通过可以修改预约
|
||||
pileReservationInfo.setStatus(Constants.ZERO);
|
||||
pileReservationInfoMapper.updateByPrimaryKeySelective(pileReservationInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验时间是否重叠
|
||||
* @param memberId
|
||||
* @param pileSn
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @param reservationId
|
||||
* @return
|
||||
*/
|
||||
public boolean isTimeSlotAvailable(String memberId, String pileSn, Time startTime, Time endTime, Integer reservationId) {
|
||||
List<PileReservationInfo> reservations = pileReservationInfoMapper.findByMemberIdAndPileSnAndStatus(memberId, pileSn, "1");
|
||||
LocalTime newStartTime = startTime.toLocalTime();
|
||||
LocalTime newEndTime = endTime.toLocalTime();
|
||||
|
||||
for (PileReservationInfo res : reservations) {
|
||||
if (res.getId().equals(reservationId)) {
|
||||
continue; // Skip the current reservation if updating
|
||||
}
|
||||
LocalTime existingStartTime = res.getStartTime().toLocalTime();
|
||||
LocalTime existingEndTime = res.getEndTime().toLocalTime();
|
||||
|
||||
if (newStartTime.isBefore(existingEndTime) && newEndTime.isAfter(existingStartTime)) {
|
||||
return false; // Time slot overlaps
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void saveReservation(PileReservationInfo reservation) {
|
||||
if (isTimeSlotAvailable(reservation.getMemberId(), reservation.getPileSn(), reservation.getStartTime(), reservation.getEndTime(), reservation.getId())) {
|
||||
this.updateByPrimaryKeySelective(reservation);
|
||||
} else {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_UPDATE_RESERVED_STATUS_REFUSED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据充电枪口编号发送指令
|
||||
* @param pileConnectorCode
|
||||
*/
|
||||
@Override
|
||||
public void pushReservedByPileConnectorCode(String pileConnectorCode) {
|
||||
// 根据充电枪口编号查询正在生效中的预约
|
||||
}
|
||||
|
||||
/**
|
||||
* 拔枪时,根据充电桩枪口编号关闭仅一次的预约
|
||||
* @param pileConnectorCode
|
||||
*/
|
||||
@Override
|
||||
public void cancelOneTimeReservation(String pileConnectorCode) {
|
||||
// 根据充电枪口编号查询仅一次正在生效中的预约
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.dto.PileReservedDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.sql.Time;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.mapper.PileReservedInfoMapper;
|
||||
import com.jsowell.pile.domain.PileReservedInfo;
|
||||
import com.jsowell.pile.service.PileReservedInfoService;
|
||||
|
||||
@Service
|
||||
public class PileReservedInfoServiceImpl implements PileReservedInfoService {
|
||||
|
||||
@Resource
|
||||
private PileReservedInfoMapper pileReservedInfoMapper;
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
return pileReservedInfoMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(PileReservedInfo record) {
|
||||
return pileReservedInfoMapper.insert(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertOrUpdate(PileReservedInfo record) {
|
||||
return pileReservedInfoMapper.insertOrUpdate(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertOrUpdateSelective(PileReservedInfo record) {
|
||||
return pileReservedInfoMapper.insertOrUpdateSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertSelective(PileReservedInfo record) {
|
||||
return pileReservedInfoMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PileReservedInfo selectByPrimaryKey(Integer id) {
|
||||
return pileReservedInfoMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKeySelective(PileReservedInfo record) {
|
||||
return pileReservedInfoMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKey(PileReservedInfo record) {
|
||||
return pileReservedInfoMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBatch(List<PileReservedInfo> list) {
|
||||
return pileReservedInfoMapper.updateBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsert(List<PileReservedInfo> list) {
|
||||
return pileReservedInfoMapper.batchInsert(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBatchSelective(List<PileReservedInfo> list) {
|
||||
return pileReservedInfoMapper.updateBatchSelective(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PileReservedInfo> getReservationsByMemberIdAndPileSn(String memberId, String pileSn) {
|
||||
return pileReservedInfoMapper.findByMemberIdAndPileSn(memberId, pileSn);
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用预约
|
||||
*/
|
||||
@Override
|
||||
public void activateReserved(PileReservedDTO dto) {
|
||||
PileReservedInfo pileReservedInfo = pileReservedInfoMapper.selectByPrimaryKey(Integer.parseInt(dto.getReservedId()));
|
||||
if (pileReservedInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (!StringUtils.equals(dto.getMemberId(), pileReservedInfo.getMemberId())) {
|
||||
return;
|
||||
}
|
||||
pileReservedInfo.setStatus(Constants.ONE);
|
||||
// 保存之前,校验时间是否重叠
|
||||
saveReservation(pileReservedInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用预约
|
||||
*/
|
||||
@Override
|
||||
public void deactivateReserved(PileReservedDTO dto) {
|
||||
PileReservedInfo pileReservedInfo = pileReservedInfoMapper.selectByPrimaryKey(Integer.parseInt(dto.getReservedId()));
|
||||
if (pileReservedInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (!StringUtils.equals(dto.getMemberId(), pileReservedInfo.getMemberId())) {
|
||||
return;
|
||||
}
|
||||
// 校验通过可以修改预约
|
||||
pileReservedInfo.setStatus(Constants.ZERO);
|
||||
pileReservedInfoMapper.updateByPrimaryKeySelective(pileReservedInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验时间是否重叠
|
||||
* @param memberId
|
||||
* @param pileSn
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @param reservationId
|
||||
* @return
|
||||
*/
|
||||
public boolean isTimeSlotAvailable(String memberId, String pileSn, Time startTime, Time endTime, Integer reservationId) {
|
||||
List<PileReservedInfo> reservations = pileReservedInfoMapper.findByMemberIdAndPileSnAndStatus(memberId, pileSn, "1");
|
||||
LocalTime newStartTime = startTime.toLocalTime();
|
||||
LocalTime newEndTime = endTime.toLocalTime();
|
||||
|
||||
for (PileReservedInfo res : reservations) {
|
||||
if (res.getId().equals(reservationId)) {
|
||||
continue; // Skip the current reservation if updating
|
||||
}
|
||||
LocalTime existingStartTime = res.getStartTime().toLocalTime();
|
||||
LocalTime existingEndTime = res.getEndTime().toLocalTime();
|
||||
|
||||
if (newStartTime.isBefore(existingEndTime) && newEndTime.isAfter(existingStartTime)) {
|
||||
return false; // Time slot overlaps
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void saveReservation(PileReservedInfo reservation) {
|
||||
if (isTimeSlotAvailable(reservation.getMemberId(), reservation.getPileSn(), reservation.getStartTime(), reservation.getEndTime(), reservation.getId())) {
|
||||
this.updateByPrimaryKeySelective(reservation);
|
||||
} else {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_UPDATE_RESERVED_STATUS_REFUSED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据充电枪口编号发送指令
|
||||
* @param pileConnectorCode
|
||||
*/
|
||||
@Override
|
||||
public void pushReservedByPileConnectorCode(String pileConnectorCode) {
|
||||
// 根据充电枪口编号查询正在生效中的预约
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?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.jsowell.pile.mapper.PileReservedInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.PileReservedInfo">
|
||||
<mapper namespace="com.jsowell.pile.mapper.PileReservationInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.PileReservationInfo">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table pile_reserved_info-->
|
||||
<!--@Table pile_reservation_info-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
|
||||
<result column="pile_sn" jdbcType="VARCHAR" property="pileSn" />
|
||||
@@ -28,17 +28,17 @@
|
||||
<!--@mbg.generated-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from pile_reserved_info
|
||||
from pile_reservation_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<!--@mbg.generated-->
|
||||
delete from pile_reserved_info
|
||||
delete from pile_reservation_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileReservedInfo" useGeneratedKeys="true">
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileReservationInfo" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into pile_reserved_info (member_id, pile_sn, pile_connector_code,
|
||||
insert into pile_reservation_info (member_id, pile_sn, pile_connector_code,
|
||||
`status`, reserved_type, start_time,
|
||||
end_time, freq, create_by,
|
||||
create_time, update_by, update_time,
|
||||
@@ -49,9 +49,9 @@
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
||||
#{delFlag,jdbcType=CHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileReservedInfo" useGeneratedKeys="true">
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileReservationInfo" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into pile_reserved_info
|
||||
insert into pile_reservation_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">
|
||||
member_id,
|
||||
@@ -135,9 +135,9 @@
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.PileReservedInfo">
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.PileReservationInfo">
|
||||
<!--@mbg.generated-->
|
||||
update pile_reserved_info
|
||||
update pile_reservation_info
|
||||
<set>
|
||||
<if test="memberId != null">
|
||||
member_id = #{memberId,jdbcType=VARCHAR},
|
||||
@@ -181,9 +181,9 @@
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.PileReservedInfo">
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.PileReservationInfo">
|
||||
<!--@mbg.generated-->
|
||||
update pile_reserved_info
|
||||
update pile_reservation_info
|
||||
set member_id = #{memberId,jdbcType=VARCHAR},
|
||||
pile_sn = #{pileSn,jdbcType=VARCHAR},
|
||||
pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR},
|
||||
@@ -201,7 +201,7 @@
|
||||
</update>
|
||||
<update id="updateBatch" parameterType="java.util.List">
|
||||
<!--@mbg.generated-->
|
||||
update pile_reserved_info
|
||||
update pile_reservation_info
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="member_id = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
@@ -276,7 +276,7 @@
|
||||
</update>
|
||||
<update id="updateBatchSelective" parameterType="java.util.List">
|
||||
<!--@mbg.generated-->
|
||||
update pile_reserved_info
|
||||
update pile_reservation_info
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="member_id = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
@@ -377,7 +377,7 @@
|
||||
</update>
|
||||
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into pile_reserved_info
|
||||
insert into pile_reservation_info
|
||||
(member_id, pile_sn, pile_connector_code, `status`, reserved_type, start_time, end_time,
|
||||
freq, create_by, create_time, update_by, update_time, del_flag)
|
||||
values
|
||||
@@ -389,9 +389,9 @@
|
||||
#{item.delFlag,jdbcType=CHAR})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileReservedInfo" useGeneratedKeys="true">
|
||||
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileReservationInfo" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into pile_reserved_info
|
||||
insert into pile_reservation_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
@@ -449,9 +449,9 @@
|
||||
del_flag = #{delFlag,jdbcType=CHAR},
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileReservedInfo" useGeneratedKeys="true">
|
||||
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileReservationInfo" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into pile_reserved_info
|
||||
insert into pile_reservation_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
@@ -591,7 +591,7 @@
|
||||
<select id="findByMemberIdAndPileSnAndStatus" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from pile_reserved_info
|
||||
from pile_reservation_info
|
||||
where del_flag = '0'
|
||||
and member_id = #{memberId,jdbcType=VARCHAR}
|
||||
and pile_sn = #{pileSn,jdbcType=VARCHAR}
|
||||
@@ -601,7 +601,7 @@
|
||||
<select id="findByMemberIdAndPileSn" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from pile_reserved_info
|
||||
from pile_reservation_info
|
||||
where del_flag = '0'
|
||||
and member_id = #{memberId,jdbcType=VARCHAR}
|
||||
and pile_sn = #{pileSn,jdbcType=VARCHAR}
|
||||
Reference in New Issue
Block a user