feat(ems): 添加备件库存预警功能并优化相关业务逻辑

- 在 SparePartsInventory 模型中添加库存阈值字段
- 实现库存预警相关的前端展示和提示功能
- 优化日常故障记录中的处置时长计算逻辑
- 在备件盘点记录中添加创建时间字段
- 实现备件库存数量的自动更新机制
boardTest
zch 3 weeks ago
parent d241909609
commit 034b5cc981

@ -85,7 +85,7 @@ public class SparePartsInventoryController extends BaseController
int colIndex = 0; int colIndex = 0;
// 基础列 // 基础列
String[] baseHeaders = {"主键", "入库时间", "采购方式", "库存位置", "物品名称", "原厂编号", "型号", "入库数量", "剩余数量", "备注"}; String[] baseHeaders = {"主键", "入库时间", "采购方式", "库存位置", "物品名称", "原厂编号", "型号", "入库数量", "剩余数量", "库存阈值", "备注"};
for (String header : baseHeaders) { for (String header : baseHeaders) {
headerRow.createCell(colIndex++).setCellValue(header); headerRow.createCell(colIndex++).setCellValue(header);
} }
@ -122,6 +122,8 @@ public class SparePartsInventoryController extends BaseController
colIndex++; colIndex++;
if (vo.getRemainingQuantity() != null) row.createCell(colIndex).setCellValue(vo.getRemainingQuantity()); if (vo.getRemainingQuantity() != null) row.createCell(colIndex).setCellValue(vo.getRemainingQuantity());
colIndex++; colIndex++;
if (vo.getThreshold() != null) row.createCell(colIndex).setCellValue(vo.getThreshold());
colIndex++;
if (vo.getRemarks() != null) row.createCell(colIndex).setCellValue(vo.getRemarks()); if (vo.getRemarks() != null) row.createCell(colIndex).setCellValue(vo.getRemarks());
colIndex++; colIndex++;
@ -329,6 +331,11 @@ public class SparePartsInventoryController extends BaseController
vo.setRemainingQuantity((long) cell.getNumericCellValue()); vo.setRemainingQuantity((long) cell.getNumericCellValue());
} }
break; break;
case "库存阈值":
if (cell.getCellType() == CellType.NUMERIC) {
vo.setThreshold((long) cell.getNumericCellValue());
}
break;
case "备注": case "备注":
vo.setRemarks(getCellStringValue(cell)); vo.setRemarks(getCellStringValue(cell));
break; break;

@ -50,6 +50,10 @@ public class SparePartsInventory extends BaseEntity
@Excel(name = "剩余数量", cellType = Excel.ColumnType.NUMERIC) @Excel(name = "剩余数量", cellType = Excel.ColumnType.NUMERIC)
private Long remainingQuantity; private Long remainingQuantity;
/** 库存阈值 */
@Excel(name = "库存阈值", cellType = Excel.ColumnType.NUMERIC)
private Long threshold;
/** 备注 */ /** 备注 */
@Excel(name = "备注", cellType = Excel.ColumnType.STRING) @Excel(name = "备注", cellType = Excel.ColumnType.STRING)
private String remarks; private String remarks;
@ -135,6 +139,15 @@ public class SparePartsInventory extends BaseEntity
{ {
return remainingQuantity; return remainingQuantity;
} }
public void setThreshold(Long threshold)
{
this.threshold = threshold;
}
public Long getThreshold()
{
return threshold;
}
public void setRemarks(String remarks) public void setRemarks(String remarks)
{ {
this.remarks = remarks; this.remarks = remarks;
@ -157,6 +170,7 @@ public class SparePartsInventory extends BaseEntity
.append("model", getModel()) .append("model", getModel())
.append("warehouseQuantity", getWarehouseQuantity()) .append("warehouseQuantity", getWarehouseQuantity())
.append("remainingQuantity", getRemainingQuantity()) .append("remainingQuantity", getRemainingQuantity())
.append("threshold", getThreshold())
.append("remarks", getRemarks()) .append("remarks", getRemarks())
.toString(); .toString();
} }

@ -1,9 +1,11 @@
package com.os.ems.info.domain; package com.os.ems.info.domain;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.os.common.annotation.Excel; import com.os.common.annotation.Excel;
import com.os.common.core.domain.BaseEntity; import com.os.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
/** /**
* spare_parts_inventory_check * spare_parts_inventory_check
@ -33,6 +35,10 @@ public class SparePartsInventoryCheck extends BaseEntity
@Excel(name = "盘点日期", cellType = Excel.ColumnType.STRING) @Excel(name = "盘点日期", cellType = Excel.ColumnType.STRING)
private String checkDate; private String checkDate;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createdAt;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -79,6 +85,16 @@ public class SparePartsInventoryCheck extends BaseEntity
return checkDate; return checkDate;
} }
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -87,6 +103,7 @@ public class SparePartsInventoryCheck extends BaseEntity
.append("checkName", getCheckName()) .append("checkName", getCheckName())
.append("checkQuantity", getCheckQuantity()) .append("checkQuantity", getCheckQuantity())
.append("checkDate", getCheckDate()) .append("checkDate", getCheckDate())
.append("createdAt", getCreatedAt())
.toString(); .toString();
} }
} }

@ -52,6 +52,10 @@ public class SparePartsInventoryExportVO
@Excel(name = "剩余数量", cellType = Excel.ColumnType.NUMERIC) @Excel(name = "剩余数量", cellType = Excel.ColumnType.NUMERIC)
private Long remainingQuantity; private Long remainingQuantity;
/** 库存阈值 */
// @Excel(name = "库存阈值", cellType = Excel.ColumnType.NUMERIC)
private Long threshold;
/** 备注 */ /** 备注 */
@Excel(name = "备注", cellType = Excel.ColumnType.STRING) @Excel(name = "备注", cellType = Excel.ColumnType.STRING)
private String remarks; private String remarks;
@ -87,6 +91,9 @@ public class SparePartsInventoryExportVO
public Long getRemainingQuantity() { return remainingQuantity; } public Long getRemainingQuantity() { return remainingQuantity; }
public void setRemainingQuantity(Long remainingQuantity) { this.remainingQuantity = remainingQuantity; } public void setRemainingQuantity(Long remainingQuantity) { this.remainingQuantity = remainingQuantity; }
public Long getThreshold() { return threshold; }
public void setThreshold(Long threshold) { this.threshold = threshold; }
public String getRemarks() { return remarks; } public String getRemarks() { return remarks; }
public void setRemarks(String remarks) { this.remarks = remarks; } public void setRemarks(String remarks) { this.remarks = remarks; }
@ -115,6 +122,7 @@ public class SparePartsInventoryExportVO
.append("model", getModel()) .append("model", getModel())
.append("warehouseQuantity", getWarehouseQuantity()) .append("warehouseQuantity", getWarehouseQuantity())
.append("remainingQuantity", getRemainingQuantity()) .append("remainingQuantity", getRemainingQuantity())
.append("threshold", getThreshold())
.append("remarks", getRemarks()) .append("remarks", getRemarks())
.append("checkData", getCheckData()) .append("checkData", getCheckData())
.toString(); .toString();

@ -65,4 +65,12 @@ public interface SparePartsInventoryCheckMapper
* @return * @return
*/ */
public List<String> selectDistinctCheckNames(); public List<String> selectDistinctCheckNames();
/**
*
*
* @param inventoryObjid ID
* @return
*/
public SparePartsInventoryCheck selectLatestCheckByInventoryObjid(Long inventoryObjid);
} }

@ -1,13 +1,18 @@
package com.os.ems.info.service.impl; package com.os.ems.info.service.impl;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.HashSet;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.os.common.exception.ServiceException; import com.os.common.exception.ServiceException;
import com.os.common.utils.StringUtils; import com.os.common.utils.StringUtils;
import com.os.ems.info.mapper.SparePartsInventoryCheckMapper; import com.os.ems.info.mapper.SparePartsInventoryCheckMapper;
import com.os.ems.info.domain.SparePartsInventoryCheck; import com.os.ems.info.domain.SparePartsInventoryCheck;
import com.os.ems.info.service.ISparePartsInventoryCheckService; import com.os.ems.info.service.ISparePartsInventoryCheckService;
import com.os.ems.info.util.InventoryQuantityUpdater;
import com.os.common.utils.DateUtils;
/** /**
* Service * Service
@ -21,6 +26,9 @@ public class SparePartsInventoryCheckServiceImpl implements ISparePartsInventory
@Autowired @Autowired
private SparePartsInventoryCheckMapper sparePartsInventoryCheckMapper; private SparePartsInventoryCheckMapper sparePartsInventoryCheckMapper;
@Autowired
private InventoryQuantityUpdater inventoryQuantityUpdater;
/** /**
* *
* *
@ -52,9 +60,22 @@ public class SparePartsInventoryCheckServiceImpl implements ISparePartsInventory
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public int insertSparePartsInventoryCheck(SparePartsInventoryCheck sparePartsInventoryCheck) public int insertSparePartsInventoryCheck(SparePartsInventoryCheck sparePartsInventoryCheck)
{ {
return sparePartsInventoryCheckMapper.insertSparePartsInventoryCheck(sparePartsInventoryCheck); // 验证必要参数
if (sparePartsInventoryCheck.getInventoryObjid() == null) {
throw new ServiceException("库存记录ID不能为空");
}
int result = sparePartsInventoryCheckMapper.insertSparePartsInventoryCheck(sparePartsInventoryCheck);
// 如果插入成功,更新主表的剩余数量
if (result > 0) {
inventoryQuantityUpdater.updateRemainingQuantityByLatestCheck(sparePartsInventoryCheck.getInventoryObjid());
}
return result;
} }
/** /**
@ -64,9 +85,17 @@ public class SparePartsInventoryCheckServiceImpl implements ISparePartsInventory
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public int updateSparePartsInventoryCheck(SparePartsInventoryCheck sparePartsInventoryCheck) public int updateSparePartsInventoryCheck(SparePartsInventoryCheck sparePartsInventoryCheck)
{ {
return sparePartsInventoryCheckMapper.updateSparePartsInventoryCheck(sparePartsInventoryCheck); int result = sparePartsInventoryCheckMapper.updateSparePartsInventoryCheck(sparePartsInventoryCheck);
// 如果更新成功,同步更新主表的剩余数量
if (result > 0 && sparePartsInventoryCheck.getInventoryObjid() != null) {
inventoryQuantityUpdater.updateRemainingQuantityByLatestCheck(sparePartsInventoryCheck.getInventoryObjid());
}
return result;
} }
/** /**
@ -76,9 +105,31 @@ public class SparePartsInventoryCheckServiceImpl implements ISparePartsInventory
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public int deleteSparePartsInventoryCheckByIds(Long[] ids) public int deleteSparePartsInventoryCheckByIds(Long[] ids)
{ {
return sparePartsInventoryCheckMapper.deleteSparePartsInventoryCheckByIds(ids); if (ids == null || ids.length == 0) {
return 0;
}
// 先查询要删除的记录收集相关的库存ID
Set<Long> inventoryObjids = new HashSet<>();
for (Long id : ids) {
SparePartsInventoryCheck check = sparePartsInventoryCheckMapper.selectSparePartsInventoryCheckById(id);
if (check != null && check.getInventoryObjid() != null) {
inventoryObjids.add(check.getInventoryObjid());
}
}
int result = sparePartsInventoryCheckMapper.deleteSparePartsInventoryCheckByIds(ids);
// 如果删除成功,批量更新相关库存记录的剩余数量
if (result > 0 && !inventoryObjids.isEmpty()) {
Long[] objidArray = inventoryObjids.toArray(new Long[0]);
inventoryQuantityUpdater.batchUpdateRemainingQuantity(objidArray);
}
return result;
} }
/** /**
@ -88,9 +139,20 @@ public class SparePartsInventoryCheckServiceImpl implements ISparePartsInventory
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public int deleteSparePartsInventoryCheckById(Long id) public int deleteSparePartsInventoryCheckById(Long id)
{ {
return sparePartsInventoryCheckMapper.deleteSparePartsInventoryCheckById(id); // 先查询要删除的记录获取库存ID
SparePartsInventoryCheck checkToDelete = sparePartsInventoryCheckMapper.selectSparePartsInventoryCheckById(id);
int result = sparePartsInventoryCheckMapper.deleteSparePartsInventoryCheckById(id);
// 如果删除成功,同步更新主表的剩余数量
if (result > 0 && checkToDelete != null && checkToDelete.getInventoryObjid() != null) {
inventoryQuantityUpdater.updateRemainingQuantityByLatestCheck(checkToDelete.getInventoryObjid());
}
return result;
} }
/** /**

@ -8,6 +8,7 @@ import java.util.HashMap;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.os.common.exception.ServiceException; import com.os.common.exception.ServiceException;
import com.os.common.utils.StringUtils; import com.os.common.utils.StringUtils;
import com.os.ems.info.mapper.SparePartsInventoryMapper; import com.os.ems.info.mapper.SparePartsInventoryMapper;
@ -16,6 +17,7 @@ import com.os.ems.info.domain.SparePartsInventory;
import com.os.ems.info.domain.SparePartsInventoryCheck; import com.os.ems.info.domain.SparePartsInventoryCheck;
import com.os.ems.info.domain.SparePartsInventoryExportVO; import com.os.ems.info.domain.SparePartsInventoryExportVO;
import com.os.ems.info.service.ISparePartsInventoryService; import com.os.ems.info.service.ISparePartsInventoryService;
import com.os.ems.info.util.InventoryQuantityUpdater;
import com.os.common.utils.DateUtils; import com.os.common.utils.DateUtils;
/** /**
@ -33,6 +35,9 @@ public class SparePartsInventoryServiceImpl implements ISparePartsInventoryServi
@Autowired @Autowired
private SparePartsInventoryCheckMapper sparePartsInventoryCheckMapper; private SparePartsInventoryCheckMapper sparePartsInventoryCheckMapper;
@Autowired
private InventoryQuantityUpdater inventoryQuantityUpdater;
/** /**
* *
* *
@ -262,15 +267,13 @@ public class SparePartsInventoryServiceImpl implements ISparePartsInventoryServi
check.setInventoryObjid(objid); check.setInventoryObjid(objid);
check.setCheckName(entry.getKey()); check.setCheckName(entry.getKey());
check.setCheckQuantity(entry.getValue()); check.setCheckQuantity(entry.getValue());
check.setCheckDate(DateUtils.getNowDate().toString()); check.setCheckDate(DateUtils.dateTimeNow());
sparePartsInventoryCheckMapper.insertSparePartsInventoryCheck(check); sparePartsInventoryCheckMapper.insertSparePartsInventoryCheck(check);
// 更新主表的剩余数量为最新盘点数量
main.setObjid(objid);
main.setRemainingQuantity(entry.getValue());
sparePartsInventoryMapper.updateSparePartsInventory(main);
} }
} }
// 盘点记录插入后,更新主表的剩余数量为最新盘点数量
inventoryQuantityUpdater.updateRemainingQuantityByLatestCheck(objid);
} }
successNum++; successNum++;
@ -382,6 +385,7 @@ public class SparePartsInventoryServiceImpl implements ISparePartsInventoryServi
* @return * @return
*/ */
@Override @Override
@Transactional
public int insertSparePartsInventoryWithDynamicColumns(SparePartsInventoryExportVO sparePartsInventoryVO) public int insertSparePartsInventoryWithDynamicColumns(SparePartsInventoryExportVO sparePartsInventoryVO)
{ {
// 创建主记录 // 创建主记录
@ -400,10 +404,13 @@ public class SparePartsInventoryServiceImpl implements ISparePartsInventoryServi
check.setInventoryObjid(objid); check.setInventoryObjid(objid);
check.setCheckName(entry.getKey()); check.setCheckName(entry.getKey());
check.setCheckQuantity(entry.getValue()); check.setCheckQuantity(entry.getValue());
check.setCheckDate(DateUtils.getNowDate().toString()); check.setCheckDate(DateUtils.dateTimeNow());
sparePartsInventoryCheckMapper.insertSparePartsInventoryCheck(check); sparePartsInventoryCheckMapper.insertSparePartsInventoryCheck(check);
} }
} }
// 在盘点记录插入后,更新主表的剩余数量为最新盘点数量
inventoryQuantityUpdater.updateRemainingQuantityByLatestCheck(objid);
} }
return result; return result;
@ -416,6 +423,7 @@ public class SparePartsInventoryServiceImpl implements ISparePartsInventoryServi
* @return * @return
*/ */
@Override @Override
@Transactional
public int updateSparePartsInventoryWithDynamicColumns(SparePartsInventoryExportVO sparePartsInventoryVO) public int updateSparePartsInventoryWithDynamicColumns(SparePartsInventoryExportVO sparePartsInventoryVO)
{ {
// 更新主记录 // 更新主记录
@ -443,11 +451,14 @@ public class SparePartsInventoryServiceImpl implements ISparePartsInventoryServi
check.setInventoryObjid(objid); check.setInventoryObjid(objid);
check.setCheckName(entry.getKey()); check.setCheckName(entry.getKey());
check.setCheckQuantity(entry.getValue()); check.setCheckQuantity(entry.getValue());
check.setCheckDate(DateUtils.getNowDate().toString()); check.setCheckDate(DateUtils.dateTimeNow());
sparePartsInventoryCheckMapper.insertSparePartsInventoryCheck(check); sparePartsInventoryCheckMapper.insertSparePartsInventoryCheck(check);
} }
} }
} }
// 在盘点记录更新后,同步更新主表的剩余数量为最新盘点数量
inventoryQuantityUpdater.updateRemainingQuantityByLatestCheck(objid);
} }
return result; return result;

@ -10,10 +10,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="checkName" column="check_name" /> <result property="checkName" column="check_name" />
<result property="checkQuantity" column="check_quantity" /> <result property="checkQuantity" column="check_quantity" />
<result property="checkDate" column="check_date" /> <result property="checkDate" column="check_date" />
<result property="createdAt" column="created_at" />
</resultMap> </resultMap>
<sql id="selectSparePartsInventoryCheckVo"> <sql id="selectSparePartsInventoryCheckVo">
select id, inventory_objid, check_name, check_quantity, check_date from spare_parts_inventory_check select id, inventory_objid, check_name, check_quantity, check_date, created_at from spare_parts_inventory_check
</sql> </sql>
<select id="selectSparePartsInventoryCheckList" parameterType="SparePartsInventoryCheck" resultMap="SparePartsInventoryCheckResult"> <select id="selectSparePartsInventoryCheckList" parameterType="SparePartsInventoryCheck" resultMap="SparePartsInventoryCheckResult">
@ -38,12 +39,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="checkName != null">check_name,</if> <if test="checkName != null">check_name,</if>
<if test="checkQuantity != null">check_quantity,</if> <if test="checkQuantity != null">check_quantity,</if>
<if test="checkDate != null">check_date,</if> <if test="checkDate != null">check_date,</if>
created_at,
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="inventoryObjid != null">#{inventoryObjid},</if> <if test="inventoryObjid != null">#{inventoryObjid},</if>
<if test="checkName != null">#{checkName},</if> <if test="checkName != null">#{checkName},</if>
<if test="checkQuantity != null">#{checkQuantity},</if> <if test="checkQuantity != null">#{checkQuantity},</if>
<if test="checkDate != null">#{checkDate},</if> <if test="checkDate != null">#{checkDate},</if>
NOW(),
</trim> </trim>
</insert> </insert>
@ -54,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="checkName != null">check_name = #{checkName},</if> <if test="checkName != null">check_name = #{checkName},</if>
<if test="checkQuantity != null">check_quantity = #{checkQuantity},</if> <if test="checkQuantity != null">check_quantity = #{checkQuantity},</if>
<if test="checkDate != null">check_date = #{checkDate},</if> <if test="checkDate != null">check_date = #{checkDate},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
@ -74,4 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where check_name is not null and check_name != '' where check_name is not null and check_name != ''
order by check_name order by check_name
</select> </select>
<!-- 查询指定库存记录的最新盘点记录 -->
<select id="selectLatestCheckByInventoryObjid" parameterType="Long" resultMap="SparePartsInventoryCheckResult">
<include refid="selectSparePartsInventoryCheckVo"/>
where inventory_objid = #{inventoryObjid}
order by created_at desc, id desc
limit 1
</select>
</mapper> </mapper>

@ -14,11 +14,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="model" column="model" /> <result property="model" column="model" />
<result property="warehouseQuantity" column="warehouse_quantity" /> <result property="warehouseQuantity" column="warehouse_quantity" />
<result property="remainingQuantity" column="remaining_quantity" /> <result property="remainingQuantity" column="remaining_quantity" />
<result property="threshold" column="threshold" />
<result property="remarks" column="remarks" /> <result property="remarks" column="remarks" />
</resultMap> </resultMap>
<sql id="selectSparePartsInventoryVo"> <sql id="selectSparePartsInventoryVo">
select objid, warehouse_date, purchase_method, storage_location, item_name, original_part_number, model, warehouse_quantity, remaining_quantity, remarks from spare_parts_inventory select objid, warehouse_date, purchase_method, storage_location, item_name, original_part_number, model, warehouse_quantity, remaining_quantity, threshold, remarks from spare_parts_inventory
</sql> </sql>
<select id="selectSparePartsInventoryList" parameterType="SparePartsInventory" resultMap="SparePartsInventoryResult"> <select id="selectSparePartsInventoryList" parameterType="SparePartsInventory" resultMap="SparePartsInventoryResult">
@ -52,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="model != null">model,</if> <if test="model != null">model,</if>
<if test="warehouseQuantity != null">warehouse_quantity,</if> <if test="warehouseQuantity != null">warehouse_quantity,</if>
<if test="remainingQuantity != null">remaining_quantity,</if> <if test="remainingQuantity != null">remaining_quantity,</if>
<if test="threshold != null">threshold,</if>
<if test="remarks != null">remarks,</if> <if test="remarks != null">remarks,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@ -63,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="model != null">#{model},</if> <if test="model != null">#{model},</if>
<if test="warehouseQuantity != null">#{warehouseQuantity},</if> <if test="warehouseQuantity != null">#{warehouseQuantity},</if>
<if test="remainingQuantity != null">#{remainingQuantity},</if> <if test="remainingQuantity != null">#{remainingQuantity},</if>
<if test="threshold != null">#{threshold},</if>
<if test="remarks != null">#{remarks},</if> <if test="remarks != null">#{remarks},</if>
</trim> </trim>
</insert> </insert>
@ -78,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="model != null">model = #{model},</if> <if test="model != null">model = #{model},</if>
<if test="warehouseQuantity != null">warehouse_quantity = #{warehouseQuantity},</if> <if test="warehouseQuantity != null">warehouse_quantity = #{warehouseQuantity},</if>
<if test="remainingQuantity != null">remaining_quantity = #{remainingQuantity},</if> <if test="remainingQuantity != null">remaining_quantity = #{remainingQuantity},</if>
<if test="threshold != null">threshold = #{threshold},</if>
<if test="remarks != null">remarks = #{remarks},</if> <if test="remarks != null">remarks = #{remarks},</if>
</trim> </trim>
where objid = #{objid} where objid = #{objid}

Loading…
Cancel
Save