Explorar el Código

硬件类型,硬件管理

车车 hace 1 año
padre
commit
d388f32a12

+ 116 - 0
ktg-iscs/src/main/java/com/ktg/iscs/controller/IsHardwareController.java

@@ -0,0 +1,116 @@
+package com.ktg.iscs.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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.poi.ExcelUtil;
+import com.ktg.iscs.domain.IsHardware;
+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.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 硬件Controller
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+@Api(tags = "硬件")
+@RestController
+@RequestMapping("/is/hardware")
+public class IsHardwareController extends BaseController
+{
+    @Autowired
+    private IIsHardwareService isHardwareService;
+
+    /**
+     * 查询硬件分页
+     */
+    @ApiOperation("查询硬件-分页")
+    @Parameters({
+            @Parameter(name = "page", description = "Page"),
+            @Parameter(name = "sysTeam", description = "实体参数")
+    })
+    @PreAuthorize("@ss.hasPermi('is:hardware:list')")
+    @GetMapping("/getIsHardwarePage")
+    public CommonResult<Page<IsHardware>> getIsHardwarePage(Page<IsHardware> page, IsHardware isHardware)
+    {
+        Page<IsHardware> result = isHardwareService.page(page, Wrappers.<IsHardware>lambdaQuery()
+                .orderByDesc(IsHardware::getId));
+        return CommonResult.success(result);
+    }
+
+    /**
+     * 导出硬件列表
+     */
+    @ApiOperation("导出硬件列表")
+    @Parameter(name = "isHardware", description = "实体参数")
+    @PreAuthorize("@ss.hasPermi('is:hardware:export')")
+    @Log(title = "硬件", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportIsHardware")
+    public void exportIsHardware(HttpServletResponse response, IsHardware isHardware)
+    {
+        List<IsHardware> list = isHardwareService.selectIsHardwareList(isHardware);
+        ExcelUtil<IsHardware> util = new ExcelUtil<IsHardware>(IsHardware.class);
+        util.exportExcel(response, list, "硬件数据");
+    }
+
+    /**
+     * 获取硬件详细信息
+     */
+    @ApiOperation("获取硬件详细信息")
+    @Parameter(name = "id", description = "id")
+    @PreAuthorize("@ss.hasPermi('is:hardware:query')")
+    @GetMapping(value = "/selectIsHardwareById")
+    public CommonResult<IsHardware> selectIsHardwareById(Long id)
+    {
+        return CommonResult.success(isHardwareService.selectIsHardwareById(id));
+    }
+
+    /**
+     * 新增硬件
+     */
+    @ApiOperation("新增硬件")
+    @PreAuthorize("@ss.hasPermi('is:hardware:add')")
+    @Log(title = "硬件", businessType = BusinessType.INSERT)
+    @PostMapping("/insertIsHardware")
+    public CommonResult<Boolean> insertIsHardware(@RequestBody @Parameter(name = "isHardware", description = "新增数据类,放到body") IsHardware isHardware)
+    {
+        return CommonResult.success(isHardwareService.insertIsHardware(isHardware) == 1);
+    }
+
+    /**
+     * 修改硬件
+     */
+    @ApiOperation("修改硬件")
+    @PreAuthorize("@ss.hasPermi('is:hardware:edit')")
+    @Log(title = "硬件", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateIsHardware")
+    public CommonResult<Boolean> updateIsHardware(@RequestBody @Parameter(name = "isHardware", description = "修改数据类,放到body") IsHardware isHardware)
+    {
+        return CommonResult.success(isHardwareService.updateIsHardware(isHardware) == 1);
+    }
+
+    /**
+     * 删除硬件
+     */
+    @ApiOperation("删除硬件")
+    @PreAuthorize("@ss.hasPermi('is:hardware:remove')")
+    @Log(title = "硬件", businessType = BusinessType.DELETE)
+	@PostMapping("/deleteIsHardwareByIds")
+    public CommonResult<Boolean> deleteIsHardwareByIds(String ids)
+    {
+        return CommonResult.success(isHardwareService.deleteIsHardwareByIds(ids) != 0);
+    }
+}

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

@@ -0,0 +1,116 @@
+package com.ktg.iscs.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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.poi.ExcelUtil;
+import com.ktg.iscs.domain.IsHardwareType;
+import com.ktg.iscs.service.IIsHardwareTypeService;
+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.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 硬件类型Controller
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+@Api(tags = "硬件类型")
+@RestController
+@RequestMapping("/is/type")
+public class IsHardwareTypeController extends BaseController
+{
+    @Autowired
+    private IIsHardwareTypeService isHardwareTypeService;
+
+    /**
+     * 查询硬件类型分页
+     */
+    @ApiOperation("查询硬件类型-分页")
+    @Parameters({
+            @Parameter(name = "page", description = "Page"),
+            @Parameter(name = "sysTeam", description = "实体参数")
+    })
+    @PreAuthorize("@ss.hasPermi('is:type:list')")
+    @GetMapping("/getIsHardwareTypePage")
+    public CommonResult<Page<IsHardwareType>> getIsHardwareTypePage(Page<IsHardwareType> page, IsHardwareType isHardwareType)
+    {
+        Page<IsHardwareType> result = isHardwareTypeService.page(page, Wrappers.<IsHardwareType>lambdaQuery()
+                .orderByDesc(IsHardwareType::getId));
+        return CommonResult.success(result);
+    }
+
+    /**
+     * 导出硬件类型列表
+     */
+    @ApiOperation("导出硬件类型列表")
+    @Parameter(name = "isHardwareType", description = "实体参数")
+    @PreAuthorize("@ss.hasPermi('is:type:export')")
+    @Log(title = "硬件类型", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportIsHardwareType")
+    public void exportIsHardwareType(HttpServletResponse response, IsHardwareType isHardwareType)
+    {
+        List<IsHardwareType> list = isHardwareTypeService.selectIsHardwareTypeList(isHardwareType);
+        ExcelUtil<IsHardwareType> util = new ExcelUtil<IsHardwareType>(IsHardwareType.class);
+        util.exportExcel(response, list, "硬件类型数据");
+    }
+
+    /**
+     * 获取硬件类型详细信息
+     */
+    @ApiOperation("获取硬件类型详细信息")
+    @Parameter(name = "id", description = "id")
+    @PreAuthorize("@ss.hasPermi('is:type:query')")
+    @GetMapping(value = "/selectIsHardwareTypeById")
+    public CommonResult<IsHardwareType> selectIsHardwareTypeById(Long id)
+    {
+        return CommonResult.success(isHardwareTypeService.selectIsHardwareTypeById(id));
+    }
+
+    /**
+     * 新增硬件类型
+     */
+    @ApiOperation("新增硬件类型")
+    @PreAuthorize("@ss.hasPermi('is:type:add')")
+    @Log(title = "硬件类型", businessType = BusinessType.INSERT)
+    @PostMapping("/insertIsHardwareType")
+    public CommonResult<Boolean> insertIsHardwareType(@RequestBody @Parameter(name = "isHardwareType", description = "新增数据类,放到body") IsHardwareType isHardwareType)
+    {
+        return CommonResult.success(isHardwareTypeService.insertIsHardwareType(isHardwareType) == 1);
+    }
+
+    /**
+     * 修改硬件类型
+     */
+    @ApiOperation("修改硬件类型")
+    @PreAuthorize("@ss.hasPermi('is:type:edit')")
+    @Log(title = "硬件类型", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateIsHardwareType")
+    public CommonResult<Boolean> updateIsHardwareType(@RequestBody @Parameter(name = "isHardwareType", description = "修改数据类,放到body") IsHardwareType isHardwareType)
+    {
+        return CommonResult.success(isHardwareTypeService.updateIsHardwareType(isHardwareType) == 1);
+    }
+
+    /**
+     * 删除硬件类型
+     */
+    @ApiOperation("删除硬件类型")
+    @PreAuthorize("@ss.hasPermi('is:type:remove')")
+    @Log(title = "硬件类型", businessType = BusinessType.DELETE)
+	@PostMapping("/deleteIsHardwareTypeByIds")
+    public CommonResult<Boolean> deleteIsHardwareTypeByIds(String ids)
+    {
+        return CommonResult.success(isHardwareTypeService.deleteIsHardwareTypeByIds(ids) != 0);
+    }
+}

+ 85 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/IsHardware.java

@@ -0,0 +1,85 @@
+package com.ktg.iscs.domain;
+
+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;
+
+/**
+ * 硬件对象 is_hardware
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class IsHardware extends BaseBean
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键id */
+    @Schema(description = "主键id")
+    private Long id;
+
+    /** 硬件类型编码 */
+    @Schema(description = "硬件类型编码")
+    @Excel(name = "硬件类型编码")
+    private String hardwareCode;
+
+    /** 硬件类型名称 */
+    @Schema(description = "硬件类型名称")
+    @Excel(name = "硬件类型名称")
+    private String hardwareName;
+
+    /** 品牌 */
+    @Schema(description = "品牌")
+    @Excel(name = "品牌")
+    private String hardwareBrand;
+
+    /** 规格型号 */
+    @Schema(description = "规格型号")
+    @Excel(name = "规格型号")
+    private String hardwareSpec;
+
+    /** 硬件类型ID */
+    @Schema(description = "硬件类型ID")
+    @Excel(name = "硬件类型ID")
+    private Long hardwareTypeId;
+
+    /** 硬件类型编码 */
+    @Schema(description = "硬件类型编码")
+    @Excel(name = "硬件类型编码")
+    private String hardwareTypeCode;
+
+    /** 硬件类型名称 */
+    @Schema(description = "硬件类型名称")
+    @Excel(name = "硬件类型名称")
+    private String hardwareTypeName;
+
+    /** 所属车间ID */
+    @Schema(description = "所属车间ID")
+    @Excel(name = "所属车间ID")
+    private Long workshopId;
+
+    /** 所属车间编码 */
+    @Schema(description = "所属车间编码")
+    @Excel(name = "所属车间编码")
+    private String workshopCode;
+
+    /** 所属车间名称 */
+    @Schema(description = "所属车间名称")
+    @Excel(name = "所属车间名称")
+    private String workshopName;
+
+    /** 硬件状态 */
+    @Schema(description = "硬件状态")
+    @Excel(name = "硬件状态")
+    private String status;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    @Schema(description = "删除标志(0代表存在 2代表删除)")
+    private String delFlag;
+
+
+}

+ 55 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/IsHardwareType.java

@@ -0,0 +1,55 @@
+package com.ktg.iscs.domain;
+
+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;
+
+/**
+ * 硬件类型对象 is_hardware_type
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class IsHardwareType extends BaseBean
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键id */
+    @Schema(description = "主键id")
+    private Long id;
+
+    /** 硬件类型编码 */
+    @Schema(description = "硬件类型编码")
+    @Excel(name = "硬件类型编码")
+    private String hardwareTypeCode;
+
+    /** 硬件类型名称 */
+    @Schema(description = "硬件类型名称")
+    @Excel(name = "硬件类型名称")
+    private String hardwareTypeName;
+
+    /** 父类型ID */
+    @Schema(description = "父类型ID")
+    @Excel(name = "父类型ID")
+    private Long parentTypeId;
+
+    /** 所有父节点ID */
+    @Schema(description = "所有父节点ID")
+    @Excel(name = "所有父节点ID")
+    private String ancestors;
+
+    /** 是否启用 */
+    @Schema(description = "是否启用")
+    @Excel(name = "是否启用")
+    private String enableFlag;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    @Schema(description = "删除标志(0代表存在 2代表删除)")
+    private String delFlag;
+
+
+}

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

@@ -0,0 +1,63 @@
+package com.ktg.iscs.mapper;
+
+import com.ktg.common.mapper.BaseMapperX;
+import com.ktg.iscs.domain.IsHardware;
+
+import java.util.List;
+
+/**
+ * 硬件Mapper接口
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+public interface IsHardwareMapper extends BaseMapperX<IsHardware>
+{
+    /**
+     * 查询硬件
+     *
+     * @param id 硬件主键
+     * @return 硬件
+     */
+    IsHardware selectIsHardwareById(Long id);
+
+    /**
+     * 查询硬件列表
+     *
+     * @param isHardware 硬件
+     * @return 硬件集合
+     */
+    List<IsHardware> selectIsHardwareList(IsHardware isHardware);
+
+    /**
+     * 新增硬件
+     *
+     * @param isHardware 硬件
+     * @return 结果
+     */
+    int insertIsHardware(IsHardware isHardware);
+
+    /**
+     * 修改硬件
+     *
+     * @param isHardware 硬件
+     * @return 结果
+     */
+    int updateIsHardware(IsHardware isHardware);
+
+    /**
+     * 删除硬件
+     *
+     * @param id 硬件主键
+     * @return 结果
+     */
+    int deleteIsHardwareById(Long id);
+
+    /**
+     * 批量删除硬件
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteIsHardwareByIds(Long[] ids);
+}

+ 63 - 0
ktg-iscs/src/main/java/com/ktg/iscs/mapper/IsHardwareTypeMapper.java

@@ -0,0 +1,63 @@
+package com.ktg.iscs.mapper;
+
+import com.ktg.common.mapper.BaseMapperX;
+import com.ktg.iscs.domain.IsHardwareType;
+
+import java.util.List;
+
+/**
+ * 硬件类型Mapper接口
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+public interface IsHardwareTypeMapper extends BaseMapperX<IsHardwareType>
+{
+    /**
+     * 查询硬件类型
+     *
+     * @param id 硬件类型主键
+     * @return 硬件类型
+     */
+    IsHardwareType selectIsHardwareTypeById(Long id);
+
+    /**
+     * 查询硬件类型列表
+     *
+     * @param isHardwareType 硬件类型
+     * @return 硬件类型集合
+     */
+    List<IsHardwareType> selectIsHardwareTypeList(IsHardwareType isHardwareType);
+
+    /**
+     * 新增硬件类型
+     *
+     * @param isHardwareType 硬件类型
+     * @return 结果
+     */
+    int insertIsHardwareType(IsHardwareType isHardwareType);
+
+    /**
+     * 修改硬件类型
+     *
+     * @param isHardwareType 硬件类型
+     * @return 结果
+     */
+    int updateIsHardwareType(IsHardwareType isHardwareType);
+
+    /**
+     * 删除硬件类型
+     *
+     * @param id 硬件类型主键
+     * @return 结果
+     */
+    int deleteIsHardwareTypeById(Long id);
+
+    /**
+     * 批量删除硬件类型
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteIsHardwareTypeByIds(Long[] ids);
+}

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

@@ -0,0 +1,63 @@
+package com.ktg.iscs.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ktg.iscs.domain.IsHardware;
+
+import java.util.List;
+
+/**
+ * 硬件Service接口
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+public interface IIsHardwareService extends IService<IsHardware>
+{
+    /**
+     * 查询硬件
+     *
+     * @param id 硬件主键
+     * @return 硬件
+     */
+    IsHardware selectIsHardwareById(Long id);
+
+    /**
+     * 查询硬件列表
+     *
+     * @param isHardware 硬件
+     * @return 硬件集合
+     */
+    List<IsHardware> selectIsHardwareList(IsHardware isHardware);
+
+    /**
+     * 新增硬件
+     *
+     * @param isHardware 硬件
+     * @return 结果
+     */
+    int insertIsHardware(IsHardware isHardware);
+
+    /**
+     * 修改硬件
+     *
+     * @param isHardware 硬件
+     * @return 结果
+     */
+    int updateIsHardware(IsHardware isHardware);
+
+    /**
+     * 批量删除硬件
+     *
+     * @param ids 需要删除的硬件主键集合
+     * @return 结果
+     */
+    int deleteIsHardwareByIds(String ids);
+
+    /**
+     * 删除硬件信息
+     *
+     * @param id 硬件主键
+     * @return 结果
+     */
+    int deleteIsHardwareById(Long id);
+}

+ 63 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/IIsHardwareTypeService.java

@@ -0,0 +1,63 @@
+package com.ktg.iscs.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ktg.iscs.domain.IsHardwareType;
+
+import java.util.List;
+
+/**
+ * 硬件类型Service接口
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+public interface IIsHardwareTypeService extends IService<IsHardwareType>
+{
+    /**
+     * 查询硬件类型
+     *
+     * @param id 硬件类型主键
+     * @return 硬件类型
+     */
+    IsHardwareType selectIsHardwareTypeById(Long id);
+
+    /**
+     * 查询硬件类型列表
+     *
+     * @param isHardwareType 硬件类型
+     * @return 硬件类型集合
+     */
+    List<IsHardwareType> selectIsHardwareTypeList(IsHardwareType isHardwareType);
+
+    /**
+     * 新增硬件类型
+     *
+     * @param isHardwareType 硬件类型
+     * @return 结果
+     */
+    int insertIsHardwareType(IsHardwareType isHardwareType);
+
+    /**
+     * 修改硬件类型
+     *
+     * @param isHardwareType 硬件类型
+     * @return 结果
+     */
+    int updateIsHardwareType(IsHardwareType isHardwareType);
+
+    /**
+     * 批量删除硬件类型
+     *
+     * @param ids 需要删除的硬件类型主键集合
+     * @return 结果
+     */
+    int deleteIsHardwareTypeByIds(String ids);
+
+    /**
+     * 删除硬件类型信息
+     *
+     * @param id 硬件类型主键
+     * @return 结果
+     */
+    int deleteIsHardwareTypeById(Long id);
+}

+ 102 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsHardwareServiceImpl.java

@@ -0,0 +1,102 @@
+package com.ktg.iscs.service.impl;
+
+import cn.hutool.core.lang.Assert;
+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.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 硬件Service业务层处理
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+@Service
+public class IsHardwareServiceImpl extends ServiceImpl<IsHardwareMapper, IsHardware> implements IIsHardwareService
+{
+    @Autowired
+    private IsHardwareMapper isHardwareMapper;
+
+    /**
+     * 查询硬件
+     *
+     * @param id 硬件主键
+     * @return 硬件
+     */
+    @Override
+    public IsHardware selectIsHardwareById(Long id)
+    {
+        return isHardwareMapper.selectIsHardwareById(id);
+    }
+
+    /**
+     * 查询硬件列表
+     *
+     * @param isHardware 硬件
+     * @return 硬件
+     */
+    @Override
+    public List<IsHardware> selectIsHardwareList(IsHardware isHardware)
+    {
+        return isHardwareMapper.selectIsHardwareList(isHardware);
+    }
+
+    /**
+     * 新增硬件
+     *
+     * @param isHardware 硬件
+     * @return 结果
+     */
+    @Override
+    public int insertIsHardware(IsHardware isHardware)
+    {
+        isHardware.setCreateTime(DateUtils.getNowDate());
+        return isHardwareMapper.insertIsHardware(isHardware);
+    }
+
+    /**
+     * 修改硬件
+     *
+     * @param isHardware 硬件
+     * @return 结果
+     */
+    @Override
+    public int updateIsHardware(IsHardware isHardware)
+    {
+        isHardware.setUpdateTime(DateUtils.getNowDate());
+        return isHardwareMapper.updateIsHardware(isHardware);
+    }
+
+    /**
+     * 批量删除硬件
+     *
+     * @param ids 需要删除的硬件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteIsHardwareByIds(String ids)
+    {
+        Assert.notBlank(ids, "请选择需要删除的数据!");
+        Long[] longIds = Convert.toLongArray(ids);
+        return isHardwareMapper.deleteIsHardwareByIds(longIds);
+    }
+
+    /**
+     * 删除硬件信息
+     *
+     * @param id 硬件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteIsHardwareById(Long id)
+    {
+        return isHardwareMapper.deleteIsHardwareById(id);
+    }
+}

+ 102 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsHardwareTypeServiceImpl.java

@@ -0,0 +1,102 @@
+package com.ktg.iscs.service.impl;
+
+import cn.hutool.core.lang.Assert;
+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.IsHardwareType;
+import com.ktg.iscs.mapper.IsHardwareTypeMapper;
+import com.ktg.iscs.service.IIsHardwareTypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 硬件类型Service业务层处理
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+@Service
+public class IsHardwareTypeServiceImpl extends ServiceImpl<IsHardwareTypeMapper, IsHardwareType> implements IIsHardwareTypeService
+{
+    @Autowired
+    private IsHardwareTypeMapper isHardwareTypeMapper;
+
+    /**
+     * 查询硬件类型
+     *
+     * @param id 硬件类型主键
+     * @return 硬件类型
+     */
+    @Override
+    public IsHardwareType selectIsHardwareTypeById(Long id)
+    {
+        return isHardwareTypeMapper.selectIsHardwareTypeById(id);
+    }
+
+    /**
+     * 查询硬件类型列表
+     *
+     * @param isHardwareType 硬件类型
+     * @return 硬件类型
+     */
+    @Override
+    public List<IsHardwareType> selectIsHardwareTypeList(IsHardwareType isHardwareType)
+    {
+        return isHardwareTypeMapper.selectIsHardwareTypeList(isHardwareType);
+    }
+
+    /**
+     * 新增硬件类型
+     *
+     * @param isHardwareType 硬件类型
+     * @return 结果
+     */
+    @Override
+    public int insertIsHardwareType(IsHardwareType isHardwareType)
+    {
+        isHardwareType.setCreateTime(DateUtils.getNowDate());
+        return isHardwareTypeMapper.insertIsHardwareType(isHardwareType);
+    }
+
+    /**
+     * 修改硬件类型
+     *
+     * @param isHardwareType 硬件类型
+     * @return 结果
+     */
+    @Override
+    public int updateIsHardwareType(IsHardwareType isHardwareType)
+    {
+        isHardwareType.setUpdateTime(DateUtils.getNowDate());
+        return isHardwareTypeMapper.updateIsHardwareType(isHardwareType);
+    }
+
+    /**
+     * 批量删除硬件类型
+     *
+     * @param ids 需要删除的硬件类型主键
+     * @return 结果
+     */
+    @Override
+    public int deleteIsHardwareTypeByIds(String ids)
+    {
+        Assert.notBlank(ids, "请选择需要删除的数据!");
+        Long[] longIds = Convert.toLongArray(ids);
+        return isHardwareTypeMapper.deleteIsHardwareTypeByIds(longIds);
+    }
+
+    /**
+     * 删除硬件类型信息
+     *
+     * @param id 硬件类型主键
+     * @return 结果
+     */
+    @Override
+    public int deleteIsHardwareTypeById(Long id)
+    {
+        return isHardwareTypeMapper.deleteIsHardwareTypeById(id);
+    }
+}

+ 130 - 0
ktg-iscs/src/main/resources/mapper/IsHardwareMapper.xml

@@ -0,0 +1,130 @@
+<?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.ktg.iscs.mapper.IsHardwareMapper">
+    
+    <resultMap type="IsHardware" id="IsHardwareResult">
+        <result property="id"    column="id"    />
+        <result property="hardwareCode"    column="hardware_code"    />
+        <result property="hardwareName"    column="hardware_name"    />
+        <result property="hardwareBrand"    column="hardware_brand"    />
+        <result property="hardwareSpec"    column="hardware_spec"    />
+        <result property="hardwareTypeId"    column="hardware_type_id"    />
+        <result property="hardwareTypeCode"    column="hardware_type_code"    />
+        <result property="hardwareTypeName"    column="hardware_type_name"    />
+        <result property="workshopId"    column="workshop_id"    />
+        <result property="workshopCode"    column="workshop_code"    />
+        <result property="workshopName"    column="workshop_name"    />
+        <result property="status"    column="status"    />
+        <result property="remark"    column="remark"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="updateBy"    column="update_by"    />
+    </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
+    </sql>
+
+    <select id="selectIsHardwareList" parameterType="IsHardware" resultMap="IsHardwareResult">
+        <include refid="selectIsHardwareVo"/>
+        <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>
+            <if test="hardwareSpec != null  and hardwareSpec != ''"> and hardware_spec = #{hardwareSpec}</if>
+            <if test="hardwareTypeId != null "> and hardware_type_id = #{hardwareTypeId}</if>
+            <if test="hardwareTypeCode != null  and hardwareTypeCode != ''"> and hardware_type_code = #{hardwareTypeCode}</if>
+            <if test="hardwareTypeName != null  and hardwareTypeName != ''"> and hardware_type_name like concat('%', #{hardwareTypeName}, '%')</if>
+            <if test="workshopId != null "> and workshop_id = #{workshopId}</if>
+            <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>
+        </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=",">
+            <if test="hardwareCode != null and hardwareCode != ''">hardware_code,</if>
+            <if test="hardwareName != null and hardwareName != ''">hardware_name,</if>
+            <if test="hardwareBrand != null">hardware_brand,</if>
+            <if test="hardwareSpec != null">hardware_spec,</if>
+            <if test="hardwareTypeId != null">hardware_type_id,</if>
+            <if test="hardwareTypeCode != null">hardware_type_code,</if>
+            <if test="hardwareTypeName != null">hardware_type_name,</if>
+            <if test="workshopId != null">workshop_id,</if>
+            <if test="workshopCode != null">workshop_code,</if>
+            <if test="workshopName != null">workshop_name,</if>
+            <if test="status != null and status != ''">status,</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 prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="hardwareCode != null and hardwareCode != ''">#{hardwareCode},</if>
+            <if test="hardwareName != null and hardwareName != ''">#{hardwareName},</if>
+            <if test="hardwareBrand != null">#{hardwareBrand},</if>
+            <if test="hardwareSpec != null">#{hardwareSpec},</if>
+            <if test="hardwareTypeId != null">#{hardwareTypeId},</if>
+            <if test="hardwareTypeCode != null">#{hardwareTypeCode},</if>
+            <if test="hardwareTypeName != null">#{hardwareTypeName},</if>
+            <if test="workshopId != null">#{workshopId},</if>
+            <if test="workshopCode != null">#{workshopCode},</if>
+            <if test="workshopName != null">#{workshopName},</if>
+            <if test="status != null and status != ''">#{status},</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>
+    </insert>
+
+    <update id="updateIsHardware" parameterType="IsHardware">
+        update is_hardware
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="hardwareCode != null and hardwareCode != ''">hardware_code = #{hardwareCode},</if>
+            <if test="hardwareName != null and hardwareName != ''">hardware_name = #{hardwareName},</if>
+            <if test="hardwareBrand != null">hardware_brand = #{hardwareBrand},</if>
+            <if test="hardwareSpec != null">hardware_spec = #{hardwareSpec},</if>
+            <if test="hardwareTypeId != null">hardware_type_id = #{hardwareTypeId},</if>
+            <if test="hardwareTypeCode != null">hardware_type_code = #{hardwareTypeCode},</if>
+            <if test="hardwareTypeName != null">hardware_type_name = #{hardwareTypeName},</if>
+            <if test="workshopId != null">workshop_id = #{workshopId},</if>
+            <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="remark != null">remark = #{remark},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteIsHardwareById" parameterType="Long">
+        delete from is_hardware where id = #{id}
+    </delete>
+
+    <delete id="deleteIsHardwareByIds" parameterType="String">
+        delete from is_hardware where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 100 - 0
ktg-iscs/src/main/resources/mapper/IsHardwareTypeMapper.xml

@@ -0,0 +1,100 @@
+<?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.ktg.iscs.mapper.IsHardwareTypeMapper">
+    
+    <resultMap type="IsHardwareType" id="IsHardwareTypeResult">
+        <result property="id"    column="id"    />
+        <result property="hardwareTypeCode"    column="hardware_type_code"    />
+        <result property="hardwareTypeName"    column="hardware_type_name"    />
+        <result property="parentTypeId"    column="parent_type_id"    />
+        <result property="ancestors"    column="ancestors"    />
+        <result property="enableFlag"    column="enable_flag"    />
+        <result property="remark"    column="remark"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectIsHardwareTypeVo">
+        select id, hardware_type_code, hardware_type_name, parent_type_id, ancestors, enable_flag, remark, del_flag, create_by, create_time, update_by, update_time from is_hardware_type
+    </sql>
+
+    <select id="selectIsHardwareTypeList" parameterType="IsHardwareType" resultMap="IsHardwareTypeResult">
+        <include refid="selectIsHardwareTypeVo"/>
+        <where>  
+            <if test="hardwareTypeCode != null  and hardwareTypeCode != ''"> and hardware_type_code = #{hardwareTypeCode}</if>
+            <if test="hardwareTypeName != null  and hardwareTypeName != ''"> and hardware_type_name like concat('%', #{hardwareTypeName}, '%')</if>
+            <if test="parentTypeId != null "> and parent_type_id = #{parentTypeId}</if>
+            <if test="ancestors != null  and ancestors != ''"> and ancestors = #{ancestors}</if>
+            <if test="enableFlag != null  and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
+        </where>
+    </select>
+    
+    <select id="selectIsHardwareTypeById" parameterType="Long" resultMap="IsHardwareTypeResult">
+        <include refid="selectIsHardwareTypeVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertIsHardwareType" parameterType="IsHardwareType" useGeneratedKeys="true" keyProperty="id">
+        insert into is_hardware_type
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="hardwareTypeCode != null and hardwareTypeCode != ''">hardware_type_code,</if>
+            <if test="hardwareTypeName != null and hardwareTypeName != ''">hardware_type_name,</if>
+            <if test="parentTypeId != null">parent_type_id,</if>
+            <if test="ancestors != null and ancestors != ''">ancestors,</if>
+            <if test="enableFlag != null and enableFlag != ''">enable_flag,</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="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="hardwareTypeCode != null and hardwareTypeCode != ''">#{hardwareTypeCode},</if>
+            <if test="hardwareTypeName != null and hardwareTypeName != ''">#{hardwareTypeName},</if>
+            <if test="parentTypeId != null">#{parentTypeId},</if>
+            <if test="ancestors != null and ancestors != ''">#{ancestors},</if>
+            <if test="enableFlag != null and enableFlag != ''">#{enableFlag},</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="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateIsHardwareType" parameterType="IsHardwareType">
+        update is_hardware_type
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="hardwareTypeCode != null and hardwareTypeCode != ''">hardware_type_code = #{hardwareTypeCode},</if>
+            <if test="hardwareTypeName != null and hardwareTypeName != ''">hardware_type_name = #{hardwareTypeName},</if>
+            <if test="parentTypeId != null">parent_type_id = #{parentTypeId},</if>
+            <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
+            <if test="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteIsHardwareTypeById" parameterType="Long">
+        delete from is_hardware_type where id = #{id}
+    </delete>
+
+    <delete id="deleteIsHardwareTypeByIds" parameterType="String">
+        delete from is_hardware_type where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>