This commit is contained in:
Lemon
2024-11-25 11:15:22 +08:00
13 changed files with 313 additions and 110 deletions

View File

@@ -4,14 +4,12 @@ import com.alibaba.fastjson2.JSON;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.jsowell.common.UserAgentUtils; import com.jsowell.common.UserAgentUtils;
import com.jsowell.common.annotation.Anonymous; import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.controller.BaseController; import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.page.PageResponse; import com.jsowell.common.core.page.PageResponse;
import com.jsowell.common.enums.ykc.ReturnCodeEnum; import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException; import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse; import com.jsowell.common.response.RestApiResponse;
import com.jsowell.common.util.StringUtils; import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.PileFirmwareInfo;
import com.jsowell.pile.dto.*; import com.jsowell.pile.dto.*;
import com.jsowell.pile.service.PileBasicInfoService; import com.jsowell.pile.service.PileBasicInfoService;
import com.jsowell.pile.service.PileFirmwareInfoService; import com.jsowell.pile.service.PileFirmwareInfoService;
@@ -97,7 +95,7 @@ public class PersonPileController extends BaseController {
*/ */
@RequestMapping("/pileMemberBindingForBT") @RequestMapping("/pileMemberBindingForBT")
public RestApiResponse<?> pileMemberBindingForBT(HttpServletRequest request, @RequestBody PileMemberBindingDTO dto) { public RestApiResponse<?> pileMemberBindingForBT(HttpServletRequest request, @RequestBody PileMemberBindingDTO dto) {
logger.info("绑定个人桩信息(蓝牙) params:{}", JSON.toJSONString(dto)); // logger.info("绑定个人桩信息(蓝牙) params:{}", JSON.toJSONString(dto));
RestApiResponse<?> response = null; RestApiResponse<?> response = null;
try { try {
String memberId = getMemberIdByAuthorization(request); String memberId = getMemberIdByAuthorization(request);
@@ -111,7 +109,7 @@ public class PersonPileController extends BaseController {
logger.error("绑定个人桩信息(蓝牙) error,", exception); logger.error("绑定个人桩信息(蓝牙) error,", exception);
response = new RestApiResponse<>(ReturnCodeEnum.CODE_BINDING_PERSONAL_PILE_ERROR); response = new RestApiResponse<>(ReturnCodeEnum.CODE_BINDING_PERSONAL_PILE_ERROR);
} }
logger.info("绑定个人桩信息(蓝牙) result:{}", response); logger.info("绑定个人桩信息(蓝牙), params:{}, result:{}", JSON.toJSONString(dto), JSON.toJSONString(response));
return response; return response;
} }

View File

@@ -1474,17 +1474,29 @@ public class OrderService {
// record.setReservationEndTime(DateUtils.parseDate(dto.getReservationEndTime())); // record.setReservationEndTime(DateUtils.parseDate(dto.getReservationEndTime()));
// record.setStartSoc(dto.getst()); // record.setStartSoc(dto.getst());
// record.setEndSoc(dto.getEndSoc()); // record.setEndSoc(dto.getEndSoc());
record.setTotalUsedElectricity(new BigDecimal(dto.getTotalEnergy())); record.setAmmeterTotalStart(dto.getStartKwh());
record.setSharpUsedElectricity(new BigDecimal(dto.getEnergySharp())); record.setAmmeterTotalEnd(dto.getStopKwh());
record.setPeakUsedElectricity(new BigDecimal(dto.getEnergyPeak())); record.setTotalUsedElectricity(StringUtils.isNotBlank(dto.getTotalEnergy()) ? new BigDecimal(dto.getTotalEnergy()) : BigDecimal.ZERO);
record.setFlatUsedElectricity(new BigDecimal(dto.getEnergyFlat())); record.setSharpUsedElectricity(StringUtils.isNotBlank(dto.getEnergySharp()) ? new BigDecimal(dto.getEnergySharp()) : BigDecimal.ZERO);
record.setValleyUsedElectricity(new BigDecimal(dto.getEnergyValley())); record.setPeakUsedElectricity(StringUtils.isNotBlank(dto.getEnergyPeak()) ? new BigDecimal(dto.getEnergyPeak()) : BigDecimal.ZERO);
record.setReason(dto.getStopReason()); record.setFlatUsedElectricity(StringUtils.isNotBlank(dto.getEnergyFlat()) ? new BigDecimal(dto.getEnergyFlat()) : BigDecimal.ZERO);
record.setValleyUsedElectricity(StringUtils.isNotBlank(dto.getEnergyValley()) ? new BigDecimal(dto.getEnergyValley()) : BigDecimal.ZERO);
if (StringUtils.isNotBlank(dto.getStopReason())) {
int i = Integer.parseInt(dto.getStopReason(), 16);
String stopReasonMsg = YKCChargingStopReasonEnum.getMsgByCode(i);
record.setReason(stopReasonMsg);
}
record.setTradeDate(DateUtils.parseDate(dto.getTradeTime()));
record.setSourceType("BT");
record.setCreateBy(dto.getMemberId()); record.setCreateBy(dto.getMemberId());
record.setCreateTime(new Date()); record.setCreateTime(new Date());
// record.setUpdateBy(dto.getUpdateBy()); // record.setUpdateBy(dto.getUpdateBy());
// record.setUpdateTime(new Date()); // record.setUpdateTime(new Date());
record.setDelFlag(DelFlagEnum.NORMAL.getValue()); record.setDelFlag(DelFlagEnum.NORMAL.getValue());
personalChargingRecordService.insertSelective(record); personalChargingRecordService.insertOrUpdateSelective(record);
}
public static void main(String[] args) {
} }
} }

View File

@@ -641,14 +641,16 @@ public class PileService {
PersonPileConnectorSumInfoVO vo; PersonPileConnectorSumInfoVO vo;
for (PersonalChargingRecord personalChargingRecord : pageInfo.getList()) { for (PersonalChargingRecord personalChargingRecord : pageInfo.getList()) {
vo = new PersonPileConnectorSumInfoVO(); vo = new PersonPileConnectorSumInfoVO();
vo.setSourceType(personalChargingRecord.getSourceType());
if (personalChargingRecord.getChargeStartTime() != null && personalChargingRecord.getChargeEndTime() != null){ if (personalChargingRecord.getChargeStartTime() != null && personalChargingRecord.getChargeEndTime() != null){
vo.setChargeStartTime(DateUtils.dateTime(personalChargingRecord.getChargeStartTime())); vo.setChargeStartTime(DateUtils.formatDateTime(personalChargingRecord.getChargeStartTime()));
vo.setChargeEndTime(DateUtils.dateTime(personalChargingRecord.getChargeEndTime())); vo.setChargeEndTime(DateUtils.formatDateTime(personalChargingRecord.getChargeEndTime()));
String datePoor = DateUtils.getDatePoor(personalChargingRecord.getChargeEndTime(), personalChargingRecord.getChargeStartTime()); String datePoor = DateUtils.getDatePoor(personalChargingRecord.getChargeEndTime(), personalChargingRecord.getChargeStartTime());
vo.setSumChargingTime(datePoor); vo.setSumChargingTime(datePoor);
} }
vo.setMemberId(personalChargingRecord.getMemberId()); vo.setMemberId(personalChargingRecord.getMemberId());
vo.setSumChargingDegree(personalChargingRecord.getTotalUsedElectricity().toString()); vo.setSumChargingDegree(personalChargingRecord.getTotalUsedElectricity().toString());
vo.setStopReasonMsg(personalChargingRecord.getReason());
list.add(vo); list.add(vo);
} }
return PageResponse.builder() return PageResponse.builder()

View File

@@ -115,7 +115,6 @@ public enum YKCChargingStopReasonEnum {
; ;
private int code; private int code;
private String msg; private String msg;

View File

@@ -57,7 +57,7 @@ public class YKCBusinessServiceImpl implements YKCBusinessService {
if (StringUtils.isBlank(pileSn)) { if (StringUtils.isBlank(pileSn)) {
return; return;
} }
log.info("充电桩退出:{}, channelId:{}", pileSn, PileChannelEntity.getChannelByPileSn(pileSn).channel().id()); log.info("充电桩退出:{}, 类型:主动断开链接, channelId:{}", pileSn, PileChannelEntity.getChannelByPileSn(pileSn).channel().id());
// 充电桩断开连接,所有枪口都设置为【离线】 // 充电桩断开连接,所有枪口都设置为【离线】
pileConnectorInfoService.updateConnectorStatusByPileSn(pileSn, PileConnectorDataBaseStatusEnum.OFF_NETWORK.getValue()); pileConnectorInfoService.updateConnectorStatusByPileSn(pileSn, PileConnectorDataBaseStatusEnum.OFF_NETWORK.getValue());
@@ -68,7 +68,7 @@ public class YKCBusinessServiceImpl implements YKCBusinessService {
// 记录充电桩退出msg // 记录充电桩退出msg
// 保存报文 // 保存报文
String type = YKCFrameTypeCode.PILE_LOG_OUT.getCode() + ""; String type = YKCFrameTypeCode.PILE_LOG_OUT.getCode() + "";
String jsonMsg = YKCFrameTypeCode.PILE_LOG_OUT.getValue(); String jsonMsg = YKCFrameTypeCode.PILE_LOG_OUT.getValue() + ": 充电桩主动断开链接";
pileMsgRecordService.save(pileSn, pileSn, type, jsonMsg, ""); pileMsgRecordService.save(pileSn, pileSn, type, jsonMsg, "");
// 删除桩编号和channel的关系 // 删除桩编号和channel的关系

View File

@@ -1,7 +1,5 @@
package com.jsowell.pile.domain; package com.jsowell.pile.domain;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
@@ -9,6 +7,9 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import java.math.BigDecimal;
import java.util.Date;
/** /**
* 个人充电桩的充电记录 * 个人充电桩的充电记录
*/ */
@@ -119,6 +120,16 @@ public class PersonalChargingRecord {
*/ */
private String endSoc; private String endSoc;
/**
* 电表总起值
*/
private String ammeterTotalStart;
/**
* 电表总止值
*/
private String ammeterTotalEnd;
/** /**
* 总用电量 * 总用电量
*/ */
@@ -149,6 +160,16 @@ public class PersonalChargingRecord {
*/ */
private String reason; private String reason;
/**
* 交易日期
*/
private Date tradeDate;
/**
* 来源(4G/BT)
*/
private String sourceType;
/** /**
* 创建人 * 创建人
*/ */

View File

@@ -97,7 +97,6 @@ public class BluetoothChargingRecordDTO {
@JsonProperty(value = "MoneyValley") @JsonProperty(value = "MoneyValley")
private String moneyValley; private String moneyValley;
// 电表总起值 // 电表总起值
@JsonProperty(value = "StartKwh") @JsonProperty(value = "StartKwh")
private String startKwh; private String startKwh;

View File

@@ -8,7 +8,6 @@ import com.jsowell.pile.dto.QueryPersonPileDTO;
import java.util.List; import java.util.List;
public interface PersonalChargingRecordService{ public interface PersonalChargingRecordService{
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
int insert(PersonalChargingRecord record); int insert(PersonalChargingRecord record);

View File

@@ -132,7 +132,7 @@ public class PersonalChargingRecordServiceImpl implements PersonalChargingRecord
chargingRecord.setTotalUsedElectricity(totalUsedElectricity); chargingRecord.setTotalUsedElectricity(totalUsedElectricity);
chargingRecord.setReason(data.getStopReasonMsg()); chargingRecord.setReason(data.getStopReasonMsg());
// 创建或更新 // 创建或更新
personalChargingRecordMapper.insertOrUpdateSelective(chargingRecord); this.insertOrUpdateSelective(chargingRecord);
} }
/** /**
@@ -176,7 +176,7 @@ public class PersonalChargingRecordServiceImpl implements PersonalChargingRecord
// chargingRecord.setTotalUsedElectricity(totalUsedElectricity); // chargingRecord.setTotalUsedElectricity(totalUsedElectricity);
// chargingRecord.setReason(data.getStopReasonMsg()); // chargingRecord.setReason(data.getStopReasonMsg());
// 创建或更新 // 创建或更新
personalChargingRecordMapper.insertOrUpdateSelective(chargingRecord); this.insertOrUpdateSelective(chargingRecord);
} }
@Override @Override

View File

@@ -12,6 +12,7 @@ import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants; import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.ykc.GroundLockData; import com.jsowell.common.core.domain.ykc.GroundLockData;
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData; import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
import com.jsowell.common.core.page.PageResponse; import com.jsowell.common.core.page.PageResponse;
import com.jsowell.common.core.redis.RedisCache; import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum; import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
@@ -82,6 +83,9 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
@Autowired @Autowired
private ThirdPartyStationRelationService thirdPartyStationRelationService; private ThirdPartyStationRelationService thirdPartyStationRelationService;
@Autowired
private PileMsgRecordService pileMsgRecordService;
@Autowired @Autowired
private PileStationInfoService pileStationInfoService; private PileStationInfoService pileStationInfoService;
@@ -863,14 +867,25 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
*/ */
@Override @Override
public boolean checkPileOffLine(String pileSn) { public boolean checkPileOffLine(String pileSn) {
boolean flag = false;
// 获取桩最后连接时间最后连接到平台的时间在3分钟之前判定为离线 // 获取桩最后连接时间最后连接到平台的时间在3分钟之前判定为离线
String lastConnectionTime = redisCache.getCacheObject(CacheConstants.PILE_LAST_CONNECTION + pileSn); String lastConnectionTime = redisCache.getCacheObject(CacheConstants.PILE_LAST_CONNECTION + pileSn);
if (StringUtils.isBlank(lastConnectionTime)) { if (StringUtils.isBlank(lastConnectionTime)) {
// 没有最后连接时间,返回离线 // 没有最后连接时间,返回离线
return true; flag = true;
} } else {
long l = DateUtils.intervalTime(lastConnectionTime, DateUtils.getDateTime()); long l = DateUtils.intervalTime(lastConnectionTime, DateUtils.getDateTime());
return l > 3L; if (l > 3L) {
// 超过3分钟返回离线
flag = true;
}
}
if (flag) {
String type = YKCFrameTypeCode.PILE_LOG_OUT.getCode() + "";
String jsonMsg = YKCFrameTypeCode.PILE_LOG_OUT.getValue() + ": 超过3分钟无通信, 判断离线!";
pileMsgRecordService.save(pileSn, pileSn, type, jsonMsg, "");
}
return flag;
} }
/** /**

View File

@@ -225,12 +225,16 @@ public class PileMsgRecordServiceImpl implements PileMsgRecordService {
// 枪口编号 // 枪口编号
String pileConnectorCode = jsonObject.getString("pileSn") + jsonObject.getString("connectorCode"); String pileConnectorCode = jsonObject.getString("pileSn") + jsonObject.getString("connectorCode");
String stopReason = jsonObject.getString("stopReasonMsg");
return "订单号:" + orderCode + ", " + return "订单号:" + orderCode + ", " +
"交易流水号:" + transactionCode + ", " + "交易流水号:" + transactionCode + ", " +
"枪口编号:" + pileConnectorCode + ", " + "枪口编号:" + pileConnectorCode + ", " +
"充电度数:" + totalElectricity + ", " + "充电度数:" + totalElectricity + ", " +
"消费金额:" + consumptionAmount + ", " + "消费金额:" + consumptionAmount + ", " +
"开始时间:" + startTime + ", " + "开始时间:" + startTime + ", " +
"结束时间:" + endTime; "结束时间:" + endTime + ", " +
"停止原因:" + stopReason
;
} }
} }

View File

@@ -41,4 +41,14 @@ public class PersonPileConnectorSumInfoVO {
* 累计充电时长 * 累计充电时长
*/ */
private String sumChargingTime; private String sumChargingTime;
/**
* 来源(4G/BT) sourceType
*/
private String sourceType;
/**
* 停止原因
*/
private String stopReasonMsg;
} }

View File

@@ -24,12 +24,16 @@
<result column="reservation_end_time" jdbcType="TIMESTAMP" property="reservationEndTime" /> <result column="reservation_end_time" jdbcType="TIMESTAMP" property="reservationEndTime" />
<result column="start_soc" jdbcType="VARCHAR" property="startSoc" /> <result column="start_soc" jdbcType="VARCHAR" property="startSoc" />
<result column="end_soc" jdbcType="VARCHAR" property="endSoc" /> <result column="end_soc" jdbcType="VARCHAR" property="endSoc" />
<result column="ammeter_total_start" jdbcType="VARCHAR" property="ammeterTotalStart" />
<result column="ammeter_total_end" jdbcType="VARCHAR" property="ammeterTotalEnd" />
<result column="total_used_electricity" jdbcType="DECIMAL" property="totalUsedElectricity" /> <result column="total_used_electricity" jdbcType="DECIMAL" property="totalUsedElectricity" />
<result column="sharp_used_electricity" jdbcType="DECIMAL" property="sharpUsedElectricity" /> <result column="sharp_used_electricity" jdbcType="DECIMAL" property="sharpUsedElectricity" />
<result column="peak_used_electricity" jdbcType="DECIMAL" property="peakUsedElectricity" /> <result column="peak_used_electricity" jdbcType="DECIMAL" property="peakUsedElectricity" />
<result column="flat_used_electricity" jdbcType="DECIMAL" property="flatUsedElectricity" /> <result column="flat_used_electricity" jdbcType="DECIMAL" property="flatUsedElectricity" />
<result column="valley_used_electricity" jdbcType="DECIMAL" property="valleyUsedElectricity" /> <result column="valley_used_electricity" jdbcType="DECIMAL" property="valleyUsedElectricity" />
<result column="reason" jdbcType="VARCHAR" property="reason" /> <result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="trade_date" jdbcType="TIMESTAMP" property="tradeDate" />
<result column="source_type" jdbcType="VARCHAR" property="sourceType" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> <result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
@@ -41,9 +45,9 @@
id, transaction_code, `status`, member_id, station_id, merchant_id, pile_sn, connector_code, id, transaction_code, `status`, member_id, station_id, merchant_id, pile_sn, connector_code,
pile_connector_code, logic_card, vin_code, start_mode, plate_number, charge_start_time, pile_connector_code, logic_card, vin_code, start_mode, plate_number, charge_start_time,
charge_end_time, start_type, reservation_start_time, reservation_end_time, start_soc, charge_end_time, start_type, reservation_start_time, reservation_end_time, start_soc,
end_soc, total_used_electricity, sharp_used_electricity, peak_used_electricity, flat_used_electricity, end_soc, ammeter_total_start, ammeter_total_end, total_used_electricity, sharp_used_electricity,
valley_used_electricity, reason, create_by, create_time, update_by, update_time, peak_used_electricity, flat_used_electricity, valley_used_electricity, reason, trade_date,
del_flag source_type, create_by, create_time, update_by, update_time, del_flag
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated--> <!--@mbg.generated-->
@@ -65,24 +69,26 @@
vin_code, start_mode, plate_number, vin_code, start_mode, plate_number,
charge_start_time, charge_end_time, start_type, charge_start_time, charge_end_time, start_type,
reservation_start_time, reservation_end_time, reservation_start_time, reservation_end_time,
start_soc, end_soc, total_used_electricity, start_soc, end_soc, ammeter_total_start,
ammeter_total_end, total_used_electricity,
sharp_used_electricity, peak_used_electricity, sharp_used_electricity, peak_used_electricity,
flat_used_electricity, valley_used_electricity, flat_used_electricity, valley_used_electricity,
reason, create_by, create_time, reason, trade_date, source_type,
update_by, update_time, del_flag create_by, create_time, update_by,
) update_time, del_flag)
values (#{transactionCode,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR}, values (#{transactionCode,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR},
#{stationId,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{pileSn,jdbcType=VARCHAR}, #{stationId,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{pileSn,jdbcType=VARCHAR},
#{connectorCode,jdbcType=VARCHAR}, #{pileConnectorCode,jdbcType=VARCHAR}, #{logicCard,jdbcType=VARCHAR}, #{connectorCode,jdbcType=VARCHAR}, #{pileConnectorCode,jdbcType=VARCHAR}, #{logicCard,jdbcType=VARCHAR},
#{vinCode,jdbcType=VARCHAR}, #{startMode,jdbcType=VARCHAR}, #{plateNumber,jdbcType=VARCHAR}, #{vinCode,jdbcType=VARCHAR}, #{startMode,jdbcType=VARCHAR}, #{plateNumber,jdbcType=VARCHAR},
#{chargeStartTime,jdbcType=TIMESTAMP}, #{chargeEndTime,jdbcType=TIMESTAMP}, #{startType,jdbcType=VARCHAR}, #{chargeStartTime,jdbcType=TIMESTAMP}, #{chargeEndTime,jdbcType=TIMESTAMP}, #{startType,jdbcType=VARCHAR},
#{reservationStartTime,jdbcType=TIMESTAMP}, #{reservationEndTime,jdbcType=TIMESTAMP}, #{reservationStartTime,jdbcType=TIMESTAMP}, #{reservationEndTime,jdbcType=TIMESTAMP},
#{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR}, #{totalUsedElectricity,jdbcType=DECIMAL}, #{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR}, #{ammeterTotalStart,jdbcType=VARCHAR},
#{ammeterTotalEnd,jdbcType=VARCHAR}, #{totalUsedElectricity,jdbcType=DECIMAL},
#{sharpUsedElectricity,jdbcType=DECIMAL}, #{peakUsedElectricity,jdbcType=DECIMAL}, #{sharpUsedElectricity,jdbcType=DECIMAL}, #{peakUsedElectricity,jdbcType=DECIMAL},
#{flatUsedElectricity,jdbcType=DECIMAL}, #{valleyUsedElectricity,jdbcType=DECIMAL}, #{flatUsedElectricity,jdbcType=DECIMAL}, #{valleyUsedElectricity,jdbcType=DECIMAL},
#{reason,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{reason,jdbcType=VARCHAR}, #{tradeDate,jdbcType=TIMESTAMP}, #{sourceType,jdbcType=VARCHAR},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR} #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
) #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR})
</insert> </insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PersonalChargingRecord" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PersonalChargingRecord" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
@@ -145,6 +151,12 @@
<if test="endSoc != null"> <if test="endSoc != null">
end_soc, end_soc,
</if> </if>
<if test="ammeterTotalStart != null">
ammeter_total_start,
</if>
<if test="ammeterTotalEnd != null">
ammeter_total_end,
</if>
<if test="totalUsedElectricity != null"> <if test="totalUsedElectricity != null">
total_used_electricity, total_used_electricity,
</if> </if>
@@ -163,6 +175,12 @@
<if test="reason != null"> <if test="reason != null">
reason, reason,
</if> </if>
<if test="tradeDate != null">
trade_date,
</if>
<if test="sourceType != null">
source_type,
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by, create_by,
</if> </if>
@@ -237,6 +255,12 @@
<if test="endSoc != null"> <if test="endSoc != null">
#{endSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR},
</if> </if>
<if test="ammeterTotalStart != null">
#{ammeterTotalStart,jdbcType=VARCHAR},
</if>
<if test="ammeterTotalEnd != null">
#{ammeterTotalEnd,jdbcType=VARCHAR},
</if>
<if test="totalUsedElectricity != null"> <if test="totalUsedElectricity != null">
#{totalUsedElectricity,jdbcType=DECIMAL}, #{totalUsedElectricity,jdbcType=DECIMAL},
</if> </if>
@@ -255,6 +279,12 @@
<if test="reason != null"> <if test="reason != null">
#{reason,jdbcType=VARCHAR}, #{reason,jdbcType=VARCHAR},
</if> </if>
<if test="tradeDate != null">
#{tradeDate,jdbcType=TIMESTAMP},
</if>
<if test="sourceType != null">
#{sourceType,jdbcType=VARCHAR},
</if>
<if test="createBy != null"> <if test="createBy != null">
#{createBy,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
</if> </if>
@@ -333,6 +363,12 @@
<if test="endSoc != null"> <if test="endSoc != null">
end_soc = #{endSoc,jdbcType=VARCHAR}, end_soc = #{endSoc,jdbcType=VARCHAR},
</if> </if>
<if test="ammeterTotalStart != null">
ammeter_total_start = #{ammeterTotalStart,jdbcType=VARCHAR},
</if>
<if test="ammeterTotalEnd != null">
ammeter_total_end = #{ammeterTotalEnd,jdbcType=VARCHAR},
</if>
<if test="totalUsedElectricity != null"> <if test="totalUsedElectricity != null">
total_used_electricity = #{totalUsedElectricity,jdbcType=DECIMAL}, total_used_electricity = #{totalUsedElectricity,jdbcType=DECIMAL},
</if> </if>
@@ -351,6 +387,12 @@
<if test="reason != null"> <if test="reason != null">
reason = #{reason,jdbcType=VARCHAR}, reason = #{reason,jdbcType=VARCHAR},
</if> </if>
<if test="tradeDate != null">
trade_date = #{tradeDate,jdbcType=TIMESTAMP},
</if>
<if test="sourceType != null">
source_type = #{sourceType,jdbcType=VARCHAR},
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
</if> </if>
@@ -391,12 +433,16 @@
reservation_end_time = #{reservationEndTime,jdbcType=TIMESTAMP}, reservation_end_time = #{reservationEndTime,jdbcType=TIMESTAMP},
start_soc = #{startSoc,jdbcType=VARCHAR}, start_soc = #{startSoc,jdbcType=VARCHAR},
end_soc = #{endSoc,jdbcType=VARCHAR}, end_soc = #{endSoc,jdbcType=VARCHAR},
ammeter_total_start = #{ammeterTotalStart,jdbcType=VARCHAR},
ammeter_total_end = #{ammeterTotalEnd,jdbcType=VARCHAR},
total_used_electricity = #{totalUsedElectricity,jdbcType=DECIMAL}, total_used_electricity = #{totalUsedElectricity,jdbcType=DECIMAL},
sharp_used_electricity = #{sharpUsedElectricity,jdbcType=DECIMAL}, sharp_used_electricity = #{sharpUsedElectricity,jdbcType=DECIMAL},
peak_used_electricity = #{peakUsedElectricity,jdbcType=DECIMAL}, peak_used_electricity = #{peakUsedElectricity,jdbcType=DECIMAL},
flat_used_electricity = #{flatUsedElectricity,jdbcType=DECIMAL}, flat_used_electricity = #{flatUsedElectricity,jdbcType=DECIMAL},
valley_used_electricity = #{valleyUsedElectricity,jdbcType=DECIMAL}, valley_used_electricity = #{valleyUsedElectricity,jdbcType=DECIMAL},
reason = #{reason,jdbcType=VARCHAR}, reason = #{reason,jdbcType=VARCHAR},
trade_date = #{tradeDate,jdbcType=TIMESTAMP},
source_type = #{sourceType,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
@@ -503,6 +549,16 @@
when id = #{item.id,jdbcType=INTEGER} then #{item.endSoc,jdbcType=VARCHAR} when id = #{item.id,jdbcType=INTEGER} then #{item.endSoc,jdbcType=VARCHAR}
</foreach> </foreach>
</trim> </trim>
<trim prefix="ammeter_total_start = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.ammeterTotalStart,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="ammeter_total_end = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.ammeterTotalEnd,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="total_used_electricity = case" suffix="end,"> <trim prefix="total_used_electricity = case" suffix="end,">
<foreach collection="list" index="index" item="item"> <foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.totalUsedElectricity,jdbcType=DECIMAL} when id = #{item.id,jdbcType=INTEGER} then #{item.totalUsedElectricity,jdbcType=DECIMAL}
@@ -533,6 +589,16 @@
when id = #{item.id,jdbcType=INTEGER} then #{item.reason,jdbcType=VARCHAR} when id = #{item.id,jdbcType=INTEGER} then #{item.reason,jdbcType=VARCHAR}
</foreach> </foreach>
</trim> </trim>
<trim prefix="trade_date = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeDate,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="source_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.sourceType,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,"> <trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item"> <foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR} when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
@@ -701,6 +767,20 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="ammeter_total_start = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.ammeterTotalStart != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.ammeterTotalStart,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="ammeter_total_end = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.ammeterTotalEnd != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.ammeterTotalEnd,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="total_used_electricity = case" suffix="end,"> <trim prefix="total_used_electricity = case" suffix="end,">
<foreach collection="list" index="index" item="item"> <foreach collection="list" index="index" item="item">
<if test="item.totalUsedElectricity != null"> <if test="item.totalUsedElectricity != null">
@@ -743,6 +823,20 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="trade_date = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.tradeDate != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeDate,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="source_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.sourceType != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.sourceType,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,"> <trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item"> <foreach collection="list" index="index" item="item">
<if test="item.createBy != null"> <if test="item.createBy != null">
@@ -790,9 +884,10 @@
(transaction_code, `status`, member_id, station_id, merchant_id, pile_sn, connector_code, (transaction_code, `status`, member_id, station_id, merchant_id, pile_sn, connector_code,
pile_connector_code, logic_card, vin_code, start_mode, plate_number, charge_start_time, pile_connector_code, logic_card, vin_code, start_mode, plate_number, charge_start_time,
charge_end_time, start_type, reservation_start_time, reservation_end_time, start_soc, charge_end_time, start_type, reservation_start_time, reservation_end_time, start_soc,
end_soc, total_used_electricity, sharp_used_electricity, peak_used_electricity, end_soc, ammeter_total_start, ammeter_total_end, total_used_electricity, sharp_used_electricity,
flat_used_electricity, valley_used_electricity, reason, create_by, create_time, peak_used_electricity, flat_used_electricity, valley_used_electricity, reason,
update_by, update_time, del_flag) trade_date, source_type, create_by, create_time, update_by, update_time, del_flag
)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.transactionCode,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.memberId,jdbcType=VARCHAR}, (#{item.transactionCode,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.memberId,jdbcType=VARCHAR},
@@ -802,12 +897,13 @@
#{item.plateNumber,jdbcType=VARCHAR}, #{item.chargeStartTime,jdbcType=TIMESTAMP}, #{item.plateNumber,jdbcType=VARCHAR}, #{item.chargeStartTime,jdbcType=TIMESTAMP},
#{item.chargeEndTime,jdbcType=TIMESTAMP}, #{item.startType,jdbcType=VARCHAR}, #{item.reservationStartTime,jdbcType=TIMESTAMP}, #{item.chargeEndTime,jdbcType=TIMESTAMP}, #{item.startType,jdbcType=VARCHAR}, #{item.reservationStartTime,jdbcType=TIMESTAMP},
#{item.reservationEndTime,jdbcType=TIMESTAMP}, #{item.startSoc,jdbcType=VARCHAR}, #{item.reservationEndTime,jdbcType=TIMESTAMP}, #{item.startSoc,jdbcType=VARCHAR},
#{item.endSoc,jdbcType=VARCHAR}, #{item.totalUsedElectricity,jdbcType=DECIMAL}, #{item.endSoc,jdbcType=VARCHAR}, #{item.ammeterTotalStart,jdbcType=VARCHAR}, #{item.ammeterTotalEnd,jdbcType=VARCHAR},
#{item.sharpUsedElectricity,jdbcType=DECIMAL}, #{item.peakUsedElectricity,jdbcType=DECIMAL}, #{item.totalUsedElectricity,jdbcType=DECIMAL}, #{item.sharpUsedElectricity,jdbcType=DECIMAL},
#{item.flatUsedElectricity,jdbcType=DECIMAL}, #{item.valleyUsedElectricity,jdbcType=DECIMAL}, #{item.peakUsedElectricity,jdbcType=DECIMAL}, #{item.flatUsedElectricity,jdbcType=DECIMAL},
#{item.reason,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.valleyUsedElectricity,jdbcType=DECIMAL}, #{item.reason,jdbcType=VARCHAR},
#{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=CHAR} #{item.tradeDate,jdbcType=TIMESTAMP}, #{item.sourceType,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
) #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.delFlag,jdbcType=CHAR})
</foreach> </foreach>
</insert> </insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PersonalChargingRecord" useGeneratedKeys="true"> <insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PersonalChargingRecord" useGeneratedKeys="true">
@@ -836,12 +932,16 @@
reservation_end_time, reservation_end_time,
start_soc, start_soc,
end_soc, end_soc,
ammeter_total_start,
ammeter_total_end,
total_used_electricity, total_used_electricity,
sharp_used_electricity, sharp_used_electricity,
peak_used_electricity, peak_used_electricity,
flat_used_electricity, flat_used_electricity,
valley_used_electricity, valley_used_electricity,
reason, reason,
trade_date,
source_type,
create_by, create_by,
create_time, create_time,
update_by, update_by,
@@ -872,12 +972,16 @@
#{reservationEndTime,jdbcType=TIMESTAMP}, #{reservationEndTime,jdbcType=TIMESTAMP},
#{startSoc,jdbcType=VARCHAR}, #{startSoc,jdbcType=VARCHAR},
#{endSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR},
#{ammeterTotalStart,jdbcType=VARCHAR},
#{ammeterTotalEnd,jdbcType=VARCHAR},
#{totalUsedElectricity,jdbcType=DECIMAL}, #{totalUsedElectricity,jdbcType=DECIMAL},
#{sharpUsedElectricity,jdbcType=DECIMAL}, #{sharpUsedElectricity,jdbcType=DECIMAL},
#{peakUsedElectricity,jdbcType=DECIMAL}, #{peakUsedElectricity,jdbcType=DECIMAL},
#{flatUsedElectricity,jdbcType=DECIMAL}, #{flatUsedElectricity,jdbcType=DECIMAL},
#{valleyUsedElectricity,jdbcType=DECIMAL}, #{valleyUsedElectricity,jdbcType=DECIMAL},
#{reason,jdbcType=VARCHAR}, #{reason,jdbcType=VARCHAR},
#{tradeDate,jdbcType=TIMESTAMP},
#{sourceType,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR},
@@ -908,12 +1012,16 @@
reservation_end_time = #{reservationEndTime,jdbcType=TIMESTAMP}, reservation_end_time = #{reservationEndTime,jdbcType=TIMESTAMP},
start_soc = #{startSoc,jdbcType=VARCHAR}, start_soc = #{startSoc,jdbcType=VARCHAR},
end_soc = #{endSoc,jdbcType=VARCHAR}, end_soc = #{endSoc,jdbcType=VARCHAR},
ammeter_total_start = #{ammeterTotalStart,jdbcType=VARCHAR},
ammeter_total_end = #{ammeterTotalEnd,jdbcType=VARCHAR},
total_used_electricity = #{totalUsedElectricity,jdbcType=DECIMAL}, total_used_electricity = #{totalUsedElectricity,jdbcType=DECIMAL},
sharp_used_electricity = #{sharpUsedElectricity,jdbcType=DECIMAL}, sharp_used_electricity = #{sharpUsedElectricity,jdbcType=DECIMAL},
peak_used_electricity = #{peakUsedElectricity,jdbcType=DECIMAL}, peak_used_electricity = #{peakUsedElectricity,jdbcType=DECIMAL},
flat_used_electricity = #{flatUsedElectricity,jdbcType=DECIMAL}, flat_used_electricity = #{flatUsedElectricity,jdbcType=DECIMAL},
valley_used_electricity = #{valleyUsedElectricity,jdbcType=DECIMAL}, valley_used_electricity = #{valleyUsedElectricity,jdbcType=DECIMAL},
reason = #{reason,jdbcType=VARCHAR}, reason = #{reason,jdbcType=VARCHAR},
trade_date = #{tradeDate,jdbcType=TIMESTAMP},
source_type = #{sourceType,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
@@ -985,6 +1093,12 @@
<if test="endSoc != null"> <if test="endSoc != null">
end_soc, end_soc,
</if> </if>
<if test="ammeterTotalStart != null">
ammeter_total_start,
</if>
<if test="ammeterTotalEnd != null">
ammeter_total_end,
</if>
<if test="totalUsedElectricity != null"> <if test="totalUsedElectricity != null">
total_used_electricity, total_used_electricity,
</if> </if>
@@ -1003,6 +1117,12 @@
<if test="reason != null"> <if test="reason != null">
reason, reason,
</if> </if>
<if test="tradeDate != null">
trade_date,
</if>
<if test="sourceType != null">
source_type,
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by, create_by,
</if> </if>
@@ -1081,6 +1201,12 @@
<if test="endSoc != null"> <if test="endSoc != null">
#{endSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR},
</if> </if>
<if test="ammeterTotalStart != null">
#{ammeterTotalStart,jdbcType=VARCHAR},
</if>
<if test="ammeterTotalEnd != null">
#{ammeterTotalEnd,jdbcType=VARCHAR},
</if>
<if test="totalUsedElectricity != null"> <if test="totalUsedElectricity != null">
#{totalUsedElectricity,jdbcType=DECIMAL}, #{totalUsedElectricity,jdbcType=DECIMAL},
</if> </if>
@@ -1099,6 +1225,12 @@
<if test="reason != null"> <if test="reason != null">
#{reason,jdbcType=VARCHAR}, #{reason,jdbcType=VARCHAR},
</if> </if>
<if test="tradeDate != null">
#{tradeDate,jdbcType=TIMESTAMP},
</if>
<if test="sourceType != null">
#{sourceType,jdbcType=VARCHAR},
</if>
<if test="createBy != null"> <if test="createBy != null">
#{createBy,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
</if> </if>
@@ -1177,6 +1309,12 @@
<if test="endSoc != null"> <if test="endSoc != null">
end_soc = #{endSoc,jdbcType=VARCHAR}, end_soc = #{endSoc,jdbcType=VARCHAR},
</if> </if>
<if test="ammeterTotalStart != null">
ammeter_total_start = #{ammeterTotalStart,jdbcType=VARCHAR},
</if>
<if test="ammeterTotalEnd != null">
ammeter_total_end = #{ammeterTotalEnd,jdbcType=VARCHAR},
</if>
<if test="totalUsedElectricity != null"> <if test="totalUsedElectricity != null">
total_used_electricity = #{totalUsedElectricity,jdbcType=DECIMAL}, total_used_electricity = #{totalUsedElectricity,jdbcType=DECIMAL},
</if> </if>
@@ -1195,6 +1333,12 @@
<if test="reason != null"> <if test="reason != null">
reason = #{reason,jdbcType=VARCHAR}, reason = #{reason,jdbcType=VARCHAR},
</if> </if>
<if test="tradeDate != null">
trade_date = #{tradeDate,jdbcType=TIMESTAMP},
</if>
<if test="sourceType != null">
source_type = #{sourceType,jdbcType=VARCHAR},
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
</if> </if>