场站模块服务

This commit is contained in:
yuyang 2021-07-20 10:30:25 +08:00
parent b2d364ecd8
commit ebba99f4bc
11 changed files with 977 additions and 0 deletions

View File

@ -0,0 +1,112 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>xhpc-modules</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>xhpc-charging-station</artifactId>
<description>
电站服务
</description>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<!-- 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>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Swagger UI -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.fox.version}</version>
</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 DataScope -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-datascope</artifactId>
</dependency>
<!-- RuoYi Common Log -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-log</artifactId>
</dependency>
<!-- RuoYi Common Swagger -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-swagger</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-core</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<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,32 @@
package com.xhpc.charging.station;
import com.ruoyi.common.security.annotation.EnableCustomConfig;
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@EnableCustomConfig
@EnableCustomSwagger2
@EnableRyFeignClients
@SpringBootApplication
@MapperScan("com.xhpc.charging.station.mapper")
public class XhpcChargingStation {
public static void main(String [] args){
SpringApplication.run(XhpcChargingStation.class,args);
System.out.println("(♥◠‿◠)ノ゙ 电站模块启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
}

View File

@ -0,0 +1,100 @@
package com.xhpc.charging.station.controller;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.PreAuthorize;
import com.xhpc.charging.station.domain.XhpcChargingStation;
import com.xhpc.charging.station.service.IXhpcChargingStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* 电站Controller
*
* @author yuyang
* @date 2021-07-19
*/
@RestController
@RequestMapping("/station")
public class XhpcChargingStationController extends BaseController {
@Autowired
private IXhpcChargingStationService xhpcChargingStationService;
/**
* 查询电站列表
*/
//@PreAuthorize(hasPermi = "system:station:list")
@GetMapping("/list")
public TableDataInfo list(XhpcChargingStation xhpcChargingStation)
{
startPage();
List<Map<String,Object>> list = xhpcChargingStationService.selectXhpcChargingStationList(xhpcChargingStation);
return getDataTable(list);
}
/**
* 导出电站列表
*/
@PreAuthorize(hasPermi = "system:station:export")
@Log(title = "电站", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, XhpcChargingStation xhpcChargingStation) throws IOException
{
//List<XhpcChargingStation> list = xhpcChargingStationService.selectXhpcChargingStationList(xhpcChargingStation);
//ExcelUtil<XhpcChargingStation> util = new ExcelUtil<XhpcChargingStation>(XhpcChargingStation.class);
//util.exportExcel(response, list, "电站数据");
}
/**
* 获取电站详细信息
*/
@PreAuthorize(hasPermi = "system:station:query")
@GetMapping(value = "/{chargingStationId}")
public AjaxResult getInfo(@PathVariable("chargingStationId") Long chargingStationId)
{
return AjaxResult.success(xhpcChargingStationService.selectXhpcChargingStationById(chargingStationId));
}
/**
* 新增电站
*/
@PreAuthorize(hasPermi = "system:station:add")
@Log(title = "电站", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody XhpcChargingStation xhpcChargingStation)
{
return toAjax(xhpcChargingStationService.insertXhpcChargingStation(xhpcChargingStation));
}
/**
* 修改电站
*/
@PreAuthorize(hasPermi = "system:station:edit")
@Log(title = "电站", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody XhpcChargingStation xhpcChargingStation)
{
return toAjax(xhpcChargingStationService.updateXhpcChargingStation(xhpcChargingStation));
}
/**
* 删除电站
*/
//@PreAuthorize(hasPermi = "system:station:remove")
//@Log(title = "电站", businessType = BusinessType.DELETE)
@DeleteMapping("/{chargingStationIds}")
public AjaxResult remove(@PathVariable Long[] chargingStationIds)
{
return toAjax(xhpcChargingStationService.updateXhpcChargingStationByIds(chargingStationIds));
}
}

View File

@ -0,0 +1,249 @@
package com.xhpc.charging.station.domain;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* 电站对象 xhpc_charging_station
*
* @author yuyang
* @date 2021-07-19
*/
public class XhpcChargingStation extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 电站id */
private Long chargingStationId;
/** 名称 */
@Excel(name = "名称")
private String name;
/** 运营商id */
@Excel(name = "运营商id")
private Long operatorId;
/** 电站类型 */
@Excel(name = "电站类型")
private Integer type;
/** 建设场所 */
@Excel(name = "建设场所")
private String constructionSite;
/** 服务设施 */
@Excel(name = "服务设施")
private String serviceFacilities;
/** 周边设施 */
@Excel(name = "周边设施")
private String peripheryFacilities;
/** 地址code */
@Excel(name = "地址code")
private Integer areaCode;
/** 地址 */
@Excel(name = "地址")
private String address;
/** 详细地址 */
@Excel(name = "详细地址")
private String detailedAddress;
/** 进度 */
@Excel(name = "进度")
private String longitude;
/** 维度 */
@Excel(name = "维度")
private String latitude;
/** 停车说明 */
@Excel(name = "停车说明")
private String parkingInstructions;
/** 编号 */
@Excel(name = "编号")
private String serialNumber;
/** 客户端可见类型 */
@Excel(name = "客户端可见类型")
private String clientVisible;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private Integer status;
/** 删除标志0代表存在 2代表删除 */
private Integer delFlag;
/** 当前计费模型id */
@Excel(name = "当前计费模型id")
private Long rateModelId;
public void setChargingStationId(Long chargingStationId)
{
this.chargingStationId = chargingStationId;
}
public Long getChargingStationId()
{
return chargingStationId;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setOperatorId(Long operatorId)
{
this.operatorId = operatorId;
}
public Long getOperatorId()
{
return operatorId;
}
public void setType(Integer type)
{
this.type = type;
}
public Integer getType()
{
return type;
}
public void setConstructionSite(String constructionSite)
{
this.constructionSite = constructionSite;
}
public String getConstructionSite()
{
return constructionSite;
}
public void setServiceFacilities(String serviceFacilities)
{
this.serviceFacilities = serviceFacilities;
}
public String getServiceFacilities()
{
return serviceFacilities;
}
public void setPeripheryFacilities(String peripheryFacilities)
{
this.peripheryFacilities = peripheryFacilities;
}
public String getPeripheryFacilities()
{
return peripheryFacilities;
}
public void setAreaCode(Integer areaCode)
{
this.areaCode = areaCode;
}
public Integer getAreaCode()
{
return areaCode;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setDetailedAddress(String detailedAddress)
{
this.detailedAddress = detailedAddress;
}
public String getDetailedAddress()
{
return detailedAddress;
}
public void setLongitude(String longitude)
{
this.longitude = longitude;
}
public String getLongitude()
{
return longitude;
}
public void setLatitude(String latitude)
{
this.latitude = latitude;
}
public String getLatitude()
{
return latitude;
}
public void setParkingInstructions(String parkingInstructions)
{
this.parkingInstructions = parkingInstructions;
}
public String getParkingInstructions()
{
return parkingInstructions;
}
public void setSerialNumber(String serialNumber)
{
this.serialNumber = serialNumber;
}
public String getSerialNumber()
{
return serialNumber;
}
public void setClientVisible(String clientVisible)
{
this.clientVisible = clientVisible;
}
public String getClientVisible()
{
return clientVisible;
}
public void setStatus(Integer status)
{
this.status = status;
}
public Integer getStatus()
{
return status;
}
public void setDelFlag(Integer delFlag)
{
this.delFlag = delFlag;
}
public Integer getDelFlag()
{
return delFlag;
}
public void setRateModelId(Long rateModelId)
{
this.rateModelId = rateModelId;
}
public Long getRateModelId()
{
return rateModelId;
}
}

View File

@ -0,0 +1,63 @@
package com.xhpc.charging.station.mapper;
import com.xhpc.charging.station.domain.XhpcChargingStation;
import java.util.List;
import java.util.Map;
/**
* 电站Mapper接口
*
* @author yuyang
* @date 2021-07-19
*/
public interface XhpcChargingStationMapper {
/**
* 查询电站
*
* @param chargingStationId 电站ID
* @return 电站
*/
public XhpcChargingStation selectXhpcChargingStationById(Long chargingStationId);
/**
* 查询电站列表
*
* @param xhpcChargingStation 电站
* @return 电站集合
*/
public List<Map<String,Object>> selectXhpcChargingStationList(XhpcChargingStation xhpcChargingStation);
/**
* 新增电站
*
* @param xhpcChargingStation 电站
* @return 结果
*/
public int insertXhpcChargingStation(XhpcChargingStation xhpcChargingStation);
/**
* 修改电站
*
* @param xhpcChargingStation 电站
* @return 结果
*/
public int updateXhpcChargingStation(XhpcChargingStation xhpcChargingStation);
/**
* 删除电站
*
* @param chargingStationId 电站ID
* @return 结果
*/
public int updateXhpcChargingStationById(Long chargingStationId);
/**
* 批量删除电站
*
* @param chargingStationIds 需要删除的数据ID
* @return 结果
*/
public int updateXhpcChargingStationByIds(Long[] chargingStationIds);
}

View File

@ -0,0 +1,63 @@
package com.xhpc.charging.station.service;
import com.xhpc.charging.station.domain.XhpcChargingStation;
import java.util.List;
import java.util.Map;
/**
* 电站Service接口
*
* @author yuyang
* @date 2021-07-19
*/
public interface IXhpcChargingStationService {
/**
* 查询电站
*
* @param chargingStationId 电站ID
* @return 电站
*/
public XhpcChargingStation selectXhpcChargingStationById(Long chargingStationId);
/**
* 查询电站列表
*
* @param xhpcChargingStation 电站
* @return 电站集合
*/
public List<Map<String,Object>> selectXhpcChargingStationList(XhpcChargingStation xhpcChargingStation);
/**
* 新增电站
*
* @param xhpcChargingStation 电站
* @return 结果
*/
public int insertXhpcChargingStation(XhpcChargingStation xhpcChargingStation);
/**
* 修改电站
*
* @param xhpcChargingStation 电站
* @return 结果
*/
public int updateXhpcChargingStation(XhpcChargingStation xhpcChargingStation);
/**
* 批量删除电站
*
* @param chargingStationIds 需要删除的电站ID
* @return 结果
*/
public int updateXhpcChargingStationByIds(Long[] chargingStationIds);
/**
* 删除电站信息
*
* @param chargingStationId 电站ID
* @return 结果
*/
public int updateXhpcChargingStationById(Long chargingStationId);
}

View File

@ -0,0 +1,98 @@
package com.xhpc.charging.station.service;
import com.ruoyi.common.core.utils.DateUtils;
import com.xhpc.charging.station.domain.XhpcChargingStation;
import com.xhpc.charging.station.mapper.XhpcChargingStationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* 电站Service业务层处理
*
* @author yuyang
* @date 2021-07-19
*/
@Service
public class XhpcChargingStationServiceImpl implements IXhpcChargingStationService{
@Autowired
private XhpcChargingStationMapper xhpcChargingStationMapper;
/**
* 查询电站
*
* @param chargingStationId 电站ID
* @return 电站
*/
@Override
public XhpcChargingStation selectXhpcChargingStationById(Long chargingStationId)
{
return xhpcChargingStationMapper.selectXhpcChargingStationById(chargingStationId);
}
/**
* 查询电站列表
*
* @param xhpcChargingStation 电站
* @return 电站
*/
@Override
public List<Map<String,Object>> selectXhpcChargingStationList(XhpcChargingStation xhpcChargingStation)
{
//桩的统计该时段金额
return xhpcChargingStationMapper.selectXhpcChargingStationList(xhpcChargingStation);
}
/**
* 新增电站
*
* @param xhpcChargingStation 电站
* @return 结果
*/
@Override
public int insertXhpcChargingStation(XhpcChargingStation xhpcChargingStation)
{
xhpcChargingStation.setCreateTime(DateUtils.getNowDate());
return xhpcChargingStationMapper.insertXhpcChargingStation(xhpcChargingStation);
}
/**
* 修改电站
*
* @param xhpcChargingStation 电站
* @return 结果
*/
@Override
public int updateXhpcChargingStation(XhpcChargingStation xhpcChargingStation)
{
xhpcChargingStation.setUpdateTime(DateUtils.getNowDate());
return xhpcChargingStationMapper.updateXhpcChargingStation(xhpcChargingStation);
}
/**
* 批量删除电站
*
* @param chargingStationIds 需要删除的电站ID
* @return 结果
*/
@Override
public int updateXhpcChargingStationByIds(Long[] chargingStationIds)
{
return xhpcChargingStationMapper.updateXhpcChargingStationByIds(chargingStationIds);
}
/**
* 删除电站信息
*
* @param chargingStationId 电站ID
* @return 结果
*/
@Override
public int updateXhpcChargingStationById(Long chargingStationId)
{
return xhpcChargingStationMapper.updateXhpcChargingStationById(chargingStationId);
}
}

View File

@ -0,0 +1,10 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}
_ __ _ _
(_) / _|(_)| |
_ __ _ _ ___ _ _ _ ______ | |_ _ | | ___
| '__|| | | | / _ \ | | | || ||______|| _|| || | / _ \
| | | |_| || (_) || |_| || | | | | || || __/
|_| \__,_| \___/ \__, ||_| |_| |_||_| \___|
__/ |
|___/

View File

@ -0,0 +1,25 @@
# Tomcat
server:
port: 9801
# Spring
spring:
application:
# 应用名称
name: xhpc-charging-station
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}

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="logs/xphc-charging-station"/>
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{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,151 @@
<?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.charging.station.mapper.XhpcChargingStationMapper">
<resultMap id="BaseResultMap" type="com.xhpc.charging.station.domain.XhpcChargingStation">
<result property="chargingStationId" column="charging_station_id" />
<result property="name" column="name" />
<result property="operatorId" column="operator_id" />
<result property="type" column="type" />
<result property="constructionSite" column="construction_site" />
<result property="serviceFacilities" column="service_facilities" />
<result property="peripheryFacilities" column="periphery_facilities" />
<result property="areaCode" column="area_code" />
<result property="address" column="address" />
<result property="detailedAddress" column="detailed_address" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="parkingInstructions" column="parking_instructions" />
<result property="serialNumber" column="serial_number" />
<result property="clientVisible" column="client_visible" />
<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="rateModelId" column="rate_model_id" />
</resultMap>
<sql id="selectXhpcChargingStationVo">
select charging_station_id, name, operator_id, type, construction_site, service_facilities, periphery_facilities, area_code, address, detailed_address, longitude, latitude, parking_instructions, serial_number, client_visible, status, del_flag, create_time, create_by, update_time, update_by, remark, rate_model_id from xhpc_charging_station
</sql>
<select id="selectXhpcChargingStationList" resultType="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 charging_station_id = cs.charging_station_id 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
</select>
<select id="selectXhpcChargingStationById" resultMap="BaseResultMap">
<include refid="selectXhpcChargingStationVo"/>
where charging_station_id = #{chargingStationId}
</select>
<insert id="insertXhpcChargingStation" parameterType="com.xhpc.charging.station.domain.XhpcChargingStation">
insert into xhpc_charging_station
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="chargingStationId != null">charging_station_id,</if>
<if test="name != null">name,</if>
<if test="operatorId != null">operator_id,</if>
<if test="type != null">type,</if>
<if test="constructionSite != null">construction_site,</if>
<if test="serviceFacilities != null">service_facilities,</if>
<if test="peripheryFacilities != null">periphery_facilities,</if>
<if test="areaCode != null">area_code,</if>
<if test="address != null">address,</if>
<if test="detailedAddress != null">detailed_address,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="parkingInstructions != null">parking_instructions,</if>
<if test="serialNumber != null">serial_number,</if>
<if test="clientVisible != null">client_visible,</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="rateModelId != null">rate_model_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="chargingStationId != null">#{chargingStationId},</if>
<if test="name != null">#{name},</if>
<if test="operatorId != null">#{operatorId},</if>
<if test="type != null">#{type},</if>
<if test="constructionSite != null">#{constructionSite},</if>
<if test="serviceFacilities != null">#{serviceFacilities},</if>
<if test="peripheryFacilities != null">#{peripheryFacilities},</if>
<if test="areaCode != null">#{areaCode},</if>
<if test="address != null">#{address},</if>
<if test="detailedAddress != null">#{detailedAddress},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="parkingInstructions != null">#{parkingInstructions},</if>
<if test="serialNumber != null">#{serialNumber},</if>
<if test="clientVisible != null">#{clientVisible},</if>
<if test="status != null">#{status},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
<if test="rateModelId != null">#{rateModelId},</if>
</trim>
</insert>
<update id="updateXhpcChargingStation" parameterType="com.xhpc.charging.station.domain.XhpcChargingStation">
update xhpc_charging_station
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="operatorId != null">operator_id = #{operatorId},</if>
<if test="type != null">type = #{type},</if>
<if test="constructionSite != null">construction_site = #{constructionSite},</if>
<if test="serviceFacilities != null">service_facilities = #{serviceFacilities},</if>
<if test="peripheryFacilities != null">periphery_facilities = #{peripheryFacilities},</if>
<if test="areaCode != null">area_code = #{areaCode},</if>
<if test="address != null">address = #{address},</if>
<if test="detailedAddress != null">detailed_address = #{detailedAddress},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="parkingInstructions != null">parking_instructions = #{parkingInstructions},</if>
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
<if test="clientVisible != null">client_visible = #{clientVisible},</if>
<if test="status != null">status = #{status},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="rateModelId != null">rate_model_id = #{rateModelId},</if>
</trim>
where charging_station_id = #{chargingStationId}
</update>
<update id="updateXhpcChargingStationById" parameterType="Long">
update xhpc_charging_station set delFlag =1 where charging_station_id = #{chargingStationId}
</update>
<update id="updateXhpcChargingStationByIds" parameterType="String">
update xhpc_charging_station set delFlag =1 where charging_station_id in
<foreach item="chargingStationId" collection="array" open="(" separator="," close=")">
#{chargingStationId}
</foreach>
</update>
</mapper>