瀏覽代碼

硬件管理

车车 1 年之前
父節點
當前提交
509883d450

+ 15 - 17
ktg-admin/src/main/java/com/ktg/web/controller/system/SysUserController.java

@@ -1,21 +1,5 @@
 package com.ktg.web.controller.system;
 
-import java.util.List;
-import java.util.stream.Collectors;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.lang3.ArrayUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
 import com.ktg.common.annotation.Log;
 import com.ktg.common.constant.UserConstants;
 import com.ktg.common.core.controller.BaseController;
@@ -30,12 +14,25 @@ import com.ktg.common.utils.poi.ExcelUtil;
 import com.ktg.system.service.ISysPostService;
 import com.ktg.system.service.ISysRoleService;
 import com.ktg.system.service.ISysUserService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.ArrayUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 用户信息
- * 
+ *
  * @author ruoyi
  */
+@Api(tags = "用户管理")
 @RestController
 @RequestMapping("/system/user")
 public class SysUserController extends BaseController
@@ -82,6 +79,7 @@ public class SysUserController extends BaseController
         return AjaxResult.success(message);
     }
 
+    @ApiOperation("用户数据导入模板")
     @PostMapping("/importTemplate")
     public void importTemplate(HttpServletResponse response)
     {

+ 34 - 1
ktg-iscs/src/main/java/com/ktg/iscs/controller/IsHardwareController.java

@@ -6,16 +6,20 @@ import com.ktg.common.annotation.Log;
 import com.ktg.common.core.controller.BaseController;
 import com.ktg.common.enums.BusinessType;
 import com.ktg.common.pojo.CommonResult;
+import com.ktg.common.utils.SecurityUtils;
 import com.ktg.common.utils.poi.ExcelUtil;
 import com.ktg.iscs.domain.IsHardware;
+import com.ktg.iscs.domain.dto.hardware.HardwarePageDTO;
 import com.ktg.iscs.service.IIsHardwareService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.Parameters;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import java.util.List;
@@ -44,9 +48,17 @@ public class IsHardwareController extends BaseController
     })
     @PreAuthorize("@ss.hasPermi('is:hardware:list')")
     @GetMapping("/getIsHardwarePage")
-    public CommonResult<Page<IsHardware>> getIsHardwarePage(Page<IsHardware> page, IsHardware isHardware)
+    public CommonResult<Page<IsHardware>> getIsHardwarePage(Page<IsHardware> page, HardwarePageDTO dto)
     {
         Page<IsHardware> result = isHardwareService.page(page, Wrappers.<IsHardware>lambdaQuery()
+                .like(StringUtils.isNotBlank(dto.getHardwareCode()), IsHardware::getHardwareCode, dto.getHardwareCode())
+                .like(StringUtils.isNotBlank(dto.getHardwareName()), IsHardware::getHardwareName, dto.getHardwareName())
+                .eq(StringUtils.isNotBlank(dto.getStatus()), IsHardware::getStatus, dto.getStatus())
+                .eq(dto.getHardwareTypeId() != null, IsHardware::getHardwareTypeId, dto.getHardwareTypeId())
+                .like(StringUtils.isNotBlank(dto.getHardwareSpec()), IsHardware::getHardwareSpec, dto.getHardwareSpec())
+                .ge(StringUtils.isNotBlank(dto.getStartTime()), IsHardware::getCreateTime, dto.getStartTime())
+                .le(StringUtils.isNotBlank(dto.getEndTime()), IsHardware::getCreateTime, dto.getEndTime())
+                .eq(dto.getWorkshopId() != null, IsHardware::getWorkshopId, dto.getWorkshopId())
                 .orderByDesc(IsHardware::getId));
         return CommonResult.success(result);
     }
@@ -113,4 +125,25 @@ public class IsHardwareController extends BaseController
     {
         return CommonResult.success(isHardwareService.deleteIsHardwareByIds(ids) != 0);
     }
+
+    @ApiOperation("导出或更新硬件模板")
+    @PostMapping("/importTemplate")
+    public void importTemplate(HttpServletResponse response)
+    {
+        ExcelUtil<IsHardware> util = new ExcelUtil<>(IsHardware.class);
+        util.importTemplateExcel(response, "硬件数据");
+    }
+
+    @ApiOperation("导出或更新硬件")
+    @PreAuthorize("@ss.hasPermi('is:hardware:import')")
+    @Log(title = "硬件", businessType = BusinessType.IMPORT)
+    @PostMapping("/importHardware")
+    public CommonResult<String> importHardware(MultipartFile file,
+                                 @RequestParam(name = "updateSupport", defaultValue = "false") boolean updateSupport) throws Exception {
+        ExcelUtil<IsHardware> util = new ExcelUtil<>(IsHardware.class);
+        List<IsHardware> hardwareList = util.importExcel(file.getInputStream());
+        String operName = SecurityUtils.getUsername();
+        String message = isHardwareService.importHardware(hardwareList, updateSupport, operName);
+        return CommonResult.success("导入成功,共导入 " + message + " 条数据");
+    }
 }

+ 2 - 0
ktg-iscs/src/main/java/com/ktg/iscs/controller/IsHardwareTypeController.java

@@ -39,6 +39,7 @@ public class IsHardwareTypeController extends BaseController
 
     @ApiOperation("查询硬件类型-列表")
     @Parameters({
+            @Parameter(name = "hardwareTypeName", description = "类型名称"),
             @Parameter(name = "hardwareTypeName", description = "类型名称"),
             @Parameter(name = "enableFlag", description = "是否启用(Y-N)")
     })
@@ -47,6 +48,7 @@ public class IsHardwareTypeController extends BaseController
     {
         List<IsHardwareType> list = isHardwareTypeService.list(Wrappers.<IsHardwareType>lambdaQuery()
                 .like(StringUtils.isNotBlank(getListDTO.getHardwareTypeName()), IsHardwareType::getHardwareTypeName, getListDTO.getHardwareTypeName())
+                .like(StringUtils.isNotBlank(getListDTO.getHardwareTypeCode()), IsHardwareType::getHardwareTypeCode, getListDTO.getHardwareTypeCode())
                 .eq(StringUtils.isNotBlank(getListDTO.getEnableFlag()), IsHardwareType::getEnableFlag, getListDTO.getEnableFlag()));
         return CommonResult.success(BeanUtils.toBean(list, IsHardwareTypeVO.class));
     }

+ 33 - 4
ktg-iscs/src/main/java/com/ktg/iscs/domain/IsHardware.java

@@ -1,11 +1,14 @@
 package com.ktg.iscs.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import io.swagger.v3.oas.annotations.media.Schema;
 import com.ktg.common.annotation.Excel;
 import com.ktg.common.core.domain.model.BaseBean;
 
+import java.util.Date;
+
 /**
  * 硬件对象 is_hardware
  *
@@ -23,13 +26,13 @@ public class IsHardware extends BaseBean
     private Long id;
 
     /** 硬件类型编码 */
-    @Schema(description = "硬件类型编码")
-    @Excel(name = "硬件类型编码")
+    @Schema(description = "硬件编码")
+    @Excel(name = "硬件编码")
     private String hardwareCode;
 
     /** 硬件类型名称 */
-    @Schema(description = "硬件类型名称")
-    @Excel(name = "硬件类型名称")
+    @Schema(description = "硬件名称")
+    @Excel(name = "硬件名称")
     private String hardwareName;
 
     /** 品牌 */
@@ -77,6 +80,32 @@ public class IsHardware extends BaseBean
     @Excel(name = "硬件状态")
     private String status;
 
+    /** 启用时间 */
+    @Schema(description = "启用时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "启用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date activationTime;
+
+    /** 可用次数 */
+    @Schema(description = "可用次数")
+    @Excel(name = "可用次数")
+    private Long availableTimes;
+
+    /** 已用次数 */
+    @Schema(description = "已用次数")
+    @Excel(name = "已用次数")
+    private Long usedTimes;
+
+    /** 可用寿命 */
+    @Schema(description = "可用寿命")
+    @Excel(name = "可用寿命")
+    private Long availableLife;
+
+    /** 已用寿命 */
+    @Schema(description = "已用寿命")
+    @Excel(name = "已用寿命")
+    private Long usedLife;
+
     /** 删除标志(0代表存在 2代表删除) */
     @Schema(description = "删除标志(0代表存在 2代表删除)")
     private String delFlag;

+ 3 - 5
ktg-iscs/src/main/java/com/ktg/iscs/domain/dto/hardware/GetListDTO.java

@@ -1,6 +1,5 @@
 package com.ktg.iscs.domain.dto.hardware;
 
-import com.ktg.common.annotation.Excel;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -13,15 +12,14 @@ import lombok.Data;
 @Data
 public class GetListDTO {
 
-    /** 硬件类型名称 */
+    @Schema(description = "硬件类型编码")
+    private String hardwareTypeCode;
+
     @Schema(description = "硬件类型名称")
-    @Excel(name = "硬件类型名称")
     private String hardwareTypeName;
 
 
-    /** 是否启用 */
     @Schema(description = "是否启用(Y-N)")
-    @Excel(name = "是否启用")
     private String enableFlag;
 
 }

+ 41 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/dto/hardware/HardwarePageDTO.java

@@ -0,0 +1,41 @@
+package com.ktg.iscs.domain.dto.hardware;
+
+import com.ktg.common.annotation.Excel;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+/**
+ * 硬件对象 is_hardware
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+@Data
+public class HardwarePageDTO
+{
+    @Schema(description = "硬件编码")
+    private String hardwareCode;
+
+    @Schema(description = "硬件名称")
+    private String hardwareName;
+
+    @Schema(description = "规格型号")
+    private String hardwareSpec;
+
+    @Schema(description = "硬件类型ID")
+    private Long hardwareTypeId;
+
+    @Schema(description = "所属车间ID")
+    @Excel(name = "所属车间ID")
+    private Long workshopId;
+
+    @Schema(description = "硬件状态")
+    private String status;
+
+    @Schema(description = "开始时间")
+    private String startTime;
+
+    @Schema(description = "结束时间")
+    private String endTime;
+
+}

+ 2 - 0
ktg-iscs/src/main/java/com/ktg/iscs/mapper/IsHardwareMapper.java

@@ -2,6 +2,7 @@ package com.ktg.iscs.mapper;
 
 import com.ktg.common.mapper.BaseMapperX;
 import com.ktg.iscs.domain.IsHardware;
+import org.apache.ibatis.annotations.Mapper;
 
 import java.util.List;
 
@@ -11,6 +12,7 @@ import java.util.List;
  * @author cgj
  * @date 2024-10-16
  */
+@Mapper
 public interface IsHardwareMapper extends BaseMapperX<IsHardware>
 {
     /**

+ 10 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/IIsHardwareService.java

@@ -60,4 +60,14 @@ public interface IIsHardwareService extends IService<IsHardware>
      * @return 结果
      */
     int deleteIsHardwareById(Long id);
+
+    /**
+     * 依据上传的文件,批量导入或更新硬件信息
+     *
+     * @param hardwareList 硬件信息列表
+     * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
+     * @param operName 操作用户
+     * @return 结果
+     */
+    String importHardware(List<IsHardware> hardwareList, Boolean isUpdateSupport, String operName);
 }

+ 48 - 3
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsHardwareServiceImpl.java

@@ -1,12 +1,13 @@
 package com.ktg.iscs.service.impl;
 
 import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ktg.common.core.text.Convert;
-import com.ktg.common.utils.DateUtils;
 import com.ktg.iscs.domain.IsHardware;
 import com.ktg.iscs.mapper.IsHardwareMapper;
 import com.ktg.iscs.service.IIsHardwareService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -57,7 +58,13 @@ public class IsHardwareServiceImpl extends ServiceImpl<IsHardwareMapper, IsHardw
     @Override
     public int insertIsHardware(IsHardware isHardware)
     {
-        isHardware.setCreateTime(DateUtils.getNowDate());
+        // 断言判断
+        Assert.isFalse(StringUtils.isBlank(isHardware.getHardwareCode()), "硬件编码不可为空!");
+        Assert.isFalse(StringUtils.isBlank(isHardware.getHardwareName()), "硬件名称不可为空!");
+        // 检查hardwareCode是否被占用
+        List<IsHardware> list = list(Wrappers.<IsHardware>lambdaQuery()
+                .eq(IsHardware::getHardwareCode, isHardware.getHardwareCode()));
+        Assert.isTrue(list.isEmpty(), isHardware.getHardwareCode() + "已被使用!");
         return isHardwareMapper.insertIsHardware(isHardware);
     }
 
@@ -70,7 +77,15 @@ public class IsHardwareServiceImpl extends ServiceImpl<IsHardwareMapper, IsHardw
     @Override
     public int updateIsHardware(IsHardware isHardware)
     {
-        isHardware.setUpdateTime(DateUtils.getNowDate());
+        // 断言判断
+        Assert.notNull(isHardware.getId(), "id不可为空!");
+        Assert.isFalse(StringUtils.isBlank(isHardware.getHardwareCode()), "硬件编码不可为空!");
+        Assert.isFalse(StringUtils.isBlank(isHardware.getHardwareName()), "硬件名称不可为空!");
+        // 检查hardwareCode是否被占用
+        List<IsHardware> list = list(Wrappers.<IsHardware>lambdaQuery()
+                .eq(IsHardware::getHardwareCode, isHardware.getHardwareCode())
+                .ne(IsHardware::getId, isHardware.getId()));
+        Assert.isTrue(list.isEmpty(), isHardware.getHardwareCode() + "已被使用!");
         return isHardwareMapper.updateIsHardware(isHardware);
     }
 
@@ -99,4 +114,34 @@ public class IsHardwareServiceImpl extends ServiceImpl<IsHardwareMapper, IsHardw
     {
         return isHardwareMapper.deleteIsHardwareById(id);
     }
+
+    @Override
+    public String importHardware(List<IsHardware> hardwareList, Boolean isUpdateSupport, String operName) {
+        if (hardwareList == null || hardwareList.isEmpty()) {
+            return "导入数据为空";
+        }
+        int successCount = 0;
+        int failureCount = 0;
+        for (IsHardware hardware : hardwareList) {
+            // 去除空格
+            String machineryCode = hardware.getHardwareCode().trim();
+            IsHardware existing = getOne(Wrappers.<IsHardware>lambdaQuery().eq(IsHardware::getHardwareCode, machineryCode));
+            if (existing != null) {
+                if (isUpdateSupport) {
+                    // 更新数据
+                    hardware.setId(existing.getId()); // 确保使用现有 ID 进行更新
+                    isHardwareMapper.updateIsHardware(hardware);
+                    successCount++;
+                } else {
+                    // 不更新数据
+                    failureCount++;
+                }
+            } else {
+                // 新增数据
+                isHardwareMapper.insertIsHardware(hardware);
+                successCount++;
+            }
+        }
+        return String.format("操作用户:%s,导入完成,成功 %d 条,失败 %d 条。", operName, successCount, failureCount);
+    }
 }

+ 36 - 11
ktg-iscs/src/main/resources/mapper/IsHardwareMapper.xml

@@ -1,9 +1,9 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ktg.iscs.mapper.IsHardwareMapper">
-    
+
     <resultMap type="IsHardware" id="IsHardwareResult">
         <result property="id"    column="id"    />
         <result property="hardwareCode"    column="hardware_code"    />
@@ -17,6 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="workshopCode"    column="workshop_code"    />
         <result property="workshopName"    column="workshop_name"    />
         <result property="status"    column="status"    />
+        <result property="activationTime"    column="activation_time"    />
+        <result property="availableTimes"    column="available_times"    />
+        <result property="usedTimes"    column="used_times"    />
+        <result property="availableLife"    column="available_life"    />
+        <result property="usedLife"    column="used_life"    />
         <result property="remark"    column="remark"    />
         <result property="delFlag"    column="del_flag"    />
         <result property="createBy"    column="create_by"    />
@@ -26,12 +31,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectIsHardwareVo">
-        select id, hardware_code, hardware_name, hardware_brand, hardware_spec, hardware_type_id, hardware_type_code, hardware_type_name, workshop_id, workshop_code, workshop_name, status, remark, del_flag, create_by, create_time, update_time, update_by from is_hardware
+        select id, hardware_code, hardware_name, hardware_brand, hardware_spec, hardware_type_id, hardware_type_code, hardware_type_name, workshop_id, workshop_code, workshop_name, status, activation_time, available_times, used_times, available_life, used_life, remark, del_flag, create_by, create_time, update_time, update_by from is_hardware
     </sql>
 
     <select id="selectIsHardwareList" parameterType="IsHardware" resultMap="IsHardwareResult">
         <include refid="selectIsHardwareVo"/>
-        <where>  
+        <where>
             <if test="hardwareCode != null  and hardwareCode != ''"> and hardware_code = #{hardwareCode}</if>
             <if test="hardwareName != null  and hardwareName != ''"> and hardware_name like concat('%', #{hardwareName}, '%')</if>
             <if test="hardwareBrand != null  and hardwareBrand != ''"> and hardware_brand = #{hardwareBrand}</if>
@@ -43,14 +48,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="workshopCode != null  and workshopCode != ''"> and workshop_code = #{workshopCode}</if>
             <if test="workshopName != null  and workshopName != ''"> and workshop_name like concat('%', #{workshopName}, '%')</if>
             <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="activationTime != null "> and activation_time = #{activationTime}</if>
+            <if test="availableTimes != null "> and available_times = #{availableTimes}</if>
+            <if test="usedTimes != null "> and used_times = #{usedTimes}</if>
+            <if test="availableLife != null "> and available_life = #{availableLife}</if>
+            <if test="usedLife != null "> and used_life = #{usedLife}</if>
         </where>
     </select>
-    
+
     <select id="selectIsHardwareById" parameterType="Long" resultMap="IsHardwareResult">
         <include refid="selectIsHardwareVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertIsHardware" parameterType="IsHardware" useGeneratedKeys="true" keyProperty="id">
         insert into is_hardware
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -65,13 +75,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="workshopCode != null">workshop_code,</if>
             <if test="workshopName != null">workshop_name,</if>
             <if test="status != null and status != ''">status,</if>
+            <if test="activationTime != null">activation_time,</if>
+            <if test="availableTimes != null">available_times,</if>
+            <if test="usedTimes != null">used_times,</if>
+            <if test="availableLife != null">available_life,</if>
+            <if test="usedLife != null">used_life,</if>
             <if test="remark != null">remark,</if>
             <if test="delFlag != null">del_flag,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="updateBy != null">update_by,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="hardwareCode != null and hardwareCode != ''">#{hardwareCode},</if>
             <if test="hardwareName != null and hardwareName != ''">#{hardwareName},</if>
@@ -84,13 +99,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="workshopCode != null">#{workshopCode},</if>
             <if test="workshopName != null">#{workshopName},</if>
             <if test="status != null and status != ''">#{status},</if>
+            <if test="activationTime != null">#{activationTime},</if>
+            <if test="availableTimes != null">#{availableTimes},</if>
+            <if test="usedTimes != null">#{usedTimes},</if>
+            <if test="availableLife != null">#{availableLife},</if>
+            <if test="usedLife != null">#{usedLife},</if>
             <if test="remark != null">#{remark},</if>
             <if test="delFlag != null">#{delFlag},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateIsHardware" parameterType="IsHardware">
@@ -107,6 +127,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="workshopCode != null">workshop_code = #{workshopCode},</if>
             <if test="workshopName != null">workshop_name = #{workshopName},</if>
             <if test="status != null and status != ''">status = #{status},</if>
+            <if test="activationTime != null">activation_time = #{activationTime},</if>
+            <if test="availableTimes != null">available_times = #{availableTimes},</if>
+            <if test="usedTimes != null">used_times = #{usedTimes},</if>
+            <if test="availableLife != null">available_life = #{availableLife},</if>
+            <if test="usedLife != null">used_life = #{usedLife},</if>
             <if test="remark != null">remark = #{remark},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
@@ -122,9 +147,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteIsHardwareByIds" parameterType="String">
-        delete from is_hardware where id in 
+        delete from is_hardware where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-</mapper>
+</mapper>