第一版

This commit is contained in:
杨晓东 2025-10-11 21:29:50 +08:00
parent 075ece8b71
commit 02075f47cb
14 changed files with 134 additions and 621 deletions

View File

@ -1,104 +0,0 @@
package com.shgx.web.controller.mold;
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.shgx.common.annotation.Log;
import com.shgx.common.core.controller.BaseController;
import com.shgx.common.core.domain.AjaxResult;
import com.shgx.common.enums.BusinessType;
import com.shgx.system.domain.mold.MoldMaintenance;
import com.shgx.system.service.mold.IMoldMaintenanceService;
import com.shgx.common.utils.poi.ExcelUtil;
import com.shgx.common.core.page.TableDataInfo;
/**
* 模具维护保养Controller
*
* @author ruoyi
* @date 2025-09-25
*/
@RestController
@RequestMapping("/mold/maintenance")
public class MoldMaintenanceController extends BaseController
{
@Autowired
private IMoldMaintenanceService moldMaintenanceService;
/**
* 查询模具维护保养列表
*/
@PreAuthorize("@ss.hasPermi('mold:maintenance:list')")
@GetMapping("/list")
public TableDataInfo list(MoldMaintenance moldMaintenance)
{
startPage();
List<MoldMaintenance> list = moldMaintenanceService.selectMoldMaintenanceList(moldMaintenance);
return getDataTable(list);
}
/**
* 导出模具维护保养列表
*/
@PreAuthorize("@ss.hasPermi('mold:maintenance:export')")
@Log(title = "模具维护保养", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MoldMaintenance moldMaintenance)
{
List<MoldMaintenance> list = moldMaintenanceService.selectMoldMaintenanceList(moldMaintenance);
ExcelUtil<MoldMaintenance> util = new ExcelUtil<MoldMaintenance>(MoldMaintenance.class);
util.exportExcel(response, list, "模具维护保养数据");
}
/**
* 获取模具维护保养详细信息
*/
@PreAuthorize("@ss.hasPermi('mold:maintenance:query')")
@GetMapping(value = "/{maintenanceId}")
public AjaxResult getInfo(@PathVariable("maintenanceId") Long maintenanceId)
{
return success(moldMaintenanceService.selectMoldMaintenanceByMaintenanceId(maintenanceId));
}
/**
* 新增模具维护保养
*/
@PreAuthorize("@ss.hasPermi('mold:maintenance:add')")
@Log(title = "模具维护保养", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MoldMaintenance moldMaintenance)
{
return toAjax(moldMaintenanceService.insertMoldMaintenance(moldMaintenance));
}
/**
* 修改模具维护保养
*/
@PreAuthorize("@ss.hasPermi('mold:maintenance:edit')")
@Log(title = "模具维护保养", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MoldMaintenance moldMaintenance)
{
return toAjax(moldMaintenanceService.updateMoldMaintenance(moldMaintenance));
}
/**
* 删除模具维护保养
*/
@PreAuthorize("@ss.hasPermi('mold:maintenance:remove')")
@Log(title = "模具维护保养", businessType = BusinessType.DELETE)
@DeleteMapping("/{maintenanceIds}")
public AjaxResult remove(@PathVariable Long[] maintenanceIds)
{
return toAjax(moldMaintenanceService.deleteMoldMaintenanceByMaintenanceIds(maintenanceIds));
}
}

View File

@ -0,0 +1,31 @@
package com.shgx.web.controller.mold;
import com.shgx.common.core.domain.AjaxResult;
import com.shgx.system.domain.dto.mold.MoldScreenQueryDto;
import com.shgx.system.service.mold.IMoldScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
@RestController
@RequestMapping("/mold/screen")
public class MoldScreenController {
@Autowired
private IMoldScreenService moldScreenService;
/**
* 大屏展示
* @return
*/
@GetMapping("/list")
public List<MoldScreenQueryDto.OutMoldScreenDto> ShowMoldScreen() {
List<MoldScreenQueryDto.OutMoldScreenDto> list = moldScreenService.ShowMoldScreen();
return list;
}
}

View File

@ -108,8 +108,8 @@ public class MoldWarehouseLocationLiveController extends BaseController
/**
* PDA查询库存实况
*/
@GetMapping("/searchMold")
public AjaxResult searchLocationMold(MoldQueryDto.SearchLocationMoldQueryDto query)
@PostMapping("/searchMold")
public AjaxResult searchLocationMold(@RequestBody MoldQueryDto.SearchLocationMoldQueryDto query)
{
List<MoldQueryDto.OutLocationMoldDto> list = moldWarehouseLocationLiveService.searchLocationMold(query);
return AjaxResult.success(list);

View File

@ -0,0 +1,30 @@
package com.shgx.system.domain.dto.mold;
import java.util.List;
// 大屏输入输出对象
public class MoldScreenQueryDto {
public static class OutMoldScreenDto {
// 模架
public String warehouseCode;
// 模具列表
public List<OutMoldScreenChildrenDto> data;
}
public static class OutMoldScreenChildrenDto {
// 模具号
public String moldCode;
// 模具名
public String moldName;
// 模具状态
public Character status;
// 库位
public String positionCode;
}
}

View File

@ -1,178 +0,0 @@
package com.shgx.system.domain.mold;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.shgx.common.annotation.Excel;
import com.shgx.common.core.domain.BaseEntity;
/**
* 模具维护保养对象 mold_maintenance
*
* @author ruoyi
* @date 2025-09-25
*/
public class MoldMaintenance extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 维护记录ID */
private Long maintenanceId;
/** 模具ID */
@Excel(name = "模具ID")
private Long moldId;
/** 维护类型:日常保养/定期维护/故障维修 */
@Excel(name = "维护类型:日常保养/定期维护/故障维修")
private String maintenanceType;
/** 维护时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "维护时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date maintenanceTime;
/** 维护人员 */
@Excel(name = "维护人员")
private String maintenancePerson;
/** 维护内容 */
@Excel(name = "维护内容")
private String maintenanceContent;
/** 更换零件 */
@Excel(name = "更换零件")
private String replacedParts;
/** 维护成本 */
@Excel(name = "维护成本")
private BigDecimal maintenanceCost;
/** 维护结果 */
@Excel(name = "维护结果")
private String maintenanceResult;
/** 下次维护时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "下次维护时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date nextMaintenanceTime;
public void setMaintenanceId(Long maintenanceId)
{
this.maintenanceId = maintenanceId;
}
public Long getMaintenanceId()
{
return maintenanceId;
}
public void setMoldId(Long moldId)
{
this.moldId = moldId;
}
public Long getMoldId()
{
return moldId;
}
public void setMaintenanceType(String maintenanceType)
{
this.maintenanceType = maintenanceType;
}
public String getMaintenanceType()
{
return maintenanceType;
}
public void setMaintenanceTime(Date maintenanceTime)
{
this.maintenanceTime = maintenanceTime;
}
public Date getMaintenanceTime()
{
return maintenanceTime;
}
public void setMaintenancePerson(String maintenancePerson)
{
this.maintenancePerson = maintenancePerson;
}
public String getMaintenancePerson()
{
return maintenancePerson;
}
public void setMaintenanceContent(String maintenanceContent)
{
this.maintenanceContent = maintenanceContent;
}
public String getMaintenanceContent()
{
return maintenanceContent;
}
public void setReplacedParts(String replacedParts)
{
this.replacedParts = replacedParts;
}
public String getReplacedParts()
{
return replacedParts;
}
public void setMaintenanceCost(BigDecimal maintenanceCost)
{
this.maintenanceCost = maintenanceCost;
}
public BigDecimal getMaintenanceCost()
{
return maintenanceCost;
}
public void setMaintenanceResult(String maintenanceResult)
{
this.maintenanceResult = maintenanceResult;
}
public String getMaintenanceResult()
{
return maintenanceResult;
}
public void setNextMaintenanceTime(Date nextMaintenanceTime)
{
this.nextMaintenanceTime = nextMaintenanceTime;
}
public Date getNextMaintenanceTime()
{
return nextMaintenanceTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("maintenanceId", getMaintenanceId())
.append("moldId", getMoldId())
.append("maintenanceType", getMaintenanceType())
.append("maintenanceTime", getMaintenanceTime())
.append("maintenancePerson", getMaintenancePerson())
.append("maintenanceContent", getMaintenanceContent())
.append("replacedParts", getReplacedParts())
.append("maintenanceCost", getMaintenanceCost())
.append("maintenanceResult", getMaintenanceResult())
.append("nextMaintenanceTime", getNextMaintenanceTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -1,61 +0,0 @@
package com.shgx.system.mapper.mold;
import java.util.List;
import com.shgx.system.domain.mold.MoldMaintenance;
/**
* 模具维护保养Mapper接口
*
* @author ruoyi
* @date 2025-09-25
*/
public interface MoldMaintenanceMapper
{
/**
* 查询模具维护保养
*
* @param maintenanceId 模具维护保养主键
* @return 模具维护保养
*/
public MoldMaintenance selectMoldMaintenanceByMaintenanceId(Long maintenanceId);
/**
* 查询模具维护保养列表
*
* @param moldMaintenance 模具维护保养
* @return 模具维护保养集合
*/
public List<MoldMaintenance> selectMoldMaintenanceList(MoldMaintenance moldMaintenance);
/**
* 新增模具维护保养
*
* @param moldMaintenance 模具维护保养
* @return 结果
*/
public int insertMoldMaintenance(MoldMaintenance moldMaintenance);
/**
* 修改模具维护保养
*
* @param moldMaintenance 模具维护保养
* @return 结果
*/
public int updateMoldMaintenance(MoldMaintenance moldMaintenance);
/**
* 删除模具维护保养
*
* @param maintenanceId 模具维护保养主键
* @return 结果
*/
public int deleteMoldMaintenanceByMaintenanceId(Long maintenanceId);
/**
* 批量删除模具维护保养
*
* @param maintenanceIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteMoldMaintenanceByMaintenanceIds(Long[] maintenanceIds);
}

View File

@ -0,0 +1,8 @@
package com.shgx.system.mapper.mold;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shgx.system.domain.dto.mold.MoldScreenQueryDto;
public interface MoldScreenMapper extends BaseMapper<MoldScreenQueryDto.OutMoldScreenDto> {
}

View File

@ -163,7 +163,6 @@ public class MoldInventoryChangeServiceImpl implements IMoldInventoryChangeServi
MoldWarehouseLocation location = locationMapper.selectOne(locationWrapper);
MoldWarehouseLocationLive live = liveMapper.selectOne(liveWrapper);
// 判断集群
if (location == null) {
throw new RuntimeException("【入库失败】不存在该库位,请重新选择库位");
@ -177,9 +176,11 @@ public class MoldInventoryChangeServiceImpl implements IMoldInventoryChangeServi
if (!query.moldCode.equals(moldInfo.getMoldCode())) {
throw new RuntimeException("【入库失败】模具表中未找到对应模具,无法入库");
}
if (live != null) {
if (query.moldCode.equals(live.getMoldCode())) {
throw new RuntimeException("【入库失败】不能重复入库");
}
}
/**
* 模具状态修改
@ -247,7 +248,6 @@ public class MoldInventoryChangeServiceImpl implements IMoldInventoryChangeServi
locationWrapper.eq(MoldWarehouseLocation::getPositionCode, inLocation.getPositionCode());
// 判断集群
if (live == null) {
throw new RuntimeException("【调度失败】库存实况表中未找到对应模具,无法调度");

View File

@ -1,93 +0,0 @@
package com.shgx.system.service.impl.mold;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shgx.system.mapper.mold.MoldMaintenanceMapper;
import com.shgx.system.domain.mold.MoldMaintenance;
import com.shgx.system.service.mold.IMoldMaintenanceService;
/**
* 模具维护保养Service业务层处理
*
* @author ruoyi
* @date 2025-09-25
*/
@Service
public class MoldMaintenanceServiceImpl implements IMoldMaintenanceService
{
@Autowired
private MoldMaintenanceMapper moldMaintenanceMapper;
/**
* 查询模具维护保养
*
* @param maintenanceId 模具维护保养主键
* @return 模具维护保养
*/
@Override
public MoldMaintenance selectMoldMaintenanceByMaintenanceId(Long maintenanceId)
{
return moldMaintenanceMapper.selectMoldMaintenanceByMaintenanceId(maintenanceId);
}
/**
* 查询模具维护保养列表
*
* @param moldMaintenance 模具维护保养
* @return 模具维护保养
*/
@Override
public List<MoldMaintenance> selectMoldMaintenanceList(MoldMaintenance moldMaintenance)
{
return moldMaintenanceMapper.selectMoldMaintenanceList(moldMaintenance);
}
/**
* 新增模具维护保养
*
* @param moldMaintenance 模具维护保养
* @return 结果
*/
@Override
public int insertMoldMaintenance(MoldMaintenance moldMaintenance)
{
return moldMaintenanceMapper.insertMoldMaintenance(moldMaintenance);
}
/**
* 修改模具维护保养
*
* @param moldMaintenance 模具维护保养
* @return 结果
*/
@Override
public int updateMoldMaintenance(MoldMaintenance moldMaintenance)
{
return moldMaintenanceMapper.updateMoldMaintenance(moldMaintenance);
}
/**
* 批量删除模具维护保养
*
* @param maintenanceIds 需要删除的模具维护保养主键
* @return 结果
*/
@Override
public int deleteMoldMaintenanceByMaintenanceIds(Long[] maintenanceIds)
{
return moldMaintenanceMapper.deleteMoldMaintenanceByMaintenanceIds(maintenanceIds);
}
/**
* 删除模具维护保养信息
*
* @param maintenanceId 模具维护保养主键
* @return 结果
*/
@Override
public int deleteMoldMaintenanceByMaintenanceId(Long maintenanceId)
{
return moldMaintenanceMapper.deleteMoldMaintenanceByMaintenanceId(maintenanceId);
}
}

View File

@ -0,0 +1,38 @@
package com.shgx.system.service.impl.mold;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shgx.system.domain.dto.mold.MoldScreenQueryDto;
import com.shgx.system.domain.mold.MoldWarehouseLocation;
import com.shgx.system.mapper.mold.MoldScreenMapper;
import com.shgx.system.mapper.mold.MoldWarehouseLocationLiveMapper;
import com.shgx.system.mapper.mold.MoldWarehouseLocationMapper;
import com.shgx.system.service.mold.IMoldScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
@Service
public class MoldScreenServiceImpl implements IMoldScreenService {
@Autowired
private MoldWarehouseLocationMapper locationMapper;
@Autowired
private MoldWarehouseLocationLiveMapper liveMapper;
@Autowired
private MoldScreenMapper moldScreenMapper;
/**
* 大屏展示
* @return
*/
@Override
public List<MoldScreenQueryDto.OutMoldScreenDto> ShowMoldScreen() {
return Collections.emptyList();
}
}

View File

@ -106,26 +106,16 @@ public class MoldWarehouseLocationLiveServiceImpl implements IMoldWarehouseLocat
@Override
public List<MoldQueryDto.OutLocationMoldDto> searchLocationMold(MoldQueryDto.SearchLocationMoldQueryDto query) {
if (query.equals(null)) {
if (query == null) {
throw new RuntimeException("请扫码或手动输入");
}
LambdaQueryWrapper<MoldWarehouseLocationLive> liveWrapper = new LambdaQueryWrapper<>();
if (query.positionCode.equals(null)) {
liveWrapper.eq(MoldWarehouseLocationLive::getMoldCode, query.moldCode);
MoldWarehouseLocationLive locationLive = moldWarehouseLocationLiveMapper.selectOne(liveWrapper);
MoldQueryDto.OutLocationMoldDto outLocationMoldDto = new MoldQueryDto.OutLocationMoldDto();
outLocationMoldDto.moldCode = locationLive.getMoldCode();
outLocationMoldDto.moldName = locationLive.getMoldName();
outLocationMoldDto.positionCode = locationLive.getPositionCode();
outLocationMoldDto.status = locationLive.getStatus();
List<MoldQueryDto.OutLocationMoldDto> list = new ArrayList<>();
list.add(outLocationMoldDto);
return list;
LambdaQueryWrapper<MoldWarehouseLocationLive> queryWrapper = new LambdaQueryWrapper<>();
if (query.moldCode == null || query.moldCode == "") {
queryWrapper.eq(MoldWarehouseLocationLive::getPositionCode, query.positionCode);
} else {
liveWrapper.eq(MoldWarehouseLocationLive::getPositionCode, query.positionCode);
List<MoldWarehouseLocationLive> list = moldWarehouseLocationLiveMapper.selectList(liveWrapper);
queryWrapper.eq(MoldWarehouseLocationLive::getMoldCode, query.moldCode);
}
List<MoldWarehouseLocationLive> list = moldWarehouseLocationLiveMapper.selectList(queryWrapper);
List<MoldQueryDto.OutLocationMoldDto> result = new ArrayList<>();
MoldQueryDto.OutLocationMoldDto outLocationMoldDto = new MoldQueryDto.OutLocationMoldDto();
for (MoldWarehouseLocationLive item : list) {
@ -138,6 +128,5 @@ public class MoldWarehouseLocationLiveServiceImpl implements IMoldWarehouseLocat
return result;
}
}
}

View File

@ -1,61 +0,0 @@
package com.shgx.system.service.mold;
import java.util.List;
import com.shgx.system.domain.mold.MoldMaintenance;
/**
* 模具维护保养Service接口
*
* @author ruoyi
* @date 2025-09-25
*/
public interface IMoldMaintenanceService
{
/**
* 查询模具维护保养
*
* @param maintenanceId 模具维护保养主键
* @return 模具维护保养
*/
public MoldMaintenance selectMoldMaintenanceByMaintenanceId(Long maintenanceId);
/**
* 查询模具维护保养列表
*
* @param moldMaintenance 模具维护保养
* @return 模具维护保养集合
*/
public List<MoldMaintenance> selectMoldMaintenanceList(MoldMaintenance moldMaintenance);
/**
* 新增模具维护保养
*
* @param moldMaintenance 模具维护保养
* @return 结果
*/
public int insertMoldMaintenance(MoldMaintenance moldMaintenance);
/**
* 修改模具维护保养
*
* @param moldMaintenance 模具维护保养
* @return 结果
*/
public int updateMoldMaintenance(MoldMaintenance moldMaintenance);
/**
* 批量删除模具维护保养
*
* @param maintenanceIds 需要删除的模具维护保养主键集合
* @return 结果
*/
public int deleteMoldMaintenanceByMaintenanceIds(Long[] maintenanceIds);
/**
* 删除模具维护保养信息
*
* @param maintenanceId 模具维护保养主键
* @return 结果
*/
public int deleteMoldMaintenanceByMaintenanceId(Long maintenanceId);
}

View File

@ -0,0 +1,14 @@
package com.shgx.system.service.mold;
import com.shgx.system.domain.dto.mold.MoldScreenQueryDto;
import java.util.List;
public interface IMoldScreenService {
/**
* 大屏展示
* @return
*/
public List<MoldScreenQueryDto.OutMoldScreenDto> ShowMoldScreen();
}

View File

@ -1,100 +0,0 @@
<?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.shgx.system.mapper.mold.MoldMaintenanceMapper">
<resultMap type="MoldMaintenance" id="MoldMaintenanceResult">
<result property="maintenanceId" column="maintenance_id" />
<result property="moldId" column="mold_id" />
<result property="maintenanceType" column="maintenance_type" />
<result property="maintenanceTime" column="maintenance_time" />
<result property="maintenancePerson" column="maintenance_person" />
<result property="maintenanceContent" column="maintenance_content" />
<result property="replacedParts" column="replaced_parts" />
<result property="maintenanceCost" column="maintenance_cost" />
<result property="maintenanceResult" column="maintenance_result" />
<result property="nextMaintenanceTime" column="next_maintenance_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectMoldMaintenanceVo">
select maintenance_id, mold_id, maintenance_type, maintenance_time, maintenance_person, maintenance_content, replaced_parts, maintenance_cost, maintenance_result, next_maintenance_time, remark from mold_maintenance
</sql>
<select id="selectMoldMaintenanceList" parameterType="MoldMaintenance" resultMap="MoldMaintenanceResult">
<include refid="selectMoldMaintenanceVo"/>
<where>
<if test="moldId != null "> and mold_id = #{moldId}</if>
<if test="maintenanceType != null and maintenanceType != ''"> and maintenance_type = #{maintenanceType}</if>
<if test="maintenanceTime != null "> and maintenance_time = #{maintenanceTime}</if>
<if test="maintenancePerson != null and maintenancePerson != ''"> and maintenance_person = #{maintenancePerson}</if>
<if test="maintenanceContent != null and maintenanceContent != ''"> and maintenance_content = #{maintenanceContent}</if>
<if test="replacedParts != null and replacedParts != ''"> and replaced_parts = #{replacedParts}</if>
<if test="maintenanceCost != null "> and maintenance_cost = #{maintenanceCost}</if>
<if test="maintenanceResult != null and maintenanceResult != ''"> and maintenance_result = #{maintenanceResult}</if>
<if test="nextMaintenanceTime != null "> and next_maintenance_time = #{nextMaintenanceTime}</if>
</where>
</select>
<select id="selectMoldMaintenanceByMaintenanceId" parameterType="Long" resultMap="MoldMaintenanceResult">
<include refid="selectMoldMaintenanceVo"/>
where maintenance_id = #{maintenanceId}
</select>
<insert id="insertMoldMaintenance" parameterType="MoldMaintenance" useGeneratedKeys="true" keyProperty="maintenanceId">
insert into mold_maintenance
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="moldId != null">mold_id,</if>
<if test="maintenanceType != null">maintenance_type,</if>
<if test="maintenanceTime != null">maintenance_time,</if>
<if test="maintenancePerson != null">maintenance_person,</if>
<if test="maintenanceContent != null">maintenance_content,</if>
<if test="replacedParts != null">replaced_parts,</if>
<if test="maintenanceCost != null">maintenance_cost,</if>
<if test="maintenanceResult != null">maintenance_result,</if>
<if test="nextMaintenanceTime != null">next_maintenance_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="moldId != null">#{moldId},</if>
<if test="maintenanceType != null">#{maintenanceType},</if>
<if test="maintenanceTime != null">#{maintenanceTime},</if>
<if test="maintenancePerson != null">#{maintenancePerson},</if>
<if test="maintenanceContent != null">#{maintenanceContent},</if>
<if test="replacedParts != null">#{replacedParts},</if>
<if test="maintenanceCost != null">#{maintenanceCost},</if>
<if test="maintenanceResult != null">#{maintenanceResult},</if>
<if test="nextMaintenanceTime != null">#{nextMaintenanceTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateMoldMaintenance" parameterType="MoldMaintenance">
update mold_maintenance
<trim prefix="SET" suffixOverrides=",">
<if test="moldId != null">mold_id = #{moldId},</if>
<if test="maintenanceType != null">maintenance_type = #{maintenanceType},</if>
<if test="maintenanceTime != null">maintenance_time = #{maintenanceTime},</if>
<if test="maintenancePerson != null">maintenance_person = #{maintenancePerson},</if>
<if test="maintenanceContent != null">maintenance_content = #{maintenanceContent},</if>
<if test="replacedParts != null">replaced_parts = #{replacedParts},</if>
<if test="maintenanceCost != null">maintenance_cost = #{maintenanceCost},</if>
<if test="maintenanceResult != null">maintenance_result = #{maintenanceResult},</if>
<if test="nextMaintenanceTime != null">next_maintenance_time = #{nextMaintenanceTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where maintenance_id = #{maintenanceId}
</update>
<delete id="deleteMoldMaintenanceByMaintenanceId" parameterType="Long">
delete from mold_maintenance where maintenance_id = #{maintenanceId}
</delete>
<delete id="deleteMoldMaintenanceByMaintenanceIds" parameterType="String">
delete from mold_maintenance where maintenance_id in
<foreach item="maintenanceId" collection="array" open="(" separator="," close=")">
#{maintenanceId}
</foreach>
</delete>
</mapper>