懒羊羊
2023-12-27 92eae26c252dc7a0cad6681847abfc2b23108c14
设备状态
已删除8个文件
已添加8个文件
1957 ■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/em/equipmentStatus/controller/EmEquipmentStatusController.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentStatus/domain/EmEquipmentStatus.java 162 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentStatus/mapper/EmEquipmentStatusMapper.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentStatus/service/IEmEquipmentStatusService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentStatus/service/impl/EmEquipmentStatusServiceImpl.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentType/controller/EmEquipmentTypeController.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentType/domain/EmEquipmentType.java 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentType/mapper/EmEquipmentTypeMapper.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentType/service/IEmEquipmentTypeService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentType/service/impl/EmEquipmentTypeServiceImpl.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/em/equipmentStatus/EmEquipmentStatusMapper.xml 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/em/equipmentType/EmEquipmentTypeMapper.xml 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/em/equipmentStatus/equipmentStatus.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/em/equipmentType/equipmentType.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/em/equipmentStatus/index.vue 356 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/em/equipmentType/index.vue 323 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/equipmentStatus/controller/EmEquipmentStatusController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,104 @@
package com.jcdm.main.em.equipmentStatus.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.equipmentStatus.domain.EmEquipmentStatus;
import com.jcdm.main.em.equipmentStatus.service.IEmEquipmentStatusService;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
/**
 * è®¾å¤‡çŠ¶æ€Controller
 *
 * @author ruimin
 * @date 2023-12-27
 */
@RestController
@RequestMapping("/em/equipmentStatus")
public class EmEquipmentStatusController extends BaseController
{
    @Autowired
    private IEmEquipmentStatusService emEquipmentStatusService;
    /**
     * æŸ¥è¯¢è®¾å¤‡çŠ¶æ€åˆ—表
     */
    @PreAuthorize("@ss.hasPermi('em:equipmentStatus:list')")
    @GetMapping("/list")
    public TableDataInfo list(EmEquipmentStatus emEquipmentStatus)
    {
        startPage();
        List<EmEquipmentStatus> list = emEquipmentStatusService.selectEmEquipmentStatusList(emEquipmentStatus);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºè®¾å¤‡çŠ¶æ€åˆ—表
     */
    @PreAuthorize("@ss.hasPermi('em:equipmentStatus:export')")
    @Log(title = "设备状态", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, EmEquipmentStatus emEquipmentStatus)
    {
        List<EmEquipmentStatus> list = emEquipmentStatusService.selectEmEquipmentStatusList(emEquipmentStatus);
        ExcelUtil<EmEquipmentStatus> util = new ExcelUtil<EmEquipmentStatus>(EmEquipmentStatus.class);
        util.exportExcel(response, list, "设备状态数据");
    }
    /**
     * èŽ·å–设备状态详细信息
     */
    @PreAuthorize("@ss.hasPermi('em:equipmentStatus:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(emEquipmentStatusService.selectEmEquipmentStatusById(id));
    }
    /**
     * æ–°å¢žè®¾å¤‡çŠ¶æ€
     */
    @PreAuthorize("@ss.hasPermi('em:equipmentStatus:add')")
    @Log(title = "设备状态", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody EmEquipmentStatus emEquipmentStatus)
    {
        return toAjax(emEquipmentStatusService.insertEmEquipmentStatus(emEquipmentStatus));
    }
    /**
     * ä¿®æ”¹è®¾å¤‡çŠ¶æ€
     */
    @PreAuthorize("@ss.hasPermi('em:equipmentStatus:edit')")
    @Log(title = "设备状态", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody EmEquipmentStatus emEquipmentStatus)
    {
        return toAjax(emEquipmentStatusService.updateEmEquipmentStatus(emEquipmentStatus));
    }
    /**
     * åˆ é™¤è®¾å¤‡çŠ¶æ€
     */
    @PreAuthorize("@ss.hasPermi('em:equipmentStatus:remove')")
    @Log(title = "设备状态", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(emEquipmentStatusService.deleteEmEquipmentStatusByIds(ids));
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/equipmentStatus/domain/EmEquipmentStatus.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,162 @@
package com.jcdm.main.em.equipmentStatus.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_status
 *
 * @author ruimin
 * @date 2023-12-27
 */
public class EmEquipmentStatus extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** ID */
    private Long id;
    /** è®¾å¤‡ç¼–号 */
    @Excel(name = "设备编号")
    private String equipmentNo;
    /** è®¾å¤‡åç§° */
    @Excel(name = "设备名称")
    private String equipmentName;
    /** è½¦é—´ç¼–号 */
    @Excel(name = "车间编号")
    private String workshopCode;
    /** äº§çº¿ç¼–号 */
    @Excel(name = "产线编号")
    private String productionLineCode;
    /** å·¥åºç¼–号 */
    @Excel(name = "工序编号")
    private String processesCode;
    /** è®¾å¤‡çŠ¶æ€(1运转2待机3故障) */
    @Excel(name = "设备状态(1运转2待机3故障)")
    private String eqStatus;
    /** é¢„留字段1 */
    private String spareField1;
    /** é¢„留字段2 */
    private String spareField2;
    /** å¤‡æ³¨ */
    @Excel(name = "备注")
    private String remarks;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setEquipmentNo(String equipmentNo)
    {
        this.equipmentNo = equipmentNo;
    }
    public String getEquipmentNo()
    {
        return equipmentNo;
    }
    public void setEquipmentName(String equipmentName)
    {
        this.equipmentName = equipmentName;
    }
    public String getEquipmentName()
    {
        return equipmentName;
    }
    public void setWorkshopCode(String workshopCode)
    {
        this.workshopCode = workshopCode;
    }
    public String getWorkshopCode()
    {
        return workshopCode;
    }
    public void setProductionLineCode(String productionLineCode)
    {
        this.productionLineCode = productionLineCode;
    }
    public String getProductionLineCode()
    {
        return productionLineCode;
    }
    public void setProcessesCode(String processesCode)
    {
        this.processesCode = processesCode;
    }
    public String getProcessesCode()
    {
        return processesCode;
    }
    public void setEqStatus(String eqStatus)
    {
        this.eqStatus = eqStatus;
    }
    public String getEqStatus()
    {
        return eqStatus;
    }
    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 setRemarks(String remarks)
    {
        this.remarks = remarks;
    }
    public String getRemarks()
    {
        return remarks;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("equipmentNo", getEquipmentNo())
            .append("equipmentName", getEquipmentName())
            .append("workshopCode", getWorkshopCode())
            .append("productionLineCode", getProductionLineCode())
            .append("processesCode", getProcessesCode())
            .append("eqStatus", getEqStatus())
            .append("spareField1", getSpareField1())
            .append("spareField2", getSpareField2())
            .append("remarks", getRemarks())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/equipmentStatus/mapper/EmEquipmentStatusMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.equipmentStatus.mapper;
import java.util.List;
import com.jcdm.main.em.equipmentStatus.domain.EmEquipmentStatus;
/**
 * è®¾å¤‡çŠ¶æ€Mapper接口
 *
 * @author ruimin
 * @date 2023-12-27
 */
public interface EmEquipmentStatusMapper
{
    /**
     * æŸ¥è¯¢è®¾å¤‡çŠ¶æ€
     *
     * @param id è®¾å¤‡çŠ¶æ€ä¸»é”®
     * @return è®¾å¤‡çŠ¶æ€
     */
    public EmEquipmentStatus selectEmEquipmentStatusById(Long id);
    /**
     * æŸ¥è¯¢è®¾å¤‡çŠ¶æ€åˆ—表
     *
     * @param emEquipmentStatus è®¾å¤‡çŠ¶æ€
     * @return è®¾å¤‡çŠ¶æ€é›†åˆ
     */
    public List<EmEquipmentStatus> selectEmEquipmentStatusList(EmEquipmentStatus emEquipmentStatus);
    /**
     * æ–°å¢žè®¾å¤‡çŠ¶æ€
     *
     * @param emEquipmentStatus è®¾å¤‡çŠ¶æ€
     * @return ç»“æžœ
     */
    public int insertEmEquipmentStatus(EmEquipmentStatus emEquipmentStatus);
    /**
     * ä¿®æ”¹è®¾å¤‡çŠ¶æ€
     *
     * @param emEquipmentStatus è®¾å¤‡çŠ¶æ€
     * @return ç»“æžœ
     */
    public int updateEmEquipmentStatus(EmEquipmentStatus emEquipmentStatus);
    /**
     * åˆ é™¤è®¾å¤‡çŠ¶æ€
     *
     * @param id è®¾å¤‡çŠ¶æ€ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteEmEquipmentStatusById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤è®¾å¤‡çŠ¶æ€
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteEmEquipmentStatusByIds(Long[] ids);
}
jcdm-main/src/main/java/com/jcdm/main/em/equipmentStatus/service/IEmEquipmentStatusService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.equipmentStatus.service;
import java.util.List;
import com.jcdm.main.em.equipmentStatus.domain.EmEquipmentStatus;
/**
 * è®¾å¤‡çŠ¶æ€Service接口
 *
 * @author ruimin
 * @date 2023-12-27
 */
public interface IEmEquipmentStatusService
{
    /**
     * æŸ¥è¯¢è®¾å¤‡çŠ¶æ€
     *
     * @param id è®¾å¤‡çŠ¶æ€ä¸»é”®
     * @return è®¾å¤‡çŠ¶æ€
     */
    public EmEquipmentStatus selectEmEquipmentStatusById(Long id);
    /**
     * æŸ¥è¯¢è®¾å¤‡çŠ¶æ€åˆ—表
     *
     * @param emEquipmentStatus è®¾å¤‡çŠ¶æ€
     * @return è®¾å¤‡çŠ¶æ€é›†åˆ
     */
    public List<EmEquipmentStatus> selectEmEquipmentStatusList(EmEquipmentStatus emEquipmentStatus);
    /**
     * æ–°å¢žè®¾å¤‡çŠ¶æ€
     *
     * @param emEquipmentStatus è®¾å¤‡çŠ¶æ€
     * @return ç»“æžœ
     */
    public int insertEmEquipmentStatus(EmEquipmentStatus emEquipmentStatus);
    /**
     * ä¿®æ”¹è®¾å¤‡çŠ¶æ€
     *
     * @param emEquipmentStatus è®¾å¤‡çŠ¶æ€
     * @return ç»“æžœ
     */
    public int updateEmEquipmentStatus(EmEquipmentStatus emEquipmentStatus);
    /**
     * æ‰¹é‡åˆ é™¤è®¾å¤‡çŠ¶æ€
     *
     * @param ids éœ€è¦åˆ é™¤çš„设备状态主键集合
     * @return ç»“æžœ
     */
    public int deleteEmEquipmentStatusByIds(Long[] ids);
    /**
     * åˆ é™¤è®¾å¤‡çŠ¶æ€ä¿¡æ¯
     *
     * @param id è®¾å¤‡çŠ¶æ€ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteEmEquipmentStatusById(Long id);
}
jcdm-main/src/main/java/com/jcdm/main/em/equipmentStatus/service/impl/EmEquipmentStatusServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,95 @@
package com.jcdm.main.em.equipmentStatus.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.equipmentStatus.mapper.EmEquipmentStatusMapper;
import com.jcdm.main.em.equipmentStatus.domain.EmEquipmentStatus;
import com.jcdm.main.em.equipmentStatus.service.IEmEquipmentStatusService;
/**
 * è®¾å¤‡çŠ¶æ€Service业务层处理
 *
 * @author ruimin
 * @date 2023-12-27
 */
@Service
public class EmEquipmentStatusServiceImpl implements IEmEquipmentStatusService
{
    @Autowired
    private EmEquipmentStatusMapper emEquipmentStatusMapper;
    /**
     * æŸ¥è¯¢è®¾å¤‡çŠ¶æ€
     *
     * @param id è®¾å¤‡çŠ¶æ€ä¸»é”®
     * @return è®¾å¤‡çŠ¶æ€
     */
    @Override
    public EmEquipmentStatus selectEmEquipmentStatusById(Long id)
    {
        return emEquipmentStatusMapper.selectEmEquipmentStatusById(id);
    }
    /**
     * æŸ¥è¯¢è®¾å¤‡çŠ¶æ€åˆ—表
     *
     * @param emEquipmentStatus è®¾å¤‡çŠ¶æ€
     * @return è®¾å¤‡çŠ¶æ€
     */
    @Override
    public List<EmEquipmentStatus> selectEmEquipmentStatusList(EmEquipmentStatus emEquipmentStatus)
    {
        return emEquipmentStatusMapper.selectEmEquipmentStatusList(emEquipmentStatus);
    }
    /**
     * æ–°å¢žè®¾å¤‡çŠ¶æ€
     *
     * @param emEquipmentStatus è®¾å¤‡çŠ¶æ€
     * @return ç»“æžœ
     */
    @Override
    public int insertEmEquipmentStatus(EmEquipmentStatus emEquipmentStatus)
    {
        return emEquipmentStatusMapper.insertEmEquipmentStatus(emEquipmentStatus);
    }
    /**
     * ä¿®æ”¹è®¾å¤‡çŠ¶æ€
     *
     * @param emEquipmentStatus è®¾å¤‡çŠ¶æ€
     * @return ç»“æžœ
     */
    @Override
    public int updateEmEquipmentStatus(EmEquipmentStatus emEquipmentStatus)
    {
        emEquipmentStatus.setUpdateTime(DateUtils.getNowDate());
        return emEquipmentStatusMapper.updateEmEquipmentStatus(emEquipmentStatus);
    }
    /**
     * æ‰¹é‡åˆ é™¤è®¾å¤‡çŠ¶æ€
     *
     * @param ids éœ€è¦åˆ é™¤çš„设备状态主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmEquipmentStatusByIds(Long[] ids)
    {
        return emEquipmentStatusMapper.deleteEmEquipmentStatusByIds(ids);
    }
    /**
     * åˆ é™¤è®¾å¤‡çŠ¶æ€ä¿¡æ¯
     *
     * @param id è®¾å¤‡çŠ¶æ€ä¸»é”®
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmEquipmentStatusById(Long id)
    {
        return emEquipmentStatusMapper.deleteEmEquipmentStatusById(id);
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/equipmentType/controller/EmEquipmentTypeController.java
ÎļþÒÑɾ³ý
jcdm-main/src/main/java/com/jcdm/main/em/equipmentType/domain/EmEquipmentType.java
ÎļþÒÑɾ³ý
jcdm-main/src/main/java/com/jcdm/main/em/equipmentType/mapper/EmEquipmentTypeMapper.java
ÎļþÒÑɾ³ý
jcdm-main/src/main/java/com/jcdm/main/em/equipmentType/service/IEmEquipmentTypeService.java
ÎļþÒÑɾ³ý
jcdm-main/src/main/java/com/jcdm/main/em/equipmentType/service/impl/EmEquipmentTypeServiceImpl.java
ÎļþÒÑɾ³ý
jcdm-main/src/main/resources/mapper/em/equipmentStatus/EmEquipmentStatusMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,99 @@
<?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.equipmentStatus.mapper.EmEquipmentStatusMapper">
    <resultMap type="EmEquipmentStatus" id="EmEquipmentStatusResult">
        <result property="id"    column="id"    />
        <result property="equipmentNo"    column="equipment_no"    />
        <result property="equipmentName"    column="equipment_name"    />
        <result property="workshopCode"    column="workshop_code"    />
        <result property="productionLineCode"    column="production_line_code"    />
        <result property="processesCode"    column="processes_code"    />
        <result property="eqStatus"    column="eq_status"    />
        <result property="spareField1"    column="spare_field_1"    />
        <result property="spareField2"    column="spare_field_2"    />
        <result property="remarks"    column="remarks"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>
    <sql id="selectEmEquipmentStatusVo">
        select id, equipment_no, equipment_name, workshop_code, production_line_code, processes_code, eq_status, spare_field_1, spare_field_2, remarks, update_time from em_equipment_status
    </sql>
    <select id="selectEmEquipmentStatusList" parameterType="EmEquipmentStatus" resultMap="EmEquipmentStatusResult">
        <include refid="selectEmEquipmentStatusVo"/>
        <where>
            <if test="equipmentNo != null  and equipmentNo != ''"> and equipment_no like concat('%', #{equipmentNo}, '%')</if>
            <if test="equipmentName != null  and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
            <if test="workshopCode != null  and workshopCode != ''"> and workshop_code like concat('%', #{workshopCode}, '%')</if>
            <if test="productionLineCode != null  and productionLineCode != ''"> and production_line_code like concat('%', #{productionLineCode}, '%')</if>
            <if test="processesCode != null  and processesCode != ''"> and processes_code like concat('%', #{processesCode}, '%')</if>
            <if test="eqStatus != null  and eqStatus != ''"> and eq_status like concat('%', #{eqStatus}, '%')</if>
        </where>
    </select>
    <select id="selectEmEquipmentStatusById" parameterType="Long" resultMap="EmEquipmentStatusResult">
        <include refid="selectEmEquipmentStatusVo"/>
        where id = #{id}
    </select>
    <insert id="insertEmEquipmentStatus" parameterType="EmEquipmentStatus">
        insert into em_equipment_status
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="equipmentNo != null">equipment_no,</if>
            <if test="equipmentName != null">equipment_name,</if>
            <if test="workshopCode != null">workshop_code,</if>
            <if test="productionLineCode != null">production_line_code,</if>
            <if test="processesCode != null">processes_code,</if>
            <if test="eqStatus != null">eq_status,</if>
            <if test="spareField1 != null">spare_field_1,</if>
            <if test="spareField2 != null">spare_field_2,</if>
            <if test="remarks != null">remarks,</if>
            <if test="updateTime != null">update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="equipmentNo != null">#{equipmentNo},</if>
            <if test="equipmentName != null">#{equipmentName},</if>
            <if test="workshopCode != null">#{workshopCode},</if>
            <if test="productionLineCode != null">#{productionLineCode},</if>
            <if test="processesCode != null">#{processesCode},</if>
            <if test="eqStatus != null">#{eqStatus},</if>
            <if test="spareField1 != null">#{spareField1},</if>
            <if test="spareField2 != null">#{spareField2},</if>
            <if test="remarks != null">#{remarks},</if>
            <if test="updateTime != null">#{updateTime},</if>
         </trim>
    </insert>
    <update id="updateEmEquipmentStatus" parameterType="EmEquipmentStatus">
        update em_equipment_status
        <trim prefix="SET" suffixOverrides=",">
            <if test="equipmentNo != null">equipment_no = #{equipmentNo},</if>
            <if test="equipmentName != null">equipment_name = #{equipmentName},</if>
            <if test="workshopCode != null">workshop_code = #{workshopCode},</if>
            <if test="productionLineCode != null">production_line_code = #{productionLineCode},</if>
            <if test="processesCode != null">processes_code = #{processesCode},</if>
            <if test="eqStatus != null">eq_status = #{eqStatus},</if>
            <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteEmEquipmentStatusById" parameterType="Long">
        delete from em_equipment_status where id = #{id}
    </delete>
    <delete id="deleteEmEquipmentStatusByIds" parameterType="String">
        delete from em_equipment_status where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
jcdm-main/src/main/resources/mapper/em/equipmentType/EmEquipmentTypeMapper.xml
ÎļþÒÑɾ³ý
jcdm-ui/src/api/main/em/equipmentStatus/equipmentStatus.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// æŸ¥è¯¢è®¾å¤‡çŠ¶æ€åˆ—表
export function listEquipmentStatus(query) {
  return request({
    url: '/em/equipmentStatus/list',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢è®¾å¤‡çŠ¶æ€è¯¦ç»†
export function getEquipmentStatus(id) {
  return request({
    url: '/em/equipmentStatus/' + id,
    method: 'get'
  })
}
// æ–°å¢žè®¾å¤‡çŠ¶æ€
export function addEquipmentStatus(data) {
  return request({
    url: '/em/equipmentStatus',
    method: 'post',
    data: data
  })
}
// ä¿®æ”¹è®¾å¤‡çŠ¶æ€
export function updateEquipmentStatus(data) {
  return request({
    url: '/em/equipmentStatus',
    method: 'put',
    data: data
  })
}
// åˆ é™¤è®¾å¤‡çŠ¶æ€
export function delEquipmentStatus(id) {
  return request({
    url: '/em/equipmentStatus/' + id,
    method: 'delete'
  })
}
jcdm-ui/src/api/main/em/equipmentType/equipmentType.js
ÎļþÒÑɾ³ý
jcdm-ui/src/views/main/em/equipmentStatus/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,356 @@
<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="equipmentNo">
            <el-input
              v-model="queryParams.equipmentNo"
              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 label="车间编号" prop="workshopCode">-->
<!--            <el-input-->
<!--              v-model="queryParams.workshopCode"-->
<!--              placeholder="请输入车间编号"-->
<!--              clearable-->
<!--              @keyup.enter.native="handleQuery"-->
<!--            />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="产线编号" prop="productionLineCode">-->
<!--            <el-input-->
<!--              v-model="queryParams.productionLineCode"-->
<!--              placeholder="请输入产线编号"-->
<!--              clearable-->
<!--              @keyup.enter.native="handleQuery"-->
<!--            />-->
<!--          </el-form-item>-->
          <el-form-item label="工序编号" prop="processesCode">
            <el-input
              v-model="queryParams.processesCode"
              placeholder="请输入工序编号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
<!--          <el-form-item label="设备状态(1运转2待机3故障)" prop="eqStatus">-->
<!--            <el-select v-model="queryParams.eqStatus" placeholder="请选择设备状态(1运转2待机3故障)" clearable>-->
<!--              <el-option-->
<!--                v-for="dict in dict.type.${dictType}"-->
<!--                :key="dict.value"-->
<!--                :label="dict.label"-->
<!--                :value="dict.value"-->
<!--              />-->
<!--            </el-select>-->
<!--          </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:equipmentStatus: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:equipmentStatus: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:equipmentStatus: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:equipmentStatus:export']"
            >导出</el-button>
          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
        <el-table border v-loading="loading" :data="equipmentStatusList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="ID" align="center" prop="id" />
          <el-table-column label="设备编号" align="center" prop="equipmentNo">
          </el-table-column>
          <el-table-column label="设备名称" align="center" prop="equipmentName">
          </el-table-column>
          <el-table-column label="车间编号" align="center" prop="workshopCode">
          </el-table-column>
          <el-table-column label="产线编号" align="center" prop="productionLineCode">
          </el-table-column>
          <el-table-column label="工序编号" align="center" prop="processesCode">
          </el-table-column>
          <el-table-column label="设备状态(1运转2待机3故障)" align="center" prop="eqStatus">
          </el-table-column>
          <el-table-column label="备注" align="center" prop="remarks">
          </el-table-column>
          <el-table-column label="更新时间" align="center" prop="updateTime">
          </el-table-column>
          <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:equipmentStatus:edit']"
              >修改</el-button>
              <el-button
                size="mini"
                type="danger"
                plain
                style="width: 72px"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['em:equipmentStatus: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="equipmentNo">
          <el-input v-model="form.equipmentNo" 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="workshopCode">
          <el-input v-model="form.workshopCode" placeholder="请输入车间编号" />
        </el-form-item>
        <el-form-item label="产线编号" prop="productionLineCode">
          <el-input v-model="form.productionLineCode" placeholder="请输入产线编号" />
        </el-form-item>
        <el-form-item label="工序编号" prop="processesCode">
          <el-input v-model="form.processesCode" placeholder="请输入工序编号" />
        </el-form-item>
<!--        <el-form-item label="设备状态(1运转2待机3故障)" prop="eqStatus">-->
<!--          <el-radio-group v-model="form.eqStatus">-->
<!--            <el-radio-->
<!--              v-for="dict in dict.type.${dictType}"-->
<!--              :key="dict.value"-->
<!--              :label="dict.value"-->
<!--            >{{dict.label}}</el-radio>-->
<!--          </el-radio-group>-->
<!--        </el-form-item>-->
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" placeholder="请输入备注" />
        </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 { listEquipmentStatus, getEquipmentStatus, delEquipmentStatus, addEquipmentStatus, updateEquipmentStatus } from "@/api/main/em/equipmentStatus/equipmentStatus";
export default {
  name: "EquipmentStatus",
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      titleName: "",
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // è®¾å¤‡çŠ¶æ€è¡¨æ ¼æ•°æ®
      equipmentStatusList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        equipmentNo: null,
        equipmentName: null,
        workshopCode: null,
        productionLineCode: null,
        processesCode: null,
        eqStatus: null,
      },
      // è¡¨å•å‚æ•°
      form: {},
      // è¡¨å•æ ¡éªŒ
      rules: {
        id: [
          { required: true, message: "ID不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢è®¾å¤‡çŠ¶æ€åˆ—表 */
    getList() {
      this.loading = true;
      listEquipmentStatus(this.queryParams).then(response => {
        this.equipmentStatusList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // å–消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // è¡¨å•é‡ç½®
    reset() {
      this.form = {
        id: null,
        equipmentNo: null,
        equipmentName: null,
        workshopCode: null,
        productionLineCode: null,
        processesCode: null,
        eqStatus: null,
        spareField1: null,
        spareField2: null,
        remarks: null,
        updateTime: 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
      getEquipmentStatus(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) {
            updateEquipmentStatus(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addEquipmentStatus(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 delEquipmentStatus(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      this.download('em/equipmentStatus/export', {
        ...this.queryParams
      }, `equipmentStatus_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
jcdm-ui/src/views/main/em/equipmentType/index.vue
ÎļþÒÑɾ³ý