保养计划-新增

highway
wws 1 year ago
parent 35b354562b
commit 8152b17171

@ -85,7 +85,7 @@ public class EquUpkeepController extends BaseController {
@Log(title = "保养计划", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquPlan equPlan) {
return toAjax(equUpkeepService.insertEquPlan(equPlan));
return equUpkeepService.insertEquPlan(equPlan);
}
/**

@ -126,11 +126,7 @@ public class EquPlan extends BaseEntity {
// 创建日期结束
private String createTimeEnd;
// 关联-计划->设备list
private List<EquPlanEqu> equPlanEquList;
private List<EquPlanEqu> equipmentItem;
private List<SysUser> personList;
private List<Date> planTimeArray;
@ -139,6 +135,39 @@ public class EquPlan extends BaseEntity {
private String workCenterName;
// 保养类型
private String upkeep;
// 计划保养时间计算规则
private String calculationRule;
// 是否停机保养
private String shutDown;
public String getUpkeep() {
return upkeep;
}
public void setUpkeep(String upkeep) {
this.upkeep = upkeep;
}
public String getCalculationRule() {
return calculationRule;
}
public void setCalculationRule(String calculationRule) {
this.calculationRule = calculationRule;
}
public String getShutDown() {
return shutDown;
}
public void setShutDown(String shutDown) {
this.shutDown = shutDown;
}
public String getWorkCenterName() {
return workCenterName;
}
@ -179,14 +208,6 @@ public class EquPlan extends BaseEntity {
this.personList = personList;
}
public List<EquPlanEqu> getEquPlanEquList() {
return equPlanEquList;
}
public void setEquPlanEquList(List<EquPlanEqu> equPlanEquList) {
this.equPlanEquList = equPlanEquList;
}
public List<Date> getCreateTimeArray() {
return createTimeArray;
}

@ -64,6 +64,17 @@ public class EquPlanEqu extends BaseEntity {
// 主计划code
private String planCode;
// 备件
private List<EquPlanEquSpare> spareList;
public List<EquPlanEquSpare> getSpareList() {
return spareList;
}
public void setSpareList(List<EquPlanEquSpare> spareList) {
this.spareList = spareList;
}
public String getPlanCode() {
return planCode;
}

@ -0,0 +1,182 @@
package com.op.device.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* equ_plan_equ_spare
*
* @author Open Platform
* @date 2023-10-26
*/
public class EquPlanEquSpare extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 编码 */
@Excel(name = "编码")
private String code;
/** 主计划code */
@Excel(name = "主计划code")
private String planCode;
/** 关联上级code */
@Excel(name = "关联上级code")
private String parentCode;
/** 备件code */
@Excel(name = "备件code")
private String materialCode;
/** 备件名称 */
@Excel(name = "备件名称")
private String materialDesc;
/** 备件类型 */
@Excel(name = "备件类型")
private String spareType;
/** 申领数量 */
@Excel(name = "申领数量")
private BigDecimal applyNum;
/** 工厂 */
@Excel(name = "工厂")
private String factoryCode;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标识 */
private String delFlag;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setCode(String code) {
this.code = code;
}
public String getCode() {
return code;
}
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
public String getPlanCode() {
return planCode;
}
public void setParentCode(String parentCode) {
this.parentCode = parentCode;
}
public String getParentCode() {
return parentCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialDesc(String materialDesc) {
this.materialDesc = materialDesc;
}
public String getMaterialDesc() {
return materialDesc;
}
public void setSpareType(String spareType) {
this.spareType = spareType;
}
public String getSpareType() {
return spareType;
}
public void setApplyNum(BigDecimal applyNum) {
this.applyNum = applyNum;
}
public BigDecimal getApplyNum() {
return applyNum;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("code", getCode())
.append("planCode", getPlanCode())
.append("parentCode", getParentCode())
.append("materialCode", getMaterialCode())
.append("materialDesc", getMaterialDesc())
.append("spareType", getSpareType())
.append("applyNum", getApplyNum())
.append("factoryCode", getFactoryCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -198,6 +198,17 @@ public class SparePartsLedger extends BaseEntity {
@Excel(name = "备件类型", readConverterExp = "备=件用")
private String spareType;
// 领用数量-保养备件领用使用
private BigDecimal applyNum;
public BigDecimal getApplyNum() {
return applyNum;
}
public void setApplyNum(BigDecimal applyNum) {
this.applyNum = applyNum;
}
public void setSpareType(String spareType) {
this.spareType = spareType;
}

@ -0,0 +1,61 @@
package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquPlanEquSpare;
/**
* Mapper
*
* @author Open Platform
* @date 2023-10-26
*/
public interface EquPlanEquSpareMapper {
/**
*
*
* @param id
* @return
*/
public EquPlanEquSpare selectEquPlanEquSpareById(String id);
/**
*
*
* @param equPlanEquSpare
* @return
*/
public List<EquPlanEquSpare> selectEquPlanEquSpareList(EquPlanEquSpare equPlanEquSpare);
/**
*
*
* @param equPlanEquSpare
* @return
*/
public int insertEquPlanEquSpare(EquPlanEquSpare equPlanEquSpare);
/**
*
*
* @param equPlanEquSpare
* @return
*/
public int updateEquPlanEquSpare(EquPlanEquSpare equPlanEquSpare);
/**
*
*
* @param id
* @return
*/
public int deleteEquPlanEquSpareById(String id);
/**
*
*
* @param ids
* @return
*/
public int deleteEquPlanEquSpareByIds(String[] ids);
}

@ -36,7 +36,7 @@ public interface IEquUpkeepService {
* @param equPlan
* @return
*/
public int insertEquPlan(EquPlan equPlan);
public AjaxResult insertEquPlan(EquPlan equPlan);
/**
*

@ -134,8 +134,6 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
@Override
@DS("#header.poolName")
public AjaxResult updateInspectionRecord(EquOrder equOrder) {
// 改变工单状态-已完成
equOrder.setOrderStatus("1");
EquOrderEqu equ = equOrder.getEqu();
List<EquOrderDetail> detailList = equ.getDetailList();
@ -169,7 +167,10 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
// 更新工单信息
equOrder.setOrderStatus("1");
equOrder.setUpdateTime(DateUtils.getNowDate());
equOrder.setUpdateBy(SecurityContextHolder.getUserName());
equOrder.setPlanPerson(SecurityContextHolder.getUserName());
equOrderMapper.updateEquOrder(equOrder);
return success(equOrder);

@ -1,19 +1,21 @@
package com.op.device.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquCheckItem;
import com.op.device.domain.EquCheckItemDetail;
import com.op.device.domain.EquPlan;
import com.op.device.domain.EquPlanEqu;
import com.op.device.mapper.EquCheckItemDetailMapper;
import com.op.device.mapper.EquCheckItemMapper;
import com.op.device.mapper.EquPlanMapper;
import com.op.device.domain.*;
import com.op.device.mapper.*;
import com.op.device.service.IEquUpkeepService;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import static com.op.common.core.web.domain.AjaxResult.error;
@ -28,6 +30,16 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
private EquCheckItemMapper equCheckItemMapper;
@Autowired
private EquCheckItemDetailMapper equCheckItemDetailMapper;
@Autowired
private EquPlanStandardMapper equPlanStandardMapper;
@Autowired
private EquPlanDetailMapper equPlanDetailMapper;
@Autowired
private EquPlanEquMapper equPlanEquMapper;
@Autowired
private EquPlanEquSpareMapper equPlanEquSpareMapper;
@Autowired
private EquPlanPersonMapper equPlanPersonMapper;
/**
*
@ -54,16 +66,160 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
}
/**
*
* TODO
*
* @param equPlan
* @return
*/
@Override
@DS("#header.poolName")
public int insertEquPlan(EquPlan equPlan) {
public AjaxResult insertEquPlan(EquPlan equPlan) {
// 获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
String str = request.getHeader(key.substring(8));
int index = str.indexOf("_");
String factory = str.substring(index + 1);
// 计划流水号
String planSerialNum = String.format("%03d", equPlanMapper.selectSerialNumber());
// 处理计划信息
equPlan.setPlanId(IdUtils.fastSimpleUUID());
equPlan.setPlanCode((DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + planSerialNum));
if (equPlan.getPlanTimeArray().size() > 0) {
equPlan.setPlanLoopStart(equPlan.getPlanTimeArray().get(0));
equPlan.setPlanLoopEnd(equPlan.getPlanTimeArray().get(1));
}
equPlan.setFactoryCode(factory);
equPlan.setCreateBy(SecurityContextHolder.getUserName());
equPlan.setCreateTime(DateUtils.getNowDate());
return equPlanMapper.insertEquPlan(equPlan);
equPlan.setUpdateBy(SecurityContextHolder.getUserName());
equPlan.setUpdateTime(DateUtils.getNowDate());
// 主计划插入数据库
equPlanMapper.insertEquPlan(equPlan);
// 处理设备信息
List<EquPlanEqu> equipmentItemList = equPlan.getEquipmentItem();
// 计划-设备流水号
int equipmentCodeTemp = 0;
for (EquPlanEqu equipment : equipmentItemList) {
equipment.setId(IdUtils.fastSimpleUUID());
equipment.setPlanCode(equPlan.getPlanCode());
equipment.setCode("E" + equPlan.getPlanCode() + String.format("%02d", ++equipmentCodeTemp));
equipment.setParentCode(equPlan.getPlanCode());
equipment.setFactoryCode(factory);
equipment.setCreateBy(SecurityContextHolder.getUserName());
equipment.setCreateTime(DateUtils.getNowDate());
equipment.setUpdateBy(SecurityContextHolder.getUserName());
equipment.setUpdateTime(DateUtils.getNowDate());
// 处理检查项信息
List<EquCheckItem> equCheckItemList = equipment.getEquCheckItemList();
if (equCheckItemList != null) {
// 计划检查项流水号
int itemCodeTemp = 0;
for (EquCheckItem item : equCheckItemList) {
if (item != null) {
EquPlanDetail planDetail = new EquPlanDetail();
BeanUtils.copyProperties(item, planDetail);
planDetail.setId(IdUtils.fastSimpleUUID());
planDetail.setPlanCode(equPlan.getPlanCode());
planDetail.setCode("C" + equPlan.getPlanCode() + String.format("%02d", ++itemCodeTemp));
planDetail.setParentCode(equipment.getCode());
planDetail.setCreateBy(SecurityContextHolder.getUserName());
planDetail.setCreateTime(DateUtils.getNowDate());
planDetail.setUpdateBy(SecurityContextHolder.getUserName());
planDetail.setUpdateTime(DateUtils.getNowDate());
// 处理标准
List<EquCheckItemDetail> equCheckItemDetailList = item.getEquCheckItemDetailList();
// 检查项详情流水号
int detailCodeTemp = 0;
// 判断是否插入检查项
boolean checkInsert = false;
for (EquCheckItemDetail detail : equCheckItemDetailList) {
if (detail.getShowFlag()) {
checkInsert = true;
EquPlanStandard planStandard = new EquPlanStandard();
BeanUtils.copyProperties(detail, planStandard);
planStandard.setId(IdUtils.fastSimpleUUID());
planStandard.setParentCode(planDetail.getCode());
planStandard.setPlanCode(equPlan.getPlanCode());
planStandard.setCode("D" + equPlan.getPlanCode() + String.format("%02d", ++detailCodeTemp));
planStandard.setCreateBy(SecurityContextHolder.getUserName());
planStandard.setCreateTime(DateUtils.getNowDate());
planStandard.setUpdateBy(SecurityContextHolder.getUserName());
planStandard.setUpdateTime(DateUtils.getNowDate());
// 详情插入数据库
equPlanStandardMapper.insertEquPlanStandard(planStandard);
}
}
// 检查项详情为空则不生成检查项信息-检查项插入数据库
if (checkInsert) {
equPlanDetailMapper.insertEquPlanDetail(planDetail);
}
}
}
// 设备插入数据库
equPlanEquMapper.insertEquPlanEqu(equipment);
}
// 处理备件信息
List<EquPlanEquSpare> spareList = equipment.getSpareList();
// 计划备件流水号
int spareCodeTemp = 0;
if (spareList != null) {
for (EquPlanEquSpare spare : spareList) {
spare.setId(IdUtils.fastSimpleUUID());
spare.setCode("S" + equPlan.getPlanCode() + String.format("%02d", ++equipmentCodeTemp));
spare.setPlanCode(equPlan.getPlanCode());
spare.setParentCode(equPlan.getPlanCode());
spare.setFactoryCode(factory);
spare.setCreateBy(SecurityContextHolder.getUserName());
spare.setCreateTime(DateUtils.getNowDate());
spare.setUpdateBy(SecurityContextHolder.getUserName());
spare.setUpdateTime(DateUtils.getNowDate());
equPlanEquSpareMapper.insertEquPlanEquSpare(spare);
}
}
}
// 处理人员信息
List<SysUser> personList = equPlan.getPersonList();
for (SysUser user : personList) {
EquPlanPerson equPlanPerson = new EquPlanPerson();
equPlanPerson.setId(IdUtils.fastSimpleUUID());
equPlanPerson.setUserId(user.getUserId());
equPlanPerson.setPlanCode(equPlan.getPlanCode());
equPlanPerson.setFactoryCode(factory);
equPlanPerson.setCreateBy(SecurityContextHolder.getUserName());
equPlanPerson.setCreateTime(DateUtils.getNowDate());
equPlanPerson.setUpdateBy(SecurityContextHolder.getUserName());
equPlanPerson.setUpdateTime(DateUtils.getNowDate());
equPlanPersonMapper.insertEquPlanPerson(equPlanPerson);
}
return success(equPlan);
}
/**

@ -0,0 +1,128 @@
<?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.op.device.mapper.EquPlanEquSpareMapper">
<resultMap type="EquPlanEquSpare" id="EquPlanEquSpareResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="planCode" column="plan_code" />
<result property="parentCode" column="parent_code" />
<result property="materialCode" column="material_code" />
<result property="materialDesc" column="material_desc" />
<result property="spareType" column="spare_type" />
<result property="applyNum" column="apply_num" />
<result property="factoryCode" column="factory_code" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectEquPlanEquSpareVo">
select id, code, plan_code, parent_code, material_code, material_desc, spare_type, apply_num, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_plan_equ_spare
</sql>
<select id="selectEquPlanEquSpareList" parameterType="EquPlanEquSpare" resultMap="EquPlanEquSpareResult">
<include refid="selectEquPlanEquSpareVo"/>
<where>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="parentCode != null and parentCode != ''"> and parent_code = #{parentCode}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialDesc != null and materialDesc != ''"> and material_desc = #{materialDesc}</if>
<if test="spareType != null and spareType != ''"> and spare_type = #{spareType}</if>
<if test="applyNum != null "> and apply_num = #{applyNum}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
</where>
</select>
<select id="selectEquPlanEquSpareById" parameterType="String" resultMap="EquPlanEquSpareResult">
<include refid="selectEquPlanEquSpareVo"/>
where id = #{id}
</select>
<insert id="insertEquPlanEquSpare" parameterType="EquPlanEquSpare">
insert into equ_plan_equ_spare
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="code != null">code,</if>
<if test="planCode != null">plan_code,</if>
<if test="parentCode != null">parent_code,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialDesc != null">material_desc,</if>
<if test="spareType != null">spare_type,</if>
<if test="applyNum != null">apply_num,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="code != null">#{code},</if>
<if test="planCode != null">#{planCode},</if>
<if test="parentCode != null">#{parentCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialDesc != null">#{materialDesc},</if>
<if test="spareType != null">#{spareType},</if>
<if test="applyNum != null">#{applyNum},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateEquPlanEquSpare" parameterType="EquPlanEquSpare">
update equ_plan_equ_spare
<trim prefix="SET" suffixOverrides=",">
<if test="code != null">code = #{code},</if>
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="parentCode != null">parent_code = #{parentCode},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialDesc != null">material_desc = #{materialDesc},</if>
<if test="spareType != null">spare_type = #{spareType},</if>
<if test="applyNum != null">apply_num = #{applyNum},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEquPlanEquSpareById" parameterType="String">
delete from equ_plan_equ_spare where id = #{id}
</delete>
<delete id="deleteEquPlanEquSpareByIds" parameterType="String">
delete from equ_plan_equ_spare where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -22,6 +22,9 @@
<result property="planType" column="plan_type" />
<result property="planOutsource" column="plan_outsource" />
<result property="workCode" column="work_code" />
<result property="upkeep" column="upkeep" />
<result property="calculationRule" column="calculation_rule" />
<result property="shutDown" column="shut_down" />
<result property="factoryCode" column="factory_code" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
@ -34,7 +37,7 @@
</resultMap>
<sql id="selectEquPlanVo">
select plan_id, plan_code, plan_name, plan_workshop, plan_prod_line, equipment_name, equipment_code, plan_loop, plan_loop_type, plan_loop_start, plan_loop_end, plan_person, plan_status, plan_restrict, plan_type, plan_outsource, work_code, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_plan
select plan_id, plan_code, plan_name, plan_workshop, plan_prod_line, equipment_name, equipment_code, plan_loop, plan_loop_type, plan_loop_start, plan_loop_end, plan_person, plan_status, plan_restrict, plan_type, plan_outsource, work_code, upkeep, calculation_rule, shut_down, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_plan
</sql>
<select id="selectEquPlanList" parameterType="EquPlan" resultMap="EquPlanResult">
@ -67,6 +70,9 @@
<if test="updateTimeStart != null "> and CONVERT(date,update_time) >= #{updateTimeStart}</if>
<if test="updateTimeEnd != null "> and #{updateTimeEnd} >= CONVERT(date,update_time)</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="upkeep != null and upkeep != ''"> and upkeep = #{upkeep}</if>
<if test="calculationRule != null and calculationRule != ''"> and calculation_rule = #{calculationRule}</if>
<if test="shutDown != null and shutDown != ''"> and shut_down = #{shutDown}</if>
and del_flag = '0'
</where>
</select>
@ -113,6 +119,9 @@
<if test="planType != null and planType != ''">plan_type,</if>
<if test="planOutsource != null and planOutsource != ''">plan_outsource,</if>
<if test="workCode != null">work_code,</if>
<if test="upkeep != null">upkeep,</if>
<if test="calculationRule != null">calculation_rule,</if>
<if test="shutDown != null">shut_down,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
@ -141,6 +150,9 @@
<if test="planType != null and planType != ''">#{planType},</if>
<if test="planOutsource != null and planOutsource != ''">#{planOutsource},</if>
<if test="workCode != null">#{workCode},</if>
<if test="upkeep != null">#{upkeep},</if>
<if test="calculationRule != null">#{calculationRule},</if>
<if test="shutDown != null">#{shutDown},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
@ -172,6 +184,9 @@
<if test="planType != null and planType != ''">plan_type = #{planType},</if>
<if test="planOutsource != null and planOutsource != ''">plan_outsource = #{planOutsource},</if>
<if test="workCode != null">work_code = #{workCode},</if>
<if test="upkeep != null">upkeep = #{upkeep},</if>
<if test="calculationRule != null">calculation_rule = #{calculationRule},</if>
<if test="shutDown != null">shut_down = #{shutDown},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
@ -182,7 +197,7 @@
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where plan_id = #{planId} and del_flag = '0'
where plan_id = #{planId}
</update>
<delete id="deleteEquPlanByPlanId" parameterType="String">

Loading…
Cancel
Save