Lius
2024-10-18 2f4d58a807ae1d91e43f7d7df33ce6b414c794ad
update
已添加6个文件
已修改1个文件
288 ■■■■■ 文件已修改
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/ComponentInfoController.java 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/ComponentInfo.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/ComponentInfoMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/ComponentInfoMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentAlarmMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IComponentInfoService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/ComponentInfoServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/ComponentInfoController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,153 @@
package org.jeecg.modules.mdc.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.mdc.entity.ComponentInfo;
import org.jeecg.modules.mdc.service.IComponentInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
 * @Description: é›¶ä»¶è¡¨
 * @Author: lius
 * @Date: 2024-10-18
 * @Version: V1.0
 */
@Slf4j
@Api(tags = "零件表")
@RestController
@RequestMapping("/mdc/componentInfo")
public class ComponentInfoController extends JeecgController<ComponentInfo, IComponentInfoService> {
    @Resource
    private IComponentInfoService componentInfoService;
    /**
     * åˆ†é¡µåˆ—表查询
     *
     * @param componentInfo
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    @AutoLog(value = "零件表-分页列表查询")
    @ApiOperation(value = "零件表-分页列表查询", notes = "零件表-分页列表查询")
    @GetMapping(value = "/list")
    public Result<?> queryPageList(ComponentInfo componentInfo,
                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                   HttpServletRequest req) {
        QueryWrapper<ComponentInfo> queryWrapper = QueryGenerator.initQueryWrapper(componentInfo, req.getParameterMap());
        Page<ComponentInfo> page = new Page<ComponentInfo>(pageNo, pageSize);
        IPage<ComponentInfo> pageList = componentInfoService.page(page, queryWrapper);
        return Result.OK(pageList);
    }
    /**
     * æ·»åŠ 
     *
     * @param componentInfo
     * @return
     */
    @AutoLog(value = "零件表-添加")
    @ApiOperation(value = "零件表-添加", notes = "零件表-添加")
    @PostMapping(value = "/add")
    public Result<?> add(@RequestBody ComponentInfo componentInfo) {
        componentInfoService.save(componentInfo);
        return Result.OK("添加成功!");
    }
    /**
     * ç¼–辑
     *
     * @param componentInfo
     * @return
     */
    @AutoLog(value = "零件表-编辑")
    @ApiOperation(value = "零件表-编辑", notes = "零件表-编辑")
    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
    public Result<?> edit(@RequestBody ComponentInfo componentInfo) {
        componentInfoService.updateById(componentInfo);
        return Result.OK("编辑成功!");
    }
    /**
     * é€šè¿‡id删除
     *
     * @param id
     * @return
     */
    @AutoLog(value = "零件表-通过id删除")
    @ApiOperation(value = "零件表-通过id删除", notes = "零件表-通过id删除")
    @DeleteMapping(value = "/delete")
    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
        componentInfoService.removeById(id);
        return Result.OK("删除成功!");
    }
    /**
     * æ‰¹é‡åˆ é™¤
     *
     * @param ids
     * @return
     */
    @AutoLog(value = "零件表-批量删除")
    @ApiOperation(value = "零件表-批量删除", notes = "零件表-批量删除")
    @DeleteMapping(value = "/deleteBatch")
    public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
        this.componentInfoService.removeByIds(Arrays.asList(ids.split(",")));
        return Result.OK("批量删除成功!");
    }
    /**
     * é€šè¿‡id查询
     *
     * @param id
     * @return
     */
    @AutoLog(value = "零件表-通过id查询")
    @ApiOperation(value = "零件表-通过id查询", notes = "零件表-通过id查询")
    @GetMapping(value = "/queryById")
    public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
        ComponentInfo componentInfo = componentInfoService.getById(id);
        return Result.OK(componentInfo);
    }
    /**
     * å¯¼å‡ºexcel
     *
     * @param request
     * @param componentInfo
     */
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, ComponentInfo componentInfo) {
        return super.exportXls(request, componentInfo, ComponentInfo.class, "零件表");
    }
    /**
     * é€šè¿‡excel导入数据
     *
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
        return super.importExcel(request, response, ComponentInfo.class);
    }
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/ComponentInfo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
package org.jeecg.modules.mdc.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
 * @Description: é›¶ä»¶è¡¨
 * @Author: lius
 * @Date: 2024-10-18
 * @Version: V1.0
 */
@Data
@TableName("Component_Info")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "Component_Info对象", description = "零件表")
public class ComponentInfo implements Serializable {
    private static final long serialVersionUID = -9191357592954290074L;
    /**
     * id
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id")
    private String id;
    /**
     * componentNo
     */
    @Excel(name = "componentNo", width = 15)
    @ApiModelProperty(value = "componentNo")
    private String componentNo;
    /**
     * componentName
     */
    @Excel(name = "componentName", width = 15)
    @ApiModelProperty(value = "componentName")
    private String componentName;
    /**
     * scheduleNum
     */
    @Excel(name = "scheduleNum", width = 15)
    @ApiModelProperty(value = "scheduleNum")
    private Integer scheduleNum;
    /**
     * dayNum
     */
    @Excel(name = "dayNum", width = 15)
    @ApiModelProperty(value = "dayNum")
    private Integer dayNum;
    /**
     * beltlineid
     */
    @Excel(name = "beltlineid", width = 15)
    @ApiModelProperty(value = "beltlineid")
    private String beltlineid;
    /**
     * overallflag
     */
    @Excel(name = "overallflag", width = 15)
    @ApiModelProperty(value = "overallflag")
    private Boolean overallflag;
    /**
     * equipmentids
     */
    @Excel(name = "equipmentids", width = 15)
    @ApiModelProperty(value = "equipmentids")
    private String equipmentids;
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/ComponentInfoMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package org.jeecg.modules.mdc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.mdc.entity.ComponentInfo;
/**
 * @Description: é›¶ä»¶è¡¨
 * @Author: lius
 * @Date:   2024-10-18
 * @Version: V1.0
 */
public interface ComponentInfoMapper extends BaseMapper<ComponentInfo> {
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/ComponentInfoMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
<?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="org.jeecg.modules.mdc.mapper.ComponentInfoMapper">
</mapper>
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentAlarmMapper.xml
@@ -13,10 +13,10 @@
            EquipmentAlarm t1 LEFT JOIN mdc_equipment t2 ON t1.EquipmentID = t2.equipment_id
        <where>
            <if test="equipmentAlarmVo.equipmentId != null and equipmentAlarmVo.equipmentId != ''">
                AND t1.EquipmentID  LIKE CONCAT(CONCAT('%',#{equipmentAlarmVo.equipmentId}),'%')
                AND t1.EquipmentID  LIKE '%' + #{equipmentAlarmVo.equipmentId} + '%'
            </if>
            <if test="equipmentAlarmVo.equipmentName != null and equipmentAlarmVo.equipmentName != ''">
                AND t1.EquipmentID  LIKE CONCAT(CONCAT('%',#{equipmentAlarmVo.equipmentName}),'%')
                AND t2.equipment_name  LIKE '%' + #{equipmentAlarmVo.equipmentName} + '%'
            </if>
            <if test="equipmentAlarmVo.startTime != null and equipmentAlarmVo.endTime != null">
                AND t1.collectTime BETWEEN #{equipmentAlarmVo.startTime} AND #{equipmentAlarmVo.endTime}
@@ -49,7 +49,7 @@
                AND t1.EquipmentID  LIKE CONCAT(CONCAT('%',#{equipmentAlarmVo.equipmentId}),'%')
            </if>
            <if test="equipmentAlarmVo.equipmentName != null and equipmentAlarmVo.equipmentName != ''">
                AND t1.EquipmentID  LIKE CONCAT(CONCAT('%',#{equipmentAlarmVo.equipmentName}),'%')
                AND t2.equipment_name  LIKE CONCAT(CONCAT('%',#{equipmentAlarmVo.equipmentName}),'%')
            </if>
            <if test="equipmentAlarmVo.startTime != null and equipmentAlarmVo.endTime != null">
                AND t1.collectTime BETWEEN #{equipmentAlarmVo.startTime} AND #{equipmentAlarmVo.endTime}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IComponentInfoService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package org.jeecg.modules.mdc.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.mdc.entity.ComponentInfo;
/**
 * @Description: é›¶ä»¶è¡¨
 * @Author: lius
 * @Date: 2024-10-18
 * @Version: V1.0
 */
public interface IComponentInfoService extends IService<ComponentInfo> {
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/ComponentInfoServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
package org.jeecg.modules.mdc.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.mdc.entity.ComponentInfo;
import org.jeecg.modules.mdc.mapper.ComponentInfoMapper;
import org.jeecg.modules.mdc.service.IComponentInfoService;
import org.springframework.stereotype.Service;
/**
 * @Description: é›¶ä»¶è¡¨
 * @Author: lius
 * @Date: 2024-10-18
 * @Version: V1.0
 */
@Service
public class ComponentInfoServiceImpl extends ServiceImpl<ComponentInfoMapper, ComponentInfo> implements IComponentInfoService {
}