Browse Source

+ 动力箱元器件最新指标

chen.cheng 11 months ago
parent
commit
2cf524e296

+ 100 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmEmsElecBoxIndexController.java

@@ -0,0 +1,100 @@
+package com.ruoyi.ems.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.ems.domain.AdmEmsElecBoxIndex;
+import com.ruoyi.ems.service.IAdmEmsElecBoxIndexService;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 动力箱指标Controller
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+@RestController
+@RequestMapping("/powerBoxIndex")
+public class AdmEmsElecBoxIndexController extends BaseController {
+    @Autowired
+    private IAdmEmsElecBoxIndexService admEmsElecBoxIndexService;
+
+    /**
+     * 查询动力箱指标列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        startPage();
+        List<AdmEmsElecBoxIndex> list = admEmsElecBoxIndexService.selectAdmEmsElecBoxIndexList(admEmsElecBoxIndex);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出动力箱指标列表
+     */
+    @Log(title = "动力箱指标", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        List<AdmEmsElecBoxIndex> list = admEmsElecBoxIndexService.selectAdmEmsElecBoxIndexList(admEmsElecBoxIndex);
+        ExcelUtil<AdmEmsElecBoxIndex> util = new ExcelUtil<AdmEmsElecBoxIndex>(AdmEmsElecBoxIndex.class);
+        util.exportExcel(response, list, "动力箱指标数据");
+    }
+
+    /**
+     * 获取动力箱指标详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(admEmsElecBoxIndexService.selectAdmEmsElecBoxIndexById(id));
+    }
+
+    /**
+     * 获取动力箱指标详细信息
+     */
+    @GetMapping(value = "/latest/{boxCode}")
+    public AjaxResult getLatestIndexByBoxCode(@PathVariable("boxCode") String boxCode) {
+        return success(admEmsElecBoxIndexService.selectAdmEmsElecBoxIndexByBoxCode(boxCode));
+    }
+
+    /**
+     * 新增动力箱指标
+     */
+    @Log(title = "动力箱指标", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        return toAjax(admEmsElecBoxIndexService.insertAdmEmsElecBoxIndex(admEmsElecBoxIndex));
+    }
+
+    /**
+     * 修改动力箱指标
+     */
+    @Log(title = "动力箱指标", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        return toAjax(admEmsElecBoxIndexService.updateAdmEmsElecBoxIndex(admEmsElecBoxIndex));
+    }
+
+    /**
+     * 删除动力箱指标
+     */
+    @Log(title = "动力箱指标", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(admEmsElecBoxIndexService.deleteAdmEmsElecBoxIndexByIds(ids));
+    }
+}

+ 1 - 2
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/PowerBoxController.java

@@ -25,7 +25,7 @@ import java.util.List;
 
 /**
  * 动力箱柜Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-08-20
  */
@@ -40,7 +40,6 @@ public class PowerBoxController extends BaseController
     /**
      * 查询动力箱柜列表
      */
-    @RequiresPermissions("ems:powerBox:list")
     @GetMapping("/list")
     public TableDataInfo list(PowerBox powerBox)
     {

+ 2 - 2
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmEmsElecBoxEqptIndex.java

@@ -51,8 +51,8 @@ public class AdmEmsElecBoxEqptIndex extends BaseEntity {
     /**
      * 时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date time;
 
     /**

+ 209 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmEmsElecBoxIndex.java

@@ -0,0 +1,209 @@
+package com.ruoyi.ems.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 动力箱指标对象 adm_ems_elec_box_index
+ * 
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+public class AdmEmsElecBoxIndex extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 箱体代码 */
+    @Excel(name = "箱体代码")
+    private String boxCode;
+
+    /** 箱体类型 */
+    @Excel(name = "箱体类型")
+    private Integer boxType;
+
+    /** 服务区代码 */
+    @Excel(name = "服务区代码")
+    private String areaCode;
+
+    /** 日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date date;
+
+    /** 时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date time;
+
+    /** 电压(A相,伏) */
+    @Excel(name = "电压(A相,伏)")
+    private Double voltageA;
+
+    /** 电压(B相,伏) */
+    @Excel(name = "电压(B相,伏)")
+    private Double voltageB;
+
+    /** 电压(C相,伏) */
+    @Excel(name = "电压(C相,伏)")
+    private Double voltageC;
+
+    /** 电流(A相,安培) */
+    @Excel(name = "电流(A相,安培)")
+    private Double electricityA;
+
+    /** 电流(B相,安培) */
+    @Excel(name = "电流(B相,安培)")
+    private Double electricityB;
+
+    /** 电流(C相,安培) */
+    @Excel(name = "电流(C相,安培)")
+    private Double electricityC;
+
+    /** 功率(千瓦) */
+    @Excel(name = "功率", readConverterExp = "千=瓦")
+    private Double power;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setBoxCode(String boxCode) 
+    {
+        this.boxCode = boxCode;
+    }
+
+    public String getBoxCode() 
+    {
+        return boxCode;
+    }
+    public void setBoxType(Integer boxType) 
+    {
+        this.boxType = boxType;
+    }
+
+    public Integer getBoxType() 
+    {
+        return boxType;
+    }
+    public void setAreaCode(String areaCode) 
+    {
+        this.areaCode = areaCode;
+    }
+
+    public String getAreaCode() 
+    {
+        return areaCode;
+    }
+    public void setDate(Date date) 
+    {
+        this.date = date;
+    }
+
+    public Date getDate() 
+    {
+        return date;
+    }
+    public void setTime(Date time) 
+    {
+        this.time = time;
+    }
+
+    public Date getTime() 
+    {
+        return time;
+    }
+    public void setVoltageA(Double voltageA) 
+    {
+        this.voltageA = voltageA;
+    }
+
+    public Double getVoltageA() 
+    {
+        return voltageA;
+    }
+    public void setVoltageB(Double voltageB) 
+    {
+        this.voltageB = voltageB;
+    }
+
+    public Double getVoltageB() 
+    {
+        return voltageB;
+    }
+    public void setVoltageC(Double voltageC) 
+    {
+        this.voltageC = voltageC;
+    }
+
+    public Double getVoltageC() 
+    {
+        return voltageC;
+    }
+    public void setElectricityA(Double electricityA) 
+    {
+        this.electricityA = electricityA;
+    }
+
+    public Double getElectricityA() 
+    {
+        return electricityA;
+    }
+    public void setElectricityB(Double electricityB) 
+    {
+        this.electricityB = electricityB;
+    }
+
+    public Double getElectricityB() 
+    {
+        return electricityB;
+    }
+    public void setElectricityC(Double electricityC) 
+    {
+        this.electricityC = electricityC;
+    }
+
+    public Double getElectricityC() 
+    {
+        return electricityC;
+    }
+    public void setPower(Double power) 
+    {
+        this.power = power;
+    }
+
+    public Double getPower() 
+    {
+        return power;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("boxCode", getBoxCode())
+            .append("boxType", getBoxType())
+            .append("areaCode", getAreaCode())
+            .append("date", getDate())
+            .append("time", getTime())
+            .append("voltageA", getVoltageA())
+            .append("voltageB", getVoltageB())
+            .append("voltageC", getVoltageC())
+            .append("electricityA", getElectricityA())
+            .append("electricityB", getElectricityB())
+            .append("electricityC", getElectricityC())
+            .append("power", getPower())
+            .toString();
+    }
+}

+ 63 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmEmsElecBoxIndexMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.ems.mapper;
+
+import java.util.List;
+
+import com.ruoyi.ems.domain.AdmEmsElecBoxIndex;
+
+/**
+ * 动力箱指标Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+public interface AdmEmsElecBoxIndexMapper {
+    /**
+     * 查询动力箱指标
+     *
+     * @param id 动力箱指标主键
+     * @return 动力箱指标
+     */
+    public AdmEmsElecBoxIndex selectAdmEmsElecBoxIndexById(Long id);
+
+    AdmEmsElecBoxIndex selectElecBoxLatestIndexByBoxCode(String boxCode);
+
+    /**
+     * 查询动力箱指标列表
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 动力箱指标集合
+     */
+    public List<AdmEmsElecBoxIndex> selectAdmEmsElecBoxIndexList(AdmEmsElecBoxIndex admEmsElecBoxIndex);
+
+    /**
+     * 新增动力箱指标
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 结果
+     */
+    public int insertAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex);
+
+    /**
+     * 修改动力箱指标
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 结果
+     */
+    public int updateAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex);
+
+    /**
+     * 删除动力箱指标
+     *
+     * @param id 动力箱指标主键
+     * @return 结果
+     */
+    public int deleteAdmEmsElecBoxIndexById(Long id);
+
+    /**
+     * 批量删除动力箱指标
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAdmEmsElecBoxIndexByIds(Long[] ids);
+}

+ 65 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmEmsElecBoxIndexService.java

@@ -0,0 +1,65 @@
+package com.ruoyi.ems.service;
+
+import java.util.List;
+
+import com.ruoyi.ems.domain.AdmEmsElecBoxIndex;
+
+/**
+ * 动力箱指标Service接口
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+public interface IAdmEmsElecBoxIndexService {
+    /**
+     * 查询动力箱指标
+     *
+     * @param id 动力箱指标主键
+     * @return 动力箱指标
+     */
+    public AdmEmsElecBoxIndex selectAdmEmsElecBoxIndexById(Long id);
+
+    public AdmEmsElecBoxIndex selectAdmEmsElecBoxIndexByBoxCode(String boxCode);
+
+    /**
+     * 查询动力箱指标列表
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 动力箱指标集合
+     */
+    public List<AdmEmsElecBoxIndex> selectAdmEmsElecBoxIndexList(AdmEmsElecBoxIndex admEmsElecBoxIndex);
+
+    /**
+     * 新增动力箱指标
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 结果
+     */
+    public int insertAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex);
+
+    /**
+     * 修改动力箱指标
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 结果
+     */
+    public int updateAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex);
+
+    /**
+     * 批量删除动力箱指标
+     *
+     * @param ids 需要删除的动力箱指标主键集合
+     * @return 结果
+     */
+    public int deleteAdmEmsElecBoxIndexByIds(Long[] ids);
+
+    /**
+     * 删除动力箱指标信息
+     *
+     * @param id 动力箱指标主键
+     * @return 结果
+     */
+    public int deleteAdmEmsElecBoxIndexById(Long id);
+
+
+}

+ 93 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AdmEmsElecBoxIndexServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.ems.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ruoyi.ems.domain.AdmEmsElecBoxIndex;
+import com.ruoyi.ems.mapper.AdmEmsElecBoxIndexMapper;
+import com.ruoyi.ems.service.IAdmEmsElecBoxIndexService;
+
+/**
+ * 动力箱指标Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-09-03
+ */
+@Service
+public class AdmEmsElecBoxIndexServiceImpl implements IAdmEmsElecBoxIndexService {
+    @Autowired
+    private AdmEmsElecBoxIndexMapper admEmsElecBoxIndexMapper;
+
+    /**
+     * 查询动力箱指标
+     *
+     * @param id 动力箱指标主键
+     * @return 动力箱指标
+     */
+    @Override
+    public AdmEmsElecBoxIndex selectAdmEmsElecBoxIndexById(Long id) {
+        return admEmsElecBoxIndexMapper.selectAdmEmsElecBoxIndexById(id);
+    }
+
+    @Override
+    public AdmEmsElecBoxIndex selectAdmEmsElecBoxIndexByBoxCode(String boxCode) {
+        return admEmsElecBoxIndexMapper.selectElecBoxLatestIndexByBoxCode(boxCode);
+    }
+
+    /**
+     * 查询动力箱指标列表
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 动力箱指标
+     */
+    @Override
+    public List<AdmEmsElecBoxIndex> selectAdmEmsElecBoxIndexList(AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        return admEmsElecBoxIndexMapper.selectAdmEmsElecBoxIndexList(admEmsElecBoxIndex);
+    }
+
+    /**
+     * 新增动力箱指标
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 结果
+     */
+    @Override
+    public int insertAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        return admEmsElecBoxIndexMapper.insertAdmEmsElecBoxIndex(admEmsElecBoxIndex);
+    }
+
+    /**
+     * 修改动力箱指标
+     *
+     * @param admEmsElecBoxIndex 动力箱指标
+     * @return 结果
+     */
+    @Override
+    public int updateAdmEmsElecBoxIndex(AdmEmsElecBoxIndex admEmsElecBoxIndex) {
+        return admEmsElecBoxIndexMapper.updateAdmEmsElecBoxIndex(admEmsElecBoxIndex);
+    }
+
+    /**
+     * 批量删除动力箱指标
+     *
+     * @param ids 需要删除的动力箱指标主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmEmsElecBoxIndexByIds(Long[] ids) {
+        return admEmsElecBoxIndexMapper.deleteAdmEmsElecBoxIndexByIds(ids);
+    }
+
+    /**
+     * 删除动力箱指标信息
+     *
+     * @param id 动力箱指标主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmEmsElecBoxIndexById(Long id) {
+        return admEmsElecBoxIndexMapper.deleteAdmEmsElecBoxIndexById(id);
+    }
+}

+ 119 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsElecBoxIndexMapper.xml

@@ -0,0 +1,119 @@
+<?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.ruoyi.ems.mapper.AdmEmsElecBoxIndexMapper">
+
+    <resultMap type="com.ruoyi.ems.domain.AdmEmsElecBoxIndex" id="AdmEmsElecBoxIndexResult">
+        <result property="id" column="id"/>
+        <result property="boxCode" column="box_code"/>
+        <result property="boxType" column="box_type"/>
+        <result property="areaCode" column="area_code"/>
+        <result property="date" column="date"/>
+        <result property="time" column="time"/>
+        <result property="voltageA" column="voltage_a"/>
+        <result property="voltageB" column="voltage_b"/>
+        <result property="voltageC" column="voltage_c"/>
+        <result property="electricityA" column="electricity_a"/>
+        <result property="electricityB" column="electricity_b"/>
+        <result property="electricityC" column="electricity_c"/>
+        <result property="power" column="power"/>
+    </resultMap>
+
+    <sql id="selectAdmEmsElecBoxIndexVo">
+        select id,
+               box_code,
+               box_type,
+               area_code, date, time, voltage_a, voltage_b, voltage_c, electricity_a, electricity_b, electricity_c, power
+        from adm_ems_elec_box_index
+    </sql>
+
+    <select id="selectAdmEmsElecBoxIndexList" parameterType="com.ruoyi.ems.domain.AdmEmsElecBoxIndex"
+            resultMap="AdmEmsElecBoxIndexResult">
+        <include refid="selectAdmEmsElecBoxIndexVo"/>
+        <where>
+            <if test="boxCode != null  and boxCode != ''">and box_code = #{boxCode}</if>
+            <if test="boxType != null ">and box_type = #{boxType}</if>
+            <if test="areaCode != null  and areaCode != ''">and area_code = #{areaCode}</if>
+        </where>
+    </select>
+
+    <select id="selectAdmEmsElecBoxIndexById" parameterType="Long" resultMap="AdmEmsElecBoxIndexResult">
+        <include refid="selectAdmEmsElecBoxIndexVo"/>
+        where id = #{id}
+    </select>
+    <select id="selectElecBoxLatestIndexByBoxCode" parameterType="String"
+            resultType="com.ruoyi.ems.domain.AdmEmsElecBoxIndex">
+        WITH rowIndex AS (SELECT *, ROW_NUMBER() over ( PARTITION BY box_code ORDER BY TIME DESC ) AS rowNum
+                          FROM adm_ems_elec_box_index
+                          WHERE box_code = #{boxCode})
+        SELECT *
+        FROM rowIndex latestIndex
+        WHERE rowNum = 1
+    </select>
+
+    <insert id="insertAdmEmsElecBoxIndex" parameterType="com.ruoyi.ems.domain.AdmEmsElecBoxIndex"
+            useGeneratedKeys="true" keyProperty="id">
+        insert into adm_ems_elec_box_index
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="boxCode != null and boxCode != ''">box_code,</if>
+            <if test="boxType != null">box_type,</if>
+            <if test="areaCode != null and areaCode != ''">area_code,</if>
+            <if test="date != null">date,</if>
+            <if test="time != null">time,</if>
+            <if test="voltageA != null">voltage_a,</if>
+            <if test="voltageB != null">voltage_b,</if>
+            <if test="voltageC != null">voltage_c,</if>
+            <if test="electricityA != null">electricity_a,</if>
+            <if test="electricityB != null">electricity_b,</if>
+            <if test="electricityC != null">electricity_c,</if>
+            <if test="power != null">power,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="boxCode != null and boxCode != ''">#{boxCode},</if>
+            <if test="boxType != null">#{boxType},</if>
+            <if test="areaCode != null and areaCode != ''">#{areaCode},</if>
+            <if test="date != null">#{date},</if>
+            <if test="time != null">#{time},</if>
+            <if test="voltageA != null">#{voltageA},</if>
+            <if test="voltageB != null">#{voltageB},</if>
+            <if test="voltageC != null">#{voltageC},</if>
+            <if test="electricityA != null">#{electricityA},</if>
+            <if test="electricityB != null">#{electricityB},</if>
+            <if test="electricityC != null">#{electricityC},</if>
+            <if test="power != null">#{power},</if>
+        </trim>
+    </insert>
+
+    <update id="updateAdmEmsElecBoxIndex" parameterType="com.ruoyi.ems.domain.AdmEmsElecBoxIndex">
+        update adm_ems_elec_box_index
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="boxCode != null and boxCode != ''">box_code = #{boxCode},</if>
+            <if test="boxType != null">box_type = #{boxType},</if>
+            <if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
+            <if test="date != null">date = #{date},</if>
+            <if test="time != null">time = #{time},</if>
+            <if test="voltageA != null">voltage_a = #{voltageA},</if>
+            <if test="voltageB != null">voltage_b = #{voltageB},</if>
+            <if test="voltageC != null">voltage_c = #{voltageC},</if>
+            <if test="electricityA != null">electricity_a = #{electricityA},</if>
+            <if test="electricityB != null">electricity_b = #{electricityB},</if>
+            <if test="electricityC != null">electricity_c = #{electricityC},</if>
+            <if test="power != null">power = #{power},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAdmEmsElecBoxIndexById" parameterType="Long">
+        delete
+        from adm_ems_elec_box_index
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteAdmEmsElecBoxIndexByIds" parameterType="String">
+        delete from adm_ems_elec_box_index where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>