增加日志管理模块

This commit is contained in:
panshuling321 2021-12-28 16:30:37 +08:00
parent 84bd6fbecb
commit e0be09ffab
33 changed files with 1868 additions and 0 deletions

35
xhpc-modules/xhpc-log/.gitignore vendored Normal file
View File

@ -0,0 +1,35 @@
HELP.md
target/
.mvn/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea/
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>xhpc-modules</artifactId>
<version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>xhpc-log</artifactId>
<description>
日志服务
</description>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.6</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Alibaba Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- RuoYi Common DataSource -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-datasource</artifactId>
</dependency>
<!-- RuoYi Common Core -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-core</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>xhpc-common</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.12</version>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.10.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,22 @@
package com.xhpc.log;
import com.xhpc.common.security.annotation.EnableCustomConfig;
import com.xhpc.common.security.annotation.EnableRyFeignClients;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@EnableCustomConfig
@SpringBootApplication
@EnableRyFeignClients
@EnableDiscoveryClient
@MapperScan("com.xhpc.log.mapper")
public class XhpcLogApplication {
public static void main(String[] args) {
SpringApplication.run(XhpcLogApplication.class, args);
}
}

View File

@ -0,0 +1,38 @@
package com.xhpc.log.controller;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.log.service.OrderLogService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* 订单报文日志
*/
@RestController
@RequestMapping("/log/order/")
public class OrderLogController extends BaseController {
@Resource
OrderLogService orderLogService;
@GetMapping("/getPage")
public TableDataInfo getOrderPage(){
startPage();
return getDataTable(orderLogService.getOrderPage());
}
@GetMapping("/order/{orderId}")
public TableDataInfo getOrderDetailPage(@PathVariable("orderId") String orderId){
startPage();
return getDataTable(orderLogService.getOrderDetailPage(orderId));
}
}

View File

@ -0,0 +1,39 @@
package com.xhpc.log.controller;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.log.service.PileLogService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* 桩运行日志
*/
@RestController
@RequestMapping("/log/pile")
public class PileLogController extends BaseController {
@Resource
PileLogService pileLogService;
@GetMapping("/getPage")
public TableDataInfo getPilePage() {
startPage();
return getDataTable(pileLogService.getPilePage());
}
@GetMapping("/pile/{pileId}")
public TableDataInfo getPileDetailPage(@PathVariable("pileId") Long pileId) {
startPage();
return getDataTable(pileLogService.getPileRunLogPage(pileId));
}
}

View File

@ -0,0 +1,45 @@
package com.xhpc.log.controller;
import com.xhpc.common.core.utils.SecurityUtils;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.log.service.PileLogService;
import com.xhpc.log.service.StationLogService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@RequestMapping("/log/station")
public class StationLogController extends BaseController {
@Resource
StationLogService stationLogService;
@GetMapping("/getPage")
public TableDataInfo getPilePage() {
startPage();
Long operatorId = SecurityUtils.getUserId();
int type = 1;
return getDataTable(stationLogService.getStationPage(operatorId, type));
}
@GetMapping("/pile/{pileId}")
public TableDataInfo getPileDetailPage(@PathVariable("pileId") Long pileId) {
startPage();
return getDataTable(stationLogService.getStationRatePage(pileId));
}
@GetMapping("/rate/{rateId}")
public AjaxResult getRateInfo(@PathVariable("rateId") Integer rateId) {
return AjaxResult.success(stationLogService.getRateInfo(rateId));
}
}

View File

@ -0,0 +1,30 @@
package com.xhpc.log.controller;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.log.service.SystemLogService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* 系统操作日志
*/
@RestController
@RequestMapping("/log/system")
public class SystemLogController extends BaseController {
@Resource
SystemLogService systemLogService;
@GetMapping("/getPage")
public TableDataInfo getPage(){
startPage();
return getDataTable(systemLogService.getPage(null));
}
}

View File

@ -0,0 +1,170 @@
package com.xhpc.log.domain;
import lombok.Data;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@Table(name="xhpc_charge_order")
public class XhpcChargeOrderDomain implements Serializable {
/**
* 充电订单id
*/
private Long chargeOrderId;
/**
* 电站id
*/
private Long chargingStationId;
/**
* 用户id
*/
private Long userId;
/**
* 终端id
*/
private Long terminalId;
/**
* 互联网流水订单号
*/
private String internetSerialNumber;
/**
* 订单编号
*/
private String serialNumber;
/**
* 充电启始soc
*/
private String startSoc;
/**
* 结束soc
*/
private String endSoc;
/**
* 订单来源0C端用户 1流量用户
*/
private Integer source;
/**
* 状态-1准备充电 0开始充电 1自动结算2异常3平台结算
*/
private Integer status;
/**
* 删除标志0代表存在 1代表删除
*/
private Integer delFlag;
/**
* 创建时间
*/
private Date createTime;
/**
* 创建者
*/
private String createBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 更新者
*/
private String updateBy;
/**
* 备注
*/
private String remark;
/**
* 费率模型id
*/
private Long rateModelId;
/**
* 充电方式
*/
private String chargingMode;
/**
* 开始充电时间
*/
private Date startTime;
/**
* 结束充电时间
*/
private Date endTime;
/**
* 充电时长
*/
private String chargingTime;
/**
* 充电度数
*/
private BigDecimal chargingDegree;
/**
* 协议定,停止方式
*/
private Integer type;
/**
* 异常备注
*/
private String erroRemark;
/**
* 总金额
*/
private BigDecimal amountCharged;
/**
* 功率
*/
private String power;
/**
* 充电时长
*/
private Long chargingTimeNumber;
/**
* 司机唯一标识手机号
*/
private String driverId;
/**
* 充电金额
*/
private Integer chargingAmt;
/**
* 车牌
*/
private String plateNum;
/**
* 符合Evcs标准的订单号,并非来自第三方的订单号
*/
private String evcsOrderNo;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,250 @@
package com.xhpc.log.domain;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* xhpc_history_order
* @author
*/
@Data
public class XhpcHistoryOrderDomain implements Serializable {
/**
* 历史订单id
*/
private Long historyOrderId;
/**
* 电站id
*/
private Long chargingStationId;
/**
* 场站名称
*/
private String chargingStationName;
/**
* 充电订单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;
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 Double chargingDegree;
/**
* 充电时长
*/
private String chargingTime;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,54 @@
package com.xhpc.log.domain;
import com.xhpc.common.core.web.domain.BaseEntity;
/**
* program: ruoyi
* User: HongYun
* Date:2021-09-13 15
*/
public class XhpcMessageDomain extends BaseEntity {
private Long messageId;
private String chargeOrderNo;
private String content;
private Integer status;
public Long getMessageId() {
return messageId;
}
public void setMessageId(Long messageId) {
this.messageId = messageId;
}
public String getChargeOrderNo() {
return chargeOrderNo;
}
public void setChargeOrderNo(String chargeOrderNo) {
this.chargeOrderNo = chargeOrderNo;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}

View File

@ -0,0 +1,18 @@
package com.xhpc.log.mapper;
import com.xhpc.system.api.domain.SysOperLog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 操作日志 数据层
*
* @author ruoyi
*/
public interface SysOperLogMapper {
List<Map<String, Object>> selectUserOperLog(@Param("operName") String operName);
}

View File

@ -0,0 +1,8 @@
package com.xhpc.log.mapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface XhpcChargeOrderMapper {
}

View File

@ -0,0 +1,61 @@
package com.xhpc.log.mapper;
import com.xhpc.common.domain.XhpcChargingPile;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author yuyang
* @date 2021/7/27 14:37
*/
public interface XhpcChargingPileMapper {
/**
* 桩列表
*
* @param serialNumber 桩编号
* @param type 桩类型
* @param name 桩名称
* @return
*/
List<Map<String, Object>> selectXhpcChargingPileList(@Param("operatorId")Long operatorId, @Param("number")Integer number);
/**
* 终端
*
* @param xhpcChargingPile 终端
* @return 结果
*/
int addXhpcChargingPile(XhpcChargingPile xhpcChargingPile);
/**
* 查询电站
*
* @param chargingStationId 电站ID
* @return 电站
*/
Map<String, Object> selectXhpcChargingStationById(Long chargingStationId);
/**
* 查询桩
*
* @param chargingPileId 终端ID
* @return 电站
*/
XhpcChargingPile selectXhpcChargingPileById(Long chargingPileId);
/**
* 终端列表
*
* @param chargingPileId 桩id
* @return
*/
List<Map<String, Object>> selectXhpcTerminalList(@Param("chargingPileId") Long chargingPileId);
XhpcChargingPile getXhpcChargingPileBySerialNumber(@Param("serialNumber") String serialNumber);
}

View File

@ -0,0 +1,33 @@
package com.xhpc.log.mapper;
import com.xhpc.common.domain.XhpcChargingStation;
import com.xhpc.common.domain.XhpcRate;
import com.xhpc.common.domain.XhpcRateModel;
import com.xhpc.common.domain.XhpcRateTime;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 电站Mapper接口
*
* @author yuyang
* @date 2021-07-19
*/
public interface XhpcChargingStationMapper {
/**
* 查询电站列表
*
* @return 电站集合
*/
List<Map<String, Object>> selectXhpcChargingStationList(@Param("operatorId")Long operatorId,@Param("type")Integer type);
List<Map<String, Object>> selectRateListByStationId(@Param("stationId")Long stationId);
List<Map<String, Object>> selectRateTimeListByRateId(@Param("rateId")Integer rateId);
}

View File

@ -0,0 +1,16 @@
package com.xhpc.log.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface XhpcHistoryOrderMapper {
List<Map<String, Object>> getOrderPage(@Param("operatorId") Long operatorId, @Param("number") Integer number);
List<Map<String, Object>> getOrderMessagePage(@Param("serialNumber")String serialNumber);
}

View File

@ -0,0 +1,10 @@
package com.xhpc.log.mapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface XhpcMessageMapper {
}

View File

@ -0,0 +1,14 @@
package com.xhpc.log.service;
import java.util.List;
import java.util.Map;
public interface OrderLogService {
List<Map<String, Object>> getOrderPage();
List<Map<String, Object>> getOrderDetailPage(String orderId);
}

View File

@ -0,0 +1,16 @@
package com.xhpc.log.service;
import com.xhpc.common.domain.XhpcChargingPile;
import java.util.List;
import java.util.Map;
public interface PileLogService {
List<Map<String, Object>> getPilePage();
List<Map<String, Object>> getPileRunLogPage(Long pileId);
}

View File

@ -0,0 +1,16 @@
package com.xhpc.log.service;
import java.util.List;
import java.util.Map;
public interface StationLogService {
List<Map<String, Object>> getStationPage(Long operatorId, int type);
List<Map<String, Object>> getStationRatePage(Long stationId);
List<Map<String, Object>> getRateInfo(int rateId);
}

View File

@ -0,0 +1,11 @@
package com.xhpc.log.service;
import java.util.List;
import java.util.Map;
public interface SystemLogService {
List<Map<String, Object>> getPage(String userName);
}

View File

@ -0,0 +1,31 @@
package com.xhpc.log.service.impl;
import com.xhpc.common.core.utils.SecurityUtils;
import com.xhpc.log.mapper.XhpcHistoryOrderMapper;
import com.xhpc.log.service.OrderLogService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class OrderLogServiceImpl implements OrderLogService {
@Resource
XhpcHistoryOrderMapper historyOrderMapper;
@Override
public List<Map<String, Object>> getOrderPage(){
Long operatorId = SecurityUtils.getUserId();
return historyOrderMapper.getOrderPage(operatorId, 1);
}
@Override
public List<Map<String, Object>> getOrderDetailPage(String orderId){
return historyOrderMapper.getOrderMessagePage(orderId);
}
}

View File

@ -0,0 +1,31 @@
package com.xhpc.log.service.impl;
import com.xhpc.common.core.utils.SecurityUtils;
import com.xhpc.log.mapper.XhpcChargingPileMapper;
import com.xhpc.log.service.PileLogService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class PileLogServiceImpl implements PileLogService {
@Resource
XhpcChargingPileMapper pileMapper;
@Override
public List<Map<String, Object>> getPilePage(){
Long operatorId = SecurityUtils.getUserId();
return pileMapper.selectXhpcChargingPileList(operatorId , 1);
}
@Override
public List<Map<String, Object>> getPileRunLogPage(Long pileId){
// todo 待完善电桩运行日志
return null;
}
}

View File

@ -0,0 +1,34 @@
package com.xhpc.log.service.impl;
import com.xhpc.log.mapper.XhpcChargingStationMapper;
import com.xhpc.log.service.StationLogService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class StationLogServiceImpl implements StationLogService {
@Resource
XhpcChargingStationMapper stationMapper;
@Override
public List<Map<String, Object>> getStationPage(Long operatorId, int type){
return stationMapper.selectXhpcChargingStationList(operatorId, type);
}
@Override
public List<Map<String, Object>> getStationRatePage(Long stationId){
return stationMapper.selectRateListByStationId(stationId);
}
@Override
public List<Map<String, Object>> getRateInfo(int rateId){
return stationMapper.selectRateTimeListByRateId(rateId);
}
}

View File

@ -0,0 +1,22 @@
package com.xhpc.log.service.impl;
import com.xhpc.log.mapper.SysOperLogMapper;
import com.xhpc.log.service.SystemLogService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class SystemLogServiceImpl implements SystemLogService {
@Resource
SysOperLogMapper operLogMapper;
@Override
public List<Map<String, Object>> getPage(String userName){
return operLogMapper.selectUserOperLog(userName);
}
}

View File

@ -0,0 +1,9 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}
,--.
,--. ,--. | ,---. ,---. ,---.
\ `' / | .-. | | .-. | | .--'
/ /. \ | | | | | '-' ' \ `--.
'--' '--' `--' `--' | |-' `---'
`--'

View File

@ -0,0 +1,90 @@
# Tomcat
server:
port: 8890
# Spring
spring:
application:
# 应用名称
name: xhpc-log
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
logging:
level:
root: info
com.xhpc.tradebill.mapper: debug
file:
path: "d:\\logs"
pattern:
console: '%d{yyyy/MM/dd-HH:mm:ss} [%thread] %-5level %logger- %msg%n'
file: '%d{yyyy/MM/dd-HH:mm:ss} [%thread] %-5level %logger- %msg%n'
wx:
pay:
appId: "wxd0a48e00319ef8a7"
mchId: "1514355771"
mchKey: "sichuanxianghuakejiyouxiangongsi"
keyPath:
alibaba:
pay:
gatewayDomain: "https://openapi.alipay.com/gateway.do"
serverDomain: "https://www.scxhua.cn/prod-api/xhpc-payment/alipay/notifyUrl"
publicKey:
privateKey: "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCGHX1s315EKjoIBkNiF3IxCAmvtVg+TdCDL/XmJZWdcZ23tEWmmIMsLRCLUKsaPfTEhnqD6EFJnmpJu4teDImo3aDbOoO31YFEXjMXUnTTS/dtDVEo1OecsRL+Re43KSohOkIL1TMyTuNfeIglQTuhCSZ3LOEOx4OHpYwcrLp8p1ORvAS7x35nsmjLp3oQTJo9RWfzfEaKbm6cxsWLKyr5/5eGDXrUHNC5hIDLjoJbe6iqNKyIiPJHtPZfJ36PcWa7PFvx4X+Ded32KZb2AA3p9w/HX7gn1MnRfT5NGH0k3ggxLNarDU8g6JjQYgNtmE/R8gbp99BudZNfDoSF1llNAgMBAAECggEAaTa9bSoXM/bErALt3ghyx1B8+OGVpts5F5IKoVEe/PNjPfkpIzdGwONhtUnF0cKFQaAWgWE1xuGGlO2Sumevn1Cvnw1axF+1F8Om5UcE67cPFvh5kUTlpyGrutt1tMSQjpy7r7jEf1UwP3e5pzBz7TPWf2wv635OC56uOtivPJZ+8vg7VYon/mNXQuL4AavoxfSDtvo0ad30X2fK1WKeeBtgiT4UzV6ZGZh5igKQHM4lVvmbo/jOeQD0KAod7pRe/h4FBFmCVIWwgW+I+Hnzp8A/nJezoowJ3jiTt0FodC9uBCT64ZCz5dVCryD62LDVjKBxB7cfIoQA+PxCiXr9QQKBgQD+2v38J/MlfK/XCYldclzumizwIw6T0Mv6XvYwXQHYgYDKYNF6k1LhMEUo7fP3EsPdV8h/nXmdU4qadOVm6QSJ/rGEl22yGlO7woUzTY/Ls9eknoqfMYuyI1+ICMnNxmesQbWyc0cOHh44cEF+icfJxEDAmrHGLmBVsKuLUJUuVQKBgQCGt663TF7mixghiUOcT11zC1fqG+dIcvAwHpCHfdxsniYRqnv+SLf6eC5PCkQ5aNAAl/ywOLQAWS0XgYti3LyZ4iuGIYcUE0IDDmhWl68V27iXcLIK+rBRqBGxSdk8xR+zSE8fpO4mXpxn8SH0Butex8PJ+oHTbmdXIUAXdn6HGQKBgQCvAB1rqtsRoL72ADxtCHy78u5srwXxhmyqrc6LgzIjQzn2vejaLJO6wfSbmFnwDNimAwNQbgf2ekkwqphjxBozz8qB66GNrPpWccoZYmcdT48CIUO68MCmQBf3R2GbhWPnKu/ja7kc/p1tz9eJVn70E2kLWK4+EdZgwQHqlhj6SQKBgF4AmbdpYOb5s9Li1vyhHJIEHkpLQi15lkPdb/g7SK26BNJa5b5fu5DYf2fDwCtXCZ0AcN/+EQwVLbOzPzGy2R9/g+NKTdkiPvOnAAM8QH2+HaX+ix3CI3o3DnFpGF6hJieRkzR/f3Ximryks451rZMrTWEIncKMzSstFm3Izy0xAoGBAJQaMqlzpM+QaJiytJNeqRpPWRsi0Dkf4XqJXPWLOrApSISsafZF5vk2ZOeIqRsVCBH3LdfVIJxEBAF4l/Sd2q7xC9JHawJDqa4ea7VwL68ANH2w3jcJ3j6DQqf7NIe/lSGxYF6Jt+74oRFHxN3GDSf+z91DYfZz8hQnyphKDNEJ"
appId: "2021002156615717"
certPath: "/www/wwwroot/scxhua.cn/xhpc-payment/appCertPublicKey.crt"
publicCertPath: "/www/wwwroot/scxhua.cn/xhpc-payment/alipayCertPublicKey_RSA2.crt"
rootCertPath: "/www/wwwroot/scxhua.cn/xhpc-payment/alipayRootCert.crt"
###获取微信openid地址
#WXGETJSCODE: "https://api.weixin.qq.com/sns/jscode2session?appid=wxb14ef93e9b7901f3&secret=b5c5672141b5930c30a1abee95a2dcbf&js_code="
###阿里云身份证验证地址
#VERIFYCARD: "http://idenauthen.market.alicloudapi.com/idenAuthentication"
##阿里云身份证验证地址appcode
#APPCODE: "APPCODE e26d9088b58e24af69411d5933cece47"
##小程序appid
#APPID: "wxd0a48e00319ef8a7"
##小程序绑定商户id
#MCHID: "1514355771"
##商户后台设置的key
#KEY: "sichuanxianghuakejiyouxiangongsi"
##微信小程序支付地址
#WXPAYUNIFIEDORDER: "https://api.mch.weixin.qq.com/pay/unifiedorder"
##微信支付回调地址
#SERVERDOMAIN: "http://www.scxhua.cn/prod-api/xhpc-payment/wx/paymentCallback"
##微信小程序支付地址
#WXTRANSFERS: "https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers"
##支付宝支付回调地址
#ALIPAYPSERVERDOMAIN: "https://www.scxhua.cn/prod-api/xhpc-payment/alipay/notifyUrl"
##支付宝公钥
#ALIPAYPUBLICKEY:
##应用私钥
#ALIPAYPRIVATEKEY: "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCGHX1s315EKjoIBkNiF3IxCAmvtVg+TdCDL/XmJZWdcZ23tEWmmIMsLRCLUKsaPfTEhnqD6EFJnmpJu4teDImo3aDbOoO31YFEXjMXUnTTS/dtDVEo1OecsRL+Re43KSohOkIL1TMyTuNfeIglQTuhCSZ3LOEOx4OHpYwcrLp8p1ORvAS7x35nsmjLp3oQTJo9RWfzfEaKbm6cxsWLKyr5/5eGDXrUHNC5hIDLjoJbe6iqNKyIiPJHtPZfJ36PcWa7PFvx4X+Ded32KZb2AA3p9w/HX7gn1MnRfT5NGH0k3ggxLNarDU8g6JjQYgNtmE/R8gbp99BudZNfDoSF1llNAgMBAAECggEAaTa9bSoXM/bErALt3ghyx1B8+OGVpts5F5IKoVEe/PNjPfkpIzdGwONhtUnF0cKFQaAWgWE1xuGGlO2Sumevn1Cvnw1axF+1F8Om5UcE67cPFvh5kUTlpyGrutt1tMSQjpy7r7jEf1UwP3e5pzBz7TPWf2wv635OC56uOtivPJZ+8vg7VYon/mNXQuL4AavoxfSDtvo0ad30X2fK1WKeeBtgiT4UzV6ZGZh5igKQHM4lVvmbo/jOeQD0KAod7pRe/h4FBFmCVIWwgW+I+Hnzp8A/nJezoowJ3jiTt0FodC9uBCT64ZCz5dVCryD62LDVjKBxB7cfIoQA+PxCiXr9QQKBgQD+2v38J/MlfK/XCYldclzumizwIw6T0Mv6XvYwXQHYgYDKYNF6k1LhMEUo7fP3EsPdV8h/nXmdU4qadOVm6QSJ/rGEl22yGlO7woUzTY/Ls9eknoqfMYuyI1+ICMnNxmesQbWyc0cOHh44cEF+icfJxEDAmrHGLmBVsKuLUJUuVQKBgQCGt663TF7mixghiUOcT11zC1fqG+dIcvAwHpCHfdxsniYRqnv+SLf6eC5PCkQ5aNAAl/ywOLQAWS0XgYti3LyZ4iuGIYcUE0IDDmhWl68V27iXcLIK+rBRqBGxSdk8xR+zSE8fpO4mXpxn8SH0Butex8PJ+oHTbmdXIUAXdn6HGQKBgQCvAB1rqtsRoL72ADxtCHy78u5srwXxhmyqrc6LgzIjQzn2vejaLJO6wfSbmFnwDNimAwNQbgf2ekkwqphjxBozz8qB66GNrPpWccoZYmcdT48CIUO68MCmQBf3R2GbhWPnKu/ja7kc/p1tz9eJVn70E2kLWK4+EdZgwQHqlhj6SQKBgF4AmbdpYOb5s9Li1vyhHJIEHkpLQi15lkPdb/g7SK26BNJa5b5fu5DYf2fDwCtXCZ0AcN/+EQwVLbOzPzGy2R9/g+NKTdkiPvOnAAM8QH2+HaX+ix3CI3o3DnFpGF6hJieRkzR/f3Ximryks451rZMrTWEIncKMzSstFm3Izy0xAoGBAJQaMqlzpM+QaJiytJNeqRpPWRsi0Dkf4XqJXPWLOrApSISsafZF5vk2ZOeIqRsVCBH3LdfVIJxEBAF4l/Sd2q7xC9JHawJDqa4ea7VwL68ANH2w3jcJ3j6DQqf7NIe/lSGxYF6Jt+74oRFHxN3GDSf+z91DYfZz8hQnyphKDNEJ"
##支付宝appid
#ALIPAYAPPID: "2021002156615717"
##应用公钥证书路径
#CERTPATH: "/www/wwwroot/scxhua.cn/xhpc-payment/appCertPublicKey.crt"
##支付宝公钥证书路径
#PUBLICCERTPATH: "/www/wwwroot/scxhua.cn/xhpc-payment/alipayCertPublicKey_RSA2.crt"
##支付宝根证书路径
#ROOTCRETPATH: "/www/wwwroot/scxhua.cn/xhpc-payment/alipayRootCert.crt"

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="logs/xhpc-order"/>
<!-- 日志输出格式 -->
<property name="log.pattern"
value="%d{MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.xhpc" level="info"/>
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn"/>
<root level="info">
<appender-ref ref="console"/>
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info"/>
<appender-ref ref="file_error"/>
</root>
</configuration>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhpc.log.mapper.SysOperLogMapper">
<select id="selectUserOperLog" resultType="map">
select
oper_id as 'openId',
title as 'title',
business_type as 'businessType',
method as 'method',
request_method as 'requestMethod',
operator_type as 'operatorType',
oper_name as 'operName',
dept_name as 'deptName',
oper_url as 'operUrl',
oper_id as 'operIp',
oper_location as 'operLocation',
oper_param as 'operParam',
json_result as 'jsonResult',
status as 'status',
error_msg as 'errorMsg',
oper_time as 'operTime'
from sys_oper_log
<where>
<if test="operName!=null and operName!=''">
oper_name = #{operName}
</if>
</where>
</select>
</mapper>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhpc.log.mapper.XhpcChargeOrderMapper">
</mapper>

View File

@ -0,0 +1,423 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhpc.log.mapper.XhpcChargingPileMapper">
<resultMap id="BaseResultMap" type="com.xhpc.common.domain.XhpcChargingPile">
<result property="chargingPileId" column="charging_pile_id"/>
<result property="chargingStationId" column="charging_station_id"/>
<result property="name" column="name"/>
<result property="nationalStandard" column="national_standard"/>
<result property="power" column="power"/>
<result property="auxiliaryPowerSupply" column="auxiliary_power_supply"/>
<result property="inputVoltage" column="input_voltage"/>
<result property="maxVoltage" column="max_voltage"/>
<result property="minVoltage" column="min_voltage"/>
<result property="maxElectricCurrent" column="max_electric_current"/>
<result property="minElectriCurrent" column="min_electric_current"/>
<result property="serialNumber" column="serial_number"/>
<result property="type" column="type"/>
<result property="programVersion" column="program_version"/>
<result property="networkLinkType" column="network_link_type"/>
<result property="gunNumber" column="gun_number"/>
<result property="communicationProtocolVersion" column="communication_protocol_version"/>
<result property="communicationOperator" column="communication_operator"/>
<result property="simCard" column="sim_card"/>
<result property="rateModelId" column="rate_model_id"/>
<result property="status" column="status"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
<result property="brandModel" column="brand_model"/>
</resultMap>
<sql id="selectXhpcChargingPileVo">
select charging_pile_id,
charging_station_id,
name,
national_standard,
power,
auxiliary_power_supply,
input_voltage,
max_voltage,
min_voltage,
max_electric_current,
min_electric_current,
serial_number,
type,
program_version,
network_link_type,
gun_number,
communication_protocol_version,
communication_operator,
sim_card,
rate_model_id,
status,
del_flag,
create_time,
create_by,
update_time,
update_by,
remark,
rate_model_id,
brand_model,
production_date productionDate,
manufacture_name manufactureName,
connector_type connectorType,
current,
equipment_type equipmentType
from xhpc_charging_pile
</sql>
<select id="selectXhpcChargingPileList" resultType="java.util.Map">
select
cp.charging_pile_id as chargingPileId,
cp.charging_station_id as chargingStationId,
concat(cp.name,'号桩') as chargingPileName,
st.name as chargingStationName,
cp.serial_number as serialNumber,
cp.brand_model as brandModel,
cp.type as type,
cp.power as power,
cp.gun_number as gunNumber,
cp.status as status
from xhpc_charging_pile as cp
left join xhpc_charging_station as st on st.charging_station_id =cp.charging_station_id
where cp.del_flag =0
<!-- <if test="name !=null and name !=''">-->
<!-- and cp.name like CONCAT('%',#{name},'%')-->
<!-- </if>-->
<!-- <if test="type !=null and type !=''">-->
<!-- and cp.type=#{type}-->
<!-- </if>-->
<!-- <if test="serialNumber !=null and serialNumber!=''">-->
<!-- and cp.serial_number=#{serialNumber}-->
<!-- </if>-->
<!-- <if test="chargingStationId !=null and chargingStationId!=''">-->
<!-- and cp.charging_station_id=#{chargingStationId}-->
<!-- </if>-->
<if test="number !=0 and number ==1">
and cp.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{operatorId})
</if>
<if test="number !=0 and number ==2">
and cp.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{operatorId})
</if>
order by cp.create_time desc
</select>
<insert id="addXhpcChargingPile" parameterType="com.xhpc.common.domain.XhpcChargingPile" useGeneratedKeys="true"
keyProperty="chargingPileId">
insert into xhpc_charging_pile
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != chargingStationId ">
charging_station_id,
</if>
<if test="null != name ">
name,
</if>
<if test="null != nationalStandard ">
national_standard,
</if>
<if test="null != power ">
power,
</if>
<if test="null != auxiliaryPowerSupply ">
auxiliary_power_supply,
</if>
<if test="null != inputVoltage ">
input_voltage,
</if>
<if test="null != maxVoltage ">
max_voltage,
</if>
<if test="null != minVoltage ">
min_voltage,
</if>
<if test="null != maxElectricCurrent ">
max_electric_current,
</if>
<if test="null != minElectriCurrent ">
min_electric_current,
</if>
<if test="null != serialNumber ">
serial_number,
</if>
<if test="null != type ">
type,
</if>
<if test="null != programVersion ">
program_version,
</if>
<if test="null != networkLinkType ">
network_link_type,
</if>
<if test="null != gunNumber ">
gun_number,
</if>
<if test="null != communicationProtocolVersion ">
communication_protocol_version,
</if>
<if test="null != communicationOperator ">
communication_operator,
</if>
<if test="null != simCard ">
sim_card,
</if>
<if test="null != rateModelId ">
rate_model_id,
</if>
<if test="null != status ">
status,
</if>
<if test="null != delFlag ">
del_flag,
</if>
<if test="null != createTime ">
create_time,
</if>
<if test="null != createBy and '' != createBy">
create_by,
</if>
<if test="null != updateTime ">
update_time,
</if>
<if test="null != updateBy and '' != updateBy">
update_by,
</if>
<if test="null != remark and '' != remark">
remark,
</if>
<if test="null != brandModel ">
brand_model,
</if>
<if test="null != productionDate ">
production_date,
</if>
<if test="null != manufactureName ">
manufacture_name,
</if>
<if test="null != connectorType ">
connector_type,
</if>
<if test="null != current ">
current,
</if>
<if test="null != equipmentType ">
equipment_type
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != chargingStationId ">
#{chargingStationId},
</if>
<if test="null != name ">
#{name},
</if>
<if test="null != nationalStandard ">
#{nationalStandard},
</if>
<if test="null != power ">
#{power},
</if>
<if test="null != auxiliaryPowerSupply ">
#{auxiliaryPowerSupply},
</if>
<if test="null != inputVoltage ">
#{inputVoltage},
</if>
<if test="null != maxVoltage ">
#{maxVoltage},
</if>
<if test="null != minVoltage ">
#{minVoltage},
</if>
<if test="null != maxElectricCurrent ">
#{maxElectricCurrent},
</if>
<if test="null != minElectriCurrent ">
#{minElectriCurrent},
</if>
<if test="null != serialNumber ">
#{serialNumber},
</if>
<if test="null != type ">
#{type},
</if>
<if test="null != programVersion ">
#{programVersion},
</if>
<if test="null != networkLinkType ">
#{networkLinkType},
</if>
<if test="null != gunNumber ">
#{gunNumber},
</if>
<if test="null != communicationProtocolVersion ">
#{communicationProtocolVersion},
</if>
<if test="null != communicationOperator ">
#{communicationOperator},
</if>
<if test="null != simCard ">
#{simCard},
</if>
<if test="null != rateModelId ">
#{rateModelId},
</if>
<if test="null != status ">
#{status},
</if>
<if test="null != delFlag ">
#{delFlag},
</if>
<if test="null != createTime ">
#{createTime},
</if>
<if test="null != createBy and '' != createBy">
#{createBy},
</if>
<if test="null != updateTime ">
#{updateTime},
</if>
<if test="null != updateBy and '' != updateBy">
#{updateBy},
</if>
<if test="null != remark and '' != remark">
#{remark},
</if>
<if test="null != brandModel ">
#{brandModel},
</if>
<if test="null != productionDate ">
#{productionDate},
</if>
<if test="null != manufactureName ">
#{manufactureName},
</if>
<if test="null != connectorType ">
#{connectorType},
</if>
<if test="null != current ">
#{current},
</if>
<if test="null != equipmentType ">
#{equipmentType}
</if>
</trim>
</insert>
<select id="selectXhpcChargingStationById" resultType="java.util.Map">
select charging_station_id as chargingStationId,
rate_model_id as rateModelId
from xhpc_charging_station
where charging_station_id = #{chargingStationId}
</select>
<select id="selectXhpcChargingPileById" resultMap="BaseResultMap">
select
charging_pile_id,
charging_station_id,
name,
national_standard,
power,
auxiliary_power_supply,
input_voltage,
max_voltage,
min_voltage,
max_electric_current,
min_electric_current,
serial_number,
type,
program_version,
network_link_type,
gun_number,
communication_protocol_version,
communication_operator,
sim_card,
rate_model_id,
status,
del_flag,
create_time,
create_by,
update_time,
update_by,
remark,
rate_model_id,
brand_model,
production_date productionDate,
manufacture_name manufactureName,
connector_type connectorType,
current,
equipment_type equipmentType
from xhpc_charging_pile
where charging_pile_id = #{chargingPileId}
</select>
<select id="selectXhpcTerminalList" resultType="java.util.Map">
select
te.terminal_id as terminalId,
te.charging_pile_id as chargingPileId,
te.charging_station_id as chargingStationId,
te.name as terminalName,
ct.name as chargingStationName,
te.pile_serial_number as pileSerialNumber,
cp.power as power,
te.serial_number as serialNumber,
cp.max_voltage as maxVoltage,
cp.serial_number as serialNumber,
cp.brand_model as brandModel,
cp.type as pileType,
te.status as status,
te.work_status as workStatus
from xhpc_terminal as te
left join xhpc_charging_station as ct on ct.charging_station_id = te.charging_station_id
left join xhpc_charging_pile as cp on cp.charging_pile_id = te.charging_pile_id
where te.del_flag=0
<if test="chargingPileId !=null">
and te.charging_pile_id=#{chargingPileId}
</if>
</select>
<select id="getXhpcChargingPileBySerialNumber" resultType="com.xhpc.common.domain.XhpcChargingPile">
select
charging_pile_id,
charging_station_id,
name,
national_standard,
power,
auxiliary_power_supply,
input_voltage,
max_voltage,
min_voltage,
max_electric_current,
min_electric_current,
serial_number,
type,
program_version,
network_link_type,
gun_number,
communication_protocol_version,
communication_operator,
sim_card,
rate_model_id,
status,
del_flag,
create_time,
create_by,
update_time,
update_by,
remark,
rate_model_id,
brand_model,
production_date productionDate,
manufacture_name manufactureName,
connector_type connectorType,
current,
equipment_type equipmentType
from xhpc_charging_pile
where serial_number = #{serialNumber}
</select>
</mapper>

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhpc.log.mapper.XhpcChargingStationMapper">
<select id="selectXhpcChargingStationList" resultType="java.util.Map">
select
cs.charging_station_id as chargingStationId,
cs.name as name,
ope.name as operatorName,
cs.address as address,
(select url from xhpc_img where img_id = cs.img_id and del_flag =0 limit 1) as url,
cs.client_visible as clientVisible,
cs.status as status
from xhpc_charging_station as cs
left join xhpc_operator as ope on cs.operator_id = ope.operator_id
where cs.del_flag =0
<if test="type ==1">
and cs.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{operatorId})
</if>
<if test="type ==2">
and cs.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{operatorId})
</if>
</select>
<select id="selectRateListByStationId" resultType="map">
select
rate_model_id as 'rateId',
create_time as 'createTime'
from xhpc_rate_time
where charging_station_id=#{stationId}
group by rate_model_id
</select>
<select id="selectRateTimeListByRateId" resultType="map">
select rt.start_time as startTime,
replace(rt.end_time, '00:00:00', '24:00:00') AS endTime,
rt.rate_id as rateId,
rt.rate_value as id,
ra.name as rateName,
ra.power_fee as powerFee,
ra.service_fee as serviceFee
from xhpc_rate_time as rt
left join xhpc_rate as ra on ra.rate_id = rt.rate_id
where rt.rate_model_id =#{rateId}
</select>
</mapper>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhpc.log.mapper.XhpcHistoryOrderMapper">
<select id="getOrderPage" resultType="map">
select
co.serial_number as 'serialNumber',
co.source as 'source',
case co.source when 0 then 'C端用户'
when 1 then '流量方用户'
when 2 then '社区用户'
when 3 then 'B端用户' end as 'sourceName',
co.start_time as 'startTime',
co.end_time as 'endTime'
from xhpc_charge_order as co
left join xhpc_charging_station as st on st.charging_station_id =co.charging_station_id
where co.del_flag =0
<if test="number !=0 and number ==1">
and co.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{operatorId})
</if>
<if test="number !=0 and number ==2">
and co.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{operatorId})
</if>
order by co.create_time desc
</select>
<select id="getOrderMessagePage" resultType="map">
select
m.message_id as 'messageId',
m.charge_order_no as 'chargeOrderNo',
m.content as 'content',
m.status as 'status',
m.remark as 'remark',
m.create_time as 'createTime'
from xhpc_message m
left join xhpc_history_order h on h.charge_order_id = m.charge_order_no
where h.serial_number=#{serialNumber}
</select>
</mapper>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhpc.log.mapper.XhpcMessageMapper">
</mapper>