完成用户总数量接口

This commit is contained in:
wenhui 2022-03-09 10:41:59 +08:00
parent 409d9bad6c
commit 172ee9a72b
14 changed files with 1675 additions and 83 deletions

View File

@ -0,0 +1,22 @@
package com.xhpc.common.constant;
import lombok.extern.slf4j.Slf4j;
/**
* 全局静态常量类
*
* @author WH
* @date 2022/3/9 10:31
* @since version-1.0
*/
@Slf4j
public class ConstantClass {
private ConstantClass() {
log.debug("This is a constant class!");
}
public static final String CHARGING_STATION_ID = "chargingStationId";
}

View File

@ -19,16 +19,16 @@ public class XhpcDataBigScreenController extends BaseController {
@Resource
XhpcDataBigScreenService xhpcDataBigScreenService;
//@GetMapping("/user-total-count")
//public R<Map<String,Object>> queryUserTotalCount(@RequestBody ) {
//
// return xhpcCardService.queryDeviceList(currentPage, items);
//}
@GetMapping("/core-locations")
public R<List<Map<String, Object>>> returnCoreLocation(CoreParam coreParam) {
return xhpcDataBigScreenService.returnCoreLocation(coreParam);
}
@GetMapping("/user-total-count")
public R<Object> queryUserTotalCount(CoreParam coreParam) {
return xhpcDataBigScreenService.queryUserTotalCount(coreParam);
}
}

View File

@ -17,5 +17,12 @@ public class CoreParam {
private String tenantIds;
private Integer areaCode;
private String chargingStationIds;
/**
* 前端传递进来的参数是用于查询什么的
* 0全国
* 1省市区
* 2场站
*/
private Integer paramType;
}

View File

@ -1,42 +0,0 @@
package com.xhpc.databigscreen.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@Data
public class ReturnCoreLocation {
/**
* 场站名称
*/
@JsonProperty("chargingStationName")
private String chargingStationName;
/**
* 场站id
*/
@JsonProperty("chargingStationId")
private Long chargingStationId;
/**
* 场站经度
*/
@JsonProperty("chargingStationLongitude")
private Double chargingStationLongitude;
/**
* 场站纬度
*/
@JsonProperty("chargingStationLatitude")
private Double chargingStationLatitude;
/**
* 场站区域码
*/
@JsonProperty("chargingStationAreaCode")
private String chargingStationAreaCode;
/**
* 场站所属租户id
*/
@JsonProperty("chargingStationTenantId")
private Long chargingStationTenantId;
}

View File

@ -0,0 +1,33 @@
package com.xhpc.databigscreen.mapper;
import com.xhpc.databigscreen.pojo.XhpcAppUser;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface XhpcAppUserMapper {
int deleteByPrimaryKey(Long appUserId);
int insert(XhpcAppUser record);
int insertSelective(XhpcAppUser record);
XhpcAppUser selectByPrimaryKey(Long appUserId);
int updateByPrimaryKeySelective(XhpcAppUser record);
int updateByPrimaryKey(XhpcAppUser record);
/**
* query user total count by according one or multiple tenant id
*
* @param tenantIdList 租户集合
* @return 租户数量
* @author WH
* @date 2022/3/4 10:37
* @since version-1.0
*/
Long selectTotalCountByTenantId(@Param("tenantIdList") List<String> tenantIdList);
}

View File

@ -3,7 +3,6 @@ package com.xhpc.databigscreen.mapper;
import com.xhpc.databigscreen.pojo.XhpcChargingStation;
import org.apache.ibatis.annotations.Param;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -26,13 +25,22 @@ public interface XhpcChargingStationMapper {
* @date 2022/2/28 17:50
* @since version-1.0
*/
List<Map<String, Object>> selectByTenantIdAndChargingStationId(@Param("tenantIdList") ArrayList<Long> tenantIdList, @Param("chargingStationId") Long chargingStationId);
List<Map<String, Object>> selectByTenantIdAndChargingStationId(@Param("tenantIdList") List<String> tenantIdList, @Param("chargingStationId") Long chargingStationId);
/**
* @author WH
* @date 2022/3/3 15:20
* @since version-1.0
*/
List<Map<String, Object>> selectByTenantIdAndAreaCode(@Param("tenantIdStr") String tenantIdStr, @Param("areaCode") Integer areaCode);
List<Map<String, Object>> selectByTenantIdAndAreaCode(@Param("tenantIdList") List<String> tenantIdList, @Param("areaCode") Integer areaCode);
/**
* query id of charging station by list of tenant id
*
* @author WH
* @date 2022/3/4 11:21
* @since version-1.0
*/
List<Long> selectChargingStationIds(@Param("tenantIdList") List<String> tenantIdList);
}

View File

@ -0,0 +1,31 @@
package com.xhpc.databigscreen.mapper;
import com.xhpc.databigscreen.pojo.XhpcHistoryOrder;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface XhpcHistoryOrderMapper {
int deleteByPrimaryKey(Long historyOrderId);
int insert(XhpcHistoryOrder record);
int insertSelective(XhpcHistoryOrder record);
XhpcHistoryOrder selectByPrimaryKey(Long historyOrderId);
int updateByPrimaryKeySelective(XhpcHistoryOrder record);
int updateByPrimaryKey(XhpcHistoryOrder record);
/**
* query user total count by multiple tenant id and multiple charging station id and user type
*
* @author WH
* @date 2022/3/4 15:32
* @since version-1.0
*/
Long selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserType(@Param("tenantIdList") List<String> tenantIdList, @Param("chargingStationIdList") List<Long> chargingStationIdList, @Param("userType") Integer userType);
}

View File

@ -0,0 +1,118 @@
package com.xhpc.databigscreen.pojo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* xhpc_app_user
*
* @author
*/
@Data
public class XhpcAppUser implements Serializable {
/**
* 用户ID
*/
private Long appUserId;
/**
* 手机号码
*/
private String phone;
private String weixinOpenId;
private String alipayOpenId;
/**
* 微信是否登录0未登录 1已登录
*/
private Integer weixinLogin;
/**
* 支付宝是否登录0未登录 1已登录
*/
private Integer alipayLogin;
/**
* 头像地址
*/
private String avatar;
/**
* 余额
*/
private BigDecimal balance;
/**
* 密码(加密)
*/
private String password;
/**
* 帐号状态
*/
private Integer status;
/**
* 是否有退款订单审核0无 1有
*/
private Integer isRefundApplication;
/**
* 删除标志0代表存在 2代表删除
*/
private String delFlag;
/**
* 创建者
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新者
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 备注
*/
private String remark;
/**
* 用户设置的SOC
*/
private Integer soc;
/**
* 是否退款 0 不退款 1 退款
*/
private Integer isRefund;
/**
* 租户id
*/
private String tenantId;
/**
* 是否开启电池保护 0 未开启 1开启
*/
private Integer socProtect;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,271 @@
package com.xhpc.databigscreen.pojo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* xhpc_history_order
*
* @author
*/
@Data
public class XhpcHistoryOrder implements Serializable {
/**
* 历史订单id
*/
private Long historyOrderId;
/**
* 电站id
*/
private Long chargingStationId;
/**
* 充电订单id
*/
private Long chargeOrderId;
/**
* 用户id
*/
private Long userId;
/**
* 终端id
*/
private Long terminalId;
/**
* 订单编号
*/
private String serialNumber;
/**
* 流量方订单号
*/
private String internetSerialNumber;
/**
* 总电费
*/
private BigDecimal powerPriceTotal;
/**
* 总服务费
*/
private BigDecimal servicePriceTotal;
/**
* 订单总价
*/
private BigDecimal totalPrice;
/**
* 电站活动抵扣--抵扣的总金额
*/
private BigDecimal promotionDiscount;
/**
* 实际价格-用户支付的钱
*/
private BigDecimal actPrice;
/**
* 实收电费-运营商电费
*/
private BigDecimal actPowerPrice;
/**
* 实收服务费-运营商服务费
*/
private BigDecimal actServicePrice;
/**
* 流量方总金额抽成
*/
private BigDecimal internetCommission;
/**
* 流量方服务费抽成
*/
private BigDecimal internetSvcCommission;
/**
* 平台总金额抽成
*/
private BigDecimal platformCommission;
/**
* 平台服务费抽成
*/
private BigDecimal platformSvcCommisssion;
/**
* 运维总抽成
*/
private BigDecimal operationCommission;
/**
* 运维服务费抽成
*/
private BigDecimal operationSvcCommission;
/**
* 开始充电soc
*/
private String startSoc;
/**
* 结束时soc
*/
private String endSoc;
/**
* 对账状态0待确认 1已确认2待提交3待审核
*/
private Integer reconciliationStatus;
/**
* 清分状态0待清分 1清分在途2已提现3待提交4待审核
*/
private Integer sortingStatus;
/**
* 1 自动结算 2 平台结算
*/
private Byte type;
/**
* 状态0正常 1停用
*/
private Integer status;
/**
* 删除标志0代表存在 2代表删除
*/
private Integer delFlag;
/**
* 创建时间
*/
private Date createTime;
/**
* 创建者
*/
private String createBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 更新者
*/
private String updateBy;
/**
* 备注
*/
private String remark;
/**
* 0未统计 1小时统计 2 其他统计
*/
private Integer state;
/**
* VIN
*/
private String vinNormal;
private String searchValue;
/**
* 运营商在EVCS分配的唯一OperatorID
*/
private String operatorIdEvcs;
/**
* 终端客户开启充电方式
*/
private Integer chargeModelEvcs;
/**
* 接口额定功率
*/
private Double connectorPowerEvcs;
/**
* 电表总起值
*/
private Double meterValueEndEvcs;
/**
* 电表总结束值
*/
private Double meterValueStartEvcs;
/**
* 流量方OperatorID
*/
private String operatorId3rdptyEvcs;
private Date startTime;
/**
* 结束时间
*/
private Date endTime;
private Integer stopReasonEvcs;
/**
* 电量
*/
private Double totalPower;
private String userNameEvcs;
private String phone;
/**
* 互联网订单流水号
*/
private String evcsOrderNo;
/**
* -1:未推送/推送失败 0:成功 1:争议交易 299:自定义
*/
private Integer confirmResult;
private Long rateModelId;
/**
* 充电方式
*/
private String chargingMode;
/**
* 流量方电量抽成
*/
private BigDecimal internetDegreeCommission;
/**
* 订单来源0 C端用户 1 流量方用户 2社区用户 3B端用户
*/
private Integer source;
/**
* 租户id
*/
private String tenantId;
private static final long serialVersionUID = 1L;
}

View File

@ -22,4 +22,13 @@ public interface XhpcDataBigScreenService {
*/
R<List<Map<String, Object>>> returnCoreLocation(CoreParam coreParam);
/**
* query total count of user
*
* @author WH
* @date 2022/3/3 18:34
* @since version-1.0
*/
R<Object> queryUserTotalCount(CoreParam coreParam);
}

View File

@ -1,8 +1,12 @@
package com.xhpc.databigscreen.service.impl;
import com.xhpc.common.constant.ConstantClass;
import com.xhpc.common.core.domain.R;
import com.xhpc.common.util.UserTypeUtil;
import com.xhpc.databigscreen.domain.CoreParam;
import com.xhpc.databigscreen.mapper.XhpcAppUserMapper;
import com.xhpc.databigscreen.mapper.XhpcChargingStationMapper;
import com.xhpc.databigscreen.mapper.XhpcHistoryOrderMapper;
import com.xhpc.databigscreen.service.XhpcDataBigScreenService;
import org.springframework.stereotype.Service;
@ -11,6 +15,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author WH
@ -22,42 +27,149 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
@Resource
XhpcChargingStationMapper xhpcChargingStationMapper;
@Resource
XhpcAppUserMapper xhpcAppUserMapper;
@Resource
XhpcHistoryOrderMapper xhpcHistoryOrderMapper;
@Override
public R<List<Map<String, Object>>> returnCoreLocation(CoreParam coreParam) {
String tenantIdsStr = null;
List<Map<String, Object>> xhpcChargingStationList = null;
List<String> tenantIdList = null;
String[] tenantIdArray = null;
if (coreParam.getParamType() == null) {
return R.fail("ParamType不能为null");
}
//judge care param function
if (coreParam.getAreaCode() == null || "".equals(coreParam.getAreaCode())) {
if (coreParam.getChargingStationIds() == null || "".equals(coreParam.getChargingStationIds())) {
//query location infos of charging station of special or all tenant
String tenantIds = coreParam.getTenantIds();
ArrayList<Long> tenantIdList = new ArrayList<>();
if (!"".equals(tenantIds) && tenantIds != null) {
String[] tenantIdArray = tenantIds.split(",");
List<String> tenantIdStrList = Arrays.asList(tenantIdArray);
for (String tenantIdStr : tenantIdStrList) {
Long tenantId = Long.valueOf(tenantIdStr);
tenantIdList.add(tenantId);
}
switch (coreParam.getParamType()) {
case 0:
tenantIdsStr = coreParam.getTenantIds();
if (!"".equals(tenantIdsStr) && tenantIdsStr != null) {
tenantIdArray = tenantIdsStr.split(",");
tenantIdList = Arrays.stream(tenantIdArray).collect(Collectors.toList());
xhpcChargingStationList = xhpcChargingStationMapper.selectByTenantIdAndChargingStationId(tenantIdList, null);
return R.ok(xhpcChargingStationList);
} else {
xhpcChargingStationList = xhpcChargingStationMapper.selectByTenantIdAndChargingStationId(null, null);
return R.ok(xhpcChargingStationList);
}
List<Map<String, Object>> xhpcChargingStationList = xhpcChargingStationMapper.selectByTenantIdAndChargingStationId(tenantIdList, null);
return R.ok(xhpcChargingStationList);
} else {
case 1:
//query charging station infos of whole area
Integer areaCode = coreParam.getAreaCode();
tenantIdsStr = coreParam.getTenantIds();
if (!"".equals(tenantIdsStr) && tenantIdsStr != null) {
tenantIdArray = tenantIdsStr.split(",");
tenantIdList = Arrays.stream(tenantIdArray).collect(Collectors.toList());
xhpcChargingStationList = xhpcChargingStationMapper.selectByTenantIdAndAreaCode(tenantIdList, areaCode);
return R.ok(xhpcChargingStationList);
} else {
xhpcChargingStationList = xhpcChargingStationMapper.selectByTenantIdAndAreaCode(null, areaCode);
return R.ok(xhpcChargingStationList);
}
case 2:
//query location info of special charging station of special tenant
String tenantIdStr = coreParam.getTenantIds();
ArrayList<Long> tenantIdList = new ArrayList<>();
long tenantId = Long.parseLong(tenantIdStr);
tenantIdList.add(tenantId);
String chargingStationIdStr = coreParam.getChargingStationIds();
long chargingStationId = Long.parseLong(chargingStationIdStr);
List<Map<String, Object>> xhpcChargingStationList = xhpcChargingStationMapper.selectByTenantIdAndChargingStationId(tenantIdList, chargingStationId);
return R.ok(xhpcChargingStationList);
}
} else {
//query charging station infos of whole area
String tenantIdStr = coreParam.getTenantIds();
Integer areaCode = coreParam.getAreaCode();
List<Map<String, Object>> xhpcChargingStationList = xhpcChargingStationMapper.selectByTenantIdAndAreaCode(tenantIdStr, areaCode);
return R.ok(xhpcChargingStationList);
tenantIdsStr = coreParam.getTenantIds();
if (!"".equals(tenantIdsStr) && tenantIdsStr != null) {
tenantIdArray = tenantIdsStr.split(",");
tenantIdList = Arrays.stream(tenantIdArray).collect(Collectors.toList());
String chargingStationIdStr = coreParam.getChargingStationIds();
long chargingStationId = Long.parseLong(chargingStationIdStr);
xhpcChargingStationList = xhpcChargingStationMapper.selectByTenantIdAndChargingStationId(tenantIdList, chargingStationId);
return R.ok(xhpcChargingStationList);
} else {
return R.fail("传入的参数有误");
}
default:
return R.fail("传入参数有误!");
}
}
@Override
public R<Object> queryUserTotalCount(CoreParam coreParam) {
String tenantIdsStr = null;
List<Map<String, Object>> xhpcChargingStationList = null;
List<String> tenantIdList = null;
String[] tenantIdArray = null;
//judge care param function
switch (coreParam.getParamType()) {
case 0:
tenantIdsStr = coreParam.getTenantIds();
if (!"".equals(tenantIdsStr) && tenantIdsStr != null) {
tenantIdArray = tenantIdsStr.split(",");
tenantIdList = Arrays.stream(tenantIdArray).collect(Collectors.toList());
//get user count of c client
Long appUserCount = xhpcAppUserMapper.selectTotalCountByTenantId(tenantIdList);
List<Long> chargingStationIdList = xhpcChargingStationMapper.selectChargingStationIds(tenantIdList);
//0 C端用户 1 流量方用户 2社区用户 3B端用户
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserType(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserType(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE);
return R.ok(appUserCount + communityUserCount + customerUserCount);
} else {
//get user count of c client
Long appUserCount = xhpcAppUserMapper.selectTotalCountByTenantId(tenantIdList);
List<Long> chargingStationIdList = xhpcChargingStationMapper.selectChargingStationIds(tenantIdList);
//0 C端用户 1 流量方用户 2社区用户 3B端用户
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserType(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserType(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE);
return R.ok(appUserCount + communityUserCount + customerUserCount);
}
//query charging station infos of whole area
case 1:
Integer areaCode = coreParam.getAreaCode();
tenantIdsStr = coreParam.getTenantIds();
if (!"".equals(tenantIdsStr) && tenantIdsStr != null) {
tenantIdArray = tenantIdsStr.split(",");
tenantIdList = Arrays.stream(tenantIdArray).collect(Collectors.toList());
xhpcChargingStationList = xhpcChargingStationMapper.selectByTenantIdAndAreaCode(tenantIdList, areaCode);
ArrayList<Long> chargingStationIdList = new ArrayList<>();
for (Map<String, Object> chargingStation : xhpcChargingStationList) {
chargingStationIdList.add((Long) chargingStation.get(ConstantClass.CHARGING_STATION_ID));
}
Long appUserCount = xhpcAppUserMapper.selectTotalCountByTenantId(tenantIdList);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserType(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserType(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE);
return R.ok(appUserCount + communityUserCount + customerUserCount);
} else {
xhpcChargingStationList = xhpcChargingStationMapper.selectByTenantIdAndAreaCode(tenantIdList, areaCode);
ArrayList<Long> chargingStationIdList = new ArrayList<>();
for (Map<String, Object> chargingStation : xhpcChargingStationList) {
chargingStationIdList.add((Long) chargingStation.get(ConstantClass.CHARGING_STATION_ID));
}
Long appUserCount = xhpcAppUserMapper.selectTotalCountByTenantId(tenantIdList);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserType(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserType(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE);
return R.ok(appUserCount + communityUserCount + customerUserCount);
}
case 2:
//query location info of special charging station of special tenant
tenantIdsStr = coreParam.getTenantIds();
if (!"".equals(tenantIdsStr) && tenantIdsStr != null) {
tenantIdArray = tenantIdsStr.split(",");
tenantIdList = Arrays.stream(tenantIdArray).collect(Collectors.toList());
String chargingStationIdStr = coreParam.getChargingStationIds();
long chargingStationId = Long.parseLong(chargingStationIdStr);
xhpcChargingStationList = xhpcChargingStationMapper.selectByTenantIdAndChargingStationId(tenantIdList, chargingStationId);
ArrayList<Long> chargingStationIdList = new ArrayList<>();
for (Map<String, Object> chargingStation : xhpcChargingStationList) {
chargingStationIdList.add((Long) chargingStation.get(ConstantClass.CHARGING_STATION_ID));
}
Long appUserCount = xhpcAppUserMapper.selectTotalCountByTenantId(tenantIdList);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserType(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserType(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE);
return R.ok(appUserCount + communityUserCount + customerUserCount);
} else {
return R.fail("传入的参数有误");
}
default:
R.fail("param type is invalid");
break;
}
return null;
}
}

View File

@ -0,0 +1,299 @@
<?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">
<!--suppress ALL -->
<mapper namespace="com.xhpc.databigscreen.mapper.XhpcAppUserMapper">
<resultMap id="BaseResultMap" type="com.xhpc.databigscreen.pojo.XhpcAppUser">
<id column="app_user_id" jdbcType="BIGINT" property="appUserId"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="weixin_open_id" jdbcType="VARCHAR" property="weixinOpenId"/>
<result column="alipay_open_id" jdbcType="VARCHAR" property="alipayOpenId"/>
<result column="weixin_login" jdbcType="INTEGER" property="weixinLogin"/>
<result column="alipay_login" jdbcType="INTEGER" property="alipayLogin"/>
<result column="avatar" jdbcType="VARCHAR" property="avatar"/>
<result column="balance" jdbcType="DECIMAL" property="balance"/>
<result column="password" jdbcType="VARCHAR" property="password"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="is_refund_application" jdbcType="INTEGER" property="isRefundApplication"/>
<result column="del_flag" jdbcType="CHAR" property="delFlag"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="soc" jdbcType="INTEGER" property="soc"/>
<result column="is_refund" jdbcType="INTEGER" property="isRefund"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="soc_protect" jdbcType="INTEGER" property="socProtect"/>
</resultMap>
<sql id="Base_Column_List">
app_user_id
, phone, weixin_open_id, alipay_open_id, weixin_login, alipay_login, avatar,
balance, `password`, `status`, is_refund_application, del_flag, create_by, create_time,
update_by, update_time, remark, soc, is_refund, tenant_id, soc_protect
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from xhpc_app_user
where app_user_id = #{appUserId,jdbcType=BIGINT}
</select>
<select id="selectTotalCountByTenantId" resultType="java.lang.Long">
SELECT
count(phone)
FROM
(
SELECT DISTINCT
(phone)
FROM
xhpc_app_user
<where>
<if test="tenantIdList!=null and tenantIdList.size()!=0 ">
and tenant_id IN
<foreach collection="tenantIdList" separator="," open="(" close=")" item="tenantId">
#{tenantId}
</foreach>
</if>
</where>
) AS a
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete
from xhpc_app_user
where app_user_id = #{appUserId,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="app_user_id" keyProperty="appUserId"
parameterType="com.xhpc.databigscreen.pojo.XhpcAppUser" useGeneratedKeys="true">
insert into xhpc_app_user (phone, weixin_open_id, alipay_open_id,
weixin_login, alipay_login, avatar,
balance, `password`, `status`,
is_refund_application, del_flag, create_by,
create_time, update_by, update_time,
remark, soc, is_refund,
tenant_id, soc_protect)
values (#{phone,jdbcType=VARCHAR}, #{weixinOpenId,jdbcType=VARCHAR}, #{alipayOpenId,jdbcType=VARCHAR},
#{weixinLogin,jdbcType=INTEGER}, #{alipayLogin,jdbcType=INTEGER}, #{avatar,jdbcType=VARCHAR},
#{balance,jdbcType=DECIMAL}, #{password,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{isRefundApplication,jdbcType=INTEGER}, #{delFlag,jdbcType=CHAR}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{remark,jdbcType=VARCHAR}, #{soc,jdbcType=INTEGER}, #{isRefund,jdbcType=INTEGER},
#{tenantId,jdbcType=VARCHAR}, #{socProtect,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="app_user_id" keyProperty="appUserId"
parameterType="com.xhpc.databigscreen.pojo.XhpcAppUser" useGeneratedKeys="true">
insert into xhpc_app_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="phone != null">
phone,
</if>
<if test="weixinOpenId != null">
weixin_open_id,
</if>
<if test="alipayOpenId != null">
alipay_open_id,
</if>
<if test="weixinLogin != null">
weixin_login,
</if>
<if test="alipayLogin != null">
alipay_login,
</if>
<if test="avatar != null">
avatar,
</if>
<if test="balance != null">
balance,
</if>
<if test="password != null">
`password`,
</if>
<if test="status != null">
`status`,
</if>
<if test="isRefundApplication != null">
is_refund_application,
</if>
<if test="delFlag != null">
del_flag,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="remark != null">
remark,
</if>
<if test="soc != null">
soc,
</if>
<if test="isRefund != null">
is_refund,
</if>
<if test="tenantId != null">
tenant_id,
</if>
<if test="socProtect != null">
soc_protect,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="weixinOpenId != null">
#{weixinOpenId,jdbcType=VARCHAR},
</if>
<if test="alipayOpenId != null">
#{alipayOpenId,jdbcType=VARCHAR},
</if>
<if test="weixinLogin != null">
#{weixinLogin,jdbcType=INTEGER},
</if>
<if test="alipayLogin != null">
#{alipayLogin,jdbcType=INTEGER},
</if>
<if test="avatar != null">
#{avatar,jdbcType=VARCHAR},
</if>
<if test="balance != null">
#{balance,jdbcType=DECIMAL},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="isRefundApplication != null">
#{isRefundApplication,jdbcType=INTEGER},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=CHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="soc != null">
#{soc,jdbcType=INTEGER},
</if>
<if test="isRefund != null">
#{isRefund,jdbcType=INTEGER},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=VARCHAR},
</if>
<if test="socProtect != null">
#{socProtect,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.databigscreen.pojo.XhpcAppUser">
update xhpc_app_user
<set>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="weixinOpenId != null">
weixin_open_id = #{weixinOpenId,jdbcType=VARCHAR},
</if>
<if test="alipayOpenId != null">
alipay_open_id = #{alipayOpenId,jdbcType=VARCHAR},
</if>
<if test="weixinLogin != null">
weixin_login = #{weixinLogin,jdbcType=INTEGER},
</if>
<if test="alipayLogin != null">
alipay_login = #{alipayLogin,jdbcType=INTEGER},
</if>
<if test="avatar != null">
avatar = #{avatar,jdbcType=VARCHAR},
</if>
<if test="balance != null">
balance = #{balance,jdbcType=DECIMAL},
</if>
<if test="password != null">
`password` = #{password,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=INTEGER},
</if>
<if test="isRefundApplication != null">
is_refund_application = #{isRefundApplication,jdbcType=INTEGER},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=CHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="soc != null">
soc = #{soc,jdbcType=INTEGER},
</if>
<if test="isRefund != null">
is_refund = #{isRefund,jdbcType=INTEGER},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=VARCHAR},
</if>
<if test="socProtect != null">
soc_protect = #{socProtect,jdbcType=INTEGER},
</if>
</set>
where app_user_id = #{appUserId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.xhpc.databigscreen.pojo.XhpcAppUser">
update xhpc_app_user
set phone = #{phone,jdbcType=VARCHAR},
weixin_open_id = #{weixinOpenId,jdbcType=VARCHAR},
alipay_open_id = #{alipayOpenId,jdbcType=VARCHAR},
weixin_login = #{weixinLogin,jdbcType=INTEGER},
alipay_login = #{alipayLogin,jdbcType=INTEGER},
avatar = #{avatar,jdbcType=VARCHAR},
balance = #{balance,jdbcType=DECIMAL},
`password` = #{password,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER},
is_refund_application = #{isRefundApplication,jdbcType=INTEGER},
del_flag = #{delFlag,jdbcType=CHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR},
soc = #{soc,jdbcType=INTEGER},
is_refund = #{isRefund,jdbcType=INTEGER},
tenant_id = #{tenantId,jdbcType=VARCHAR},
soc_protect = #{socProtect,jdbcType=INTEGER}
where app_user_id = #{appUserId,jdbcType=BIGINT}
</update>
</mapper>

View File

@ -86,13 +86,30 @@
xhpc_charging_station
WHERE
del_flag = 0
<if test="tenantIdStr!=null and tenantIdStr!='' ">
AND tenant_id = #{tenantIdStr}
<if test="tenantIdList!=null and tenantIdList.size()!=0 ">
AND tenant_id in
<foreach collection="tenantIdList" item="tenantId" open="(" close=")" separator=",">
#{tenantId}
</foreach>
</if>
<if test="areaCode != null and areaCode != '' ">
AND area_code = #{areaCode}
</if>
</select>
<select id="selectChargingStationIds" resultType="java.lang.Long">
SELECT
charging_station_id
FROM
xhpc_charging_station
<where>
<if test="tenantIdList!=null and tenantIdList.size()!=0 ">
and tenant_id in
<foreach collection="tenantIdList" item="tenantId" open="(" close=")" separator=",">
#{tenantId}
</foreach>
</if>
</where>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete
from xhpc_charging_station

View File

@ -0,0 +1,707 @@
<?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">
<!--suppress ALL -->
<mapper namespace="com.xhpc.databigscreen.mapper.XhpcHistoryOrderMapper">
<resultMap id="BaseResultMap" type="com.xhpc.databigscreen.pojo.XhpcHistoryOrder">
<id column="history_order_id" jdbcType="BIGINT" property="historyOrderId"/>
<result column="charging_station_id" jdbcType="BIGINT" property="chargingStationId"/>
<result column="charge_order_id" jdbcType="BIGINT" property="chargeOrderId"/>
<result column="user_id" jdbcType="BIGINT" property="userId"/>
<result column="terminal_id" jdbcType="BIGINT" property="terminalId"/>
<result column="serial_number" jdbcType="VARCHAR" property="serialNumber"/>
<result column="internet_serial_number" jdbcType="VARCHAR" property="internetSerialNumber"/>
<result column="power_price_total" jdbcType="DECIMAL" property="powerPriceTotal"/>
<result column="service_price_total" jdbcType="DECIMAL" property="servicePriceTotal"/>
<result column="total_price" jdbcType="DECIMAL" property="totalPrice"/>
<result column="promotion_discount" jdbcType="DECIMAL" property="promotionDiscount"/>
<result column="act_price" jdbcType="DECIMAL" property="actPrice"/>
<result column="act_power_price" jdbcType="DECIMAL" property="actPowerPrice"/>
<result column="act_service_price" jdbcType="DECIMAL" property="actServicePrice"/>
<result column="internet_commission" jdbcType="DECIMAL" property="internetCommission"/>
<result column="internet_svc_commission" jdbcType="DECIMAL" property="internetSvcCommission"/>
<result column="platform_commission" jdbcType="DECIMAL" property="platformCommission"/>
<result column="platform_svc_commisssion" jdbcType="DECIMAL" property="platformSvcCommisssion"/>
<result column="operation_commission" jdbcType="DECIMAL" property="operationCommission"/>
<result column="operation_svc_commission" jdbcType="DECIMAL" property="operationSvcCommission"/>
<result column="start_soc" jdbcType="VARCHAR" property="startSoc"/>
<result column="end_soc" jdbcType="VARCHAR" property="endSoc"/>
<result column="reconciliation_status" jdbcType="INTEGER" property="reconciliationStatus"/>
<result column="sorting_status" jdbcType="INTEGER" property="sortingStatus"/>
<result column="type" jdbcType="TINYINT" property="type"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
<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="remark" jdbcType="VARCHAR" property="remark"/>
<result column="state" jdbcType="INTEGER" property="state"/>
<result column="vin_normal" jdbcType="VARCHAR" property="vinNormal"/>
<result column="search_value" jdbcType="VARCHAR" property="searchValue"/>
<result column="operator_id_evcs" jdbcType="VARCHAR" property="operatorIdEvcs"/>
<result column="charge_model_evcs" jdbcType="INTEGER" property="chargeModelEvcs"/>
<result column="connector_power_evcs" jdbcType="DOUBLE" property="connectorPowerEvcs"/>
<result column="meter_value_end_evcs" jdbcType="DOUBLE" property="meterValueEndEvcs"/>
<result column="meter_value_start_evcs" jdbcType="DOUBLE" property="meterValueStartEvcs"/>
<result column="operator_id3rdpty_evcs" jdbcType="VARCHAR" property="operatorId3rdptyEvcs"/>
<result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
<result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
<result column="stop_reason_evcs" jdbcType="INTEGER" property="stopReasonEvcs"/>
<result column="total_power" jdbcType="DOUBLE" property="totalPower"/>
<result column="user_name_evcs" jdbcType="VARCHAR" property="userNameEvcs"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="evcs_order_no" jdbcType="VARCHAR" property="evcsOrderNo"/>
<result column="confirm_Result" jdbcType="INTEGER" property="confirmResult"/>
<result column="rate_model_id" jdbcType="BIGINT" property="rateModelId"/>
<result column="charging_mode" jdbcType="VARCHAR" property="chargingMode"/>
<result column="internet_degree_commission" jdbcType="DECIMAL" property="internetDegreeCommission"/>
<result column="source" jdbcType="INTEGER" property="source"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
</resultMap>
<sql id="Base_Column_List">
history_order_id
, charging_station_id, charge_order_id, user_id, terminal_id, serial_number,
internet_serial_number, power_price_total, service_price_total, total_price, promotion_discount,
act_price, act_power_price, act_service_price, internet_commission, internet_svc_commission,
platform_commission, platform_svc_commisssion, operation_commission, operation_svc_commission,
start_soc, end_soc, reconciliation_status, sorting_status, `type`, `status`, del_flag,
create_time, create_by, update_time, update_by, remark, `state`, vin_normal, search_value,
operator_id_evcs, charge_model_evcs, connector_power_evcs, meter_value_end_evcs,
meter_value_start_evcs, operator_id3rdpty_evcs, start_time, end_time, stop_reason_evcs,
total_power, user_name_evcs, phone, evcs_order_no, confirm_Result, rate_model_id,
charging_mode, internet_degree_commission, `source`, tenant_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from xhpc_history_order
where history_order_id = #{historyOrderId,jdbcType=BIGINT}
</select>
<select id="selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserType" resultType="java.lang.Long">
SELECT
count(user_id)
FROM
(
SELECT
user_id
FROM
xhpc_history_order
WHERE
del_flag = 0
<if test="tenantIdList!=null and tenantIdList.size()!=0 ">
AND tenant_id IN
<foreach collection="tenantIdList" separator="," open="(" close=")" item="tenantId">
#{tenantId}
</foreach>
</if>
<if test="chargingStationIdList!=null and chargingStationIdList.size()!=0 ">
AND tenant_id IN
<foreach collection="chargingStationIdList" separator="," open="(" close=")" item="chargingStationId">
#{chargingStationId}
</foreach>
</if>
<if test="userType!=null">
AND source = #{userType}
</if>
) AS a
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete
from xhpc_history_order
where history_order_id = #{historyOrderId,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="history_order_id" keyProperty="historyOrderId"
parameterType="com.xhpc.databigscreen.pojo.XhpcHistoryOrder" useGeneratedKeys="true">
insert into xhpc_history_order (charging_station_id, charge_order_id, user_id,
terminal_id, serial_number, internet_serial_number,
power_price_total, service_price_total, total_price,
promotion_discount, act_price, act_power_price,
act_service_price, internet_commission, internet_svc_commission,
platform_commission, platform_svc_commisssion,
operation_commission, operation_svc_commission,
start_soc, end_soc, reconciliation_status,
sorting_status, `type`, `status`,
del_flag, create_time, create_by,
update_time, update_by, remark,
`state`, vin_normal, search_value,
operator_id_evcs, charge_model_evcs, connector_power_evcs,
meter_value_end_evcs, meter_value_start_evcs, operator_id3rdpty_evcs,
start_time, end_time, stop_reason_evcs,
total_power, user_name_evcs, phone,
evcs_order_no, confirm_Result, rate_model_id,
charging_mode, internet_degree_commission,
`source`, tenant_id)
values (#{chargingStationId,jdbcType=BIGINT}, #{chargeOrderId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
#{terminalId,jdbcType=BIGINT}, #{serialNumber,jdbcType=VARCHAR},
#{internetSerialNumber,jdbcType=VARCHAR},
#{powerPriceTotal,jdbcType=DECIMAL}, #{servicePriceTotal,jdbcType=DECIMAL},
#{totalPrice,jdbcType=DECIMAL},
#{promotionDiscount,jdbcType=DECIMAL}, #{actPrice,jdbcType=DECIMAL}, #{actPowerPrice,jdbcType=DECIMAL},
#{actServicePrice,jdbcType=DECIMAL}, #{internetCommission,jdbcType=DECIMAL},
#{internetSvcCommission,jdbcType=DECIMAL},
#{platformCommission,jdbcType=DECIMAL}, #{platformSvcCommisssion,jdbcType=DECIMAL},
#{operationCommission,jdbcType=DECIMAL}, #{operationSvcCommission,jdbcType=DECIMAL},
#{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR}, #{reconciliationStatus,jdbcType=INTEGER},
#{sortingStatus,jdbcType=INTEGER}, #{type,jdbcType=TINYINT}, #{status,jdbcType=INTEGER},
#{delFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{state,jdbcType=INTEGER}, #{vinNormal,jdbcType=VARCHAR}, #{searchValue,jdbcType=VARCHAR},
#{operatorIdEvcs,jdbcType=VARCHAR}, #{chargeModelEvcs,jdbcType=INTEGER},
#{connectorPowerEvcs,jdbcType=DOUBLE},
#{meterValueEndEvcs,jdbcType=DOUBLE}, #{meterValueStartEvcs,jdbcType=DOUBLE},
#{operatorId3rdptyEvcs,jdbcType=VARCHAR},
#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{stopReasonEvcs,jdbcType=INTEGER},
#{totalPower,jdbcType=DOUBLE}, #{userNameEvcs,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
#{evcsOrderNo,jdbcType=VARCHAR}, #{confirmResult,jdbcType=INTEGER}, #{rateModelId,jdbcType=BIGINT},
#{chargingMode,jdbcType=VARCHAR}, #{internetDegreeCommission,jdbcType=DECIMAL},
#{source,jdbcType=INTEGER}, #{tenantId,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="history_order_id" keyProperty="historyOrderId"
parameterType="com.xhpc.databigscreen.pojo.XhpcHistoryOrder" useGeneratedKeys="true">
insert into xhpc_history_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="chargingStationId != null">
charging_station_id,
</if>
<if test="chargeOrderId != null">
charge_order_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="terminalId != null">
terminal_id,
</if>
<if test="serialNumber != null">
serial_number,
</if>
<if test="internetSerialNumber != null">
internet_serial_number,
</if>
<if test="powerPriceTotal != null">
power_price_total,
</if>
<if test="servicePriceTotal != null">
service_price_total,
</if>
<if test="totalPrice != null">
total_price,
</if>
<if test="promotionDiscount != null">
promotion_discount,
</if>
<if test="actPrice != null">
act_price,
</if>
<if test="actPowerPrice != null">
act_power_price,
</if>
<if test="actServicePrice != null">
act_service_price,
</if>
<if test="internetCommission != null">
internet_commission,
</if>
<if test="internetSvcCommission != null">
internet_svc_commission,
</if>
<if test="platformCommission != null">
platform_commission,
</if>
<if test="platformSvcCommisssion != null">
platform_svc_commisssion,
</if>
<if test="operationCommission != null">
operation_commission,
</if>
<if test="operationSvcCommission != null">
operation_svc_commission,
</if>
<if test="startSoc != null">
start_soc,
</if>
<if test="endSoc != null">
end_soc,
</if>
<if test="reconciliationStatus != null">
reconciliation_status,
</if>
<if test="sortingStatus != null">
sorting_status,
</if>
<if test="type != null">
`type`,
</if>
<if test="status != null">
`status`,
</if>
<if test="delFlag != null">
del_flag,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null">
remark,
</if>
<if test="state != null">
`state`,
</if>
<if test="vinNormal != null">
vin_normal,
</if>
<if test="searchValue != null">
search_value,
</if>
<if test="operatorIdEvcs != null">
operator_id_evcs,
</if>
<if test="chargeModelEvcs != null">
charge_model_evcs,
</if>
<if test="connectorPowerEvcs != null">
connector_power_evcs,
</if>
<if test="meterValueEndEvcs != null">
meter_value_end_evcs,
</if>
<if test="meterValueStartEvcs != null">
meter_value_start_evcs,
</if>
<if test="operatorId3rdptyEvcs != null">
operator_id3rdpty_evcs,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="stopReasonEvcs != null">
stop_reason_evcs,
</if>
<if test="totalPower != null">
total_power,
</if>
<if test="userNameEvcs != null">
user_name_evcs,
</if>
<if test="phone != null">
phone,
</if>
<if test="evcsOrderNo != null">
evcs_order_no,
</if>
<if test="confirmResult != null">
confirm_Result,
</if>
<if test="rateModelId != null">
rate_model_id,
</if>
<if test="chargingMode != null">
charging_mode,
</if>
<if test="internetDegreeCommission != null">
internet_degree_commission,
</if>
<if test="source != null">
`source`,
</if>
<if test="tenantId != null">
tenant_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="chargingStationId != null">
#{chargingStationId,jdbcType=BIGINT},
</if>
<if test="chargeOrderId != null">
#{chargeOrderId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="terminalId != null">
#{terminalId,jdbcType=BIGINT},
</if>
<if test="serialNumber != null">
#{serialNumber,jdbcType=VARCHAR},
</if>
<if test="internetSerialNumber != null">
#{internetSerialNumber,jdbcType=VARCHAR},
</if>
<if test="powerPriceTotal != null">
#{powerPriceTotal,jdbcType=DECIMAL},
</if>
<if test="servicePriceTotal != null">
#{servicePriceTotal,jdbcType=DECIMAL},
</if>
<if test="totalPrice != null">
#{totalPrice,jdbcType=DECIMAL},
</if>
<if test="promotionDiscount != null">
#{promotionDiscount,jdbcType=DECIMAL},
</if>
<if test="actPrice != null">
#{actPrice,jdbcType=DECIMAL},
</if>
<if test="actPowerPrice != null">
#{actPowerPrice,jdbcType=DECIMAL},
</if>
<if test="actServicePrice != null">
#{actServicePrice,jdbcType=DECIMAL},
</if>
<if test="internetCommission != null">
#{internetCommission,jdbcType=DECIMAL},
</if>
<if test="internetSvcCommission != null">
#{internetSvcCommission,jdbcType=DECIMAL},
</if>
<if test="platformCommission != null">
#{platformCommission,jdbcType=DECIMAL},
</if>
<if test="platformSvcCommisssion != null">
#{platformSvcCommisssion,jdbcType=DECIMAL},
</if>
<if test="operationCommission != null">
#{operationCommission,jdbcType=DECIMAL},
</if>
<if test="operationSvcCommission != null">
#{operationSvcCommission,jdbcType=DECIMAL},
</if>
<if test="startSoc != null">
#{startSoc,jdbcType=VARCHAR},
</if>
<if test="endSoc != null">
#{endSoc,jdbcType=VARCHAR},
</if>
<if test="reconciliationStatus != null">
#{reconciliationStatus,jdbcType=INTEGER},
</if>
<if test="sortingStatus != null">
#{sortingStatus,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
<if test="vinNormal != null">
#{vinNormal,jdbcType=VARCHAR},
</if>
<if test="searchValue != null">
#{searchValue,jdbcType=VARCHAR},
</if>
<if test="operatorIdEvcs != null">
#{operatorIdEvcs,jdbcType=VARCHAR},
</if>
<if test="chargeModelEvcs != null">
#{chargeModelEvcs,jdbcType=INTEGER},
</if>
<if test="connectorPowerEvcs != null">
#{connectorPowerEvcs,jdbcType=DOUBLE},
</if>
<if test="meterValueEndEvcs != null">
#{meterValueEndEvcs,jdbcType=DOUBLE},
</if>
<if test="meterValueStartEvcs != null">
#{meterValueStartEvcs,jdbcType=DOUBLE},
</if>
<if test="operatorId3rdptyEvcs != null">
#{operatorId3rdptyEvcs,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
<if test="stopReasonEvcs != null">
#{stopReasonEvcs,jdbcType=INTEGER},
</if>
<if test="totalPower != null">
#{totalPower,jdbcType=DOUBLE},
</if>
<if test="userNameEvcs != null">
#{userNameEvcs,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="evcsOrderNo != null">
#{evcsOrderNo,jdbcType=VARCHAR},
</if>
<if test="confirmResult != null">
#{confirmResult,jdbcType=INTEGER},
</if>
<if test="rateModelId != null">
#{rateModelId,jdbcType=BIGINT},
</if>
<if test="chargingMode != null">
#{chargingMode,jdbcType=VARCHAR},
</if>
<if test="internetDegreeCommission != null">
#{internetDegreeCommission,jdbcType=DECIMAL},
</if>
<if test="source != null">
#{source,jdbcType=INTEGER},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.databigscreen.pojo.XhpcHistoryOrder">
update xhpc_history_order
<set>
<if test="chargingStationId != null">
charging_station_id = #{chargingStationId,jdbcType=BIGINT},
</if>
<if test="chargeOrderId != null">
charge_order_id = #{chargeOrderId,jdbcType=BIGINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="terminalId != null">
terminal_id = #{terminalId,jdbcType=BIGINT},
</if>
<if test="serialNumber != null">
serial_number = #{serialNumber,jdbcType=VARCHAR},
</if>
<if test="internetSerialNumber != null">
internet_serial_number = #{internetSerialNumber,jdbcType=VARCHAR},
</if>
<if test="powerPriceTotal != null">
power_price_total = #{powerPriceTotal,jdbcType=DECIMAL},
</if>
<if test="servicePriceTotal != null">
service_price_total = #{servicePriceTotal,jdbcType=DECIMAL},
</if>
<if test="totalPrice != null">
total_price = #{totalPrice,jdbcType=DECIMAL},
</if>
<if test="promotionDiscount != null">
promotion_discount = #{promotionDiscount,jdbcType=DECIMAL},
</if>
<if test="actPrice != null">
act_price = #{actPrice,jdbcType=DECIMAL},
</if>
<if test="actPowerPrice != null">
act_power_price = #{actPowerPrice,jdbcType=DECIMAL},
</if>
<if test="actServicePrice != null">
act_service_price = #{actServicePrice,jdbcType=DECIMAL},
</if>
<if test="internetCommission != null">
internet_commission = #{internetCommission,jdbcType=DECIMAL},
</if>
<if test="internetSvcCommission != null">
internet_svc_commission = #{internetSvcCommission,jdbcType=DECIMAL},
</if>
<if test="platformCommission != null">
platform_commission = #{platformCommission,jdbcType=DECIMAL},
</if>
<if test="platformSvcCommisssion != null">
platform_svc_commisssion = #{platformSvcCommisssion,jdbcType=DECIMAL},
</if>
<if test="operationCommission != null">
operation_commission = #{operationCommission,jdbcType=DECIMAL},
</if>
<if test="operationSvcCommission != null">
operation_svc_commission = #{operationSvcCommission,jdbcType=DECIMAL},
</if>
<if test="startSoc != null">
start_soc = #{startSoc,jdbcType=VARCHAR},
</if>
<if test="endSoc != null">
end_soc = #{endSoc,jdbcType=VARCHAR},
</if>
<if test="reconciliationStatus != null">
reconciliation_status = #{reconciliationStatus,jdbcType=INTEGER},
</if>
<if test="sortingStatus != null">
sorting_status = #{sortingStatus,jdbcType=INTEGER},
</if>
<if test="type != null">
`type` = #{type,jdbcType=TINYINT},
</if>
<if test="status != null">
`status` = #{status,jdbcType=INTEGER},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="state != null">
`state` = #{state,jdbcType=INTEGER},
</if>
<if test="vinNormal != null">
vin_normal = #{vinNormal,jdbcType=VARCHAR},
</if>
<if test="searchValue != null">
search_value = #{searchValue,jdbcType=VARCHAR},
</if>
<if test="operatorIdEvcs != null">
operator_id_evcs = #{operatorIdEvcs,jdbcType=VARCHAR},
</if>
<if test="chargeModelEvcs != null">
charge_model_evcs = #{chargeModelEvcs,jdbcType=INTEGER},
</if>
<if test="connectorPowerEvcs != null">
connector_power_evcs = #{connectorPowerEvcs,jdbcType=DOUBLE},
</if>
<if test="meterValueEndEvcs != null">
meter_value_end_evcs = #{meterValueEndEvcs,jdbcType=DOUBLE},
</if>
<if test="meterValueStartEvcs != null">
meter_value_start_evcs = #{meterValueStartEvcs,jdbcType=DOUBLE},
</if>
<if test="operatorId3rdptyEvcs != null">
operator_id3rdpty_evcs = #{operatorId3rdptyEvcs,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="stopReasonEvcs != null">
stop_reason_evcs = #{stopReasonEvcs,jdbcType=INTEGER},
</if>
<if test="totalPower != null">
total_power = #{totalPower,jdbcType=DOUBLE},
</if>
<if test="userNameEvcs != null">
user_name_evcs = #{userNameEvcs,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="evcsOrderNo != null">
evcs_order_no = #{evcsOrderNo,jdbcType=VARCHAR},
</if>
<if test="confirmResult != null">
confirm_Result = #{confirmResult,jdbcType=INTEGER},
</if>
<if test="rateModelId != null">
rate_model_id = #{rateModelId,jdbcType=BIGINT},
</if>
<if test="chargingMode != null">
charging_mode = #{chargingMode,jdbcType=VARCHAR},
</if>
<if test="internetDegreeCommission != null">
internet_degree_commission = #{internetDegreeCommission,jdbcType=DECIMAL},
</if>
<if test="source != null">
`source` = #{source,jdbcType=INTEGER},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=VARCHAR},
</if>
</set>
where history_order_id = #{historyOrderId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.xhpc.databigscreen.pojo.XhpcHistoryOrder">
update xhpc_history_order
set charging_station_id = #{chargingStationId,jdbcType=BIGINT},
charge_order_id = #{chargeOrderId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=BIGINT},
terminal_id = #{terminalId,jdbcType=BIGINT},
serial_number = #{serialNumber,jdbcType=VARCHAR},
internet_serial_number = #{internetSerialNumber,jdbcType=VARCHAR},
power_price_total = #{powerPriceTotal,jdbcType=DECIMAL},
service_price_total = #{servicePriceTotal,jdbcType=DECIMAL},
total_price = #{totalPrice,jdbcType=DECIMAL},
promotion_discount = #{promotionDiscount,jdbcType=DECIMAL},
act_price = #{actPrice,jdbcType=DECIMAL},
act_power_price = #{actPowerPrice,jdbcType=DECIMAL},
act_service_price = #{actServicePrice,jdbcType=DECIMAL},
internet_commission = #{internetCommission,jdbcType=DECIMAL},
internet_svc_commission = #{internetSvcCommission,jdbcType=DECIMAL},
platform_commission = #{platformCommission,jdbcType=DECIMAL},
platform_svc_commisssion = #{platformSvcCommisssion,jdbcType=DECIMAL},
operation_commission = #{operationCommission,jdbcType=DECIMAL},
operation_svc_commission = #{operationSvcCommission,jdbcType=DECIMAL},
start_soc = #{startSoc,jdbcType=VARCHAR},
end_soc = #{endSoc,jdbcType=VARCHAR},
reconciliation_status = #{reconciliationStatus,jdbcType=INTEGER},
sorting_status = #{sortingStatus,jdbcType=INTEGER},
`type` = #{type,jdbcType=TINYINT},
`status` = #{status,jdbcType=INTEGER},
del_flag = #{delFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
`state` = #{state,jdbcType=INTEGER},
vin_normal = #{vinNormal,jdbcType=VARCHAR},
search_value = #{searchValue,jdbcType=VARCHAR},
operator_id_evcs = #{operatorIdEvcs,jdbcType=VARCHAR},
charge_model_evcs = #{chargeModelEvcs,jdbcType=INTEGER},
connector_power_evcs = #{connectorPowerEvcs,jdbcType=DOUBLE},
meter_value_end_evcs = #{meterValueEndEvcs,jdbcType=DOUBLE},
meter_value_start_evcs = #{meterValueStartEvcs,jdbcType=DOUBLE},
operator_id3rdpty_evcs = #{operatorId3rdptyEvcs,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
stop_reason_evcs = #{stopReasonEvcs,jdbcType=INTEGER},
total_power = #{totalPower,jdbcType=DOUBLE},
user_name_evcs = #{userNameEvcs,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
evcs_order_no = #{evcsOrderNo,jdbcType=VARCHAR},
confirm_Result = #{confirmResult,jdbcType=INTEGER},
rate_model_id = #{rateModelId,jdbcType=BIGINT},
charging_mode = #{chargingMode,jdbcType=VARCHAR},
internet_degree_commission = #{internetDegreeCommission,jdbcType=DECIMAL},
`source` = #{source,jdbcType=INTEGER},
tenant_id = #{tenantId,jdbcType=VARCHAR}
where history_order_id = #{historyOrderId,jdbcType=BIGINT}
</update>
</mapper>