zhanghl
2025-05-19 e3121b4eb236c694afc8893e84b367722edf12cc
Merge remote-tracking branch 'origin/dev' into dev
已添加6个文件
618 ■■■■■ 文件已修改
aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelineMoController.java 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsGasPipelineMo.java 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsGasPipelineMoMapper.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsGasPipelineMoService.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineMoServiceImpl.java 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipelineMoMapper.xml 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelineMoController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,120 @@
package com.aps.core.controller.mainPlan;
import com.aps.common.core.utils.poi.ExcelUtil;
import com.aps.common.core.web.controller.BaseController;
import com.aps.common.core.web.domain.AjaxResult;
import com.aps.common.core.web.page.TableDataInfo;
import com.aps.common.log.annotation.Log;
import com.aps.common.log.enums.BusinessType;
import com.aps.common.security.annotation.RequiresPermissions;
import com.aps.core.domain.ApsGasPipelineMo;
import com.aps.core.service.IApsGasPipelineMoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
 * ç®¡è·¯æ‰‹å·¥æ°”体工单数据Controller
 *
 * @author sfd
 * @date 2025-05-19
 */
@Tag(name = "管路手工气体工单数据", description = "管路手工气体工单数据接口")
@RestController
@RequestMapping("/gasPipelineMo")
public class ApsGasPipelineMoController extends BaseController
{
    @Autowired
    private IApsGasPipelineMoService apsGasPipelineMoService;
    /**
     * æŸ¥è¯¢ç®¡è·¯æ‰‹å·¥æ°”体工单数据列表
     */
    @Operation(summary = "查询管路手工气体工单数据列表", description = "分页查询")
    @RequiresPermissions("gasPipeline:mo:list")
    @GetMapping("/list")
    public TableDataInfo list(ApsGasPipelineMo apsGasPipelineMo)
    {
        startPage();
        List<ApsGasPipelineMo> list = apsGasPipelineMoService.selectApsGasPipelineMoList(apsGasPipelineMo);
        return getDataTable(list);
    }
    @Operation(summary = "导入管路手工气体工单数据", description = "批量导入")
    @Log(title = "导入管路手工气体工单数据", businessType = BusinessType.IMPORT)
    @RequiresPermissions("gasPipeline:mo:import")
    @PostMapping("/importData")
    public AjaxResult importData(MultipartFile file) throws Exception {
        int i = apsGasPipelineMoService.batchInsertGasPipelineMo(file);
        return  toAjax(i);
    }
    /**
     * å¯¼å‡ºç®¡è·¯æ‰‹å·¥æ°”体工单数据列表
     */
    @Operation(summary = "导出管路手工气体工单数据列表", description = "导出")
    @RequiresPermissions("gasPipeline:mo:export")
    @Log(title = "管路手工气体工单数据", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ApsGasPipelineMo apsGasPipelineMo)
    {
        List<ApsGasPipelineMo> list = apsGasPipelineMoService.selectApsGasPipelineMoList(apsGasPipelineMo);
        ExcelUtil<ApsGasPipelineMo> util = new ExcelUtil<ApsGasPipelineMo>(ApsGasPipelineMo.class);
        util.exportExcel(response, list, "管路手工气体工单数据数据");
    }
    /**
     * èŽ·å–ç®¡è·¯æ‰‹å·¥æ°”ä½“å·¥å•æ•°æ®è¯¦ç»†ä¿¡æ¯
     */
    @Operation(summary = "获取管路手工气体工单数据详细信息", description = "根据id获取")
    @RequiresPermissions("gasPipeline:mo:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(apsGasPipelineMoService.selectApsGasPipelineMoById(id));
    }
    /**
     * æ–°å¢žç®¡è·¯æ‰‹å·¥æ°”体工单数据
     */
    @Operation(summary = "新增管路手工气体工单数据", description = "单个新增")
    @RequiresPermissions("gasPipeline:mo:add")
    @Log(title = "管路手工气体工单数据", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ApsGasPipelineMo apsGasPipelineMo)
    {
        return toAjax(apsGasPipelineMoService.insertApsGasPipelineMo(apsGasPipelineMo));
    }
    /**
     * ä¿®æ”¹ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     */
    @Operation(summary = "修改管路手工气体工单数据", description = "单个修改")
    @RequiresPermissions("gasPipeline:mo:edit")
    @Log(title = "管路手工气体工单数据", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ApsGasPipelineMo apsGasPipelineMo)
    {
        return toAjax(apsGasPipelineMoService.updateApsGasPipelineMo(apsGasPipelineMo));
    }
    /**
     * åˆ é™¤ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     */
    @Operation(summary = "删除管路手工气体工单数据", description = "批量删除")
    @RequiresPermissions("gasPipeline:mo:remove")
    @Log(title = "管路手工气体工单数据", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(apsGasPipelineMoService.deleteApsGasPipelineMoByIds(ids));
    }
}
aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsGasPipelineMo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,114 @@
package com.aps.core.domain;
import com.aps.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aps.common.core.annotation.Excel;
import org.springframework.data.annotation.Id;
import java.math.BigDecimal;
import java.sql.Timestamp;
/**
 * ç®¡è·¯æ‰‹å·¥æ°”体工单数据对象 aps_gas_pipeline_mo
 *
 * @author ruoyi
 * @date 2025-05-19
 */
@Schema(description = "管路手工气体工单数据实体类")
@Data
public class ApsGasPipelineMo extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    @Id
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    /** ID */
    @Schema(description = "ID")
    private Long id;
    /** å·¥å•号 */
    @Excel(name = "工单号")
    @Schema(description = "工单号")
    private String mo;
    /** ç”Ÿäº§åŸºåœ° */
    @Excel(name = "生产基地")
    @Schema(description = "生产基地")
    private String factory;
    /** æ–™å· */
    @Excel(name = "料号")
    @Schema(description = "料号")
    private String materialCode;
    /** è®¡åˆ’完工日期 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "计划完工日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "计划完工日期")
    private Timestamp planEnd;
    /** æ•°é‡ */
    @Excel(name = "数量")
    @Schema(description = "数量")
    private BigDecimal quantity;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setMo(String mo)
    {
        this.mo = mo;
    }
    public String getMo()
    {
        return mo;
    }
    public void setFactory(String factory)
    {
        this.factory = factory;
    }
    public String getFactory()
    {
        return factory;
    }
    public void setMaterialCode(String materialCode)
    {
        this.materialCode = materialCode;
    }
    public String getMaterialCode()
    {
        return materialCode;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("mo", getMo())
            .append("factory", getFactory())
            .append("materialCode", getMaterialCode())
            .append("planEnd", getPlanEnd())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsGasPipelineMoMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,68 @@
package com.aps.core.mapper;
import com.aps.core.domain.ApsGasPipelineMo;
import com.aps.core.domain.ApsPlanCycle;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
 * ç®¡è·¯æ‰‹å·¥æ°”体工单数据Mapper接口
 *
 * @author ruoyi
 * @date 2025-05-19
 */
@Mapper
public interface ApsGasPipelineMoMapper extends BaseMapper<ApsGasPipelineMo>
{
    /**
     * æŸ¥è¯¢ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param id ç®¡è·¯æ‰‹å·¥æ°”体工单数据主键
     * @return ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     */
    public ApsGasPipelineMo selectApsGasPipelineMoById(Long id);
    /**
     * æŸ¥è¯¢ç®¡è·¯æ‰‹å·¥æ°”体工单数据列表
     *
     * @param apsGasPipelineMo ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     * @return ç®¡è·¯æ‰‹å·¥æ°”体工单数据集合
     */
    public List<ApsGasPipelineMo> selectApsGasPipelineMoList(ApsGasPipelineMo apsGasPipelineMo);
    /**
     * æ–°å¢žç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param apsGasPipelineMo ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     * @return ç»“æžœ
     */
    public int insertApsGasPipelineMo(ApsGasPipelineMo apsGasPipelineMo);
    /**
     * ä¿®æ”¹ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param apsGasPipelineMo ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     * @return ç»“æžœ
     */
    public int updateApsGasPipelineMo(ApsGasPipelineMo apsGasPipelineMo);
    /**
     * åˆ é™¤ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param id ç®¡è·¯æ‰‹å·¥æ°”体工单数据主键
     * @return ç»“æžœ
     */
    public int deleteApsGasPipelineMoById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
    public int deleteApsGasPipelineMoByIds(Long[] ids);
    void deleteAll();
}
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsGasPipelineMoService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,70 @@
package com.aps.core.service;
import java.util.List;
import com.aps.core.domain.ApsGasPipelineMo;
import org.springframework.web.multipart.MultipartFile;
/**
 * ç®¡è·¯æ‰‹å·¥æ°”体工单数据Service接口
 *
 * @author ruoyi
 * @date 2025-05-19
 */
public interface IApsGasPipelineMoService
{
    /**
     * æŸ¥è¯¢ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param id ç®¡è·¯æ‰‹å·¥æ°”体工单数据主键
     * @return ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     */
    public ApsGasPipelineMo selectApsGasPipelineMoById(Long id);
    /**
     * æŸ¥è¯¢ç®¡è·¯æ‰‹å·¥æ°”体工单数据列表
     *
     * @param apsGasPipelineMo ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     * @return ç®¡è·¯æ‰‹å·¥æ°”体工单数据集合
     */
    public List<ApsGasPipelineMo> selectApsGasPipelineMoList(ApsGasPipelineMo apsGasPipelineMo);
    /**
     * æ–°å¢žç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param apsGasPipelineMo ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     * @return ç»“æžœ
     */
    public int insertApsGasPipelineMo(ApsGasPipelineMo apsGasPipelineMo);
    /**
     * ä¿®æ”¹ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param apsGasPipelineMo ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     * @return ç»“æžœ
     */
    public int updateApsGasPipelineMo(ApsGasPipelineMo apsGasPipelineMo);
    /**
     * æ‰¹é‡åˆ é™¤ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param ids éœ€è¦åˆ é™¤çš„管路手工气体工单数据主键集合
     * @return ç»“æžœ
     */
    public int deleteApsGasPipelineMoByIds(Long[] ids);
    /**
     * åˆ é™¤ç®¡è·¯æ‰‹å·¥æ°”体工单数据信息
     *
     * @param id ç®¡è·¯æ‰‹å·¥æ°”体工单数据主键
     * @return ç»“æžœ
     */
    public int deleteApsGasPipelineMoById(Long id);
    /**
     * æ’å…¥ ç®¡è·¯å·¥å•数据
     * @param file
     * @return
     */
    int batchInsertGasPipelineMo(MultipartFile file);
}
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineMoServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,150 @@
package com.aps.core.service.impl;
import cn.hutool.core.util.IdUtil;
import com.aps.common.core.utils.DateUtils;
import com.aps.common.security.utils.SecurityUtils;
import com.aps.core.domain.ApsGasPipelineMo;
import com.aps.core.mapper.ApsGasPipelineMoMapper;
import com.aps.core.service.IApsGasPipelineMoService;
import io.micrometer.common.util.StringUtils;
import lombok.SneakyThrows;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * ç®¡è·¯æ‰‹å·¥æ°”体工单数据Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-19
 */
@Service
public class ApsGasPipelineMoServiceImpl implements IApsGasPipelineMoService {
    @Autowired
    private ApsGasPipelineMoMapper apsGasPipelineMoMapper;
    /**
     * æŸ¥è¯¢ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param id ç®¡è·¯æ‰‹å·¥æ°”体工单数据主键
     * @return ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     */
    @Override
    public ApsGasPipelineMo selectApsGasPipelineMoById(Long id) {
        return apsGasPipelineMoMapper.selectApsGasPipelineMoById(id);
    }
    /**
     * æŸ¥è¯¢ç®¡è·¯æ‰‹å·¥æ°”体工单数据列表
     *
     * @param apsGasPipelineMo ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     * @return ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     */
    @Override
    public List<ApsGasPipelineMo> selectApsGasPipelineMoList(ApsGasPipelineMo apsGasPipelineMo) {
        return apsGasPipelineMoMapper.selectApsGasPipelineMoList(apsGasPipelineMo);
    }
    /**
     * æ–°å¢žç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param apsGasPipelineMo ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     * @return ç»“æžœ
     */
    @Override
    public int insertApsGasPipelineMo(ApsGasPipelineMo apsGasPipelineMo) {
        apsGasPipelineMo.setCreateTime(DateUtils.getNowDate());
        apsGasPipelineMo.setId(IdUtil.getSnowflakeNextId());
        apsGasPipelineMo.setCreateBy(SecurityUtils.getUsername());
        return apsGasPipelineMoMapper.insertApsGasPipelineMo(apsGasPipelineMo);
    }
    /**
     * ä¿®æ”¹ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param apsGasPipelineMo ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     * @return ç»“æžœ
     */
    @Override
    public int updateApsGasPipelineMo(ApsGasPipelineMo apsGasPipelineMo) {
        apsGasPipelineMo.setUpdateTime(DateUtils.getNowDate());
        return apsGasPipelineMoMapper.updateApsGasPipelineMo(apsGasPipelineMo);
    }
    /**
     * æ‰¹é‡åˆ é™¤ç®¡è·¯æ‰‹å·¥æ°”体工单数据
     *
     * @param ids éœ€è¦åˆ é™¤çš„管路手工气体工单数据主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteApsGasPipelineMoByIds(Long[] ids) {
        return apsGasPipelineMoMapper.deleteApsGasPipelineMoByIds(ids);
    }
    /**
     * åˆ é™¤ç®¡è·¯æ‰‹å·¥æ°”体工单数据信息
     *
     * @param id ç®¡è·¯æ‰‹å·¥æ°”体工单数据主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteApsGasPipelineMoById(Long id) {
        return apsGasPipelineMoMapper.deleteApsGasPipelineMoById(id);
    }
    @SneakyThrows
    @Transactional(rollbackFor = Exception.class)
    @Override
    public int batchInsertGasPipelineMo(MultipartFile file) {
        Workbook workbook = WorkbookFactory.create(file.getInputStream());
        Sheet sheet = workbook.getSheetAt(0);
        int rows = sheet.getLastRowNum();
        if (rows > 0) {
            List<ApsGasPipelineMo> list = new ArrayList<>();
            /*数据列从1开始*/
            for (int i = 1; i <= rows; i++) {
                Row row = sheet.getRow(i);
                String mo = row.getCell(0).getStringCellValue();
                String factory = row.getCell(1).getStringCellValue();
                String materialNum = row.getCell(2).getStringCellValue();
                double quantity = row.getCell(3).getNumericCellValue();
                Date planEnd = row.getCell(4).getDateCellValue();
                if (StringUtils.isNotBlank(mo) &&
                    StringUtils.isNotBlank(factory) &&
                    StringUtils.isNotBlank(materialNum) &&
                    planEnd != null) {
                    ApsGasPipelineMo apsGasPipelineMo = new ApsGasPipelineMo();
                    apsGasPipelineMo.setMo(mo);
                    apsGasPipelineMo.setId(IdUtil.getSnowflakeNextId());
                    apsGasPipelineMo.setFactory(factory);
                    apsGasPipelineMo.setCreateBy(SecurityUtils.getUsername());
                    apsGasPipelineMo.setCreateTime(DateUtils.getNowDate());
                    apsGasPipelineMo.setQuantity(new BigDecimal(quantity));
                    apsGasPipelineMo.setPlanEnd(new Timestamp(planEnd.getTime()));
                    list.add(apsGasPipelineMo);
                }
            }
            if (!list.isEmpty()) {
                apsGasPipelineMoMapper.deleteAll();
                apsGasPipelineMoMapper.insert(list);
            }
            return list.size();
        }
        return 0;
    }
}
aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipelineMoMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
<?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.aps.core.mapper.ApsGasPipelineMoMapper">
    <resultMap type="com.aps.core.domain.ApsGasPipelineMo" id="ApsGasPipelineMoResult">
        <result property="id"    column="id"    />
        <result property="mo"    column="mo"    />
        <result property="factory"    column="factory"    />
        <result property="materialCode"    column="material_code"    />
        <result property="planEnd"    column="plan_end"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="quantity"    column="quantity"    />
    </resultMap>
    <sql id="selectApsGasPipelineMoVo">
        select id, mo, factory, material_code, plan_end, create_by, create_time, update_by, update_time, quantity from aps_gas_pipeline_mo
    </sql>
    <select id="selectApsGasPipelineMoList" parameterType="ApsGasPipelineMo" resultMap="ApsGasPipelineMoResult">
        <include refid="selectApsGasPipelineMoVo"/>
        <where>
            <if test="mo != null  and mo != ''"> and mo = #{mo}</if>
            <if test="factory != null  and factory != ''"> and factory = #{factory}</if>
            <if test="materialCode != null  and materialCode != ''"> and material_code = #{materialCode}</if>
            <if test="planEnd != null  and planEnd != ''"> and plan_end = #{planEnd}</if>
            <if test="quantity != null  and quantity != ''"> and quantity = #{quantity}</if>
        </where>
    </select>
    <select id="selectApsGasPipelineMoById" parameterType="Long" resultMap="ApsGasPipelineMoResult">
    </select>
    <insert id="insertApsGasPipelineMo" parameterType="ApsGasPipelineMo">
        insert into aps_gas_pipeline_mo
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="mo != null">mo,</if>
            <if test="factory != null">factory,</if>
            <if test="materialCode != null">material_code,</if>
            <if test="planEnd != null">plan_end,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="quantity != null">quantity,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="mo != null">#{mo},</if>
            <if test="factory != null">#{factory},</if>
            <if test="materialCode != null">#{materialCode},</if>
            <if test="planEnd != null">#{planEnd},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="quantity != null">#{quantity},</if>
         </trim>
    </insert>
    <update id="updateApsGasPipelineMo" parameterType="ApsGasPipelineMo">
        update aps_gas_pipeline_mo
        <trim prefix="SET" suffixOverrides=",">
            <if test="mo != null">mo = #{mo},</if>
            <if test="factory != null">factory = #{factory},</if>
            <if test="materialCode != null">material_code = #{materialCode},</if>
            <if test="planEnd != null">plan_end = #{planEnd},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="quantity != null">quantity = #{quantity},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteApsGasPipelineMoById" parameterType="Long">
        delete from aps_gas_pipeline_mo where id = #{id}
    </delete>
    <delete id="deleteAll">
        delete from aps_gas_pipeline_mo
    </delete>
    <delete id="deleteApsGasPipelineMoByIds" parameterType="String">
        delete from aps_gas_pipeline_mo where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>