巡检计划初始化
parent
b1d37a7c79
commit
8e4a8bb12b
@ -0,0 +1,97 @@
|
||||
package com.op.device.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.device.domain.EquPlan;
|
||||
import com.op.device.service.IEquPlanService;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 计划Controller
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-10-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/plan")
|
||||
public class EquPlanController extends BaseController {
|
||||
@Autowired
|
||||
private IEquPlanService equPlanService;
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*/
|
||||
@RequiresPermissions("device:plan:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EquPlan equPlan) {
|
||||
startPage();
|
||||
List<EquPlan> list = equPlanService.selectEquPlanList(equPlan);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出计划列表
|
||||
*/
|
||||
@RequiresPermissions("device:plan:export")
|
||||
@Log(title = "计划", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EquPlan equPlan) {
|
||||
List<EquPlan> list = equPlanService.selectEquPlanList(equPlan);
|
||||
ExcelUtil<EquPlan> util = new ExcelUtil<EquPlan>(EquPlan.class);
|
||||
util.exportExcel(response, list, "计划数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计划详细信息
|
||||
*/
|
||||
@RequiresPermissions("device:plan:query")
|
||||
@GetMapping(value = "/{planId}")
|
||||
public AjaxResult getInfo(@PathVariable("planId") String planId) {
|
||||
return success(equPlanService.selectEquPlanByPlanId(planId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划
|
||||
*/
|
||||
@RequiresPermissions("device:plan:add")
|
||||
@Log(title = "计划", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EquPlan equPlan) {
|
||||
return toAjax(equPlanService.insertEquPlan(equPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*/
|
||||
@RequiresPermissions("device:plan:edit")
|
||||
@Log(title = "计划", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EquPlan equPlan) {
|
||||
return toAjax(equPlanService.updateEquPlan(equPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划
|
||||
*/
|
||||
@RequiresPermissions("device:plan:remove")
|
||||
@Log(title = "计划", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planIds}")
|
||||
public AjaxResult remove(@PathVariable String[] planIds) {
|
||||
return toAjax(equPlanService.deleteEquPlanByPlanIds(planIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,362 @@
|
||||
package com.op.device.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-10-16
|
||||
*/
|
||||
public class EquPlan extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String planId;
|
||||
|
||||
/** 计划编码 */
|
||||
@Excel(name = "计划编码")
|
||||
private String planCode;
|
||||
|
||||
/** 计划名称 */
|
||||
@Excel(name = "计划名称")
|
||||
private String planName;
|
||||
|
||||
/** 车间 */
|
||||
@Excel(name = "车间")
|
||||
private String planWorkshop;
|
||||
|
||||
/** 产线 */
|
||||
@Excel(name = "产线")
|
||||
private String planProdLine;
|
||||
|
||||
/** 设备名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String equipmentName;
|
||||
|
||||
/** 设备编码 */
|
||||
@Excel(name = "设备编码")
|
||||
private String equipmentCode;
|
||||
|
||||
/** 循环周期 */
|
||||
@Excel(name = "循环周期")
|
||||
private String planLoop;
|
||||
|
||||
/** 循环周期类型 */
|
||||
@Excel(name = "循环周期类型")
|
||||
private String planLoopType;
|
||||
|
||||
/** 循环执行时间开始 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "循环执行时间开始", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date planLoopStart;
|
||||
|
||||
/** 循环执行时间结束 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "循环执行时间结束", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date planLoopEnd;
|
||||
|
||||
/** 巡检人员 */
|
||||
@Excel(name = "巡检人员")
|
||||
private String planPerson;
|
||||
|
||||
/** 计划状态 */
|
||||
@Excel(name = "计划状态")
|
||||
private String planStatus;
|
||||
|
||||
/** 是否可生产-限制 */
|
||||
@Excel(name = "是否可生产-限制")
|
||||
private String planRestrict;
|
||||
|
||||
/** 维护类型 */
|
||||
@Excel(name = "维护类型")
|
||||
private String planType;
|
||||
|
||||
/** 是否委外 */
|
||||
@Excel(name = "是否委外")
|
||||
private String planOutsource;
|
||||
|
||||
/** 委外工单编码 */
|
||||
@Excel(name = "委外工单编码")
|
||||
private String workCode;
|
||||
|
||||
/** 工厂 */
|
||||
@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;
|
||||
|
||||
/** 删除标志 */
|
||||
@Excel(name = "删除标志")
|
||||
private String delFlag;
|
||||
|
||||
// 创建日期范围list
|
||||
private List<Date> createTimeArray;
|
||||
|
||||
// 更新日期范围list
|
||||
private List<Date> updateTimeArray;
|
||||
|
||||
// 更新日期开始
|
||||
private String updateTimeStart;
|
||||
|
||||
// 更新日期结束
|
||||
private String updateTimeEnd;
|
||||
|
||||
// 创建日期开始
|
||||
private String createTimeStart;
|
||||
|
||||
// 创建日期结束
|
||||
private String createTimeEnd;
|
||||
|
||||
public List<Date> getCreateTimeArray() {
|
||||
return createTimeArray;
|
||||
}
|
||||
|
||||
public void setCreateTimeArray(List<Date> createTimeArray) {
|
||||
this.createTimeArray = createTimeArray;
|
||||
}
|
||||
|
||||
public List<Date> getUpdateTimeArray() {
|
||||
return updateTimeArray;
|
||||
}
|
||||
|
||||
public void setUpdateTimeArray(List<Date> updateTimeArray) {
|
||||
this.updateTimeArray = updateTimeArray;
|
||||
}
|
||||
|
||||
public String getUpdateTimeStart() {
|
||||
return updateTimeStart;
|
||||
}
|
||||
|
||||
public void setUpdateTimeStart(String updateTimeStart) {
|
||||
this.updateTimeStart = updateTimeStart;
|
||||
}
|
||||
|
||||
public String getUpdateTimeEnd() {
|
||||
return updateTimeEnd;
|
||||
}
|
||||
|
||||
public void setUpdateTimeEnd(String updateTimeEnd) {
|
||||
this.updateTimeEnd = updateTimeEnd;
|
||||
}
|
||||
|
||||
public String getCreateTimeStart() {
|
||||
return createTimeStart;
|
||||
}
|
||||
|
||||
public void setCreateTimeStart(String createTimeStart) {
|
||||
this.createTimeStart = createTimeStart;
|
||||
}
|
||||
|
||||
public String getCreateTimeEnd() {
|
||||
return createTimeEnd;
|
||||
}
|
||||
|
||||
public void setCreateTimeEnd(String createTimeEnd) {
|
||||
this.createTimeEnd = createTimeEnd;
|
||||
}
|
||||
|
||||
public void setPlanId(String planId) {
|
||||
this.planId = planId;
|
||||
}
|
||||
|
||||
public String getPlanId() {
|
||||
return planId;
|
||||
}
|
||||
public void setPlanCode(String planCode) {
|
||||
this.planCode = planCode;
|
||||
}
|
||||
|
||||
public String getPlanCode() {
|
||||
return planCode;
|
||||
}
|
||||
public void setPlanName(String planName) {
|
||||
this.planName = planName;
|
||||
}
|
||||
|
||||
public String getPlanName() {
|
||||
return planName;
|
||||
}
|
||||
public void setPlanWorkshop(String planWorkshop) {
|
||||
this.planWorkshop = planWorkshop;
|
||||
}
|
||||
|
||||
public String getPlanWorkshop() {
|
||||
return planWorkshop;
|
||||
}
|
||||
public void setPlanProdLine(String planProdLine) {
|
||||
this.planProdLine = planProdLine;
|
||||
}
|
||||
|
||||
public String getPlanProdLine() {
|
||||
return planProdLine;
|
||||
}
|
||||
public void setEquipmentName(String equipmentName) {
|
||||
this.equipmentName = equipmentName;
|
||||
}
|
||||
|
||||
public String getEquipmentName() {
|
||||
return equipmentName;
|
||||
}
|
||||
public void setEquipmentCode(String equipmentCode) {
|
||||
this.equipmentCode = equipmentCode;
|
||||
}
|
||||
|
||||
public String getEquipmentCode() {
|
||||
return equipmentCode;
|
||||
}
|
||||
public void setPlanLoop(String planLoop) {
|
||||
this.planLoop = planLoop;
|
||||
}
|
||||
|
||||
public String getPlanLoop() {
|
||||
return planLoop;
|
||||
}
|
||||
public void setPlanLoopType(String planLoopType) {
|
||||
this.planLoopType = planLoopType;
|
||||
}
|
||||
|
||||
public String getPlanLoopType() {
|
||||
return planLoopType;
|
||||
}
|
||||
public void setPlanLoopStart(Date planLoopStart) {
|
||||
this.planLoopStart = planLoopStart;
|
||||
}
|
||||
|
||||
public Date getPlanLoopStart() {
|
||||
return planLoopStart;
|
||||
}
|
||||
public void setPlanLoopEnd(Date planLoopEnd) {
|
||||
this.planLoopEnd = planLoopEnd;
|
||||
}
|
||||
|
||||
public Date getPlanLoopEnd() {
|
||||
return planLoopEnd;
|
||||
}
|
||||
public void setPlanPerson(String planPerson) {
|
||||
this.planPerson = planPerson;
|
||||
}
|
||||
|
||||
public String getPlanPerson() {
|
||||
return planPerson;
|
||||
}
|
||||
public void setPlanStatus(String planStatus) {
|
||||
this.planStatus = planStatus;
|
||||
}
|
||||
|
||||
public String getPlanStatus() {
|
||||
return planStatus;
|
||||
}
|
||||
public void setPlanRestrict(String planRestrict) {
|
||||
this.planRestrict = planRestrict;
|
||||
}
|
||||
|
||||
public String getPlanRestrict() {
|
||||
return planRestrict;
|
||||
}
|
||||
public void setPlanType(String planType) {
|
||||
this.planType = planType;
|
||||
}
|
||||
|
||||
public String getPlanType() {
|
||||
return planType;
|
||||
}
|
||||
public void setPlanOutsource(String planOutsource) {
|
||||
this.planOutsource = planOutsource;
|
||||
}
|
||||
|
||||
public String getPlanOutsource() {
|
||||
return planOutsource;
|
||||
}
|
||||
public void setWorkCode(String workCode) {
|
||||
this.workCode = workCode;
|
||||
}
|
||||
|
||||
public String getWorkCode() {
|
||||
return workCode;
|
||||
}
|
||||
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("planId", getPlanId())
|
||||
.append("planCode", getPlanCode())
|
||||
.append("planName", getPlanName())
|
||||
.append("planWorkshop", getPlanWorkshop())
|
||||
.append("planProdLine", getPlanProdLine())
|
||||
.append("equipmentName", getEquipmentName())
|
||||
.append("equipmentCode", getEquipmentCode())
|
||||
.append("planLoop", getPlanLoop())
|
||||
.append("planLoopType", getPlanLoopType())
|
||||
.append("planLoopStart", getPlanLoopStart())
|
||||
.append("planLoopEnd", getPlanLoopEnd())
|
||||
.append("planPerson", getPlanPerson())
|
||||
.append("planStatus", getPlanStatus())
|
||||
.append("planRestrict", getPlanRestrict())
|
||||
.append("planType", getPlanType())
|
||||
.append("planOutsource", getPlanOutsource())
|
||||
.append("workCode", getWorkCode())
|
||||
.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();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.op.device.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.op.device.domain.EquPlan;
|
||||
|
||||
/**
|
||||
* 计划Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-10-16
|
||||
*/
|
||||
public interface EquPlanMapper {
|
||||
/**
|
||||
* 查询计划
|
||||
*
|
||||
* @param planId 计划主键
|
||||
* @return 计划
|
||||
*/
|
||||
public EquPlan selectEquPlanByPlanId(String planId);
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*
|
||||
* @param equPlan 计划
|
||||
* @return 计划集合
|
||||
*/
|
||||
public List<EquPlan> selectEquPlanList(EquPlan equPlan);
|
||||
|
||||
/**
|
||||
* 新增计划
|
||||
*
|
||||
* @param equPlan 计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEquPlan(EquPlan equPlan);
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*
|
||||
* @param equPlan 计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEquPlan(EquPlan equPlan);
|
||||
|
||||
/**
|
||||
* 删除计划
|
||||
*
|
||||
* @param planId 计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEquPlanByPlanId(String planId);
|
||||
|
||||
/**
|
||||
* 批量删除计划
|
||||
*
|
||||
* @param planIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEquPlanByPlanIds(String[] planIds);
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.op.device.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.op.device.domain.EquPlan;
|
||||
|
||||
/**
|
||||
* 计划Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-10-16
|
||||
*/
|
||||
public interface IEquPlanService {
|
||||
/**
|
||||
* 查询计划
|
||||
*
|
||||
* @param planId 计划主键
|
||||
* @return 计划
|
||||
*/
|
||||
public EquPlan selectEquPlanByPlanId(String planId);
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*
|
||||
* @param equPlan 计划
|
||||
* @return 计划集合
|
||||
*/
|
||||
public List<EquPlan> selectEquPlanList(EquPlan equPlan);
|
||||
|
||||
/**
|
||||
* 新增计划
|
||||
*
|
||||
* @param equPlan 计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEquPlan(EquPlan equPlan);
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*
|
||||
* @param equPlan 计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEquPlan(EquPlan equPlan);
|
||||
|
||||
/**
|
||||
* 批量删除计划
|
||||
*
|
||||
* @param planIds 需要删除的计划主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEquPlanByPlanIds(String[] planIds);
|
||||
|
||||
/**
|
||||
* 删除计划信息
|
||||
*
|
||||
* @param planId 计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEquPlanByPlanId(String planId);
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package com.op.device.service.impl;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.op.device.mapper.EquPlanMapper;
|
||||
import com.op.device.domain.EquPlan;
|
||||
import com.op.device.service.IEquPlanService;
|
||||
|
||||
/**
|
||||
* 计划Service业务层处理
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-10-16
|
||||
*/
|
||||
@Service
|
||||
public class EquPlanServiceImpl implements IEquPlanService {
|
||||
@Autowired
|
||||
private EquPlanMapper equPlanMapper;
|
||||
|
||||
/**
|
||||
* 查询计划
|
||||
*
|
||||
* @param planId 计划主键
|
||||
* @return 计划
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public EquPlan selectEquPlanByPlanId(String planId) {
|
||||
return equPlanMapper.selectEquPlanByPlanId(planId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*
|
||||
* @param equPlan 计划
|
||||
* @return 计划
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<EquPlan> selectEquPlanList(EquPlan equPlan) {
|
||||
if (equPlan.getCreateTimeArray() != null) {
|
||||
// 设置创建日期开始和结束值
|
||||
if (equPlan.getCreateTimeArray().size() == 2) {
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||
equPlan.setCreateTimeStart(formatter.format(equPlan.getCreateTimeArray().get(0)));
|
||||
equPlan.setCreateTimeEnd(formatter.format(equPlan.getCreateTimeArray().get(1)));
|
||||
}
|
||||
}
|
||||
if (equPlan.getUpdateTimeArray() != null) {
|
||||
// 设置更新日期开始和结束
|
||||
if (equPlan.getUpdateTimeArray().size() == 2) {
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||
equPlan.setUpdateTimeStart(formatter.format(equPlan.getUpdateTimeArray().get(0)));
|
||||
equPlan.setUpdateTimeEnd(formatter.format(equPlan.getUpdateTimeArray().get(1)));
|
||||
}
|
||||
}
|
||||
return equPlanMapper.selectEquPlanList(equPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划
|
||||
*
|
||||
* @param equPlan 计划
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertEquPlan(EquPlan equPlan) {
|
||||
equPlan.setCreateTime(DateUtils.getNowDate());
|
||||
return equPlanMapper.insertEquPlan(equPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*
|
||||
* @param equPlan 计划
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateEquPlan(EquPlan equPlan) {
|
||||
equPlan.setUpdateTime(DateUtils.getNowDate());
|
||||
return equPlanMapper.updateEquPlan(equPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计划
|
||||
*
|
||||
* @param planIds 需要删除的计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteEquPlanByPlanIds(String[] planIds) {
|
||||
return equPlanMapper.deleteEquPlanByPlanIds(planIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划信息
|
||||
*
|
||||
* @param planId 计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteEquPlanByPlanId(String planId) {
|
||||
return equPlanMapper.deleteEquPlanByPlanId(planId);
|
||||
}
|
||||
}
|
@ -0,0 +1,183 @@
|
||||
<?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.EquPlanMapper">
|
||||
|
||||
<resultMap type="EquPlan" id="EquPlanResult">
|
||||
<result property="planId" column="plan_id" />
|
||||
<result property="planCode" column="plan_code" />
|
||||
<result property="planName" column="plan_name" />
|
||||
<result property="planWorkshop" column="plan_workshop" />
|
||||
<result property="planProdLine" column="plan_prod_line" />
|
||||
<result property="equipmentName" column="equipment_name" />
|
||||
<result property="equipmentCode" column="equipment_code" />
|
||||
<result property="planLoop" column="plan_loop" />
|
||||
<result property="planLoopType" column="plan_loop_type" />
|
||||
<result property="planLoopStart" column="plan_loop_start" />
|
||||
<result property="planLoopEnd" column="plan_loop_end" />
|
||||
<result property="planPerson" column="plan_person" />
|
||||
<result property="planStatus" column="plan_status" />
|
||||
<result property="planRestrict" column="plan_restrict" />
|
||||
<result property="planType" column="plan_type" />
|
||||
<result property="planOutsource" column="plan_outsource" />
|
||||
<result property="workCode" column="work_code" />
|
||||
<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="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
|
||||
</sql>
|
||||
|
||||
<select id="selectEquPlanList" parameterType="EquPlan" resultMap="EquPlanResult">
|
||||
<include refid="selectEquPlanVo"/>
|
||||
<where>
|
||||
<if test="planCode != null and planCode != ''"> and plan_code like concat('%', #{planCode}, '%')</if>
|
||||
<if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
|
||||
<if test="planWorkshop != null and planWorkshop != ''"> and plan_workshop like concat('%', #{planWorkshop}, '%')</if>
|
||||
<if test="planProdLine != null and planProdLine != ''"> and plan_prod_line like concat('%', #{planProdLine}, '%')</if>
|
||||
<if test="equipmentName != null and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
|
||||
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if>
|
||||
<if test="planLoop != null and planLoop != ''"> and plan_loop like concat('%', #{planLoop}, '%')</if>
|
||||
<if test="planLoopType != null and planLoopType != ''"> and plan_loop_type = #{planLoopType}</if>
|
||||
<if test="planLoopStart != null "> and plan_loop_start = #{planLoopStart}</if>
|
||||
<if test="planLoopEnd != null "> and plan_loop_end = #{planLoopEnd}</if>
|
||||
<if test="planPerson != null and planPerson != ''"> and plan_person like concat('%', #{planPerson}, '%')</if>
|
||||
<if test="planStatus != null and planStatus != ''"> and plan_status = #{planStatus}</if>
|
||||
<if test="planRestrict != null and planRestrict != ''"> and plan_restrict = #{planRestrict}</if>
|
||||
<if test="planType != null and planType != ''"> and plan_type = #{planType}</if>
|
||||
<if test="planOutsource != null and planOutsource != ''"> and plan_outsource = #{planOutsource}</if>
|
||||
<if test="workCode != null and workCode != ''"> and work_code like concat('%', #{workCode}, '%')</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>
|
||||
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
|
||||
<if test="createTimeStart != null "> and CONVERT(date,create_time) >= #{createTimeStart}</if>
|
||||
<if test="createTimeEnd != null "> and #{createTimeEnd} >= CONVERT(date,create_time)</if>
|
||||
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
||||
<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>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEquPlanByPlanId" parameterType="String" resultMap="EquPlanResult">
|
||||
<include refid="selectEquPlanVo"/>
|
||||
where plan_id = #{planId}
|
||||
</select>
|
||||
|
||||
<insert id="insertEquPlan" parameterType="EquPlan">
|
||||
insert into equ_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="planId != null">plan_id,</if>
|
||||
<if test="planCode != null and planCode != ''">plan_code,</if>
|
||||
<if test="planName != null and planName != ''">plan_name,</if>
|
||||
<if test="planWorkshop != null and planWorkshop != ''">plan_workshop,</if>
|
||||
<if test="planProdLine != null and planProdLine != ''">plan_prod_line,</if>
|
||||
<if test="equipmentName != null and equipmentName != ''">equipment_name,</if>
|
||||
<if test="equipmentCode != null and equipmentCode != ''">equipment_code,</if>
|
||||
<if test="planLoop != null and planLoop != ''">plan_loop,</if>
|
||||
<if test="planLoopType != null and planLoopType != ''">plan_loop_type,</if>
|
||||
<if test="planLoopStart != null">plan_loop_start,</if>
|
||||
<if test="planLoopEnd != null">plan_loop_end,</if>
|
||||
<if test="planPerson != null and planPerson != ''">plan_person,</if>
|
||||
<if test="planStatus != null and planStatus != ''">plan_status,</if>
|
||||
<if test="planRestrict != null">plan_restrict,</if>
|
||||
<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="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="planId != null">#{planId},</if>
|
||||
<if test="planCode != null and planCode != ''">#{planCode},</if>
|
||||
<if test="planName != null and planName != ''">#{planName},</if>
|
||||
<if test="planWorkshop != null and planWorkshop != ''">#{planWorkshop},</if>
|
||||
<if test="planProdLine != null and planProdLine != ''">#{planProdLine},</if>
|
||||
<if test="equipmentName != null and equipmentName != ''">#{equipmentName},</if>
|
||||
<if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if>
|
||||
<if test="planLoop != null and planLoop != ''">#{planLoop},</if>
|
||||
<if test="planLoopType != null and planLoopType != ''">#{planLoopType},</if>
|
||||
<if test="planLoopStart != null">#{planLoopStart},</if>
|
||||
<if test="planLoopEnd != null">#{planLoopEnd},</if>
|
||||
<if test="planPerson != null and planPerson != ''">#{planPerson},</if>
|
||||
<if test="planStatus != null and planStatus != ''">#{planStatus},</if>
|
||||
<if test="planRestrict != null">#{planRestrict},</if>
|
||||
<if test="planType != null and planType != ''">#{planType},</if>
|
||||
<if test="planOutsource != null and planOutsource != ''">#{planOutsource},</if>
|
||||
<if test="workCode != null">#{workCode},</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="updateEquPlan" parameterType="EquPlan">
|
||||
update equ_plan
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="planCode != null and planCode != ''">plan_code = #{planCode},</if>
|
||||
<if test="planName != null and planName != ''">plan_name = #{planName},</if>
|
||||
<if test="planWorkshop != null and planWorkshop != ''">plan_workshop = #{planWorkshop},</if>
|
||||
<if test="planProdLine != null and planProdLine != ''">plan_prod_line = #{planProdLine},</if>
|
||||
<if test="equipmentName != null and equipmentName != ''">equipment_name = #{equipmentName},</if>
|
||||
<if test="equipmentCode != null and equipmentCode != ''">equipment_code = #{equipmentCode},</if>
|
||||
<if test="planLoop != null and planLoop != ''">plan_loop = #{planLoop},</if>
|
||||
<if test="planLoopType != null and planLoopType != ''">plan_loop_type = #{planLoopType},</if>
|
||||
<if test="planLoopStart != null">plan_loop_start = #{planLoopStart},</if>
|
||||
<if test="planLoopEnd != null">plan_loop_end = #{planLoopEnd},</if>
|
||||
<if test="planPerson != null and planPerson != ''">plan_person = #{planPerson},</if>
|
||||
<if test="planStatus != null and planStatus != ''">plan_status = #{planStatus},</if>
|
||||
<if test="planRestrict != null">plan_restrict = #{planRestrict},</if>
|
||||
<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="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="createTimeStart != null "> and CONVERT(date,create_time) >= #{createTimeStart}</if>
|
||||
<if test="createTimeEnd != null "> and #{createTimeEnd} >= CONVERT(date,create_time)</if>
|
||||
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
||||
<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>
|
||||
and del_flag = '0'
|
||||
</trim>
|
||||
where plan_id = #{planId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEquPlanByPlanId" parameterType="String">
|
||||
delete from equ_plan where plan_id = #{planId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEquPlanByPlanIds" parameterType="String">
|
||||
delete from equ_plan where plan_id in
|
||||
<foreach item="planId" collection="array" open="(" separator="," close=")">
|
||||
#{planId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue