Adding a field insertion, which named user_id from xhpc_charge_order, and change the sql style of addBy3rd.
This commit is contained in:
parent
d5bbfca20f
commit
7da229de62
@ -182,7 +182,9 @@ public interface XhpcChargeOrderMapper {
|
||||
@Param(value = "terminalId") Long terminalId,
|
||||
@Param(value = "power") Double power,
|
||||
@Param(value = "chargingStationId") Long chargingStationId,
|
||||
@Param(value = "chargingMode") String chargingMode);
|
||||
@Param(value = "chargingMode") String chargingMode,
|
||||
@Param(value = "source") Integer source,
|
||||
@Param(value = "userId") Long userId);
|
||||
|
||||
/**
|
||||
* 标记异常大于创建4小时,标记为异常
|
||||
@ -190,7 +192,7 @@ public interface XhpcChargeOrderMapper {
|
||||
// void updateStatus();
|
||||
List<Map<String, Object>> selectDate3rdNeedBy(@Param(value = "serialNumber") String serialNumber);
|
||||
|
||||
String select3rdNameBy(@Param(value = "operatorIdEvcs") String operatorIdEvcs);
|
||||
List<Map<String, Object>> select3rdNameBy(@Param(value = "operatorIdEvcs") String operatorIdEvcs);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -472,13 +472,15 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService {
|
||||
return r;
|
||||
}
|
||||
String startTime = DateUtil.format(date, "yyyy-MM-dd HH: mm: ss");
|
||||
Map<String, Object> extraData = xhpcChargeOrderMapper.selectDate3rdNeedBy(connectorId).get(0);
|
||||
Long rateModelId = (Long) extraData.get("rateModelId");
|
||||
Long terminalId = (Long) extraData.get("terminalId");
|
||||
Double power = (Double) extraData.get("power");
|
||||
Long chargingStationId = (Long) extraData.get("chargingStationId");
|
||||
String chargingMode = xhpcChargeOrderMapper.select3rdNameBy(internetSerialNumber.substring(0, 9));
|
||||
int res = xhpcChargeOrderMapper.addBy3rd(internetSerialNumber, orderNo, driverId, chargingAmt, plateNum, status, date, rateModelId, terminalId, power, chargingStationId, chargingMode);
|
||||
Map<String, Object> extraData1 = xhpcChargeOrderMapper.selectDate3rdNeedBy(connectorId).get(0);
|
||||
Long rateModelId = (Long) extraData1.get("rateModelId");
|
||||
Long terminalId = (Long) extraData1.get("terminalId");
|
||||
Double power = (Double) extraData1.get("power");
|
||||
Long chargingStationId = (Long) extraData1.get("chargingStationId");
|
||||
Map<String, Object> extraData2 = xhpcChargeOrderMapper.select3rdNameBy(internetSerialNumber.substring(0, 9)).get(0);
|
||||
String chargingMode = (String) extraData2.get("name");
|
||||
Long userId = (Long) extraData2.get("userId");
|
||||
int res = xhpcChargeOrderMapper.addBy3rd(internetSerialNumber, orderNo, driverId, chargingAmt, plateNum, status, date, rateModelId, terminalId, power, chargingStationId, chargingMode, 1, userId);
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
System.out.println(res);
|
||||
if (res != 0) {
|
||||
|
||||
@ -491,64 +491,95 @@
|
||||
|
||||
|
||||
<insert id="addBy3rd">
|
||||
|
||||
insert into xhpc_charge_order
|
||||
(internet_serial_number,
|
||||
serial_number,
|
||||
<if test=" driverId != null and driverId != ''">
|
||||
driver_id,
|
||||
</if>
|
||||
<if test="chargingAmt != null and chargingAmt != ''">
|
||||
charging_amt,
|
||||
</if>
|
||||
<if test="plateNum != null and plateNum != ''">
|
||||
Plate_num,
|
||||
</if>
|
||||
status,source,create_time,
|
||||
<if test="rateModelId != null and rateModelId != ''">
|
||||
rate_model_id,
|
||||
</if>
|
||||
<if test="terminalId != null and terminalId != ''">
|
||||
terminal_id,
|
||||
</if>
|
||||
<if test="power != null and power != ''">
|
||||
power,
|
||||
</if>
|
||||
<if test="chargingStationId != null and chargingStationId != ''">
|
||||
charging_station_id,
|
||||
</if>
|
||||
<if test="chargingMode != null and chargingMode != ''">
|
||||
charging_mode
|
||||
</if>)
|
||||
values
|
||||
(#{internetSerialNumber},
|
||||
#{serialNum},
|
||||
<if test="driverId != null and driverId != ''">
|
||||
#{driverId},
|
||||
</if>
|
||||
<if test="chargingAmt != null and chargingAmt != ''">
|
||||
#{chargingAmt},
|
||||
</if>
|
||||
<if test="plateNum != null and plateNum != ''">
|
||||
#{plateNum},
|
||||
</if>
|
||||
#{status},1,#{createTime}
|
||||
<if test="rateModelId != null and rateModelId != ''">
|
||||
,#{rateModelId}
|
||||
</if>
|
||||
<if test="terminalId != null and terminalId != ''">
|
||||
,#{terminalId}
|
||||
</if>
|
||||
<if test="power != null and power != ''">
|
||||
,#{power}
|
||||
</if>
|
||||
<if test="chargingStationId != null and chargingStationId != ''">
|
||||
,#{chargingStationId}
|
||||
</if>
|
||||
<if test="chargingMode != null and chargingMode != ''">
|
||||
,#{chargingMode}
|
||||
</if>
|
||||
)
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="null != internetSerialNumber ">
|
||||
internet_serial_number,
|
||||
</if>
|
||||
<if test="null != serialNum ">
|
||||
serial_number,
|
||||
</if>
|
||||
<if test="null != driverId ">
|
||||
driver_id,
|
||||
</if>
|
||||
<if test="null != chargingAmt ">
|
||||
charging_amt,
|
||||
</if>
|
||||
<if test="null != plateNum ">
|
||||
plate_num,
|
||||
</if>
|
||||
<if test="null != status ">
|
||||
status,
|
||||
</if>
|
||||
<if test="null != createTime ">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="null != rateModelId ">
|
||||
rate_model_id,
|
||||
</if>
|
||||
<if test="null != terminalId ">
|
||||
terminal_id,
|
||||
</if>
|
||||
<if test="null != power ">
|
||||
power,
|
||||
</if>
|
||||
<if test="null != chargingStationId ">
|
||||
charging_station_id,
|
||||
</if>
|
||||
<if test="null != chargingMode ">
|
||||
charging_mode,
|
||||
</if>
|
||||
<if test="null != source ">
|
||||
source,
|
||||
</if>
|
||||
<if test="null != userId ">
|
||||
user_id
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="null != internetSerialNumber ">
|
||||
#{internetSerialNumber},
|
||||
</if>
|
||||
<if test="null != serialNum ">
|
||||
#{serialNum},
|
||||
</if>
|
||||
<if test="null != driverId ">
|
||||
#{driverId},
|
||||
</if>
|
||||
<if test="null != chargingAmt ">
|
||||
#{chargingAmt},
|
||||
</if>
|
||||
<if test="null != plateNum ">
|
||||
#{plateNum},
|
||||
</if>
|
||||
<if test="null != status ">
|
||||
#{status},
|
||||
</if>
|
||||
<if test="null != createTime ">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="null != rateModelId ">
|
||||
#{rateModelId},
|
||||
</if>
|
||||
<if test="null != terminalId ">
|
||||
#{terminalId},
|
||||
</if>
|
||||
<if test="null != power ">
|
||||
#{power},
|
||||
</if>
|
||||
<if test="null != chargingStationId ">
|
||||
#{chargingStationId},
|
||||
</if>
|
||||
<if test="null != chargingMode ">
|
||||
#{chargingMode},
|
||||
</if>
|
||||
<if test="null != source ">
|
||||
#{source},
|
||||
</if>
|
||||
<if test="null != userId ">
|
||||
#{userId}
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="selectDate3rdNeedBy" resultType="map">
|
||||
@ -563,9 +594,9 @@
|
||||
where xt.serial_number = #{serialNumber}
|
||||
</select>
|
||||
|
||||
<select id="select3rdNameBy" resultType="java.lang.String">
|
||||
<select id="select3rdNameBy" resultType="map">
|
||||
|
||||
select name
|
||||
select name, internet_user_id as userId
|
||||
from xhpc_internet_user
|
||||
where operator_id_evcs = #{operatorIdEvcs}
|
||||
</select>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user