change - 下达计划逻辑
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
@ -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);
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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…
Reference in New Issue