zhanghl
2025-04-25 98d0e65ddbb42e7c5fab436f45dde3a4b051c77f
气柜和管路物料用量-接口提交
已添加6个文件
619 ■■■■■ 文件已修改
aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsGasMaterialUsageController.java 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsGasMaterialUsage.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsGasMaterialUsageMapper.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsGasMaterialUsageService.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasMaterialUsageServiceImpl.java 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/resources/mapper/core/ApsGasMaterialUsageMapper.xml 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsGasMaterialUsageController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,113 @@
package com.aps.core.controller.basicData;
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.ApsGasMaterialUsage;
import com.aps.core.service.IApsGasMaterialUsageService;
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 zhl
 * @date 2025-04-25
 */
@Tag(name = "气柜管路物料用量", description = "气柜管路物料用量接口")
@RestController
@RequestMapping("/gasMaterialUsage")
public class ApsGasMaterialUsageController extends BaseController {
    @Autowired
    private IApsGasMaterialUsageService apsGasMaterialUsageService;
    /**
     * æŸ¥è¯¢æ°”柜管路物料用量列表
     */
    @Operation(summary = "查询气柜管路物料用量列表", description = "分页查询")
    @RequiresPermissions("gasMaterialUsage:list")
    @GetMapping("/list")
    public TableDataInfo list(ApsGasMaterialUsage apsGasMaterialUsage) {
        startPage();
        List<ApsGasMaterialUsage> list = apsGasMaterialUsageService.selectApsGasMaterialUsageList(apsGasMaterialUsage);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºæ°”柜管路物料用量列表
     */
    @Operation(summary = "导出气柜管路物料用量列表", description = "导出")
    @RequiresPermissions("gasMaterialUsage:export")
    @Log(title = "气柜管路物料用量", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ApsGasMaterialUsage apsGasMaterialUsage) {
        List<ApsGasMaterialUsage> list = apsGasMaterialUsageService.selectApsGasMaterialUsageList(apsGasMaterialUsage);
        ExcelUtil<ApsGasMaterialUsage> util = new ExcelUtil<ApsGasMaterialUsage>(ApsGasMaterialUsage.class);
        util.exportExcel(response, list, "气柜管路物料用量数据");
    }
    /**
     * èŽ·å–æ°”æŸœç®¡è·¯ç‰©æ–™ç”¨é‡è¯¦ç»†ä¿¡æ¯
     */
    @Operation(summary = "获取气柜管路物料用量详细信息", description = "根据id获取")
    @RequiresPermissions("gasMaterialUsage:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(apsGasMaterialUsageService.selectApsGasMaterialUsageById(id));
    }
    /**
     * æ–°å¢žæ°”柜管路物料用量
     */
    @Operation(summary = "新增气柜管路物料用量", description = "单个新增")
    @RequiresPermissions("gasMaterialUsage:add")
    @Log(title = "气柜管路物料用量", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ApsGasMaterialUsage apsGasMaterialUsage) {
        return toAjax(apsGasMaterialUsageService.insertApsGasMaterialUsage(apsGasMaterialUsage));
    }
    /**
     * ä¿®æ”¹æ°”柜管路物料用量
     */
    @Operation(summary = "修改气柜管路物料用量", description = "单个修改")
    @RequiresPermissions("gasMaterialUsage:edit")
    @Log(title = "气柜管路物料用量", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ApsGasMaterialUsage apsGasMaterialUsage) {
        return toAjax(apsGasMaterialUsageService.updateApsGasMaterialUsage(apsGasMaterialUsage));
    }
    /**
     * åˆ é™¤æ°”柜管路物料用量
     */
    @Operation(summary = "删除气柜管路物料用量", description = "批量删除")
    @RequiresPermissions("gasMaterialUsage:remove")
    @Log(title = "气柜管路物料用量", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(apsGasMaterialUsageService.deleteApsGasMaterialUsageByIds(ids));
    }
    @Operation(summary = "导入气柜管路物料用量", description = "批量导入")
    @Log(title = "气柜管路物料用量", businessType = BusinessType.IMPORT)
    @RequiresPermissions("gasMaterialUsage:import")
    @PostMapping("/importData")
    public AjaxResult importData(MultipartFile file) throws Exception {
        int i = apsGasMaterialUsageService.batchInsertGasMaterialUsage(file);
        return  toAjax(i);
    }
}
aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsGasMaterialUsage.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
package com.aps.core.domain;
import com.aps.common.core.annotation.Excel;
import com.aps.common.core.web.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
 * æ°”柜管路物料用量对象 aps_gas_material_usage
 *
 * @author zhl
 * @date 2025-04-25
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(description = "气柜管路物料用量实体类")
public class ApsGasMaterialUsage extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * æ•°æ®ä¸»é”®
     */
    @Schema(description ="数据主键", type = "String")
    private Long id;
    /**
     * æ–™å·
     */
    @Excel(name = "料号")
    @Schema(description ="料号", type = "String")
    private String itemNumber;
    /**
     * å›¾å·
     */
    @Excel(name = "图号")
    @Schema(description ="图号", type = "String")
    private String drawingNo;
    /**
     * ç‰ˆæœ¬
     */
    @Excel(name = "版本")
    @Schema(description ="版本", type = "String")
    private String version;
    /**
     * å·¥åºåç§°
     */
    @Excel(name = "工序名称")
    @Schema(description ="工序名称", type = "String")
    private String processName;
    /**
     * æ ‡å‡†ç”¨é‡
     */
    @Excel(name = "标准用量")
    @Schema(description ="标准用量", type = "String")
    private BigDecimal standardAmount;
    /**
     * è´¦å¥—编码
     */
    @Excel(name = "账套编码")
    @Schema(description ="账套编码", type = "String")
    private String orgCode;
    /**
     * åˆ é™¤æ ‡å¿—(0代表存在 1代表删除)
     */
    @Schema(description ="删除标志(0代表存在 1代表删除)", type = "String")
    private String delFlag;
}
aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsGasMaterialUsageMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,75 @@
package com.aps.core.mapper;
import java.util.List;
import com.aps.core.domain.ApsGasMaterialUsage;
import org.apache.ibatis.annotations.Mapper;
/**
 * æ°”柜管路物料用量Mapper接口
 *
 * @author zhl
 * @date 2025-04-25
 */
@Mapper
public interface ApsGasMaterialUsageMapper
{
    /**
     * æŸ¥è¯¢æ°”柜管路物料用量
     *
     * @param id æ°”柜管路物料用量主键
     * @return æ°”柜管路物料用量
     */
    public ApsGasMaterialUsage selectApsGasMaterialUsageById(Long id);
    /**
     * æŸ¥è¯¢æ°”柜管路物料用量列表
     *
     * @param apsGasMaterialUsage æ°”柜管路物料用量
     * @return æ°”柜管路物料用量集合
     */
    public List<ApsGasMaterialUsage> selectApsGasMaterialUsageList(ApsGasMaterialUsage apsGasMaterialUsage);
    /**
     * æ–°å¢žæ°”柜管路物料用量
     *
     * @param apsGasMaterialUsage æ°”柜管路物料用量
     * @return ç»“æžœ
     */
    public int insertApsGasMaterialUsage(ApsGasMaterialUsage apsGasMaterialUsage);
    /**
     * ä¿®æ”¹æ°”柜管路物料用量
     *
     * @param apsGasMaterialUsage æ°”柜管路物料用量
     * @return ç»“æžœ
     */
    public int updateApsGasMaterialUsage(ApsGasMaterialUsage apsGasMaterialUsage);
    /**
     * åˆ é™¤æ°”柜管路物料用量
     *
     * @param id æ°”柜管路物料用量主键
     * @return ç»“æžœ
     */
    public int deleteApsGasMaterialUsageById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤æ°”柜管路物料用量
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
    public int deleteApsGasMaterialUsageByIds(Long[] ids);
    /**
     * æ‰¹é‡åˆ é™¤æ•°æ®
     * */
    int batchDeleteGasMaterialUsage();
    /**
     * æ‰¹é‡æ’入数据
     * */
    int batchInsertGasMaterialUsage(List<ApsGasMaterialUsage> list);
}
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsGasMaterialUsageService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
package com.aps.core.service;
import java.util.List;
import com.aps.core.domain.ApsGasMaterialUsage;
import org.springframework.web.multipart.MultipartFile;
/**
 * æ°”柜管路物料用量Service接口
 *
 * @author zhl
 * @date 2025-04-25
 */
public interface IApsGasMaterialUsageService
{
    /**
     * æŸ¥è¯¢æ°”柜管路物料用量
     *
     * @param id æ°”柜管路物料用量主键
     * @return æ°”柜管路物料用量
     */
    public ApsGasMaterialUsage selectApsGasMaterialUsageById(Long id);
    /**
     * æŸ¥è¯¢æ°”柜管路物料用量列表
     *
     * @param apsGasMaterialUsage æ°”柜管路物料用量
     * @return æ°”柜管路物料用量集合
     */
    public List<ApsGasMaterialUsage> selectApsGasMaterialUsageList(ApsGasMaterialUsage apsGasMaterialUsage);
    /**
     * æ–°å¢žæ°”柜管路物料用量
     *
     * @param apsGasMaterialUsage æ°”柜管路物料用量
     * @return ç»“æžœ
     */
    public int insertApsGasMaterialUsage(ApsGasMaterialUsage apsGasMaterialUsage);
    /**
     * ä¿®æ”¹æ°”柜管路物料用量
     *
     * @param apsGasMaterialUsage æ°”柜管路物料用量
     * @return ç»“æžœ
     */
    public int updateApsGasMaterialUsage(ApsGasMaterialUsage apsGasMaterialUsage);
    /**
     * æ‰¹é‡åˆ é™¤æ°”柜管路物料用量
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ°”柜管路物料用量主键集合
     * @return ç»“æžœ
     */
    public int deleteApsGasMaterialUsageByIds(Long[] ids);
    /**
     * åˆ é™¤æ°”柜管路物料用量信息
     *
     * @param id æ°”柜管路物料用量主键
     * @return ç»“æžœ
     */
    public int deleteApsGasMaterialUsageById(Long id);
    int batchInsertGasMaterialUsage(MultipartFile file);
}
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasMaterialUsageServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,169 @@
package com.aps.core.service.impl;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import com.aps.common.core.utils.DateUtils;
import com.aps.common.core.utils.StringUtils;
import com.aps.common.security.utils.SecurityUtils;
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 com.aps.core.mapper.ApsGasMaterialUsageMapper;
import com.aps.core.domain.ApsGasMaterialUsage;
import com.aps.core.service.IApsGasMaterialUsageService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
/**
 * æ°”柜管路物料用量Service业务层处理
 *
 * @author zhl
 * @date 2025-04-25
 */
@Service
public class ApsGasMaterialUsageServiceImpl implements IApsGasMaterialUsageService
{
    @Autowired
    private ApsGasMaterialUsageMapper apsGasMaterialUsageMapper;
    /**
     * æŸ¥è¯¢æ°”柜管路物料用量
     *
     * @param id æ°”柜管路物料用量主键
     * @return æ°”柜管路物料用量
     */
    @Override
    public ApsGasMaterialUsage selectApsGasMaterialUsageById(Long id)
    {
        return apsGasMaterialUsageMapper.selectApsGasMaterialUsageById(id);
    }
    /**
     * æŸ¥è¯¢æ°”柜管路物料用量列表
     *
     * @param apsGasMaterialUsage æ°”柜管路物料用量
     * @return æ°”柜管路物料用量
     */
    @Override
    public List<ApsGasMaterialUsage> selectApsGasMaterialUsageList(ApsGasMaterialUsage apsGasMaterialUsage)
    {
        return apsGasMaterialUsageMapper.selectApsGasMaterialUsageList(apsGasMaterialUsage);
    }
    /**
     * æ–°å¢žæ°”柜管路物料用量
     *
     * @param apsGasMaterialUsage æ°”柜管路物料用量
     * @return ç»“æžœ
     */
    @Override
    public int insertApsGasMaterialUsage(ApsGasMaterialUsage apsGasMaterialUsage)
    {
        apsGasMaterialUsage.setCreateTime(DateUtils.getNowDate());
        return apsGasMaterialUsageMapper.insertApsGasMaterialUsage(apsGasMaterialUsage);
    }
    /**
     * ä¿®æ”¹æ°”柜管路物料用量
     *
     * @param apsGasMaterialUsage æ°”柜管路物料用量
     * @return ç»“æžœ
     */
    @Override
    public int updateApsGasMaterialUsage(ApsGasMaterialUsage apsGasMaterialUsage)
    {
        return apsGasMaterialUsageMapper.updateApsGasMaterialUsage(apsGasMaterialUsage);
    }
    /**
     * æ‰¹é‡åˆ é™¤æ°”柜管路物料用量
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ°”柜管路物料用量主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteApsGasMaterialUsageByIds(Long[] ids)
    {
        return apsGasMaterialUsageMapper.deleteApsGasMaterialUsageByIds(ids);
    }
    /**
     * åˆ é™¤æ°”柜管路物料用量信息
     *
     * @param id æ°”柜管路物料用量主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteApsGasMaterialUsageById(Long id)
    {
        return apsGasMaterialUsageMapper.deleteApsGasMaterialUsageById(id);
    }
    @Transactional
    @Override
    public int batchInsertGasMaterialUsage(MultipartFile file) {
        ArrayList<ApsGasMaterialUsage> list = new ArrayList<>();
        Workbook workbook = null;
        try {
            workbook = WorkbookFactory.create(file.getInputStream());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        Sheet sheet =workbook.getSheetAt(0);
        int rows = sheet.getLastRowNum();
        if (rows > 0)
        {
            /*从表头中取出工序名称*/
            Hashtable<Integer,String> processTitle=new Hashtable<>();
            Row titleRow = sheet.getRow(0);
            short lastTitleNum = titleRow.getLastCellNum();
            for (int i = 4; i < lastTitleNum; i++) {
                processTitle.put(i,titleRow.getCell(i).getStringCellValue());
            }
            /*数据列从1开始*/
            for (int i =  1; i <= rows; i++)
            {
                Row row = sheet.getRow(i);
                String itemNumber = row.getCell(0).getStringCellValue();
                String drawingNo = row.getCell(1).getStringCellValue();
                String version = row.getCell(2).getStringCellValue();
                for (int j = 4; j < lastTitleNum; j++){
                    String processName = processTitle.get(j);
                    double standardAmount = row.getCell(j).getNumericCellValue();
                    ApsGasMaterialUsage apsGasMaterialUsage = new ApsGasMaterialUsage();
                    apsGasMaterialUsage.setItemNumber(itemNumber);
                    apsGasMaterialUsage.setDrawingNo(drawingNo);
                    apsGasMaterialUsage.setVersion(version);
                    apsGasMaterialUsage.setProcessName(processName);
                    apsGasMaterialUsage.setStandardAmount(BigDecimal.valueOf(standardAmount));
                    apsGasMaterialUsage.setDelFlag("0");
                    apsGasMaterialUsage.setCreateBy(SecurityUtils.getUsername());
                    apsGasMaterialUsage.setCreateTime(DateUtils.getNowDate());
                    list.add(apsGasMaterialUsage);
                }
            }
        }
        int batchSize = 1000;
        int totalInserted = 0;
        apsGasMaterialUsageMapper.batchDeleteGasMaterialUsage();
        for (int i = 0; i < list.size(); i += batchSize) {
            int end = Math.min(i + batchSize, list.size());
            List<ApsGasMaterialUsage> subList = list.subList(i, end);
            // è®¾ç½®åˆ›å»ºæ—¶é—´ ç™»å½•人
            for (ApsGasMaterialUsage item : subList) {
                item.setCreateBy(SecurityUtils.getUsername());
                item.setCreateTime(DateUtils.getNowDate());
            }
            totalInserted += apsGasMaterialUsageMapper.batchInsertGasMaterialUsage(subList);
        }
        return totalInserted;
    }
}
aps-modules/aps-core/src/main/resources/mapper/core/ApsGasMaterialUsageMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,120 @@
<?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.ApsGasMaterialUsageMapper">
    <resultMap type="ApsGasMaterialUsage" id="ApsGasMaterialUsageResult">
        <result property="id"    column="id"    />
        <result property="itemNumber"    column="item_number"    />
        <result property="drawingNo"    column="drawing_no"    />
        <result property="version"    column="version"    />
        <result property="processName"    column="process_name"    />
        <result property="standardAmount"    column="standard_amount"    />
        <result property="orgCode"    column="org_code"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="delFlag"    column="del_flag"    />
    </resultMap>
    <sql id="selectApsGasMaterialUsageVo">
        select id, item_number, drawing_no, version, process_name, standard_amount, org_code, create_by, create_time, del_flag from aps_gas_material_usage
    </sql>
    <select id="selectApsGasMaterialUsageList" parameterType="ApsGasMaterialUsage" resultMap="ApsGasMaterialUsageResult">
        <include refid="selectApsGasMaterialUsageVo"/>
        <where>
            <if test="itemNumber != null  and itemNumber != ''"> and item_number = #{itemNumber}</if>
            <if test="drawingNo != null  and drawingNo != ''"> and drawing_no = #{drawingNo}</if>
            <if test="version != null  and version != ''"> and version = #{version}</if>
            <if test="processName != null  and processName != ''"> and process_name = #{processName}</if>
            <if test="standardAmount != null "> and standard_amount = #{standardAmount}</if>
            <if test="orgCode != null  and orgCode != ''"> and org_code = #{orgCode}</if>
            and del_flag='0'
        </where>
    </select>
    <select id="selectApsGasMaterialUsageById" parameterType="Long" resultMap="ApsGasMaterialUsageResult">
        <include refid="selectApsGasMaterialUsageVo"/>
        where id = #{id}
    </select>
    <insert id="insertApsGasMaterialUsage" parameterType="ApsGasMaterialUsage" useGeneratedKeys="true" keyProperty="id">
        insert into aps_gas_material_usage
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="itemNumber != null">item_number,</if>
            <if test="drawingNo != null">drawing_no,</if>
            <if test="version != null">version,</if>
            <if test="processName != null">process_name,</if>
            <if test="standardAmount != null">standard_amount,</if>
            <if test="orgCode != null">org_code,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="delFlag != null">del_flag,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="itemNumber != null">#{itemNumber},</if>
            <if test="drawingNo != null">#{drawingNo},</if>
            <if test="version != null">#{version},</if>
            <if test="processName != null">#{processName},</if>
            <if test="standardAmount != null">#{standardAmount},</if>
            <if test="orgCode != null">#{orgCode},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="delFlag != null">#{delFlag},</if>
        </trim>
    </insert>
    <update id="updateApsGasMaterialUsage" parameterType="ApsGasMaterialUsage">
        update aps_gas_material_usage
        <trim prefix="SET" suffixOverrides=",">
            <if test="itemNumber != null">item_number = #{itemNumber},</if>
            <if test="drawingNo != null">drawing_no = #{drawingNo},</if>
            <if test="version != null">version = #{version},</if>
            <if test="processName != null">process_name = #{processName},</if>
            <if test="standardAmount != null">standard_amount = #{standardAmount},</if>
            <if test="orgCode != null">org_code = #{orgCode},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteApsGasMaterialUsageById" parameterType="Long">
        delete from aps_gas_material_usage where id = #{id}
    </delete>
    <delete id="deleteApsGasMaterialUsageByIds" parameterType="String">
        delete from aps_gas_material_usage where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    <!-- æ–°å¢žæ‰¹é‡æ’入方法 -->
    <insert id="batchInsertGasMaterialUsage" parameterType="java.util.List">
        insert into aps_gas_material_usage (item_number, drawing_no, version
        , process_name, standard_amount, org_code, del_flag, create_by, create_time)
        values
        <foreach collection="list" item="item" separator=",">
         (
                #{item.itemNumber},
                #{item.drawingNo},
                #{item.version},
                #{item.processName},
                #{item.standardAmount},
                #{item.orgCode},
                #{item.delFlag},
                #{item.createBy},
                #{item.createTime}
        )
        </foreach>
    </insert>
    <delete id="batchDeleteGasMaterialUsage" >
       delete  from aps_gas_material_usage   where del_flag in ('0','1');
    </delete>
</mapper>