change - 下达计划逻辑

main
yinq 5 months ago
parent 6c4b0a9296
commit 3f6ff8c9ae

@ -0,0 +1,57 @@
package com.os.common.utils.uuid;
import com.os.common.core.redis.RedisCache;
import com.os.common.utils.spring.SpringUtils;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.concurrent.TimeUnit;
/**
* @ClassName : PlanCodeUtils
* @Description : zhouhy
* @Author :-
* @Date: 2023-10-07 09:46
*/
@Component
public class PlanCodeUtils {
public static String getPlanCode() {
LocalDate date = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyMMdd");
String format = "plan_code:" + date.format(formatter);
//以当日日期作为key
if (!SpringUtils.getBean(RedisCache.class).hasKey(format)) {
SpringUtils.getBean(RedisCache.class).setCacheObject(format, 1);
SpringUtils.getBean(RedisCache.class).expire(format, getSecondsNextEarlyMorning(), TimeUnit.SECONDS);
} else {
//获取当前的value在+1
Object cacheObject = SpringUtils.getBean(RedisCache.class).getCacheObject(format);
String value = String.valueOf(cacheObject);
Integer integer = Integer.parseInt(value) + 1;
SpringUtils.getBean(RedisCache.class).setCacheObject(format, integer);
SpringUtils.getBean(RedisCache.class).expire(format, getSecondsNextEarlyMorning(), TimeUnit.SECONDS);
}
Object cacheObject = SpringUtils.getBean(RedisCache.class).getCacheObject(format);
//转成string在转成int
String code = String.format("%04d", Integer.valueOf(String.valueOf(cacheObject)));
return date.format(formatter) + code;
}
//判断当前时间距离第二天0点时间的秒数
public static Long getSecondsNextEarlyMorning() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_YEAR, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.MILLISECOND, 0);
return (cal.getTimeInMillis() - System.currentTimeMillis()) / 1000;
}
}

@ -115,4 +115,13 @@ public class ProdBomInfoController extends BaseController {
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(prodBomInfoService.deleteProdBomInfoByObjIds(objIds));
}
/**
* BOM
*/
@GetMapping("/generateTickets")
public AjaxResult generateTickets(ProdBomInfo prodBomInfo) {
List<ProdBomInfo> list = prodBomInfoService.generateTickets(prodBomInfo);
return success(list);
}
}

@ -0,0 +1,111 @@
package com.os.mes.prod.controller;
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.os.common.annotation.Log;
import com.os.common.core.controller.BaseController;
import com.os.common.core.domain.AjaxResult;
import com.os.common.enums.BusinessType;
import com.os.mes.prod.domain.ProdPlanInfo;
import com.os.mes.prod.service.IProdPlanInfoService;
import com.os.common.utils.poi.ExcelUtil;
import com.os.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2024-06-03
*/
@RestController
@RequestMapping("/mes/prod/prodPlanInfo")
public class ProdPlanInfoController extends BaseController {
@Autowired
private IProdPlanInfoService prodPlanInfoService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/prod:prodPlanInfo:list')")
@GetMapping("/list")
public TableDataInfo list(ProdPlanInfo prodPlanInfo) {
startPage();
List<ProdPlanInfo> list = prodPlanInfoService.selectProdPlanInfoList(prodPlanInfo);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/prod:prodPlanInfo:export')")
@Log(title = "生产工单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProdPlanInfo prodPlanInfo) {
List<ProdPlanInfo> list = prodPlanInfoService.selectProdPlanInfoList(prodPlanInfo);
ExcelUtil<ProdPlanInfo> util = new ExcelUtil<ProdPlanInfo>(ProdPlanInfo.class);
util.exportExcel(response, list, "生产工单数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/prod:prodPlanInfo:query')")
@GetMapping(value = "/{objId}")
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
return success(prodPlanInfoService.selectProdPlanInfoByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/prod:prodPlanInfo:add')")
@Log(title = "生产工单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProdPlanInfo prodPlanInfo) {
prodPlanInfo.setCreateBy(getUsername());
return toAjax(prodPlanInfoService.insertProdPlanInfo(prodPlanInfo));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/prod:prodPlanInfo:edit')")
@Log(title = "生产工单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProdPlanInfo prodPlanInfo) {
prodPlanInfo.setUpdateBy(getUsername());
return toAjax(prodPlanInfoService.updateProdPlanInfo(prodPlanInfo));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/prod:prodPlanInfo:remove')")
@Log(title = "生产工单", businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}")
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(prodPlanInfoService.deleteProdPlanInfoByObjIds(objIds));
}
/**
* List
* @param prodPlanInfos
* @return
*/
@PostMapping("/orderAddProdPlanInfoList")
public AjaxResult orderAddProdPlanInfoList(@RequestBody List<ProdPlanInfo> prodPlanInfos) {
return toAjax(prodPlanInfoService.orderAddProdPlanInfoList(prodPlanInfos));
}
}

@ -129,6 +129,16 @@ public class ProdBomInfo extends BaseEntity {
@Excel(name = "BOM全称")
private String materialAll;
private String planCode;
public String getPlanCode() {
return planCode;
}
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
public String getMaterialAll() {
return materialAll;
}

@ -0,0 +1,315 @@
package com.os.mes.prod.domain;
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.os.common.annotation.Excel;
import com.os.common.core.domain.BaseEntity;
/**
* prod_plan_info
*
* @author Yinq
* @date 2024-06-03
*/
public class ProdPlanInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objId;
/**
*
*/
@Excel(name = "工单编号")
private String planCode;
/**
*
*/
@Excel(name = "订单编号")
private String orderCode;
/**
*
*/
@Excel(name = "物料编号")
private String materialCode;
/**
*
*/
@Excel(name = "物料名称")
private String materialName;
/**
*
*/
@Excel(name = "计划工位")
private String stationCode;
/**
*
*/
@Excel(name = "设备编号")
private String deviceCode;
/**
*
*/
@Excel(name = "计划班组")
private String teamCode;
/**
*
*/
@Excel(name = "计划数量")
private Long planAmount;
/**
*
*/
@Excel(name = "完成数量")
private Long completeAmount;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "实际开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date beginTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "实际完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/**
* 0=1=2=
*/
@Excel(name = "完成标识", readConverterExp = "0==正常1=降级2=超额")
private String compFlag;
/**
*
*/
@Excel(name = "创建人")
private String createdBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/**
*
*/
@Excel(name = "更新人")
private String updatedBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date planBeginTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date planEndTime;
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
public String getPlanCode() {
return planCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialName() {
return materialName;
}
public void setStationCode(String stationCode) {
this.stationCode = stationCode;
}
public String getStationCode() {
return stationCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceCode() {
return deviceCode;
}
public void setTeamCode(String teamCode) {
this.teamCode = teamCode;
}
public String getTeamCode() {
return teamCode;
}
public void setPlanAmount(Long planAmount) {
this.planAmount = planAmount;
}
public Long getPlanAmount() {
return planAmount;
}
public void setCompleteAmount(Long completeAmount) {
this.completeAmount = completeAmount;
}
public Long getCompleteAmount() {
return completeAmount;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getBeginTime() {
return beginTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Date getEndTime() {
return endTime;
}
public void setCompFlag(String compFlag) {
this.compFlag = compFlag;
}
public String getCompFlag() {
return compFlag;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getCreatedTime() {
return createdTime;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
public Date getUpdatedTime() {
return updatedTime;
}
public void setPlanBeginTime(Date planBeginTime) {
this.planBeginTime = planBeginTime;
}
public Date getPlanBeginTime() {
return planBeginTime;
}
public void setPlanEndTime(Date planEndTime) {
this.planEndTime = planEndTime;
}
public Date getPlanEndTime() {
return planEndTime;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("planCode", getPlanCode())
.append("orderCode", getOrderCode())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("stationCode", getStationCode())
.append("deviceCode", getDeviceCode())
.append("teamCode", getTeamCode())
.append("planAmount", getPlanAmount())
.append("completeAmount", getCompleteAmount())
.append("beginTime", getBeginTime())
.append("endTime", getEndTime())
.append("compFlag", getCompFlag())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.append("planBeginTime", getPlanBeginTime())
.append("planEndTime", getPlanEndTime())
.toString();
}
}

@ -0,0 +1,61 @@
package com.os.mes.prod.mapper;
import java.util.List;
import com.os.mes.prod.domain.ProdPlanInfo;
/**
* Mapper
*
* @author Yinq
* @date 2024-06-03
*/
public interface ProdPlanInfoMapper {
/**
*
*
* @param objId
* @return
*/
public ProdPlanInfo selectProdPlanInfoByObjId(Long objId);
/**
*
*
* @param prodPlanInfo
* @return
*/
public List<ProdPlanInfo> selectProdPlanInfoList(ProdPlanInfo prodPlanInfo);
/**
*
*
* @param prodPlanInfo
* @return
*/
public int insertProdPlanInfo(ProdPlanInfo prodPlanInfo);
/**
*
*
* @param prodPlanInfo
* @return
*/
public int updateProdPlanInfo(ProdPlanInfo prodPlanInfo);
/**
*
*
* @param objId
* @return
*/
public int deleteProdPlanInfoByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteProdPlanInfoByObjIds(Long[] objIds);
}

@ -65,4 +65,11 @@ public interface IProdBomInfoService {
* @return
*/
List<ProdBomInfo> selectProductionBomTreeList(ProdBomInfo prodBomInfo);
/**
* BOM
* @param prodBomInfo
* @return
*/
List<ProdBomInfo> generateTickets(ProdBomInfo prodBomInfo);
}

@ -0,0 +1,68 @@
package com.os.mes.prod.service;
import java.util.List;
import com.os.mes.prod.domain.ProdPlanInfo;
/**
* Service
*
* @author Yinq
* @date 2024-06-03
*/
public interface IProdPlanInfoService {
/**
*
*
* @param objId
* @return
*/
public ProdPlanInfo selectProdPlanInfoByObjId(Long objId);
/**
*
*
* @param prodPlanInfo
* @return
*/
public List<ProdPlanInfo> selectProdPlanInfoList(ProdPlanInfo prodPlanInfo);
/**
*
*
* @param prodPlanInfo
* @return
*/
public int insertProdPlanInfo(ProdPlanInfo prodPlanInfo);
/**
*
*
* @param prodPlanInfo
* @return
*/
public int updateProdPlanInfo(ProdPlanInfo prodPlanInfo);
/**
*
*
* @param objIds
* @return
*/
public int deleteProdPlanInfoByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteProdPlanInfoByObjId(Long objId);
/**
* List
* @param prodPlanInfos
* @return
*/
int orderAddProdPlanInfoList(List<ProdPlanInfo> prodPlanInfos);
}

@ -6,6 +6,7 @@ import java.util.List;
import com.os.common.exception.base.BaseException;
import com.os.common.utils.DateUtils;
import com.os.common.utils.StringUtils;
import com.os.common.utils.uuid.PlanCodeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.mes.prod.mapper.ProdBomInfoMapper;
@ -127,4 +128,19 @@ public class ProdBomInfoServiceImpl implements IProdBomInfoService {
public int deleteProdBomInfoByObjId(Long objId) {
return prodBomInfoMapper.deleteProdBomInfoByObjId(objId);
}
/**
* BOM
* @param prodBomInfo
* @return
*/
@Override
public List<ProdBomInfo> generateTickets(ProdBomInfo prodBomInfo) {
List<ProdBomInfo> prodBomInfoList = prodBomInfoMapper.selectProdBomInfoList(prodBomInfo);
for (ProdBomInfo bomInfo : prodBomInfoList) {
bomInfo.setPlanCode(PlanCodeUtils.getPlanCode());
}
return prodBomInfoList;
}
}

@ -0,0 +1,105 @@
package com.os.mes.prod.service.impl;
import java.util.List;
import com.os.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.mes.prod.mapper.ProdPlanInfoMapper;
import com.os.mes.prod.domain.ProdPlanInfo;
import com.os.mes.prod.service.IProdPlanInfoService;
import static com.os.common.utils.SecurityUtils.getUsername;
/**
* Service
*
* @author Yinq
* @date 2024-06-03
*/
@Service
public class ProdPlanInfoServiceImpl implements IProdPlanInfoService {
@Autowired
private ProdPlanInfoMapper prodPlanInfoMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public ProdPlanInfo selectProdPlanInfoByObjId(Long objId) {
return prodPlanInfoMapper.selectProdPlanInfoByObjId(objId);
}
/**
*
*
* @param prodPlanInfo
* @return
*/
@Override
public List<ProdPlanInfo> selectProdPlanInfoList(ProdPlanInfo prodPlanInfo) {
return prodPlanInfoMapper.selectProdPlanInfoList(prodPlanInfo);
}
/**
*
*
* @param prodPlanInfo
* @return
*/
@Override
public int insertProdPlanInfo(ProdPlanInfo prodPlanInfo) {
return prodPlanInfoMapper.insertProdPlanInfo(prodPlanInfo);
}
/**
*
*
* @param prodPlanInfo
* @return
*/
@Override
public int updateProdPlanInfo(ProdPlanInfo prodPlanInfo) {
return prodPlanInfoMapper.updateProdPlanInfo(prodPlanInfo);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteProdPlanInfoByObjIds(Long[] objIds) {
return prodPlanInfoMapper.deleteProdPlanInfoByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteProdPlanInfoByObjId(Long objId) {
return prodPlanInfoMapper.deleteProdPlanInfoByObjId(objId);
}
/**
* List
* @param prodPlanInfos
* @return
*/
@Override
public int orderAddProdPlanInfoList(List<ProdPlanInfo> prodPlanInfos) {
for (ProdPlanInfo prodPlanInfo : prodPlanInfos) {
prodPlanInfo.setCreatedBy(getUsername());
prodPlanInfo.setCreatedTime(DateUtils.getNowDate());
prodPlanInfoMapper.insertProdPlanInfo(prodPlanInfo);
}
return 1;
}
}

@ -69,7 +69,7 @@
<if test="materialType != null and materialType != ''">and pbi.material_type = #{materialType}</if>
<if test="materialDesc != null and materialDesc != ''">and pbi.material_desc = #{materialDesc}</if>
<if test="standardAmount != null ">and pbi.standard_amount = #{standardAmount}</if>
<if test="parentId != null and parentId != ''">and pbi.parent_id = #{parentId}</if>
<if test="parentId != null">and pbi.parent_id = #{parentId}</if>
<if test="parentName != null and parentName != ''">and pbi.parent_name like concat('%', #{parentName}, '%')
</if>
<if test="factoryCode != null and factoryCode != ''">and pbi.factory_code = #{factoryCode}</if>

@ -0,0 +1,166 @@
<?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.os.mes.prod.mapper.ProdPlanInfoMapper">
<resultMap type="ProdPlanInfo" id="ProdPlanInfoResult">
<result property="objId" column="obj_id"/>
<result property="planCode" column="plan_code"/>
<result property="orderCode" column="order_code"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="stationCode" column="station_code"/>
<result property="deviceCode" column="device_code"/>
<result property="teamCode" column="team_code"/>
<result property="planAmount" column="plan_amount"/>
<result property="completeAmount" column="complete_amount"/>
<result property="beginTime" column="begin_time"/>
<result property="endTime" column="end_time"/>
<result property="compFlag" column="comp_flag"/>
<result property="createdBy" column="created_by"/>
<result property="createdTime" column="created_time"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time"/>
<result property="planBeginTime" column="plan_begin_time"/>
<result property="planEndTime" column="plan_end_time"/>
</resultMap>
<sql id="selectProdPlanInfoVo">
select obj_id,
plan_code,
order_code,
material_code,
material_name,
station_code,
device_code,
team_code,
plan_amount,
complete_amount,
begin_time,
end_time,
comp_flag,
created_by,
created_time,
updated_by,
updated_time,
plan_begin_time,
plan_end_time
from prod_plan_info
</sql>
<select id="selectProdPlanInfoList" parameterType="ProdPlanInfo" resultMap="ProdPlanInfoResult">
<include refid="selectProdPlanInfoVo"/>
<where>
<if test="planCode != null and planCode != ''">and plan_code = #{planCode}</if>
<if test="orderCode != null and orderCode != ''">and order_code = #{orderCode}</if>
<if test="materialCode != null and materialCode != ''">and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''">and material_name like concat('%', #{materialName},
'%')
</if>
<if test="stationCode != null and stationCode != ''">and station_code = #{stationCode}</if>
<if test="deviceCode != null and deviceCode != ''">and device_code = #{deviceCode}</if>
<if test="teamCode != null and teamCode != ''">and team_code = #{teamCode}</if>
<if test="planAmount != null ">and plan_amount = #{planAmount}</if>
<if test="completeAmount != null ">and complete_amount = #{completeAmount}</if>
<if test="params.beginBeginTime != null and params.beginBeginTime != '' and params.endBeginTime != null and params.endBeginTime != ''">
and begin_time between #{params.beginBeginTime} and #{params.endBeginTime}
</if>
<if test="endTime != null ">and end_time = #{endTime}</if>
<if test="compFlag != null and compFlag != ''">and comp_flag = #{compFlag}</if>
<if test="createdBy != null and createdBy != ''">and created_by = #{createdBy}</if>
<if test="createdTime != null ">and created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''">and updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and updated_time = #{updatedTime}</if>
<if test="planBeginTime != null ">and plan_begin_time = #{planBeginTime}</if>
<if test="planEndTime != null ">and plan_end_time = #{planEndTime}</if>
</where>
</select>
<select id="selectProdPlanInfoByObjId" parameterType="Long" resultMap="ProdPlanInfoResult">
<include refid="selectProdPlanInfoVo"/>
where obj_id = #{objId}
</select>
<insert id="insertProdPlanInfo" parameterType="ProdPlanInfo" useGeneratedKeys="true" keyProperty="objId">
insert into prod_plan_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planCode != null and planCode != ''">plan_code,</if>
<if test="orderCode != null">order_code,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="stationCode != null">station_code,</if>
<if test="deviceCode != null">device_code,</if>
<if test="teamCode != null">team_code,</if>
<if test="planAmount != null">plan_amount,</if>
<if test="completeAmount != null">complete_amount,</if>
<if test="beginTime != null">begin_time,</if>
<if test="endTime != null">end_time,</if>
<if test="compFlag != null">comp_flag,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="planBeginTime != null">plan_begin_time,</if>
<if test="planEndTime != null">plan_end_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planCode != null and planCode != ''">#{planCode},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="stationCode != null">#{stationCode},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="teamCode != null">#{teamCode},</if>
<if test="planAmount != null">#{planAmount},</if>
<if test="completeAmount != null">#{completeAmount},</if>
<if test="beginTime != null">#{beginTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="compFlag != null">#{compFlag},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="planBeginTime != null">#{planBeginTime},</if>
<if test="planEndTime != null">#{planEndTime},</if>
</trim>
</insert>
<update id="updateProdPlanInfo" parameterType="ProdPlanInfo">
update prod_plan_info
<trim prefix="SET" suffixOverrides=",">
<if test="planCode != null and planCode != ''">plan_code = #{planCode},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="stationCode != null">station_code = #{stationCode},</if>
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="teamCode != null">team_code = #{teamCode},</if>
<if test="planAmount != null">plan_amount = #{planAmount},</if>
<if test="completeAmount != null">complete_amount = #{completeAmount},</if>
<if test="beginTime != null">begin_time = #{beginTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="compFlag != null">comp_flag = #{compFlag},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="planBeginTime != null">plan_begin_time = #{planBeginTime},</if>
<if test="planEndTime != null">plan_end_time = #{planEndTime},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteProdPlanInfoByObjId" parameterType="Long">
delete
from prod_plan_info
where obj_id = #{objId}
</delete>
<delete id="deleteProdPlanInfoByObjIds" parameterType="String">
delete from prod_plan_info where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save