懒羊羊
2024-03-09 38b15031cc02a746bef74993da828ec441b040d5
设备点检保养
已添加16个文件
2178 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/em/inspectionItems/controller/EmInspectionItemsController.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionItems/domain/EmInspectionItems.java 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionItems/mapper/EmInspectionItemsMapper.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionItems/service/IEmInspectionItemsService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionItems/service/impl/EmInspectionItemsServiceImpl.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlan/controller/EmInspectionPlanController.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlan/domain/EmInspectionPlan.java 285 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlan/mapper/EmInspectionPlanMapper.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlan/service/IEmInspectionPlanService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlan/service/impl/EmInspectionPlanServiceImpl.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/em/inspectionItems/EmInspectionItemsMapper.xml 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/em/inspectionPlan/EmInspectionPlanMapper.xml 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/em/inspectionItems/inspectionItems.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/em/inspectionPlan/inspectionPlan.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/em/inspectionItems/index.vue 356 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/em/inspectionPlan/index.vue 381 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionItems/controller/EmInspectionItemsController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,104 @@
package com.jcdm.main.em.inspectionItems.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.inspectionItems.domain.EmInspectionItems;
import com.jcdm.main.em.inspectionItems.service.IEmInspectionItemsService;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
/**
 * ç‚¹æ£€ä¿å…»é¡¹ç›®Controller
 *
 * @author Yi
 * @date 2024-03-08
 */
@RestController
@RequestMapping("/em/inspectionItems")
public class EmInspectionItemsController extends BaseController
{
    @Autowired
    private IEmInspectionItemsService emInspectionItemsService;
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»é¡¹ç›®åˆ—表
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionItems:list')")
    @GetMapping("/list")
    public TableDataInfo list(EmInspectionItems emInspectionItems)
    {
        startPage();
        List<EmInspectionItems> list = emInspectionItemsService.selectEmInspectionItemsList(emInspectionItems);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºç‚¹æ£€ä¿å…»é¡¹ç›®åˆ—表
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionItems:export')")
    @Log(title = "点检保养项目", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, EmInspectionItems emInspectionItems)
    {
        List<EmInspectionItems> list = emInspectionItemsService.selectEmInspectionItemsList(emInspectionItems);
        ExcelUtil<EmInspectionItems> util = new ExcelUtil<EmInspectionItems>(EmInspectionItems.class);
        util.exportExcel(response, list, "点检保养项目数据");
    }
    /**
     * èŽ·å–点检保养项目详细信息
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionItems:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(emInspectionItemsService.selectEmInspectionItemsById(id));
    }
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»é¡¹ç›®
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionItems:add')")
    @Log(title = "点检保养项目", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody EmInspectionItems emInspectionItems)
    {
        return toAjax(emInspectionItemsService.insertEmInspectionItems(emInspectionItems));
    }
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»é¡¹ç›®
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionItems:edit')")
    @Log(title = "点检保养项目", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody EmInspectionItems emInspectionItems)
    {
        return toAjax(emInspectionItemsService.updateEmInspectionItems(emInspectionItems));
    }
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»é¡¹ç›®
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionItems:remove')")
    @Log(title = "点检保养项目", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(emInspectionItemsService.deleteEmInspectionItemsByIds(ids));
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionItems/domain/EmInspectionItems.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,178 @@
package com.jcdm.main.em.inspectionItems.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_inspection_items
 *
 * @author Yi
 * @date 2024-03-08
 */
public class EmInspectionItems extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** ID */
    private Long id;
    /** é¡¹ç›®ç¼–号 */
    @Excel(name = "项目编号")
    private String itemsCode;
    /** é¡¹ç›®åç§° */
    @Excel(name = "项目名称")
    private String itemsName;
    /** é¡¹ç›®ç±»åž‹ */
    @Excel(name = "项目类型")
    private String itemsType;
    /** æ˜¯å¦å¯ç”¨ */
    @Excel(name = "是否启用")
    private String status;
    /** æ ‡å‡† */
    @Excel(name = "标准")
    private String standard;
    /** é¡¹ç›®å†…容 */
    @Excel(name = "项目内容")
    private String itemsContent;
    /** åˆ›å»ºäºº */
    @Excel(name = "创建人")
    private String createUser;
    /** æ›´æ–°äºº */
    @Excel(name = "更新人")
    private String updateUser;
    /** é¢„留字段1 */
    private String spareField1;
    /** é¢„留字段2 */
    private String spareField2;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setItemsCode(String itemsCode)
    {
        this.itemsCode = itemsCode;
    }
    public String getItemsCode()
    {
        return itemsCode;
    }
    public void setItemsName(String itemsName)
    {
        this.itemsName = itemsName;
    }
    public String getItemsName()
    {
        return itemsName;
    }
    public void setItemsType(String itemsType)
    {
        this.itemsType = itemsType;
    }
    public String getItemsType()
    {
        return itemsType;
    }
    public void setStatus(String status)
    {
        this.status = status;
    }
    public String getStatus()
    {
        return status;
    }
    public void setStandard(String standard)
    {
        this.standard = standard;
    }
    public String getStandard()
    {
        return standard;
    }
    public void setItemsContent(String itemsContent)
    {
        this.itemsContent = itemsContent;
    }
    public String getItemsContent()
    {
        return itemsContent;
    }
    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;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("itemsCode", getItemsCode())
            .append("itemsName", getItemsName())
            .append("itemsType", getItemsType())
            .append("status", getStatus())
            .append("standard", getStandard())
            .append("itemsContent", getItemsContent())
            .append("remark", getRemark())
            .append("createUser", getCreateUser())
            .append("createTime", getCreateTime())
            .append("updateUser", getUpdateUser())
            .append("updateTime", getUpdateTime())
            .append("spareField1", getSpareField1())
            .append("spareField2", getSpareField2())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionItems/mapper/EmInspectionItemsMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.inspectionItems.mapper;
import java.util.List;
import com.jcdm.main.em.inspectionItems.domain.EmInspectionItems;
/**
 * ç‚¹æ£€ä¿å…»é¡¹ç›®Mapper接口
 *
 * @author Yi
 * @date 2024-03-08
 */
public interface EmInspectionItemsMapper
{
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param id ç‚¹æ£€ä¿å…»é¡¹ç›®ä¸»é”®
     * @return ç‚¹æ£€ä¿å…»é¡¹ç›®
     */
    public EmInspectionItems selectEmInspectionItemsById(Long id);
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»é¡¹ç›®åˆ—表
     *
     * @param emInspectionItems ç‚¹æ£€ä¿å…»é¡¹ç›®
     * @return ç‚¹æ£€ä¿å…»é¡¹ç›®é›†åˆ
     */
    public List<EmInspectionItems> selectEmInspectionItemsList(EmInspectionItems emInspectionItems);
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param emInspectionItems ç‚¹æ£€ä¿å…»é¡¹ç›®
     * @return ç»“æžœ
     */
    public int insertEmInspectionItems(EmInspectionItems emInspectionItems);
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param emInspectionItems ç‚¹æ£€ä¿å…»é¡¹ç›®
     * @return ç»“æžœ
     */
    public int updateEmInspectionItems(EmInspectionItems emInspectionItems);
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param id ç‚¹æ£€ä¿å…»é¡¹ç›®ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteEmInspectionItemsById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤ç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteEmInspectionItemsByIds(Long[] ids);
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionItems/service/IEmInspectionItemsService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.inspectionItems.service;
import java.util.List;
import com.jcdm.main.em.inspectionItems.domain.EmInspectionItems;
/**
 * ç‚¹æ£€ä¿å…»é¡¹ç›®Service接口
 *
 * @author Yi
 * @date 2024-03-08
 */
public interface IEmInspectionItemsService
{
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param id ç‚¹æ£€ä¿å…»é¡¹ç›®ä¸»é”®
     * @return ç‚¹æ£€ä¿å…»é¡¹ç›®
     */
    public EmInspectionItems selectEmInspectionItemsById(Long id);
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»é¡¹ç›®åˆ—表
     *
     * @param emInspectionItems ç‚¹æ£€ä¿å…»é¡¹ç›®
     * @return ç‚¹æ£€ä¿å…»é¡¹ç›®é›†åˆ
     */
    public List<EmInspectionItems> selectEmInspectionItemsList(EmInspectionItems emInspectionItems);
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param emInspectionItems ç‚¹æ£€ä¿å…»é¡¹ç›®
     * @return ç»“æžœ
     */
    public int insertEmInspectionItems(EmInspectionItems emInspectionItems);
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param emInspectionItems ç‚¹æ£€ä¿å…»é¡¹ç›®
     * @return ç»“æžœ
     */
    public int updateEmInspectionItems(EmInspectionItems emInspectionItems);
    /**
     * æ‰¹é‡åˆ é™¤ç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param ids éœ€è¦åˆ é™¤çš„点检保养项目主键集合
     * @return ç»“æžœ
     */
    public int deleteEmInspectionItemsByIds(Long[] ids);
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»é¡¹ç›®ä¿¡æ¯
     *
     * @param id ç‚¹æ£€ä¿å…»é¡¹ç›®ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteEmInspectionItemsById(Long id);
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionItems/service/impl/EmInspectionItemsServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
package com.jcdm.main.em.inspectionItems.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.inspectionItems.mapper.EmInspectionItemsMapper;
import com.jcdm.main.em.inspectionItems.domain.EmInspectionItems;
import com.jcdm.main.em.inspectionItems.service.IEmInspectionItemsService;
/**
 * ç‚¹æ£€ä¿å…»é¡¹ç›®Service业务层处理
 *
 * @author Yi
 * @date 2024-03-08
 */
@Service
public class EmInspectionItemsServiceImpl implements IEmInspectionItemsService
{
    @Autowired
    private EmInspectionItemsMapper emInspectionItemsMapper;
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param id ç‚¹æ£€ä¿å…»é¡¹ç›®ä¸»é”®
     * @return ç‚¹æ£€ä¿å…»é¡¹ç›®
     */
    @Override
    public EmInspectionItems selectEmInspectionItemsById(Long id)
    {
        return emInspectionItemsMapper.selectEmInspectionItemsById(id);
    }
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»é¡¹ç›®åˆ—表
     *
     * @param emInspectionItems ç‚¹æ£€ä¿å…»é¡¹ç›®
     * @return ç‚¹æ£€ä¿å…»é¡¹ç›®
     */
    @Override
    public List<EmInspectionItems> selectEmInspectionItemsList(EmInspectionItems emInspectionItems)
    {
        return emInspectionItemsMapper.selectEmInspectionItemsList(emInspectionItems);
    }
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param emInspectionItems ç‚¹æ£€ä¿å…»é¡¹ç›®
     * @return ç»“æžœ
     */
    @Override
    public int insertEmInspectionItems(EmInspectionItems emInspectionItems)
    {
        emInspectionItems.setCreateTime(DateUtils.getNowDate());
        return emInspectionItemsMapper.insertEmInspectionItems(emInspectionItems);
    }
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param emInspectionItems ç‚¹æ£€ä¿å…»é¡¹ç›®
     * @return ç»“æžœ
     */
    @Override
    public int updateEmInspectionItems(EmInspectionItems emInspectionItems)
    {
        emInspectionItems.setUpdateTime(DateUtils.getNowDate());
        return emInspectionItemsMapper.updateEmInspectionItems(emInspectionItems);
    }
    /**
     * æ‰¹é‡åˆ é™¤ç‚¹æ£€ä¿å…»é¡¹ç›®
     *
     * @param ids éœ€è¦åˆ é™¤çš„点检保养项目主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmInspectionItemsByIds(Long[] ids)
    {
        return emInspectionItemsMapper.deleteEmInspectionItemsByIds(ids);
    }
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»é¡¹ç›®ä¿¡æ¯
     *
     * @param id ç‚¹æ£€ä¿å…»é¡¹ç›®ä¸»é”®
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmInspectionItemsById(Long id)
    {
        return emInspectionItemsMapper.deleteEmInspectionItemsById(id);
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlan/controller/EmInspectionPlanController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,104 @@
package com.jcdm.main.em.inspectionPlan.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.inspectionPlan.domain.EmInspectionPlan;
import com.jcdm.main.em.inspectionPlan.service.IEmInspectionPlanService;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’Controller
 *
 * @author Yi
 * @date 2024-03-08
 */
@RestController
@RequestMapping("/em/inspectionPlan")
public class EmInspectionPlanController extends BaseController
{
    @Autowired
    private IEmInspectionPlanService emInspectionPlanService;
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’列表
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlan:list')")
    @GetMapping("/list")
    public TableDataInfo list(EmInspectionPlan emInspectionPlan)
    {
        startPage();
        List<EmInspectionPlan> list = emInspectionPlanService.selectEmInspectionPlanList(emInspectionPlan);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºç‚¹æ£€ä¿å…»è®¡åˆ’列表
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlan:export')")
    @Log(title = "点检保养计划", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, EmInspectionPlan emInspectionPlan)
    {
        List<EmInspectionPlan> list = emInspectionPlanService.selectEmInspectionPlanList(emInspectionPlan);
        ExcelUtil<EmInspectionPlan> util = new ExcelUtil<EmInspectionPlan>(EmInspectionPlan.class);
        util.exportExcel(response, list, "点检保养计划数据");
    }
    /**
     * èŽ·å–点检保养计划详细信息
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlan:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(emInspectionPlanService.selectEmInspectionPlanById(id));
    }
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlan:add')")
    @Log(title = "点检保养计划", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody EmInspectionPlan emInspectionPlan)
    {
        return toAjax(emInspectionPlanService.insertEmInspectionPlan(emInspectionPlan));
    }
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlan:edit')")
    @Log(title = "点检保养计划", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody EmInspectionPlan emInspectionPlan)
    {
        return toAjax(emInspectionPlanService.updateEmInspectionPlan(emInspectionPlan));
    }
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlan:remove')")
    @Log(title = "点检保养计划", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(emInspectionPlanService.deleteEmInspectionPlanByIds(ids));
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlan/domain/EmInspectionPlan.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,285 @@
package com.jcdm.main.em.inspectionPlan.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_inspection_plan
 *
 * @author Yi
 * @date 2024-03-08
 */
public class EmInspectionPlan extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** ID */
    private Long id;
    /** è®¡åˆ’编号 */
    @Excel(name = "计划编号")
    private String planCode;
    /** è®¡åˆ’名称 */
    @Excel(name = "计划名称")
    private String planName;
    /** è®¡åˆ’类型 */
    @Excel(name = "计划类型")
    private String planType;
    /** çŠ¶æ€ */
    @Excel(name = "状态")
    private String state;
    /** é¢‘率 */
    @Excel(name = "频率")
    private String frequency;
    /** ç»´åº¦ */
    @Excel(name = "维度")
    private String dimension;
    /** ä¸Šæ¬¡ç”Ÿæˆæ—¶é—´ */
    @Excel(name = "上次生成时间")
    private String lastGenerationTime;
    /** å¼€å§‹æ—¶é—´ */
    @Excel(name = "开始时间")
    private String startTime;
    /** ç»“束时间 */
    @Excel(name = "结束时间")
    private String endTime;
    /** è®¾å¤‡æ¸…单 */
    private String devices;
    /** ç‚¹æ£€é¡¹ç›® */
    private String inspectionItems;
    /** å¤‡æ³¨ */
    @Excel(name = "备注")
    private String remarks;
    /** åˆ›å»ºäºº */
    @Excel(name = "创建人")
    private String createUser;
    /** ä¿®æ”¹äºº */
    @Excel(name = "修改人")
    private String updateUser;
    /** é¢„留字段1 */
    private String spareField1;
    /** é¢„留字段2 */
    private String spareField2;
    /** é¢„留字段3 */
    private String spareField3;
    /** é¢„留字段4 */
    private String spareField4;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setPlanCode(String planCode)
    {
        this.planCode = planCode;
    }
    public String getPlanCode()
    {
        return planCode;
    }
    public void setPlanName(String planName)
    {
        this.planName = planName;
    }
    public String getPlanName()
    {
        return planName;
    }
    public void setPlanType(String planType)
    {
        this.planType = planType;
    }
    public String getPlanType()
    {
        return planType;
    }
    public void setState(String state)
    {
        this.state = state;
    }
    public String getState()
    {
        return state;
    }
    public void setFrequency(String frequency)
    {
        this.frequency = frequency;
    }
    public String getFrequency()
    {
        return frequency;
    }
    public void setDimension(String dimension)
    {
        this.dimension = dimension;
    }
    public String getDimension()
    {
        return dimension;
    }
    public void setLastGenerationTime(String lastGenerationTime)
    {
        this.lastGenerationTime = lastGenerationTime;
    }
    public String getLastGenerationTime()
    {
        return lastGenerationTime;
    }
    public void setStartTime(String startTime)
    {
        this.startTime = startTime;
    }
    public String getStartTime()
    {
        return startTime;
    }
    public void setEndTime(String endTime)
    {
        this.endTime = endTime;
    }
    public String getEndTime()
    {
        return endTime;
    }
    public void setDevices(String devices)
    {
        this.devices = devices;
    }
    public String getDevices()
    {
        return devices;
    }
    public void setInspectionItems(String inspectionItems)
    {
        this.inspectionItems = inspectionItems;
    }
    public String getInspectionItems()
    {
        return inspectionItems;
    }
    public void setRemarks(String remarks)
    {
        this.remarks = remarks;
    }
    public String getRemarks()
    {
        return remarks;
    }
    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(String spareField3)
    {
        this.spareField3 = spareField3;
    }
    public String getSpareField3()
    {
        return spareField3;
    }
    public void setSpareField4(String spareField4)
    {
        this.spareField4 = spareField4;
    }
    public String getSpareField4()
    {
        return spareField4;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("planCode", getPlanCode())
            .append("planName", getPlanName())
            .append("planType", getPlanType())
            .append("state", getState())
            .append("frequency", getFrequency())
            .append("dimension", getDimension())
            .append("lastGenerationTime", getLastGenerationTime())
            .append("startTime", getStartTime())
            .append("endTime", getEndTime())
            .append("devices", getDevices())
            .append("inspectionItems", getInspectionItems())
            .append("remarks", getRemarks())
            .append("createTime", getCreateTime())
            .append("createUser", getCreateUser())
            .append("updateTime", getUpdateTime())
            .append("updateUser", getUpdateUser())
            .append("spareField1", getSpareField1())
            .append("spareField2", getSpareField2())
            .append("spareField3", getSpareField3())
            .append("spareField4", getSpareField4())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlan/mapper/EmInspectionPlanMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.inspectionPlan.mapper;
import java.util.List;
import com.jcdm.main.em.inspectionPlan.domain.EmInspectionPlan;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’Mapper接口
 *
 * @author Yi
 * @date 2024-03-08
 */
public interface EmInspectionPlanMapper
{
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’主键
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    public EmInspectionPlan selectEmInspectionPlanById(Long id);
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’列表
     *
     * @param emInspectionPlan ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’集合
     */
    public List<EmInspectionPlan> selectEmInspectionPlanList(EmInspectionPlan emInspectionPlan);
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param emInspectionPlan ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç»“æžœ
     */
    public int insertEmInspectionPlan(EmInspectionPlan emInspectionPlan);
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param emInspectionPlan ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç»“æžœ
     */
    public int updateEmInspectionPlan(EmInspectionPlan emInspectionPlan);
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’主键
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanByIds(Long[] ids);
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlan/service/IEmInspectionPlanService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.inspectionPlan.service;
import java.util.List;
import com.jcdm.main.em.inspectionPlan.domain.EmInspectionPlan;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’Service接口
 *
 * @author Yi
 * @date 2024-03-08
 */
public interface IEmInspectionPlanService
{
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’主键
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    public EmInspectionPlan selectEmInspectionPlanById(Long id);
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’列表
     *
     * @param emInspectionPlan ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’集合
     */
    public List<EmInspectionPlan> selectEmInspectionPlanList(EmInspectionPlan emInspectionPlan);
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param emInspectionPlan ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç»“æžœ
     */
    public int insertEmInspectionPlan(EmInspectionPlan emInspectionPlan);
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param emInspectionPlan ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç»“æžœ
     */
    public int updateEmInspectionPlan(EmInspectionPlan emInspectionPlan);
    /**
     * æ‰¹é‡åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param ids éœ€è¦åˆ é™¤çš„点检保养计划主键集合
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanByIds(Long[] ids);
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’信息
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’主键
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanById(Long id);
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlan/service/impl/EmInspectionPlanServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
package com.jcdm.main.em.inspectionPlan.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.inspectionPlan.mapper.EmInspectionPlanMapper;
import com.jcdm.main.em.inspectionPlan.domain.EmInspectionPlan;
import com.jcdm.main.em.inspectionPlan.service.IEmInspectionPlanService;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’Service业务层处理
 *
 * @author Yi
 * @date 2024-03-08
 */
@Service
public class EmInspectionPlanServiceImpl implements IEmInspectionPlanService
{
    @Autowired
    private EmInspectionPlanMapper emInspectionPlanMapper;
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’主键
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    @Override
    public EmInspectionPlan selectEmInspectionPlanById(Long id)
    {
        return emInspectionPlanMapper.selectEmInspectionPlanById(id);
    }
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’列表
     *
     * @param emInspectionPlan ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    @Override
    public List<EmInspectionPlan> selectEmInspectionPlanList(EmInspectionPlan emInspectionPlan)
    {
        return emInspectionPlanMapper.selectEmInspectionPlanList(emInspectionPlan);
    }
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param emInspectionPlan ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç»“æžœ
     */
    @Override
    public int insertEmInspectionPlan(EmInspectionPlan emInspectionPlan)
    {
        emInspectionPlan.setCreateTime(DateUtils.getNowDate());
        return emInspectionPlanMapper.insertEmInspectionPlan(emInspectionPlan);
    }
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param emInspectionPlan ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç»“æžœ
     */
    @Override
    public int updateEmInspectionPlan(EmInspectionPlan emInspectionPlan)
    {
        emInspectionPlan.setUpdateTime(DateUtils.getNowDate());
        return emInspectionPlanMapper.updateEmInspectionPlan(emInspectionPlan);
    }
    /**
     * æ‰¹é‡åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param ids éœ€è¦åˆ é™¤çš„点检保养计划主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmInspectionPlanByIds(Long[] ids)
    {
        return emInspectionPlanMapper.deleteEmInspectionPlanByIds(ids);
    }
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’信息
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmInspectionPlanById(Long id)
    {
        return emInspectionPlanMapper.deleteEmInspectionPlanById(id);
    }
}
jcdm-main/src/main/resources/mapper/em/inspectionItems/EmInspectionItemsMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,107 @@
<?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.inspectionItems.mapper.EmInspectionItemsMapper">
    <resultMap type="EmInspectionItems" id="EmInspectionItemsResult">
        <result property="id"    column="id"    />
        <result property="itemsCode"    column="items_code"    />
        <result property="itemsName"    column="items_name"    />
        <result property="itemsType"    column="items_type"    />
        <result property="status"    column="status"    />
        <result property="standard"    column="standard"    />
        <result property="itemsContent"    column="items_content"    />
        <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"    />
    </resultMap>
    <sql id="selectEmInspectionItemsVo">
        select id, items_code, items_name, items_type, status, standard, items_content, remark, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2 from em_inspection_items
    </sql>
    <select id="selectEmInspectionItemsList" parameterType="EmInspectionItems" resultMap="EmInspectionItemsResult">
        <include refid="selectEmInspectionItemsVo"/>
        <where>
            <if test="itemsCode != null  and itemsCode != ''"> and items_code like concat('%', #{itemsCode}, '%')</if>
            <if test="itemsName != null  and itemsName != ''"> and items_name like concat('%', #{itemsName}, '%')</if>
            <if test="itemsType != null  and itemsType != ''"> and items_type = #{itemsType}</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
        </where>
    </select>
    <select id="selectEmInspectionItemsById" parameterType="Long" resultMap="EmInspectionItemsResult">
        <include refid="selectEmInspectionItemsVo"/>
        where id = #{id}
    </select>
    <insert id="insertEmInspectionItems" parameterType="EmInspectionItems" useGeneratedKeys="true" keyProperty="id">
        insert into em_inspection_items
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="itemsCode != null">items_code,</if>
            <if test="itemsName != null">items_name,</if>
            <if test="itemsType != null">items_type,</if>
            <if test="status != null">status,</if>
            <if test="standard != null">standard,</if>
            <if test="itemsContent != null">items_content,</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>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="itemsCode != null">#{itemsCode},</if>
            <if test="itemsName != null">#{itemsName},</if>
            <if test="itemsType != null">#{itemsType},</if>
            <if test="status != null">#{status},</if>
            <if test="standard != null">#{standard},</if>
            <if test="itemsContent != null">#{itemsContent},</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>
         </trim>
    </insert>
    <update id="updateEmInspectionItems" parameterType="EmInspectionItems">
        update em_inspection_items
        <trim prefix="SET" suffixOverrides=",">
            <if test="itemsCode != null">items_code = #{itemsCode},</if>
            <if test="itemsName != null">items_name = #{itemsName},</if>
            <if test="itemsType != null">items_type = #{itemsType},</if>
            <if test="status != null">status = #{status},</if>
            <if test="standard != null">standard = #{standard},</if>
            <if test="itemsContent != null">items_content = #{itemsContent},</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>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteEmInspectionItemsById" parameterType="Long">
        delete from em_inspection_items where id = #{id}
    </delete>
    <delete id="deleteEmInspectionItemsByIds" parameterType="String">
        delete from em_inspection_items where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
jcdm-main/src/main/resources/mapper/em/inspectionPlan/EmInspectionPlanMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,139 @@
<?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.inspectionPlan.mapper.EmInspectionPlanMapper">
    <resultMap type="EmInspectionPlan" id="EmInspectionPlanResult">
        <result property="id"    column="id"    />
        <result property="planCode"    column="plan_code"    />
        <result property="planName"    column="plan_name"    />
        <result property="planType"    column="plan_type"    />
        <result property="state"    column="state"    />
        <result property="frequency"    column="frequency"    />
        <result property="dimension"    column="dimension"    />
        <result property="lastGenerationTime"    column="last_generation_time"    />
        <result property="startTime"    column="start_time"    />
        <result property="endTime"    column="end_time"    />
        <result property="devices"    column="devices"    />
        <result property="inspectionItems"    column="Inspection_items"    />
        <result property="remarks"    column="remarks"    />
        <result property="createTime"    column="create_time"    />
        <result property="createUser"    column="create_user"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateUser"    column="update_user"    />
        <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="selectEmInspectionPlanVo">
        select id, plan_code, plan_name, plan_type, state, frequency, dimension, last_generation_time, start_time, end_time, devices, Inspection_items, remarks, create_time, create_user, update_time, update_user, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from em_inspection_plan
    </sql>
    <select id="selectEmInspectionPlanList" parameterType="EmInspectionPlan" resultMap="EmInspectionPlanResult">
        <include refid="selectEmInspectionPlanVo"/>
        <where>
            <if test="planCode != null  and planCode != ''"> and plan_code like concat('%', #{planCode}, '%')</if>
            <if test="planName != null  and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
            <if test="planType != null  and planType != ''"> and plan_type = #{planType}</if>
            <if test="state != null  and state != ''"> and state = #{state}</if>
            <if test="frequency != null  and frequency != ''"> and frequency = #{frequency}</if>
            <if test="dimension != null  and dimension != ''"> and dimension = #{dimension}</if>
            <if test="startTime != null  and startTime != ''"> and start_time = #{startTime}</if>
            <if test="endTime != null  and endTime != ''"> and end_time = #{endTime}</if>
        </where>
    </select>
    <select id="selectEmInspectionPlanById" parameterType="Long" resultMap="EmInspectionPlanResult">
        <include refid="selectEmInspectionPlanVo"/>
        where id = #{id}
    </select>
    <insert id="insertEmInspectionPlan" parameterType="EmInspectionPlan" useGeneratedKeys="true" keyProperty="id">
        insert into em_inspection_plan
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="planCode != null">plan_code,</if>
            <if test="planName != null">plan_name,</if>
            <if test="planType != null">plan_type,</if>
            <if test="state != null">state,</if>
            <if test="frequency != null">frequency,</if>
            <if test="dimension != null">dimension,</if>
            <if test="lastGenerationTime != null">last_generation_time,</if>
            <if test="startTime != null">start_time,</if>
            <if test="endTime != null">end_time,</if>
            <if test="devices != null">devices,</if>
            <if test="inspectionItems != null">Inspection_items,</if>
            <if test="remarks != null">remarks,</if>
            <if test="createTime != null">create_time,</if>
            <if test="createUser != null">create_user,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="updateUser != null">update_user,</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="planCode != null">#{planCode},</if>
            <if test="planName != null">#{planName},</if>
            <if test="planType != null">#{planType},</if>
            <if test="state != null">#{state},</if>
            <if test="frequency != null">#{frequency},</if>
            <if test="dimension != null">#{dimension},</if>
            <if test="lastGenerationTime != null">#{lastGenerationTime},</if>
            <if test="startTime != null">#{startTime},</if>
            <if test="endTime != null">#{endTime},</if>
            <if test="devices != null">#{devices},</if>
            <if test="inspectionItems != null">#{inspectionItems},</if>
            <if test="remarks != null">#{remarks},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="updateUser != null">#{updateUser},</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="updateEmInspectionPlan" parameterType="EmInspectionPlan">
        update em_inspection_plan
        <trim prefix="SET" suffixOverrides=",">
            <if test="planCode != null">plan_code = #{planCode},</if>
            <if test="planName != null">plan_name = #{planName},</if>
            <if test="planType != null">plan_type = #{planType},</if>
            <if test="state != null">state = #{state},</if>
            <if test="frequency != null">frequency = #{frequency},</if>
            <if test="dimension != null">dimension = #{dimension},</if>
            <if test="lastGenerationTime != null">last_generation_time = #{lastGenerationTime},</if>
            <if test="startTime != null">start_time = #{startTime},</if>
            <if test="endTime != null">end_time = #{endTime},</if>
            <if test="devices != null">devices = #{devices},</if>
            <if test="inspectionItems != null">Inspection_items = #{inspectionItems},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateUser != null">update_user = #{updateUser},</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="deleteEmInspectionPlanById" parameterType="Long">
        delete from em_inspection_plan where id = #{id}
    </delete>
    <delete id="deleteEmInspectionPlanByIds" parameterType="String">
        delete from em_inspection_plan where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
jcdm-ui/src/api/main/em/inspectionItems/inspectionItems.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// æŸ¥è¯¢ç‚¹æ£€ä¿å…»é¡¹ç›®åˆ—表
export function listInspectionItems(query) {
  return request({
    url: '/em/inspectionItems/list',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢ç‚¹æ£€ä¿å…»é¡¹ç›®è¯¦ç»†
export function getInspectionItems(id) {
  return request({
    url: '/em/inspectionItems/' + id,
    method: 'get'
  })
}
// æ–°å¢žç‚¹æ£€ä¿å…»é¡¹ç›®
export function addInspectionItems(data) {
  return request({
    url: '/em/inspectionItems',
    method: 'post',
    data: data
  })
}
// ä¿®æ”¹ç‚¹æ£€ä¿å…»é¡¹ç›®
export function updateInspectionItems(data) {
  return request({
    url: '/em/inspectionItems',
    method: 'put',
    data: data
  })
}
// åˆ é™¤ç‚¹æ£€ä¿å…»é¡¹ç›®
export function delInspectionItems(id) {
  return request({
    url: '/em/inspectionItems/' + id,
    method: 'delete'
  })
}
jcdm-ui/src/api/main/em/inspectionPlan/inspectionPlan.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’列表
export function listInspectionPlan(query) {
  return request({
    url: '/em/inspectionPlan/list',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’详细
export function getInspectionPlan(id) {
  return request({
    url: '/em/inspectionPlan/' + id,
    method: 'get'
  })
}
// æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’
export function addInspectionPlan(data) {
  return request({
    url: '/em/inspectionPlan',
    method: 'post',
    data: data
  })
}
// ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’
export function updateInspectionPlan(data) {
  return request({
    url: '/em/inspectionPlan',
    method: 'put',
    data: data
  })
}
// åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’
export function delInspectionPlan(id) {
  return request({
    url: '/em/inspectionPlan/' + id,
    method: 'delete'
  })
}
jcdm-ui/src/views/main/em/inspectionItems/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="itemsCode">
            <el-input
              v-model="queryParams.itemsCode"
              placeholder="请输入项目编号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="项目名称" prop="itemsName">
            <el-input
              v-model="queryParams.itemsName"
              placeholder="请输入项目名称"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
<!--          <el-form-item label="项目类型" prop="itemsType">-->
<!--            <el-select v-model="queryParams.itemsType" placeholder="请选择项目类型" 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 label="是否启用" prop="status">-->
<!--            <el-select v-model="queryParams.status" placeholder="请选择是否启用" 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:inspectionItems: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:inspectionItems: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:inspectionItems: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:inspectionItems:export']"
            >导出</el-button>
          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
        <el-table border v-loading="loading" :data="inspectionItemsList" @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="itemsCode">
          </el-table-column>
          <el-table-column label="项目名称" align="center" prop="itemsName">
          </el-table-column>
          <el-table-column label="项目类型" align="center" prop="itemsType">
          </el-table-column>
          <el-table-column label="是否启用" align="center" prop="status">
          </el-table-column>
          <el-table-column label="标准" align="center" prop="standard">
          </el-table-column>
          <el-table-column label="项目内容" align="center" prop="itemsContent">
          </el-table-column>
          <el-table-column label="备注" align="center" prop="remark">
          </el-table-column>
          <el-table-column label="创建人" align="center" prop="createUser">
          </el-table-column>
          <el-table-column label="创建时间" align="center" prop="createTime">
          </el-table-column>
          <el-table-column label="更新人" align="center" prop="updateUser">
          </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:inspectionItems:edit']"
              >修改</el-button>
              <el-button
                size="mini"
                type="danger"
                plain
                style="width: 72px"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['em:inspectionItems: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="itemsCode">
          <el-input v-model="form.itemsCode" placeholder="请输入项目编号" />
        </el-form-item>
        <el-form-item label="项目名称" prop="itemsName">
          <el-input v-model="form.itemsName" placeholder="请输入项目名称" />
        </el-form-item>
        <el-form-item label="项目类型" prop="itemsType">
<!--          <el-select v-model="form.itemsType" placeholder="请选择项目类型">-->
<!--            <el-option-->
<!--              v-for="dict in dict.type.${dictType}"-->
<!--              :key="dict.value"-->
<!--              :label="dict.label"-->
<!--              :value="dict.value"-->
<!--            ></el-option>-->
<!--          </el-select>-->
        </el-form-item>
        <el-form-item label="是否启用" prop="status">
<!--          <el-radio-group v-model="form.status">-->
<!--            <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="standard">
          <el-input v-model="form.standard" placeholder="请输入标准" />
        </el-form-item>
        <el-form-item label="项目内容">
          <editor v-model="form.itemsContent" :min-height="192"/>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" 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 { listInspectionItems, getInspectionItems, delInspectionItems, addInspectionItems, updateInspectionItems } from "@/api/main/em/inspectionItems/inspectionItems";
export default {
  name: "InspectionItems",
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      titleName: "",
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // ç‚¹æ£€ä¿å…»é¡¹ç›®è¡¨æ ¼æ•°æ®
      inspectionItemsList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        itemsCode: null,
        itemsName: null,
        itemsType: null,
        status: null,
      },
      // è¡¨å•å‚æ•°
      form: {},
      // è¡¨å•æ ¡éªŒ
      rules: {
        id: [
          { required: true, message: "ID不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢ç‚¹æ£€ä¿å…»é¡¹ç›®åˆ—表 */
    getList() {
      this.loading = true;
      listInspectionItems(this.queryParams).then(response => {
        this.inspectionItemsList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // å–消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // è¡¨å•é‡ç½®
    reset() {
      this.form = {
        id: null,
        itemsCode: null,
        itemsName: null,
        itemsType: null,
        status: null,
        standard: null,
        itemsContent: null,
        remark: null,
        createUser: null,
        createTime: null,
        updateUser: null,
        updateTime: null,
        spareField1: null,
        spareField2: 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
      getInspectionItems(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) {
            updateInspectionItems(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addInspectionItems(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 delInspectionItems(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      this.download('em/inspectionItems/export', {
        ...this.queryParams
      }, `inspectionItems_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
jcdm-ui/src/views/main/em/inspectionPlan/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,381 @@
<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="planCode">
            <el-input
              v-model="queryParams.planCode"
              placeholder="请输入计划编号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="计划名称" prop="planName">
            <el-input
              v-model="queryParams.planName"
              placeholder="请输入计划名称"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
<!--          <el-form-item label="计划类型" prop="planType">-->
<!--            <el-select v-model="queryParams.planType" placeholder="请选择计划类型" 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 label="状态" prop="state">
            <el-input
              v-model="queryParams.state"
              placeholder="请输入状态"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="频率" prop="frequency">
            <el-input
              v-model="queryParams.frequency"
              placeholder="请输入频率"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="维度" prop="dimension">
            <el-input
              v-model="queryParams.dimension"
              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:inspectionPlan: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:inspectionPlan: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:inspectionPlan: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:inspectionPlan:export']"
            >导出</el-button>
          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
        <el-table border v-loading="loading" :data="inspectionPlanList" @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="planCode">
          </el-table-column>
          <el-table-column label="计划名称" align="center" prop="planName">
          </el-table-column>
          <el-table-column label="计划类型" align="center" prop="planType">
          </el-table-column>
          <el-table-column label="状态" align="center" prop="state">
          </el-table-column>
          <el-table-column label="频率" align="center" prop="frequency">
          </el-table-column>
          <el-table-column label="维度" align="center" prop="dimension">
          </el-table-column>
          <el-table-column label="上次生成时间" align="center" prop="lastGenerationTime">
          </el-table-column>
          <el-table-column label="开始时间" align="center" prop="startTime">
          </el-table-column>
          <el-table-column label="结束时间" align="center" prop="endTime">
          </el-table-column>
          <el-table-column label="备注" align="center" prop="remarks">
          </el-table-column>
          <el-table-column label="创建时间" align="center" prop="createTime">
          </el-table-column>
          <el-table-column label="创建人" align="center" prop="createUser">
          </el-table-column>
          <el-table-column label="修改时间" align="center" prop="updateTime">
          </el-table-column>
          <el-table-column label="修改人" align="center" prop="updateUser">
          </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:inspectionPlan:edit']"
              >修改</el-button>
              <el-button
                size="mini"
                type="danger"
                plain
                style="width: 72px"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['em:inspectionPlan: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="planCode">
          <el-input v-model="form.planCode" placeholder="请输入计划编号" />
        </el-form-item>
        <el-form-item label="计划名称" prop="planName">
          <el-input v-model="form.planName" placeholder="请输入计划名称" />
        </el-form-item>
<!--        <el-form-item label="计划类型" prop="planType">-->
<!--          <el-select v-model="form.planType" placeholder="请选择计划类型">-->
<!--            <el-option-->
<!--              v-for="dict in dict.type.${dictType}"-->
<!--              :key="dict.value"-->
<!--              :label="dict.label"-->
<!--              :value="dict.value"-->
<!--            ></el-option>-->
<!--          </el-select>-->
<!--        </el-form-item>-->
        <el-form-item label="状态" prop="state">
          <el-input v-model="form.state" placeholder="请输入状态" />
        </el-form-item>
        <el-form-item label="频率" prop="frequency">
          <el-input v-model="form.frequency" placeholder="请输入频率" />
        </el-form-item>
        <el-form-item label="维度" prop="dimension">
          <el-input v-model="form.dimension" placeholder="请输入维度" />
        </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 { listInspectionPlan, getInspectionPlan, delInspectionPlan, addInspectionPlan, updateInspectionPlan } from "@/api/main/em/inspectionPlan/inspectionPlan";
export default {
  name: "InspectionPlan",
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      titleName: "",
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // ç‚¹æ£€ä¿å…»è®¡åˆ’表格数据
      inspectionPlanList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        planCode: null,
        planName: null,
        planType: null,
        state: null,
        frequency: null,
        dimension: null,
        startTime: null,
        endTime: null,
      },
      // è¡¨å•å‚æ•°
      form: {},
      // è¡¨å•æ ¡éªŒ
      rules: {
        id: [
          { required: true, message: "ID不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’列表 */
    getList() {
      this.loading = true;
      listInspectionPlan(this.queryParams).then(response => {
        this.inspectionPlanList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // å–消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // è¡¨å•é‡ç½®
    reset() {
      this.form = {
        id: null,
        planCode: null,
        planName: null,
        planType: null,
        state: null,
        frequency: null,
        dimension: null,
        lastGenerationTime: null,
        startTime: null,
        endTime: null,
        devices: null,
        inspectionItems: null,
        remarks: null,
        createTime: null,
        createUser: null,
        updateTime: null,
        updateUser: 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
      getInspectionPlan(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) {
            updateInspectionPlan(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addInspectionPlan(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 delInspectionPlan(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      this.download('em/inspectionPlan/export', {
        ...this.queryParams
      }, `inspectionPlan_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>