hdy
2023-12-27 3bbdaf8334aff3d070c9e64f9882a1e1c0d6cf77
设备档案
已添加8个文件
1163 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/em/equipmentArchives/controller/EmEquipmentArchivesController.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentArchives/domain/EmEquipmentArchives.java 278 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentArchives/mapper/EmEquipmentArchivesMapper.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentArchives/service/IEmEquipmentArchivesService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentArchives/service/impl/EmEquipmentArchivesServiceImpl.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/em/equipmentArchives/EmEquipmentArchivesMapper.xml 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/em/equipmentArchives/equipmentArchives.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/em/equipmentArchives/index.vue 369 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentArchives/controller/EmEquipmentArchivesController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,104 @@
package com.jcdm.main.em.equipmentArchives.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
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.jcdm.common.annotation.Log;
import com.jcdm.common.core.controller.BaseController;
import com.jcdm.common.core.domain.AjaxResult;
import com.jcdm.common.enums.BusinessType;
import com.jcdm.main.em.equipmentArchives.domain.EmEquipmentArchives;
import com.jcdm.main.em.equipmentArchives.service.IEmEquipmentArchivesService;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
/**
 * è®¾å¤‡æ¡£æ¡ˆController
 *
 * @author Yi
 * @date 2023-12-26
 */
@RestController
@RequestMapping("/em/equipmentArchives")
public class EmEquipmentArchivesController extends BaseController
{
    @Autowired
    private IEmEquipmentArchivesService emEquipmentArchivesService;
    /**
     * æŸ¥è¯¢è®¾å¤‡æ¡£æ¡ˆåˆ—表
     */
    @PreAuthorize("@ss.hasPermi('em:equipmentArchives:list')")
    @GetMapping("/list")
    public TableDataInfo list(EmEquipmentArchives emEquipmentArchives)
    {
        startPage();
        List<EmEquipmentArchives> list = emEquipmentArchivesService.selectEmEquipmentArchivesList(emEquipmentArchives);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºè®¾å¤‡æ¡£æ¡ˆåˆ—表
     */
    @PreAuthorize("@ss.hasPermi('em:equipmentArchives:export')")
    @Log(title = "设备档案", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, EmEquipmentArchives emEquipmentArchives)
    {
        List<EmEquipmentArchives> list = emEquipmentArchivesService.selectEmEquipmentArchivesList(emEquipmentArchives);
        ExcelUtil<EmEquipmentArchives> util = new ExcelUtil<EmEquipmentArchives>(EmEquipmentArchives.class);
        util.exportExcel(response, list, "设备档案数据");
    }
    /**
     * èŽ·å–设备档案详细信息
     */
    @PreAuthorize("@ss.hasPermi('em:equipmentArchives:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(emEquipmentArchivesService.selectEmEquipmentArchivesById(id));
    }
    /**
     * æ–°å¢žè®¾å¤‡æ¡£æ¡ˆ
     */
    @PreAuthorize("@ss.hasPermi('em:equipmentArchives:add')")
    @Log(title = "设备档案", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody EmEquipmentArchives emEquipmentArchives)
    {
        return toAjax(emEquipmentArchivesService.insertEmEquipmentArchives(emEquipmentArchives));
    }
    /**
     * ä¿®æ”¹è®¾å¤‡æ¡£æ¡ˆ
     */
    @PreAuthorize("@ss.hasPermi('em:equipmentArchives:edit')")
    @Log(title = "设备档案", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody EmEquipmentArchives emEquipmentArchives)
    {
        return toAjax(emEquipmentArchivesService.updateEmEquipmentArchives(emEquipmentArchives));
    }
    /**
     * åˆ é™¤è®¾å¤‡æ¡£æ¡ˆ
     */
    @PreAuthorize("@ss.hasPermi('em:equipmentArchives:remove')")
    @Log(title = "设备档案", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(emEquipmentArchivesService.deleteEmEquipmentArchivesByIds(ids));
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/equipmentArchives/domain/EmEquipmentArchives.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,278 @@
package com.jcdm.main.em.equipmentArchives.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jcdm.common.annotation.Excel;
import com.jcdm.common.core.domain.BaseEntity;
/**
 * è®¾å¤‡æ¡£æ¡ˆå¯¹è±¡ em_equipment_archives
 *
 * @author Yi
 * @date 2023-12-26
 */
public class EmEquipmentArchives extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** ID */
    private Long id;
    /** è®¾å¤‡ç¼–码 */
    @Excel(name = "设备编码")
    private String equipmentCode;
    /** è®¾å¤‡åç§° */
    @Excel(name = "设备名称")
    private String equipmentName;
    /** å“ç‰Œ */
    @Excel(name = "品牌")
    private String equipmentBrand;
    /** è§„格型号 */
    @Excel(name = "规格型号")
    private String equipmentSpec;
    /** è®¾å¤‡ç±»åž‹ID */
    @Excel(name = "设备类型ID")
    private Long equipmentTypeId;
    /** è®¾å¤‡ç±»åž‹ç¼–码 */
    @Excel(name = "设备类型编码")
    private String equipmentTypeCode;
    /** è®¾å¤‡ç±»åž‹åç§° */
    @Excel(name = "设备类型名称")
    private String equipmentTypeName;
    /** è½¦é—´ç¼–码 */
    @Excel(name = "车间编码")
    private String workshopCode;
    /** äº§çº¿ç¼–码 */
    @Excel(name = "产线编码")
    private String lineCode;
    /** å·¥åºç¼–码 */
    @Excel(name = "工序编码")
    private String processes;
    /** è®¾å¤‡çŠ¶æ€ */
    @Excel(name = "设备状态")
    private String status;
    /** åˆ›å»ºäºº */
    @Excel(name = "创建人")
    private String createUser;
    /** æ›´æ–°äºº */
    @Excel(name = "更新人")
    private String updateUser;
    /** é¢„留字段1 */
    @Excel(name = "预留字段1")
    private String spareField1;
    /** é¢„留字段2 */
    @Excel(name = "预留字段2")
    private String spareField2;
    /** é¢„留字段3 */
    @Excel(name = "预留字段3")
    private Long spareField3;
    /** é¢„留字段4 */
    @Excel(name = "预留字段4")
    private Long spareField4;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setEquipmentCode(String equipmentCode)
    {
        this.equipmentCode = equipmentCode;
    }
    public String getEquipmentCode()
    {
        return equipmentCode;
    }
    public void setEquipmentName(String equipmentName)
    {
        this.equipmentName = equipmentName;
    }
    public String getEquipmentName()
    {
        return equipmentName;
    }
    public void setEquipmentBrand(String equipmentBrand)
    {
        this.equipmentBrand = equipmentBrand;
    }
    public String getEquipmentBrand()
    {
        return equipmentBrand;
    }
    public void setEquipmentSpec(String equipmentSpec)
    {
        this.equipmentSpec = equipmentSpec;
    }
    public String getEquipmentSpec()
    {
        return equipmentSpec;
    }
    public void setEquipmentTypeId(Long equipmentTypeId)
    {
        this.equipmentTypeId = equipmentTypeId;
    }
    public Long getEquipmentTypeId()
    {
        return equipmentTypeId;
    }
    public void setEquipmentTypeCode(String equipmentTypeCode)
    {
        this.equipmentTypeCode = equipmentTypeCode;
    }
    public String getEquipmentTypeCode()
    {
        return equipmentTypeCode;
    }
    public void setEquipmentTypeName(String equipmentTypeName)
    {
        this.equipmentTypeName = equipmentTypeName;
    }
    public String getEquipmentTypeName()
    {
        return equipmentTypeName;
    }
    public void setWorkshopCode(String workshopCode)
    {
        this.workshopCode = workshopCode;
    }
    public String getWorkshopCode()
    {
        return workshopCode;
    }
    public void setLineCode(String lineCode)
    {
        this.lineCode = lineCode;
    }
    public String getLineCode()
    {
        return lineCode;
    }
    public void setProcesses(String processes)
    {
        this.processes = processes;
    }
    public String getProcesses()
    {
        return processes;
    }
    public void setStatus(String status)
    {
        this.status = status;
    }
    public String getStatus()
    {
        return status;
    }
    public void setCreateUser(String createUser)
    {
        this.createUser = createUser;
    }
    public String getCreateUser()
    {
        return createUser;
    }
    public void setUpdateUser(String updateUser)
    {
        this.updateUser = updateUser;
    }
    public String getUpdateUser()
    {
        return updateUser;
    }
    public void setSpareField1(String spareField1)
    {
        this.spareField1 = spareField1;
    }
    public String getSpareField1()
    {
        return spareField1;
    }
    public void setSpareField2(String spareField2)
    {
        this.spareField2 = spareField2;
    }
    public String getSpareField2()
    {
        return spareField2;
    }
    public void setSpareField3(Long spareField3)
    {
        this.spareField3 = spareField3;
    }
    public Long getSpareField3()
    {
        return spareField3;
    }
    public void setSpareField4(Long spareField4)
    {
        this.spareField4 = spareField4;
    }
    public Long getSpareField4()
    {
        return spareField4;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("equipmentCode", getEquipmentCode())
            .append("equipmentName", getEquipmentName())
            .append("equipmentBrand", getEquipmentBrand())
            .append("equipmentSpec", getEquipmentSpec())
            .append("equipmentTypeId", getEquipmentTypeId())
            .append("equipmentTypeCode", getEquipmentTypeCode())
            .append("equipmentTypeName", getEquipmentTypeName())
            .append("workshopCode", getWorkshopCode())
            .append("lineCode", getLineCode())
            .append("processes", getProcesses())
            .append("status", getStatus())
            .append("remark", getRemark())
            .append("createUser", getCreateUser())
            .append("createTime", getCreateTime())
            .append("updateUser", getUpdateUser())
            .append("updateTime", getUpdateTime())
            .append("spareField1", getSpareField1())
            .append("spareField2", getSpareField2())
            .append("spareField3", getSpareField3())
            .append("spareField4", getSpareField4())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/equipmentArchives/mapper/EmEquipmentArchivesMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.equipmentArchives.mapper;
import java.util.List;
import com.jcdm.main.em.equipmentArchives.domain.EmEquipmentArchives;
/**
 * è®¾å¤‡æ¡£æ¡ˆMapper接口
 *
 * @author Yi
 * @date 2023-12-26
 */
public interface EmEquipmentArchivesMapper
{
    /**
     * æŸ¥è¯¢è®¾å¤‡æ¡£æ¡ˆ
     *
     * @param id è®¾å¤‡æ¡£æ¡ˆä¸»é”®
     * @return è®¾å¤‡æ¡£æ¡ˆ
     */
    public EmEquipmentArchives selectEmEquipmentArchivesById(Long id);
    /**
     * æŸ¥è¯¢è®¾å¤‡æ¡£æ¡ˆåˆ—表
     *
     * @param emEquipmentArchives è®¾å¤‡æ¡£æ¡ˆ
     * @return è®¾å¤‡æ¡£æ¡ˆé›†åˆ
     */
    public List<EmEquipmentArchives> selectEmEquipmentArchivesList(EmEquipmentArchives emEquipmentArchives);
    /**
     * æ–°å¢žè®¾å¤‡æ¡£æ¡ˆ
     *
     * @param emEquipmentArchives è®¾å¤‡æ¡£æ¡ˆ
     * @return ç»“æžœ
     */
    public int insertEmEquipmentArchives(EmEquipmentArchives emEquipmentArchives);
    /**
     * ä¿®æ”¹è®¾å¤‡æ¡£æ¡ˆ
     *
     * @param emEquipmentArchives è®¾å¤‡æ¡£æ¡ˆ
     * @return ç»“æžœ
     */
    public int updateEmEquipmentArchives(EmEquipmentArchives emEquipmentArchives);
    /**
     * åˆ é™¤è®¾å¤‡æ¡£æ¡ˆ
     *
     * @param id è®¾å¤‡æ¡£æ¡ˆä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteEmEquipmentArchivesById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤è®¾å¤‡æ¡£æ¡ˆ
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteEmEquipmentArchivesByIds(Long[] ids);
}
jcdm-main/src/main/java/com/jcdm/main/em/equipmentArchives/service/IEmEquipmentArchivesService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.equipmentArchives.service;
import java.util.List;
import com.jcdm.main.em.equipmentArchives.domain.EmEquipmentArchives;
/**
 * è®¾å¤‡æ¡£æ¡ˆService接口
 *
 * @author Yi
 * @date 2023-12-26
 */
public interface IEmEquipmentArchivesService
{
    /**
     * æŸ¥è¯¢è®¾å¤‡æ¡£æ¡ˆ
     *
     * @param id è®¾å¤‡æ¡£æ¡ˆä¸»é”®
     * @return è®¾å¤‡æ¡£æ¡ˆ
     */
    public EmEquipmentArchives selectEmEquipmentArchivesById(Long id);
    /**
     * æŸ¥è¯¢è®¾å¤‡æ¡£æ¡ˆåˆ—表
     *
     * @param emEquipmentArchives è®¾å¤‡æ¡£æ¡ˆ
     * @return è®¾å¤‡æ¡£æ¡ˆé›†åˆ
     */
    public List<EmEquipmentArchives> selectEmEquipmentArchivesList(EmEquipmentArchives emEquipmentArchives);
    /**
     * æ–°å¢žè®¾å¤‡æ¡£æ¡ˆ
     *
     * @param emEquipmentArchives è®¾å¤‡æ¡£æ¡ˆ
     * @return ç»“æžœ
     */
    public int insertEmEquipmentArchives(EmEquipmentArchives emEquipmentArchives);
    /**
     * ä¿®æ”¹è®¾å¤‡æ¡£æ¡ˆ
     *
     * @param emEquipmentArchives è®¾å¤‡æ¡£æ¡ˆ
     * @return ç»“æžœ
     */
    public int updateEmEquipmentArchives(EmEquipmentArchives emEquipmentArchives);
    /**
     * æ‰¹é‡åˆ é™¤è®¾å¤‡æ¡£æ¡ˆ
     *
     * @param ids éœ€è¦åˆ é™¤çš„设备档案主键集合
     * @return ç»“æžœ
     */
    public int deleteEmEquipmentArchivesByIds(Long[] ids);
    /**
     * åˆ é™¤è®¾å¤‡æ¡£æ¡ˆä¿¡æ¯
     *
     * @param id è®¾å¤‡æ¡£æ¡ˆä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteEmEquipmentArchivesById(Long id);
}
jcdm-main/src/main/java/com/jcdm/main/em/equipmentArchives/service/impl/EmEquipmentArchivesServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
package com.jcdm.main.em.equipmentArchives.service.impl;
import java.util.List;
import com.jcdm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jcdm.main.em.equipmentArchives.mapper.EmEquipmentArchivesMapper;
import com.jcdm.main.em.equipmentArchives.domain.EmEquipmentArchives;
import com.jcdm.main.em.equipmentArchives.service.IEmEquipmentArchivesService;
/**
 * è®¾å¤‡æ¡£æ¡ˆService业务层处理
 *
 * @author Yi
 * @date 2023-12-26
 */
@Service
public class EmEquipmentArchivesServiceImpl implements IEmEquipmentArchivesService
{
    @Autowired
    private EmEquipmentArchivesMapper emEquipmentArchivesMapper;
    /**
     * æŸ¥è¯¢è®¾å¤‡æ¡£æ¡ˆ
     *
     * @param id è®¾å¤‡æ¡£æ¡ˆä¸»é”®
     * @return è®¾å¤‡æ¡£æ¡ˆ
     */
    @Override
    public EmEquipmentArchives selectEmEquipmentArchivesById(Long id)
    {
        return emEquipmentArchivesMapper.selectEmEquipmentArchivesById(id);
    }
    /**
     * æŸ¥è¯¢è®¾å¤‡æ¡£æ¡ˆåˆ—表
     *
     * @param emEquipmentArchives è®¾å¤‡æ¡£æ¡ˆ
     * @return è®¾å¤‡æ¡£æ¡ˆ
     */
    @Override
    public List<EmEquipmentArchives> selectEmEquipmentArchivesList(EmEquipmentArchives emEquipmentArchives)
    {
        return emEquipmentArchivesMapper.selectEmEquipmentArchivesList(emEquipmentArchives);
    }
    /**
     * æ–°å¢žè®¾å¤‡æ¡£æ¡ˆ
     *
     * @param emEquipmentArchives è®¾å¤‡æ¡£æ¡ˆ
     * @return ç»“æžœ
     */
    @Override
    public int insertEmEquipmentArchives(EmEquipmentArchives emEquipmentArchives)
    {
        emEquipmentArchives.setCreateTime(DateUtils.getNowDate());
        return emEquipmentArchivesMapper.insertEmEquipmentArchives(emEquipmentArchives);
    }
    /**
     * ä¿®æ”¹è®¾å¤‡æ¡£æ¡ˆ
     *
     * @param emEquipmentArchives è®¾å¤‡æ¡£æ¡ˆ
     * @return ç»“æžœ
     */
    @Override
    public int updateEmEquipmentArchives(EmEquipmentArchives emEquipmentArchives)
    {
        emEquipmentArchives.setUpdateTime(DateUtils.getNowDate());
        return emEquipmentArchivesMapper.updateEmEquipmentArchives(emEquipmentArchives);
    }
    /**
     * æ‰¹é‡åˆ é™¤è®¾å¤‡æ¡£æ¡ˆ
     *
     * @param ids éœ€è¦åˆ é™¤çš„设备档案主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmEquipmentArchivesByIds(Long[] ids)
    {
        return emEquipmentArchivesMapper.deleteEmEquipmentArchivesByIds(ids);
    }
    /**
     * åˆ é™¤è®¾å¤‡æ¡£æ¡ˆä¿¡æ¯
     *
     * @param id è®¾å¤‡æ¡£æ¡ˆä¸»é”®
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmEquipmentArchivesById(Long id)
    {
        return emEquipmentArchivesMapper.deleteEmEquipmentArchivesById(id);
    }
}
jcdm-main/src/main/resources/mapper/em/equipmentArchives/EmEquipmentArchivesMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,150 @@
<?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.jcdm.main.em.equipmentArchives.mapper.EmEquipmentArchivesMapper">
    <resultMap type="EmEquipmentArchives" id="EmEquipmentArchivesResult">
        <result property="id"    column="id"    />
        <result property="equipmentCode"    column="equipment_code"    />
        <result property="equipmentName"    column="equipment_name"    />
        <result property="equipmentBrand"    column="equipment_brand"    />
        <result property="equipmentSpec"    column="equipment_spec"    />
        <result property="equipmentTypeId"    column="equipment_type_id"    />
        <result property="equipmentTypeCode"    column="equipment_type_code"    />
        <result property="equipmentTypeName"    column="equipment_type_name"    />
        <result property="workshopCode"    column="workshop_code"    />
        <result property="lineCode"    column="line_code"    />
        <result property="processes"    column="processes"    />
        <result property="status"    column="status"    />
        <result property="remark"    column="remark"    />
        <result property="createUser"    column="create_user"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="updateTime"    column="update_time"    />
        <result property="spareField1"    column="spare_field_1"    />
        <result property="spareField2"    column="spare_field_2"    />
        <result property="spareField3"    column="spare_field_3"    />
        <result property="spareField4"    column="spare_field_4"    />
    </resultMap>
    <sql id="selectEmEquipmentArchivesVo">
        select id, equipment_code, equipment_name, equipment_brand, equipment_spec, equipment_type_id, equipment_type_code, equipment_type_name, workshop_code, line_code, processes, status, remark, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from em_equipment_archives
    </sql>
    <select id="selectEmEquipmentArchivesList" parameterType="EmEquipmentArchives" resultMap="EmEquipmentArchivesResult">
        <include refid="selectEmEquipmentArchivesVo"/>
        <where>
            <if test="equipmentCode != null  and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
            <if test="equipmentName != null  and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
            <if test="equipmentBrand != null  and equipmentBrand != ''"> and equipment_brand = #{equipmentBrand}</if>
            <if test="equipmentSpec != null  and equipmentSpec != ''"> and equipment_spec = #{equipmentSpec}</if>
            <if test="equipmentTypeId != null "> and equipment_type_id = #{equipmentTypeId}</if>
            <if test="equipmentTypeCode != null  and equipmentTypeCode != ''"> and equipment_type_code = #{equipmentTypeCode}</if>
            <if test="equipmentTypeName != null  and equipmentTypeName != ''"> and equipment_type_name like concat('%', #{equipmentTypeName}, '%')</if>
            <if test="workshopCode != null  and workshopCode != ''"> and workshop_code = #{workshopCode}</if>
            <if test="lineCode != null  and lineCode != ''"> and line_code = #{lineCode}</if>
            <if test="processes != null  and processes != ''"> and processes = #{processes}</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
            <if test="spareField1 != null  and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
            <if test="spareField2 != null  and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
            <if test="spareField3 != null "> and spare_field_3 = #{spareField3}</if>
            <if test="spareField4 != null "> and spare_field_4 = #{spareField4}</if>
        </where>
    </select>
    <select id="selectEmEquipmentArchivesById" parameterType="Long" resultMap="EmEquipmentArchivesResult">
        <include refid="selectEmEquipmentArchivesVo"/>
        where id = #{id}
    </select>
    <insert id="insertEmEquipmentArchives" parameterType="EmEquipmentArchives">
        insert into em_equipment_archives
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="equipmentCode != null and equipmentCode != ''">equipment_code,</if>
            <if test="equipmentName != null and equipmentName != ''">equipment_name,</if>
            <if test="equipmentBrand != null">equipment_brand,</if>
            <if test="equipmentSpec != null">equipment_spec,</if>
            <if test="equipmentTypeId != null">equipment_type_id,</if>
            <if test="equipmentTypeCode != null">equipment_type_code,</if>
            <if test="equipmentTypeName != null">equipment_type_name,</if>
            <if test="workshopCode != null">workshop_code,</if>
            <if test="lineCode != null">line_code,</if>
            <if test="processes != null">processes,</if>
            <if test="status != null">status,</if>
            <if test="remark != null">remark,</if>
            <if test="createUser != null">create_user,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateUser != null">update_user,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="spareField1 != null">spare_field_1,</if>
            <if test="spareField2 != null">spare_field_2,</if>
            <if test="spareField3 != null">spare_field_3,</if>
            <if test="spareField4 != null">spare_field_4,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if>
            <if test="equipmentName != null and equipmentName != ''">#{equipmentName},</if>
            <if test="equipmentBrand != null">#{equipmentBrand},</if>
            <if test="equipmentSpec != null">#{equipmentSpec},</if>
            <if test="equipmentTypeId != null">#{equipmentTypeId},</if>
            <if test="equipmentTypeCode != null">#{equipmentTypeCode},</if>
            <if test="equipmentTypeName != null">#{equipmentTypeName},</if>
            <if test="workshopCode != null">#{workshopCode},</if>
            <if test="lineCode != null">#{lineCode},</if>
            <if test="processes != null">#{processes},</if>
            <if test="status != null">#{status},</if>
            <if test="remark != null">#{remark},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateUser != null">#{updateUser},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="spareField1 != null">#{spareField1},</if>
            <if test="spareField2 != null">#{spareField2},</if>
            <if test="spareField3 != null">#{spareField3},</if>
            <if test="spareField4 != null">#{spareField4},</if>
         </trim>
    </insert>
    <update id="updateEmEquipmentArchives" parameterType="EmEquipmentArchives">
        update em_equipment_archives
        <trim prefix="SET" suffixOverrides=",">
            <if test="equipmentCode != null and equipmentCode != ''">equipment_code = #{equipmentCode},</if>
            <if test="equipmentName != null and equipmentName != ''">equipment_name = #{equipmentName},</if>
            <if test="equipmentBrand != null">equipment_brand = #{equipmentBrand},</if>
            <if test="equipmentSpec != null">equipment_spec = #{equipmentSpec},</if>
            <if test="equipmentTypeId != null">equipment_type_id = #{equipmentTypeId},</if>
            <if test="equipmentTypeCode != null">equipment_type_code = #{equipmentTypeCode},</if>
            <if test="equipmentTypeName != null">equipment_type_name = #{equipmentTypeName},</if>
            <if test="workshopCode != null">workshop_code = #{workshopCode},</if>
            <if test="lineCode != null">line_code = #{lineCode},</if>
            <if test="processes != null">processes = #{processes},</if>
            <if test="status != null">status = #{status},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateUser != null">update_user = #{updateUser},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
            <if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
            <if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteEmEquipmentArchivesById" parameterType="Long">
        delete from em_equipment_archives where id = #{id}
    </delete>
    <delete id="deleteEmEquipmentArchivesByIds" parameterType="String">
        delete from em_equipment_archives where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
jcdm-ui/src/api/main/em/equipmentArchives/equipmentArchives.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// æŸ¥è¯¢è®¾å¤‡æ¡£æ¡ˆåˆ—表
export function listEquipmentArchives(query) {
  return request({
    url: '/em/equipmentArchives/list',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢è®¾å¤‡æ¡£æ¡ˆè¯¦ç»†
export function getEquipmentArchives(id) {
  return request({
    url: '/em/equipmentArchives/' + id,
    method: 'get'
  })
}
// æ–°å¢žè®¾å¤‡æ¡£æ¡ˆ
export function addEquipmentArchives(data) {
  return request({
    url: '/em/equipmentArchives',
    method: 'post',
    data: data
  })
}
// ä¿®æ”¹è®¾å¤‡æ¡£æ¡ˆ
export function updateEquipmentArchives(data) {
  return request({
    url: '/em/equipmentArchives',
    method: 'put',
    data: data
  })
}
// åˆ é™¤è®¾å¤‡æ¡£æ¡ˆ
export function delEquipmentArchives(id) {
  return request({
    url: '/em/equipmentArchives/' + id,
    method: 'delete'
  })
}
jcdm-ui/src/views/main/em/equipmentArchives/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,369 @@
<template>
  <div class="app-container">
    <el-card class="box-card">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="设备编码" prop="equipmentCode">
            <el-input
              v-model="queryParams.equipmentCode"
              placeholder="请输入设备编码"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="设备名称" prop="equipmentName">
            <el-input
              v-model="queryParams.equipmentName"
              placeholder="请输入设备名称"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item style="float: right">
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>
    </el-card>
    <el-card style="margin-top: 10px" class="box-card">
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              type="primary"
              plain
              icon="el-icon-plus"
              size="mini"
              @click="handleAdd"
              v-hasPermi="['em:equipmentArchives:add']"
            >新增</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="success"
              plain
              icon="el-icon-edit"
              size="mini"
              :disabled="single"
              @click="handleUpdate"
              v-hasPermi="['em:equipmentArchives:edit']"
            >修改</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="danger"
              plain
              icon="el-icon-delete"
              size="mini"
              :disabled="multiple"
              @click="handleDelete"
              v-hasPermi="['em:equipmentArchives:remove']"
            >删除</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="warning"
              plain
              icon="el-icon-download"
              size="mini"
              @click="handleExport"
              v-hasPermi="['em:equipmentArchives:export']"
            >导出</el-button>
          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
        <el-table border v-loading="loading" :data="equipmentArchivesList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="设备编码" align="center" prop="equipmentCode"/>
          <el-table-column label="设备名称" align="center" prop="equipmentName"/>
          <el-table-column label="品牌" align="center" prop="equipmentBrand"/>
          <el-table-column label="规格型号" align="center" prop="equipmentSpec"/>
          <el-table-column label="车间编码" align="center" prop="workshopCode"/>
          <el-table-column label="设备状态" align="center" prop="status"/>
          <el-table-column label="报警时间" width="160" align="center" prop="createTime"/>
          <el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="success"
                plain
                style="width: 72px"
                icon="el-icon-edit"
                @click="handleUpdate(scope.row)"
                v-hasPermi="['em:equipmentArchives:edit']"
              >修改</el-button>
              <el-button
                size="mini"
                type="danger"
                plain
                style="width: 72px"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['em:equipmentArchives:remove']"
              >删除</el-button>
            </template>
          </el-table-column>
        </el-table>
    </el-card>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <!-- æ·»åŠ æˆ–修改设备档案对话框 -->
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body>
      <span slot="title">
        <i class="el-icon-s-order"></i>
        {{titleName}}
      </span>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="设备编码" prop="equipmentCode">
          <el-input v-model="form.equipmentCode" placeholder="请输入设备编码" />
        </el-form-item>
        <el-form-item label="设备名称" prop="equipmentName">
          <el-input v-model="form.equipmentName" placeholder="请输入设备名称" />
        </el-form-item>
        <el-form-item label="品牌" prop="equipmentBrand">
          <el-input v-model="form.equipmentBrand" placeholder="请输入品牌" />
        </el-form-item>
        <el-form-item label="设备类型名称" prop="equipmentTypeName">
          <el-input v-model="form.equipmentTypeName" placeholder="请输入设备类型名称" />
        </el-form-item>
        <el-form-item label="规格型号" prop="equipmentSpec">
          <el-input v-model="form.equipmentSpec" placeholder="请输入规格型号" />
        </el-form-item>
        <el-form-item label="车间编码" prop="workshopCode">
          <el-input v-model="form.workshopCode" placeholder="请输入车间编码" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注" />
        </el-form-item>
<!--        <el-form-item label="设备类型ID" prop="equipmentTypeId">-->
<!--          <el-input v-model="form.equipmentTypeId" placeholder="请输入设备类型ID" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="设备类型编码" prop="equipmentTypeCode">-->
<!--          <el-input v-model="form.equipmentTypeCode" placeholder="请输入设备类型编码" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="产线编码" prop="lineCode">-->
<!--          <el-input v-model="form.lineCode" placeholder="请输入产线编码" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="工序编码" prop="processes">-->
<!--          <el-input v-model="form.processes" placeholder="请输入工序编码" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="创建人" prop="createUser">-->
<!--          <el-input v-model="form.createUser" placeholder="请输入创建人" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="更新人" prop="updateUser">-->
<!--          <el-input v-model="form.updateUser" placeholder="请输入更新人" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="预留字段1" prop="spareField1">-->
<!--          <el-input v-model="form.spareField1" placeholder="请输入预留字段1" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="预留字段2" prop="spareField2">-->
<!--          <el-input v-model="form.spareField2" placeholder="请输入预留字段2" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="预留字段3" prop="spareField3">-->
<!--          <el-input v-model="form.spareField3" placeholder="请输入预留字段3" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="预留字段4" prop="spareField4">-->
<!--          <el-input v-model="form.spareField4" placeholder="请输入预留字段4" />-->
<!--        </el-form-item>-->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">ç¡® å®š</el-button>
        <el-button @click="cancel">取 æ¶ˆ</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { listEquipmentArchives, getEquipmentArchives, delEquipmentArchives, addEquipmentArchives, updateEquipmentArchives } from "@/api/main/em/equipmentArchives/equipmentArchives";
export default {
  name: "EquipmentArchives",
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      titleName: "",
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // è®¾å¤‡æ¡£æ¡ˆè¡¨æ ¼æ•°æ®
      equipmentArchivesList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        equipmentCode: null,
        equipmentName: null,
        equipmentBrand: null,
        equipmentSpec: null,
        equipmentTypeId: null,
        equipmentTypeCode: null,
        equipmentTypeName: null,
        workshopCode: null,
        lineCode: null,
        processes: null,
        status: null,
        createUser: null,
        updateUser: null,
        spareField1: null,
        spareField2: null,
        spareField3: null,
        spareField4: null
      },
      // è¡¨å•å‚æ•°
      form: {},
      // è¡¨å•æ ¡éªŒ
      rules: {
        id: [
          { required: true, message: "ID不能为空", trigger: "blur" }
        ],
        equipmentCode: [
          { required: true, message: "设备编码不能为空", trigger: "blur" }
        ],
        equipmentName: [
          { required: true, message: "设备名称不能为空", trigger: "blur" }
        ],
        equipmentTypeId: [
          { required: true, message: "设备类型ID不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢è®¾å¤‡æ¡£æ¡ˆåˆ—表 */
    getList() {
      this.loading = true;
      listEquipmentArchives(this.queryParams).then(response => {
        this.equipmentArchivesList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // å–消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // è¡¨å•é‡ç½®
    reset() {
      this.form = {
        id: null,
        equipmentCode: null,
        equipmentName: null,
        equipmentBrand: null,
        equipmentSpec: null,
        equipmentTypeId: null,
        equipmentTypeCode: null,
        equipmentTypeName: null,
        workshopCode: null,
        lineCode: null,
        processes: null,
        status: null,
        remark: null,
        createUser: null,
        createTime: null,
        updateUser: null,
        updateTime: null,
        spareField1: null,
        spareField2: null,
        spareField3: null,
        spareField4: null
      };
      this.resetForm("form");
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** é‡ç½®æŒ‰é’®æ“ä½œ */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // å¤šé€‰æ¡†é€‰ä¸­æ•°æ®
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** æ–°å¢žæŒ‰é’®æ“ä½œ */
    handleAdd() {
      this.reset();
      this.open = true;
      this.titleName = "添加设备档案";
    },
    /** ä¿®æ”¹æŒ‰é’®æ“ä½œ */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getEquipmentArchives(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.titleName = "修改设备档案";
      });
    },
    /** æäº¤æŒ‰é’® */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateEquipmentArchives(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addEquipmentArchives(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** åˆ é™¤æŒ‰é’®æ“ä½œ */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除设备档案编号为"' + ids + '"的数据项?').then(function() {
        return delEquipmentArchives(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      this.download('em/equipmentArchives/export', {
        ...this.queryParams
      }, `equipmentArchives_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>