From 297dc2c3c08f691f6c5a804861af353c1d6f3b5a Mon Sep 17 00:00:00 2001 From: mashuai Date: Sat, 15 Nov 2025 15:07:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E7=94=A8=E5=87=BA=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constants/TypeConstants.java | 12 + .../material/common/enums/TypeEnums.java | 26 ++ .../controller/DevChangeController.java | 83 +++++- .../devchange/domain/CsDeviceDetails.java | 65 +++++ .../devchange/domain/CsDeviceInfo.java | 79 ++++++ .../material/devchange/domain/CsDeviceVo.java | 18 ++ .../devchange/mapper/DevChangeMapper.java | 73 +++++ .../devchange/service/DevChangeService.java | 48 +++- .../service/DevChangeServiceImpl.java | 167 +++++++++++- .../material/devchange/DevChangeMapper.xml | 249 ++++++++++++++++++ 10 files changed, 801 insertions(+), 19 deletions(-) create mode 100644 bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/common/constants/TypeConstants.java create mode 100644 bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/common/enums/TypeEnums.java create mode 100644 bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceDetails.java create mode 100644 bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceInfo.java create mode 100644 bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceVo.java diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/common/constants/TypeConstants.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/common/constants/TypeConstants.java new file mode 100644 index 0000000..20ef431 --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/common/constants/TypeConstants.java @@ -0,0 +1,12 @@ +package com.bonus.material.common.constants; + +/** + * 类型常量类 + * @Author ma_sh + * @create 2025/11/15 13:26 + */ +public class TypeConstants { + + /** 领料单号的开头字母 */ + public static final String LEASE_TASK_TYPE_LABEL = "L"; +} diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/common/enums/TypeEnums.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/common/enums/TypeEnums.java new file mode 100644 index 0000000..3134df3 --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/common/enums/TypeEnums.java @@ -0,0 +1,26 @@ +package com.bonus.material.common.enums; + +import lombok.Getter; + +/** + * 类型枚举类 + * @Author ma_sh + * @create 2025/11/15 13:31 + */ +@Getter +public enum TypeEnums { + + TM_TASK_BACK(1, "退还任务"), + TM_TASK_LEASE(2, "领用任务"), + TM_TASK_RETIRE(3, "退役任务"), + TM_TASK_REPAIR(4, "维修任务"); + + + private final Integer taskTypeId; + private final String taskTypeName; + + TypeEnums(Integer taskTypeId, String taskTypeName) { + this.taskTypeId = taskTypeId; + this.taskTypeName = taskTypeName; + } +} diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/controller/DevChangeController.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/controller/DevChangeController.java index 4d86329..4b2dc32 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/controller/DevChangeController.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/controller/DevChangeController.java @@ -1,22 +1,12 @@ package com.bonus.material.devchange.controller; -import cn.hutool.core.convert.Convert; -import com.bonus.common.biz.config.ListPagingUtil; import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.core.web.page.TableDataInfo; -import com.bonus.common.log.annotation.SysLog; -import com.bonus.common.log.enums.OperaType; -import com.bonus.material.basic.domain.BmSlideShow; -import com.bonus.material.common.annotation.PreventRepeatSubmit; -import com.bonus.material.devchange.domain.CsDeviceChangeDetailsVo; -import com.bonus.material.devchange.domain.CsDeviceChangeVo; -import com.bonus.material.devchange.domain.DevChangeVo; -import com.bonus.material.devchange.domain.JjProjectVo; +import com.bonus.material.devchange.domain.*; import com.bonus.material.devchange.service.DevChangeService; -import com.bonus.material.device.domain.vo.DevInfoVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -133,4 +123,75 @@ public class DevChangeController extends BaseController { return AjaxResult.success(service.getDevDetails(vo)); } + /** + * 获取添加设备详情 + * @param dto + * @return + */ + @ApiOperation(value = "获取添加设备详情") + @GetMapping("/getDevDetailsInfo") + public AjaxResult getDevDetailsInfo(CsDeviceDetails dto) { + startPage(); + List list = service.getDevDetailsInfo(dto); + return AjaxResult.success(getDataTable(list)); + } + + /** + * 新增出库申请 + * @param csDeviceVo + * @return + */ + @ApiOperation(value = "新增出库申请") + @PostMapping("/addDevDetails") + public AjaxResult addDevDetails(@RequestBody CsDeviceVo csDeviceVo) { + return service.addDevDetails(csDeviceVo); + } + + /** + * 修改出库申请 + * @param csDeviceVo + * @return + */ + @ApiOperation(value = "修改出库申请") + @PostMapping("/updateDevDetails") + public AjaxResult updateDevDetails(@RequestBody CsDeviceVo csDeviceVo) { + return service.updateDevDetails(csDeviceVo); + } + + /** + * 删除出库申请 + * @param csDeviceInfo + * @return + */ + @ApiOperation(value = "删除出库申请") + @PostMapping("/deleteDevDetails") + public AjaxResult deleteDevDetails(@RequestBody CsDeviceInfo csDeviceInfo) { + return service.deleteDevDetails(csDeviceInfo); + } + + /** + * 获取设备详情 + * @param dto + * @return + */ + @ApiOperation(value = "获取设备详情") + @GetMapping("/getDevDetailsById") + public AjaxResult getDevDetailsById(CsDeviceDetails dto) { + CsDeviceVo devInfo = service.getDevDetailsById(dto); + return AjaxResult.success(devInfo); + } + + /** + * 获取申请一级列表 + * @param dto + * @return + */ + @ApiOperation(value = "获取申请一级列表") + @GetMapping("/getList") + public AjaxResult getList(CsDeviceInfo dto) { + startPage(); + List list = service.getList(dto); + return AjaxResult.success(getDataTable(list)); + } + } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceDetails.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceDetails.java new file mode 100644 index 0000000..819f35c --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceDetails.java @@ -0,0 +1,65 @@ +package com.bonus.material.devchange.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * 设备详情列表 + * @author ma_sh + */ +@Data +public class CsDeviceDetails { + + private Long id; + + @ApiModelProperty(value = "主任务ID") + private Long changeId; + + @ApiModelProperty(value = "类型ID") + private Long typeId; + + @ApiModelProperty(value = "设备类型 1装备 2工具") + private String devType; + + @ApiModelProperty(value = "类目") + private String category; + + @ApiModelProperty(value = "名称") + private String typeName; + + @ApiModelProperty(value = "规格型号") + private String typeModelName; + + @ApiModelProperty(value = "计量单位") + private String unitName; + + @ApiModelProperty(value = "管理模式") + private String manageType; + + @ApiModelProperty(value = "设备编码") + private String devCode; + + @ApiModelProperty(value = "当前库存") + private Integer storageNum; + + @ApiModelProperty(value = "申请数量") + private Integer num; + + @ApiModelProperty(value = "使用到期日期") + private String useTime; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "更新人") + private String updateBy; + +} diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceInfo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceInfo.java new file mode 100644 index 0000000..3b0687a --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceInfo.java @@ -0,0 +1,79 @@ +package com.bonus.material.devchange.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * 设备详情 + * @author ma_sh + */ +@Data +public class CsDeviceInfo { + + private Long id; + + @ApiModelProperty(value = "需求单位") + private String useUnit; + + @ApiModelProperty(value = "项目编号") + private String proCode; + + @ApiModelProperty(value = "使用项目") + private String proName; + + @ApiModelProperty(value = "项目类型") + private String proType; + + @ApiModelProperty(value = "电压等级") + private String voltageLevel; + + @ApiModelProperty(value = "省") + private String proProvince; + + @ApiModelProperty(value = "市") + private String proCity; + + @ApiModelProperty(value = "区/县") + private String proCounty; + + @ApiModelProperty(value = "使用到期日期") + private String useTime; + + @ApiModelProperty(value = "领用单号") + private String code; + + @ApiModelProperty(value = "任务类型 1退还 2领用 3退役 4维修") + private String type; + + @ApiModelProperty(value = "领用方式 0自用 1共享") + private String leaseType; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "更新人") + private String updateBy; + + @ApiModelProperty(value = "申请装备数量") + private Integer devNum; + + @ApiModelProperty(value = "申请工具数量") + private Integer toolNum; + + @ApiModelProperty(value = "任务状态") + private String taskStatus; + + @ApiModelProperty(value = "开始时间") + private String startTime; + + @ApiModelProperty(value = "结束时间") + private String endTime; +} diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceVo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceVo.java new file mode 100644 index 0000000..50771ed --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceVo.java @@ -0,0 +1,18 @@ +package com.bonus.material.devchange.domain; + +import lombok.Data; + +import java.util.List; + +/** + * 设备详情列表vo + * @author ma_sh + */ +@Data +public class CsDeviceVo { + + private CsDeviceInfo devInfo; + + private List devDetailsList; + +} diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/mapper/DevChangeMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/mapper/DevChangeMapper.java index 2019d17..ce06162 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/mapper/DevChangeMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/mapper/DevChangeMapper.java @@ -5,6 +5,7 @@ import com.bonus.material.devchange.domain.*; import com.bonus.material.device.domain.vo.DevInfoPropertyVo; import com.bonus.material.device.domain.vo.DevInfoVo; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -141,4 +142,76 @@ public interface DevChangeMapper { * @param newNum */ void updateChangeDetailsNum(DevChangeDetailsVo voo); + + /** + * 获取添加设备详情 + * @param dto + * @return + */ + List getDevDetailsInfo(CsDeviceDetails dto); + + /** + * 获取申请编号 + * @param year + * @param month + * @param taskType + * @return + */ + int getMonthMaxOrderByDate(@Param("year") String year, @Param("month") String month, @Param("taskType") Integer taskType); + + /** + * + * @param devInfo + * @return + */ + int addChangeInfoNew(CsDeviceInfo devInfo); + + /** + * 添加设备详情 + * @param devDetailsList + * @return + */ + int addDetails(List devDetailsList); + + /** + * 修改设备信息 + * @param devInfo + * @return + */ + int updateCsDevInfo(CsDeviceInfo devInfo); + + /** + * 删除设备详情 + * @param id + * @return + */ + int deleteChangeDetails(Long id); + + /** + * 根据id查询主任务表数据 + * @param dto + * @return + */ + CsDeviceInfo getDevInfoById(CsDeviceDetails dto); + + /** + * 根据id查询设备详情表数据 + * @param dto + * @return + */ + List getDevDetailsById(CsDeviceDetails dto); + + /** + * 删除主任务 + * @param csDeviceInfo + * @return + */ + int deleteChangeInfo(CsDeviceInfo csDeviceInfo); + + /** + * 获取申请一级列表 + * @param dto + * @return + */ + List getList(CsDeviceInfo dto); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeService.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeService.java index 79906be..4316eeb 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeService.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeService.java @@ -1,11 +1,7 @@ package com.bonus.material.devchange.service; import com.bonus.common.core.web.domain.AjaxResult; -import com.bonus.material.devchange.domain.CsDeviceChangeDetailsVo; -import com.bonus.material.devchange.domain.CsDeviceChangeVo; -import com.bonus.material.devchange.domain.DevChangeVo; -import com.bonus.material.devchange.domain.JjProjectVo; -import com.bonus.material.device.domain.vo.DevInfoVo; +import com.bonus.material.devchange.domain.*; import java.util.List; @@ -63,4 +59,46 @@ public interface DevChangeService { AjaxResult updateDevChangeInfo2(CsDeviceChangeVo vo); AjaxResult updateDevChangeInfo3(CsDeviceChangeVo vo); + + /** + * 获取添加设备详情 + * @param dto + * @return + */ + List getDevDetailsInfo(CsDeviceDetails dto); + + /** + * 新增出库申请 + * @param csDeviceVo + * @return + */ + AjaxResult addDevDetails(CsDeviceVo csDeviceVo); + + /** + * 修改出库申请 + * @param csDeviceVo + * @return + */ + AjaxResult updateDevDetails(CsDeviceVo csDeviceVo); + + /** + * 获取设备详情 + * @param dto + * @return + */ + CsDeviceVo getDevDetailsById(CsDeviceDetails dto); + + /** + * 删除出库申请 + * @param csDeviceInfo + * @return + */ + AjaxResult deleteDevDetails(CsDeviceInfo csDeviceInfo); + + /** + * 获取申请一级列表 + * @param dto + * @return + */ + List getList(CsDeviceInfo dto); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java index 1de6ef5..2e1d619 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java @@ -2,19 +2,23 @@ package com.bonus.material.devchange.service; import com.alibaba.cloud.commons.lang.StringUtils; import com.alibaba.fastjson.JSON; +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.security.utils.SecurityUtils; -import com.bonus.material.common.utils.StringUtil; +import com.bonus.material.common.constants.TypeConstants; +import com.bonus.material.common.enums.TypeEnums; import com.bonus.material.devchange.domain.*; import com.bonus.material.devchange.mapper.DevChangeMapper; import com.bonus.material.device.domain.vo.DevInfoPropertyVo; -import com.bonus.material.device.domain.vo.DevInfoVo; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.kafka.KafkaProperties; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.List; @Service @@ -197,6 +201,163 @@ public class DevChangeServiceImpl implements DevChangeService { return AjaxResult.success(); } + /** + * 获取添加设备详情 + * @param dto + * @return + */ + @Override + public List getDevDetailsInfo(CsDeviceDetails dto) { + try { + return mapper.getDevDetailsInfo(dto); + } catch (Exception e) { + log.error(e.getMessage()); + return new ArrayList<>(); + } + } + + /** + * 新增出库申请 + * @param csDeviceVo + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult addDevDetails(CsDeviceVo csDeviceVo) { + try { + if (csDeviceVo == null || csDeviceVo.getDevInfo() == null || CollectionUtils.isEmpty(csDeviceVo.getDevDetailsList())) { + return AjaxResult.error("请选择需要添加的设备"); + } + Long userId = SecurityUtils.getLoginUser().getUserid(); + // 获取申请编号 + int thisMonthMaxOrder = mapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TypeEnums.TM_TASK_LEASE.getTaskTypeId()); + String code = genderTaskCode(thisMonthMaxOrder); + CsDeviceInfo devInfo = csDeviceVo.getDevInfo(); + devInfo.setCode(code); + devInfo.setCreateBy(userId.toString()); + // 添加主任务 + int num = mapper.addChangeInfoNew(devInfo); + if (num < 1) { + throw new RuntimeException("添加主任务失败"); + } + csDeviceVo.getDevDetailsList().forEach(devDetails -> { + devDetails.setChangeId(devInfo.getId()); + devDetails.setCreateBy(userId.toString()); + devDetails.setCreateTime(DateUtils.getNowDate()); + }); + // 添加设备详情 + num = mapper.addDetails(csDeviceVo.getDevDetailsList()); + if (num < 1) { + throw new RuntimeException("添加设备详情失败"); + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("添加成功"); + } + + /** + * 修改出库申请 + * @param csDeviceVo + * @return + */ + @Override + public AjaxResult updateDevDetails(CsDeviceVo csDeviceVo) { + try { + if (csDeviceVo == null || csDeviceVo.getDevInfo() == null || csDeviceVo.getDevInfo().getId() == null + || CollectionUtils.isEmpty(csDeviceVo.getDevDetailsList())) { + return AjaxResult.error("请选择需要修改的设备"); + } + Long userId = SecurityUtils.getLoginUser().getUserid(); + csDeviceVo.getDevInfo().setUpdateBy(userId.toString()); + // 修改主任务 + int num = mapper.updateCsDevInfo(csDeviceVo.getDevInfo()); + if (num < 1) { + throw new RuntimeException("修改主任务失败"); + } + // 先将设备详情删除,重新添加 + num = mapper.deleteChangeDetails(csDeviceVo.getDevInfo().getId()); + if (num < 1) { + throw new RuntimeException("删除设备详情失败"); + } + csDeviceVo.getDevDetailsList().forEach(devDetails -> { + devDetails.setChangeId(csDeviceVo.getDevInfo().getId()); + devDetails.setUpdateBy(userId.toString()); + devDetails.setCreateBy(userId.toString()); + devDetails.setCreateTime(DateUtils.getNowDate()); + devDetails.setUpdateTime(DateUtils.getNowDate()); + }); + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("修改成功"); + } + + /** + * 获取设备详情 + * @param dto + * @return + */ + @Override + public CsDeviceVo getDevDetailsById(CsDeviceDetails dto) { + CsDeviceVo csDeviceVo = new CsDeviceVo(); + // 根据id查询主任务表数据 + CsDeviceInfo devInfo = mapper.getDevInfoById(dto); + // 根据id查询设备详情表数据 + List devDetailsList = mapper.getDevDetailsById(dto); + csDeviceVo.setDevInfo(devInfo); + csDeviceVo.setDevDetailsList(devDetailsList); + return csDeviceVo; + } + + /** + * 删除出库申请 + * @param csDeviceInfo + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult deleteDevDetails(CsDeviceInfo csDeviceInfo) { + try { + // 删除主任务 + int num = mapper.deleteChangeInfo(csDeviceInfo); + if (num < 1) { + throw new RuntimeException("删除主任务失败"); + } + // 删除设备详情 + num = mapper.deleteChangeDetails(csDeviceInfo.getId()); + if (num < 1) { + throw new RuntimeException("删除设备详情失败"); + } + } catch (RuntimeException e) { + e.printStackTrace(); + } + return AjaxResult.success("删除成功"); + } + + /** + * 获取申请一级列表 + * @param dto + * @return + */ + @Override + public List getList(CsDeviceInfo dto) { + return mapper.getList(dto); + } + + /** + * 生成任务编号 + * @param thisMonthMaxOrder + * @return + */ + private String genderTaskCode(int thisMonthMaxOrder) { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + Date nowDate = DateUtils.getNowDate(); + String format = dateFormat.format(nowDate); + String result = format.replace("-", ""); + return TypeConstants.LEASE_TASK_TYPE_LABEL + result + String.format("-%04d", thisMonthMaxOrder + 1); + } + /** * 维修接口 * diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml index 5a22d0f..b2f04c4 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml @@ -232,4 +232,253 @@ + + + + + + + + + + + + + insert into cs_device_change(change_status, type, lease_type, pro_code, pro_name, + pro_type, voltage_level, use_unit, pro_province, pro_city, + pro_county, create_time, create_user, del_flag, change_unit, code, use_time) + values ( #{changeStatus}, #{type}, #{leaseType}, #{proCode}, #{proName}, #{proType}, + #{voltageLevel}, #{useUnit}, #{proProvince}, #{proCity}, #{proCounty}, + now(), #{createUser}, 0, #{changeUnit}, #{code}, #{useTime}) + + + + insert into cs_device_change_details(change_id, dev_code, dev_type_id, dev_type, num, use_time, + create_user, create_time, update_user, update_time, del_flag) + values + + (#{item.changeId},#{item.devCode},#{item.typeId},#{item.devType},#{item.num},#{item.useTime}, + #{item.createBy}, #{item.createTime},#{item.updateBy}, #{item.updateTime}, 0) + + + + + update cs_device_change + + + pro_code = #{proCode}, + + + pro_name = #{proName}, + + + pro_type = #{proType}, + + + voltage_level = #{voltageLevel}, + + + use_unit = #{useUnit}, + + + pro_province = #{proProvince}, + + + pro_city = #{proCity}, + + + pro_county = #{proCounty}, + + + use_time = #{useTime}, + + + update_user = #{updateBy}, + + update_time = NOW() + + where id = #{id} + + + + update cs_device_change_details set del_flag = '1' where change_id = #{id} + + + + update cs_device_change set del_flag = '1' where id = #{id} + \ No newline at end of file