Merge remote-tracking branch 'origin/master'

赵嘉伟 4 years ago
commit 7805bc4595

@ -16,5 +16,8 @@ public interface Constants {
String STATUS_Y = "Y";
String STATUS_N = "N";
//任务编号常量
String RESOURCE_INSPECT_TASK = "RESOURCE_INSPECT_TASK";
String SITE_ADMIN = "SITE_ADMIN";
}

@ -106,7 +106,12 @@ public enum HandleEnum {
NC_CODE("NCCodeBO","NCCodeBO:{0},{1}"),
/**不良代码组**/
NC_GROUP("NCGroupBO","NCGroupBO:{0},{1}");
NC_GROUP("NCGroupBO","NCGroupBO:{0},{1}"),
/**设备检验任务的检验项**/
RESOURCE_INSPECT_TASK_SPARE("ResourceInspectTaskSpareBo","ResourceInspectTaskSpareBo:{0},{1}"),
/**用户**/
USR("UserBo","UserBo:{0},{1}");
private String prefix;

@ -0,0 +1,122 @@
package com.foreverwin.mesnac.equip.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.equip.service.InspectPlanUserGroupService;
import com.foreverwin.mesnac.equip.model.InspectPlanUserGroup;
import java.util.List;
/**
*
* @author pavel.Liu
* @since 2021-06-18
*/
@RestController
@RequestMapping("/Z-INSPECT-PLAN-USER-GROUP")
public class InspectPlanUserGroupController {
@Autowired
public InspectPlanUserGroupService inspectPlanUserGroupService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getInspectPlanUserGroupById(@PathVariable String id) {
return R.ok( inspectPlanUserGroupService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getInspectPlanUserGroupList(InspectPlanUserGroup inspectPlanUserGroup){
List<InspectPlanUserGroup> result;
QueryWrapper<InspectPlanUserGroup> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectPlanUserGroup);
result = inspectPlanUserGroupService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<InspectPlanUserGroup> frontPage, InspectPlanUserGroup inspectPlanUserGroup){
IPage result;
QueryWrapper<InspectPlanUserGroup> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectPlanUserGroup);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(InspectPlanUserGroup::getHandle, frontPage.getGlobalQuery())
.or().like(InspectPlanUserGroup::getUserGroupBo, frontPage.getGlobalQuery())
.or().like(InspectPlanUserGroup::getResourceInspectPlanBo, frontPage.getGlobalQuery())
.or().like(InspectPlanUserGroup::getCreateUser, frontPage.getGlobalQuery())
.or().like(InspectPlanUserGroup::getModifyUser, frontPage.getGlobalQuery())
);
}
result = inspectPlanUserGroupService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param inspectPlanUserGroup
* @return null
*/
@PostMapping
public R save(@RequestBody InspectPlanUserGroup inspectPlanUserGroup) {
return R.ok(inspectPlanUserGroupService.save(inspectPlanUserGroup));
}
/**
*
* @param inspectPlanUserGroup
* @return null
*/
@PutMapping
public R updateById(@RequestBody InspectPlanUserGroup inspectPlanUserGroup) {
return R.ok(inspectPlanUserGroupService.updateById(inspectPlanUserGroup));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(inspectPlanUserGroupService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(inspectPlanUserGroupService.removeByIds(ids));
}
}

@ -151,7 +151,12 @@ public class ResourceInspectPlanController {
*/
@PostMapping(value = "/saveOrUpdate")
public R saveOrUpdate(@RequestBody ResourceInspectPlan resourceInspectPlan) {
return R.ok(resourceInspectPlanService.saveResourcePlanData(resourceInspectPlan));
try{
resourceInspectPlanService.saveResourcePlanData(resourceInspectPlan);
}catch (Exception e){
return R.failed("更新或保存失败:" + e.getMessage());
}
return R.ok();
}
/**
@ -179,4 +184,48 @@ public class ResourceInspectPlanController {
return R.ok(inspectionItemDetailList);
}
/**
* handle
* @param resourceInspectPlan
* @return
*/
@ResponseBody
@RequestMapping("/getInspectPlanByHandle")
public R getInspectPlanByHandle(ResourceInspectPlan resourceInspectPlan){
return R.ok(resourceInspectPlanService.getInspectPlanByHandle(resourceInspectPlan));
}
/**
* handle
* @param resourceInspectPlan
* @return
*/
@ResponseBody
@RequestMapping("/deleteInspectionPlanByHandle")
public R deleteInspectionPlanByHandle(ResourceInspectPlan resourceInspectPlan){
try {
resourceInspectPlanService.deleteInspectionPlanByHandle(resourceInspectPlan);
} catch (Exception e) {
R.failed("计划删除失败:" + e.getMessage());
}
return R.ok();
}
/**
*
* @param resourceInspectPlan
* @return
*/
/*@ResponseBody
@RequestMapping("/autoCreateTaskByResourceInspectPlan")
public R autoCreateTaskByResourceInspectPlan(ResourceInspectPlan resourceInspectPlan){
try {
resourceInspectPlanService.deleteInspectionPlanByHandle(resourceInspectPlan);
} catch (Exception e) {
R.failed("计划删除失败:" + e.getMessage());
}
return R.ok();
}*/
}

@ -143,8 +143,8 @@ public class ResourceInspectResourceController {
* @return
*/
@ResponseBody
@RequestMapping(value = "/addEquipList")
public R addEquipList(EquipType resourceType){
@RequestMapping(value = "/getEquipList")
public R getEquipList(EquipType resourceType){
String equipType = resourceType.getEquipType();
String site = CommonMethods.getSite();
List<ResourceInspectResource> resourceList = new ArrayList<>();

@ -1,5 +1,7 @@
package com.foreverwin.mesnac.equip.controller;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.equip.dto.ResourceInspectTaskDto;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
@ -11,12 +13,14 @@ import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.equip.service.ResourceInspectTaskService;
import com.foreverwin.mesnac.equip.model.ResourceInspectTask;
import java.time.LocalDateTime;
import java.util.List;
/**
*
* @author pavel.Liu
* @since 2021-06-10
* @since 2021-07-01
*/
@RestController
@RequestMapping("/Z-RESOURCE-INSPECT-TASK")
@ -76,9 +80,10 @@ public class ResourceInspectTaskController {
.or().like(ResourceInspectTask::getResourceInspectPlanBo, frontPage.getGlobalQuery())
.or().like(ResourceInspectTask::getInspectionItemBo, frontPage.getGlobalQuery())
.or().like(ResourceInspectTask::getResourceBo, frontPage.getGlobalQuery())
.or().like(ResourceInspectTask::getResult, frontPage.getGlobalQuery())
.or().like(ResourceInspectTask::getExecutor, frontPage.getGlobalQuery())
.or().like(ResourceInspectTask::getResult, frontPage.getGlobalQuery())
.or().like(ResourceInspectTask::getRemark, frontPage.getGlobalQuery())
.or().like(ResourceInspectTask::getReason, frontPage.getGlobalQuery())
.or().like(ResourceInspectTask::getCreateUser, frontPage.getGlobalQuery())
.or().like(ResourceInspectTask::getModifyUser, frontPage.getGlobalQuery())
);
@ -128,4 +133,95 @@ public class ResourceInspectTaskController {
public R removeByIds(List<String> ids){
return R.ok(resourceInspectTaskService.removeByIds(ids));
}
/**
*
* @param resourceInspectTaskDto
* @return
*/
@ResponseBody
@GetMapping("/findResourceInspectTaskList")
public R findResourceInspectTaskList(ResourceInspectTaskDto resourceInspectTaskDto){
String site = CommonMethods.getSite();
String planNo = resourceInspectTaskDto.getPlanNo();
String resourceNo = resourceInspectTaskDto.getResourceNo();
String resourceTypeNo = resourceInspectTaskDto.getResourceTypeNo();
if (planNo != null){
resourceInspectTaskDto.setResourceInspectPlanBo(HandleEnum.RESOURCE_INSPECT_PLAN.getHandle(site,planNo));
}
if (resourceNo != null){
resourceInspectTaskDto.setResourceBo(HandleEnum.RESOURCE.getHandle(site,resourceNo));
}
if (resourceTypeNo != null){
resourceInspectTaskDto.setResourceTypeBo(HandleEnum.RESOURCE_TYPE.getHandle(site,resourceTypeNo));
}
return R.ok(resourceInspectTaskService.findResourceInspectTaskList(resourceInspectTaskDto));
}
/**
*
* 1
* 2HANDLE
* @param resourceInspectTask
* @return
*/
@ResponseBody
@GetMapping("/getAndCreateTaskParamList")
public R getOrCreateTaskParamList(ResourceInspectTask resourceInspectTask){
ResourceInspectTask inspectTask;
try {
inspectTask = resourceInspectTaskService.getResourceInspectTaskAll(resourceInspectTask);
}catch (Exception e){
return R.failed("获取数据失败" + e.getMessage());
}
return R.ok(inspectTask);
}
/**
*
* @param taskNo
* @return
*/
@ResponseBody
@GetMapping("/startAndUpdateTask")
public R startAndUpdateTask(String taskNo){
String handle = HandleEnum.RESOURCE_INSPECT_TASK.getHandle(CommonMethods.getSite(), taskNo);
ResourceInspectTask task = resourceInspectTaskService.getById(handle);
task.setStatus("501");
task.setActualStartDate(LocalDateTime.now());
task.setExecutor(CommonMethods.getUser());
// 保存的数据id或者handle
//task.setExecutor(CommonMethods.getUser());
try {
resourceInspectTaskService.saveOrUpdate(task);
}catch (Exception e){
return R.failed("数据更新失败,开始执行异常" + e.getMessage());
}
return R.ok(task);
}
/***
* /
* 1
* 2
* @param
* @return
*/
@PostMapping ("/saveOrUpdateTaskInfo")
public R saveOrUpdateTaskInfo(@RequestBody ResourceInspectTaskDto resourceInspectTaskDto){
String user = CommonMethods.getUser();
String executor = resourceInspectTaskDto.getExecutor();
if (user.equals(executor)){
try {
resourceInspectTaskService.saveOrUpdateTaskInfo(resourceInspectTaskDto);
}catch (Exception e){
return R.failed("数据保存失败" + e.getMessage());
}
return R.ok();
}
return R.failed("当前操作用户与执行人不一致,无法保存!!!");
}
}

@ -16,7 +16,7 @@ import java.util.List;
/**
*
* @author pavel.Liu
* @since 2021-06-10
* @since 2021-07-01
*/
@RestController
@RequestMapping("/Z-RESOURCE-INSPECT-TASK-PARAM")
@ -68,17 +68,16 @@ public class ResourceInspectTaskParamController {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(ResourceInspectTaskParam::getHandle, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getResourceInspectTaskBo, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getResourceBo, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getInspectNo, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getResourceInspectTaskBo, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getDescription, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getInspectMethod, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getInspectDataType, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getParamUnit, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getRequired, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getStandardValue, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getResrceValue, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getParamUnit, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getResrce, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getResultValue, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getResult, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getRemark, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getCreateUser, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskParam::getModifyUser, frontPage.getGlobalQuery())

@ -0,0 +1,126 @@
package com.foreverwin.mesnac.equip.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService;
import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare;
import java.util.List;
/**
*
* @author pavel.Liu
* @since 2021-07-01
*/
@RestController
@RequestMapping("/Z-RESOURCE-INSPECT-TASK-SPARE")
public class ResourceInspectTaskSpareController {
@Autowired
public ResourceInspectTaskSpareService resourceInspectTaskSpareService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getResourceInspectTaskSpareById(@PathVariable String id) {
return R.ok( resourceInspectTaskSpareService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getResourceInspectTaskSpareList(ResourceInspectTaskSpare resourceInspectTaskSpare){
List<ResourceInspectTaskSpare> result;
QueryWrapper<ResourceInspectTaskSpare> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(resourceInspectTaskSpare);
result = resourceInspectTaskSpareService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<ResourceInspectTaskSpare> frontPage, ResourceInspectTaskSpare resourceInspectTaskSpare){
IPage result;
QueryWrapper<ResourceInspectTaskSpare> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(resourceInspectTaskSpare);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(ResourceInspectTaskSpare::getHandle, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskSpare::getSpareNo, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskSpare::getResourceInspectTaskBo, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskSpare::getItemBo, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskSpare::getDescription, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskSpare::getUnit, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskSpare::getRemark, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskSpare::getCreateUser, frontPage.getGlobalQuery())
.or().like(ResourceInspectTaskSpare::getModifyUser, frontPage.getGlobalQuery())
);
}
result = resourceInspectTaskSpareService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param resourceInspectTaskSpare
* @return null
*/
@PostMapping
public R save(@RequestBody ResourceInspectTaskSpare resourceInspectTaskSpare) {
return R.ok(resourceInspectTaskSpareService.save(resourceInspectTaskSpare));
}
/**
*
* @param resourceInspectTaskSpare
* @return null
*/
@PutMapping
public R updateById(@RequestBody ResourceInspectTaskSpare resourceInspectTaskSpare) {
return R.ok(resourceInspectTaskSpareService.updateById(resourceInspectTaskSpare));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(resourceInspectTaskSpareService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(resourceInspectTaskSpareService.removeByIds(ids));
}
}

@ -0,0 +1,356 @@
package com.foreverwin.mesnac.equip.dto;
import com.foreverwin.mesnac.equip.model.ResourceInspectTaskParam;
import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author pavel.Liu
* @since 2021-06-24
*/
public class ResourceInspectTaskDto implements Serializable {
/**序号**/
private Integer itemSeq;
/**主键**/
private String handle;
/**站点**/
private String site;
/**任务编号**/
private String taskNo;
/**类型(自动AUTO/手动)**/
private String category;
/**任务描述**/
private String description;
/**任务状态(新建/处理中/完成/关闭)**/
private String status;
/**设备检验计划HANDLE**/
private String resourceInspectPlanBo;
/**检验项目清单HANDLE**/
private String inspectionItemBo;
/**设备HANDLE**/
private String resourceBo;
/**检验结果**/
private String result;
/**任务创建时间**/
private LocalDateTime taskCreateDate;
/**计划开始时间**/
private LocalDateTime planStartDate;
/**计划完成时间**/
private LocalDateTime planCompleteDate;
/**实际开始时间**/
private LocalDateTime actualStartDate;
/**实际完成时间**/
private LocalDateTime actualCompleteDate;
/**执行人**/
private String executor;
/**备注**/
private String remark;
/**检索时间段的开始时间**/
private LocalDateTime compareStartTime;
/**检索时间段的结束时间**/
private LocalDateTime compareEndTime;
/**设备编号NO**/
private String resourceNo;
/**设备描述**/
private String resourceDescription;
/**设备类型编号NO**/
private String resourceTypeNo;
/**设备类型描述**/
private String resourceTypeDescription;
/**设备类型HANDLE**/
private String resourceTypeBo;
/**计划编号NO**/
private String planNo;
/**计划描述**/
private String planDescription;
/**频率**/
private String frequency;
/**周期单位**/
private String frequencyUnit;
/**周期**/
private String cycle;
/**当前用户**/
private String currentUser;
/**车间**/
private String workCenter;
/**任务检验项明细**/
private List<ResourceInspectTaskParam> taskItemDetailList;
/**消耗备品**/
private List<ResourceInspectTaskSpare> taskSpareList;
public List<ResourceInspectTaskParam> getTaskItemDetailList() {
return taskItemDetailList;
}
public void setTaskItemDetailList(List<ResourceInspectTaskParam> taskItemDetailList) {
this.taskItemDetailList = taskItemDetailList;
}
public List<ResourceInspectTaskSpare> getTaskSpareList() {
return taskSpareList;
}
public void setTaskSpareList(List<ResourceInspectTaskSpare> taskSpareList) {
this.taskSpareList = taskSpareList;
}
public ResourceInspectTaskDto() {
}
public String getResourceNo() {
return resourceNo;
}
public void setResourceNo(String resourceNo) {
this.resourceNo = resourceNo;
}
public String getResourceDescription() {
return resourceDescription;
}
public void setResourceDescription(String resourceDescription) {
this.resourceDescription = resourceDescription;
}
public String getPlanNo() {
return planNo;
}
public void setPlanNo(String planNo) {
this.planNo = planNo;
}
public String getPlanDescription() {
return planDescription;
}
public void setPlanDescription(String planDescription) {
this.planDescription = planDescription;
}
public String getCycle() {
return cycle;
}
public void setCycle(String cycle) {
this.cycle = cycle;
}
public String getFrequency() {
return frequency;
}
public void setFrequency(String frequency) {
this.frequency = frequency;
}
public String getFrequencyUnit() {
return frequencyUnit;
}
public void setFrequencyUnit(String frequencyUnit) {
this.frequencyUnit = frequencyUnit;
}
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getTaskNo() {
return taskNo;
}
public void setTaskNo(String taskNo) {
this.taskNo = taskNo;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getResourceInspectPlanBo() {
return resourceInspectPlanBo;
}
public void setResourceInspectPlanBo(String resourceInspectPlanBo) {
this.resourceInspectPlanBo = resourceInspectPlanBo;
}
public String getInspectionItemBo() {
return inspectionItemBo;
}
public void setInspectionItemBo(String inspectionItemBo) {
this.inspectionItemBo = inspectionItemBo;
}
public String getResourceBo() {
return resourceBo;
}
public void setResourceBo(String resourceBo) {
this.resourceBo = resourceBo;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public LocalDateTime getTaskCreateDate() {
return taskCreateDate;
}
public void setTaskCreateDate(LocalDateTime taskCreateDate) {
this.taskCreateDate = taskCreateDate;
}
public LocalDateTime getPlanStartDate() {
return planStartDate;
}
public void setPlanStartDate(LocalDateTime planStartDate) {
this.planStartDate = planStartDate;
}
public LocalDateTime getPlanCompleteDate() {
return planCompleteDate;
}
public void setPlanCompleteDate(LocalDateTime planCompleteDate) {
this.planCompleteDate = planCompleteDate;
}
public LocalDateTime getActualStartDate() {
return actualStartDate;
}
public void setActualStartDate(LocalDateTime actualStartDate) {
this.actualStartDate = actualStartDate;
}
public LocalDateTime getActualCompleteDate() {
return actualCompleteDate;
}
public void setActualCompleteDate(LocalDateTime actualCompleteDate) {
this.actualCompleteDate = actualCompleteDate;
}
public String getExecutor() {
return executor;
}
public void setExecutor(String executor) {
this.executor = executor;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public LocalDateTime getCompareStartTime() {
return compareStartTime;
}
public void setCompareStartTime(LocalDateTime compareStartTime) {
this.compareStartTime = compareStartTime;
}
public LocalDateTime getCompareEndTime() {
return compareEndTime;
}
public void setCompareEndTime(LocalDateTime compareEndTime) {
this.compareEndTime = compareEndTime;
}
public String getCurrentUser() {
return currentUser;
}
public void setCurrentUser(String currentUser) {
this.currentUser = currentUser;
}
public String getResourceTypeNo() {
return resourceTypeNo;
}
public void setResourceTypeNo(String resourceTypeNo) {
this.resourceTypeNo = resourceTypeNo;
}
public String getResourceTypeDescription() {
return resourceTypeDescription;
}
public void setResourceTypeDescription(String resourceTypeDescription) {
this.resourceTypeDescription = resourceTypeDescription;
}
public String getResourceTypeBo() {
return resourceTypeBo;
}
public void setResourceTypeBo(String resourceTypeBo) {
this.resourceTypeBo = resourceTypeBo;
}
public String getWorkCenter() {
return workCenter;
}
public void setWorkCenter(String workCenter) {
this.workCenter = workCenter;
}
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.equip.mapper;
import com.foreverwin.mesnac.equip.model.InspectPlanUserGroup;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author pavel.Liu
* @since 2021-06-18
*/
@Repository
public interface InspectPlanUserGroupMapper extends BaseMapper<InspectPlanUserGroup> {
}

@ -1,18 +1,27 @@
package com.foreverwin.mesnac.equip.mapper;
import com.foreverwin.mesnac.equip.dto.ResourceInspectTaskDto;
import com.foreverwin.mesnac.equip.model.ResourceInspectTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
* </p>
*
* @author pavel.Liu
* @since 2021-06-10
* @since 2021-07-01
*/
@Repository
public interface ResourceInspectTaskMapper extends BaseMapper<ResourceInspectTask> {
/**
* ---
* @param resourceInspectTaskDto
* @return
*/
List<ResourceInspectTaskDto> findResourceInspectTaskList(ResourceInspectTaskDto resourceInspectTaskDto);
}

@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository;
* </p>
*
* @author pavel.Liu
* @since 2021-06-10
* @since 2021-07-01
*/
@Repository
public interface ResourceInspectTaskParamMapper extends BaseMapper<ResourceInspectTaskParam> {

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.equip.mapper;
import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* - Mapper
* </p>
*
* @author pavel.Liu
* @since 2021-07-01
*/
@Repository
public interface ResourceInspectTaskSpareMapper extends BaseMapper<ResourceInspectTaskSpare> {
}

@ -0,0 +1,192 @@
package com.foreverwin.mesnac.equip.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
*
* </p>
*
* @author pavel.Liu
* @since 2021-06-18
*/
@TableName("Z_INSPECT_PLAN_USER_GROUP")
public class InspectPlanUserGroup extends Model<InspectPlanUserGroup> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
* HANDLE
*/
@TableField("USER_GROUP_BO")
private String userGroupBo;
/**
* HANDLE
*/
@TableField("RESOURCE_INSPECT_PLAN_BO")
private String resourceInspectPlanBo;
/**
*
*/
@TableField("CREATE_USER")
private String createUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("MODIFY_USER")
private String modifyUser;
/**
*
*/
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
/***
*
*/
@TableField(exist = false)
private String userGroupNo;
/**
*
*/
@TableField(exist = false)
private String description;
/**
*
*/
@TableField(exist = false)
private Integer itemSeq;
public String getUserGroupNo() {
return userGroupNo;
}
public void setUserGroupNo(String userGroupNo) {
this.userGroupNo = userGroupNo;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getItemSeq() {
return itemSeq;
}
public void setItemSeq(Integer itemSeq) {
this.itemSeq = itemSeq;
}
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getUserGroupBo() {
return userGroupBo;
}
public void setUserGroupBo(String userGroupBo) {
this.userGroupBo = userGroupBo;
}
public String getResourceInspectPlanBo() {
return resourceInspectPlanBo;
}
public void setResourceInspectPlanBo(String resourceInspectPlanBo) {
this.resourceInspectPlanBo = resourceInspectPlanBo;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String USER_GROUP_BO = "USER_GROUP_BO";
public static final String RESOURCE_INSPECT_PLAN_BO = "RESOURCE_INSPECT_PLAN_BO";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "InspectPlanUserGroup{" +
"handle = " + handle +
", userGroupBo = " + userGroupBo +
", resourceInspectPlanBo = " + resourceInspectPlanBo +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -8,13 +8,14 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.foreverwin.mesnac.common.model.InspectionItemDetail;
//import com.foreverwin.mesnac.quality.model.InspectionItem;
/**
* <p>
@ -148,12 +149,17 @@ public class ResourceInspectPlan extends Model<ResourceInspectPlan> {
@TableField(exist = false)
private List<InspectionItemDetail> inspectionItemDetailList = new ArrayList<>();
/**
*
*/
@TableField(exist = false)
private List<InspectPlanUserGroup> inspectPlanUserGroupList = new ArrayList<>();
public List<ResourceInspectResource> getMaintainPlanEquipList() {
return maintainPlanEquipList;
}
public void setMaintainPlanEquips(List<ResourceInspectResource> maintainPlanEquipList) {
public void setMaintainPlanEquipList(List<ResourceInspectResource> maintainPlanEquipList) {
this.maintainPlanEquipList = maintainPlanEquipList;
}
@ -165,6 +171,14 @@ public class ResourceInspectPlan extends Model<ResourceInspectPlan> {
this.inspectionItemDetailList = inspectionItemDetailList;
}
public List<InspectPlanUserGroup> getInspectPlanUserGroupList() {
return inspectPlanUserGroupList;
}
public void setInspectPlanUserGroupList(List<InspectPlanUserGroup> inspectPlanUserGroupList) {
this.inspectPlanUserGroupList = inspectPlanUserGroupList;
}
public String getHandle() {
return handle;
}

@ -9,7 +9,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
@ -51,6 +53,7 @@ public class ResourceInspectResource extends Model<ResourceInspectResource> {
*
*/
@TableField("DESCRIPTION")
// @TableField(exist = false)
private String description;
/**
* (/)
@ -61,6 +64,8 @@ public class ResourceInspectResource extends Model<ResourceInspectResource> {
*
*/
@TableField("TASK_CREATE_DATE")
// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
// @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime taskCreateDate;
/**
*

@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
/**
@ -16,7 +18,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
* </p>
*
* @author pavel.Liu
* @since 2021-06-10
* @since 2021-07-01
*/
@TableName("Z_RESOURCE_INSPECT_TASK")
@ -71,10 +73,10 @@ public class ResourceInspectTask extends Model<ResourceInspectTask> {
@TableField("RESOURCE_BO")
private String resourceBo;
/**
*
*
*/
@TableField("RESULT")
private String result;
@TableField("TASK_CREATE_DATE")
private LocalDateTime taskCreateDate;
/**
*
*/
@ -100,11 +102,21 @@ public class ResourceInspectTask extends Model<ResourceInspectTask> {
*/
@TableField("EXECUTOR")
private String executor;
/**
*
*/
@TableField("RESULT")
private String result;
/**
*
*/
@TableField("REMARK")
private String remark;
/**
*
*/
@TableField("REASON")
private String reason;
/**
*
*/
@ -126,6 +138,27 @@ public class ResourceInspectTask extends Model<ResourceInspectTask> {
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
@TableField(exist = false)
private List<ResourceInspectTaskParam> taskItemDetailList;
@TableField(exist = false)
private List<ResourceInspectTaskSpare> taskSpareList;
public List<ResourceInspectTaskParam> getTaskItemDetailList() {
return taskItemDetailList;
}
public void setTaskItemDetailList(List<ResourceInspectTaskParam> taskItemDetailList) {
this.taskItemDetailList = taskItemDetailList;
}
public List<ResourceInspectTaskSpare> getTaskSpareList() {
return taskSpareList;
}
public void setTaskSpareList(List<ResourceInspectTaskSpare> taskSpareList) {
this.taskSpareList = taskSpareList;
}
public String getHandle() {
return handle;
@ -199,12 +232,12 @@ public class ResourceInspectTask extends Model<ResourceInspectTask> {
this.resourceBo = resourceBo;
}
public String getResult() {
return result;
public LocalDateTime getTaskCreateDate() {
return taskCreateDate;
}
public void setResult(String result) {
this.result = result;
public void setTaskCreateDate(LocalDateTime taskCreateDate) {
this.taskCreateDate = taskCreateDate;
}
public LocalDateTime getPlanStartDate() {
@ -247,6 +280,14 @@ public class ResourceInspectTask extends Model<ResourceInspectTask> {
this.executor = executor;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public String getRemark() {
return remark;
}
@ -255,6 +296,14 @@ public class ResourceInspectTask extends Model<ResourceInspectTask> {
this.remark = remark;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getCreateUser() {
return createUser;
}
@ -305,7 +354,7 @@ public static final String INSPECTION_ITEM_BO = "INSPECTION_ITEM_BO";
public static final String RESOURCE_BO = "RESOURCE_BO";
public static final String RESULT = "RESULT";
public static final String TASK_CREATE_DATE = "TASK_CREATE_DATE";
public static final String PLAN_START_DATE = "PLAN_START_DATE";
@ -317,8 +366,12 @@ public static final String ACTUAL_COMPLETE_DATE = "ACTUAL_COMPLETE_DATE";
public static final String EXECUTOR = "EXECUTOR";
public static final String RESULT = "RESULT";
public static final String REMARK = "REMARK";
public static final String REASON = "REASON";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
@ -345,13 +398,15 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
", resourceInspectPlanBo = " + resourceInspectPlanBo +
", inspectionItemBo = " + inspectionItemBo +
", resourceBo = " + resourceBo +
", result = " + result +
", taskCreateDate = " + taskCreateDate +
", planStartDate = " + planStartDate +
", planCompleteDate = " + planCompleteDate +
", actualStartDate = " + actualStartDate +
", actualCompleteDate = " + actualCompleteDate +
", executor = " + executor +
", result = " + result +
", remark = " + remark +
", reason = " + reason +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +

@ -4,6 +4,7 @@ import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
@ -15,7 +16,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
* </p>
*
* @author pavel.Liu
* @since 2021-06-10
* @since 2021-07-01
*/
@TableName("Z_RESOURCE_INSPECT_TASK_PARAM")
@ -27,76 +28,71 @@ public class ResourceInspectTaskParam extends Model<ResourceInspectTaskParam> {
/**
*
*/
@TableField("HANDLE")
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
* HANDLE
*/
@TableField("RESOURCE_INSPECT_TASK_BO")
private String resourceInspectTaskBo;
/**
*
*/
@TableField("RESOURCE_BO")
private String resourceBo;
/**
*
*/
@TableField("INSPECT_NO")
private String inspectNo;
/**
*
* HANDLE
*/
@TableField("RESOURCE_INSPECT_TASK_BO")
private String resourceInspectTaskBo;
/**
*
*/
@TableField("DESCRIPTION")
private String description;
/**
* TNB
* /
*/
@TableField("INSPECT_METHOD")
private String inspectMethod;
/**
*
* TNB
*/
@TableField("INSPECT_DATA_TYPE")
private String inspectDataType;
/**
*
*
*/
@TableField("PARAM_UNIT")
private String paramUnit;
/**
* YN
*/
@TableField("REQUIRED")
private String required;
/**
*
*
*/
@TableField("MIN_VALUE")
private Double minValue;
/**
*
*
*/
@TableField("MAX_VALUE")
private Double maxValue;
/**
*
*
*/
@TableField("STANDARD_VALUE")
private String standardValue;
/**
*
*
*/
@TableField("RESRCE_VALUE")
private String resrceValue;
@TableField("RESULT_VALUE")
private String resultValue;
/**
* Y/N
* Y/N
*/
@TableField("PARAM_UNIT")
private String paramUnit;
@TableField("RESULT")
private String result;
/**
*
*/
@TableField("RESRCE")
private String resrce;
/**
*
*/
@TableField("REMARK")
private String remark;
/**
@ -120,29 +116,26 @@ public class ResourceInspectTaskParam extends Model<ResourceInspectTaskParam> {
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
/**
*
* **/
@TableField(exist = false)
private Integer seq;
public String getHandle() {
return handle;
public Integer getSeq() {
return seq;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getResourceInspectTaskBo() {
return resourceInspectTaskBo;
}
public void setResourceInspectTaskBo(String resourceInspectTaskBo) {
this.resourceInspectTaskBo = resourceInspectTaskBo;
public void setSeq(Integer seq) {
this.seq = seq;
}
public String getResourceBo() {
return resourceBo;
public String getHandle() {
return handle;
}
public void setResourceBo(String resourceBo) {
this.resourceBo = resourceBo;
public void setHandle(String handle) {
this.handle = handle;
}
public String getInspectNo() {
@ -153,6 +146,14 @@ public class ResourceInspectTaskParam extends Model<ResourceInspectTaskParam> {
this.inspectNo = inspectNo;
}
public String getResourceInspectTaskBo() {
return resourceInspectTaskBo;
}
public void setResourceInspectTaskBo(String resourceInspectTaskBo) {
this.resourceInspectTaskBo = resourceInspectTaskBo;
}
public String getDescription() {
return description;
}
@ -177,6 +178,14 @@ public class ResourceInspectTaskParam extends Model<ResourceInspectTaskParam> {
this.inspectDataType = inspectDataType;
}
public String getParamUnit() {
return paramUnit;
}
public void setParamUnit(String paramUnit) {
this.paramUnit = paramUnit;
}
public String getRequired() {
return required;
}
@ -209,28 +218,20 @@ public class ResourceInspectTaskParam extends Model<ResourceInspectTaskParam> {
this.standardValue = standardValue;
}
public String getResrceValue() {
return resrceValue;
public String getResultValue() {
return resultValue;
}
public void setResrceValue(String resrceValue) {
this.resrceValue = resrceValue;
public void setResultValue(String resultValue) {
this.resultValue = resultValue;
}
public String getParamUnit() {
return paramUnit;
}
public void setParamUnit(String paramUnit) {
this.paramUnit = paramUnit;
public String getResult() {
return result;
}
public String getResrce() {
return resrce;
}
public void setResrce(String resrce) {
this.resrce = resrce;
public void setResult(String result) {
this.result = result;
}
public String getRemark() {
@ -275,18 +276,18 @@ public class ResourceInspectTaskParam extends Model<ResourceInspectTaskParam> {
public static final String HANDLE = "HANDLE";
public static final String RESOURCE_INSPECT_TASK_BO = "RESOURCE_INSPECT_TASK_BO";
public static final String RESOURCE_BO = "RESOURCE_BO";
public static final String INSPECT_NO = "INSPECT_NO";
public static final String RESOURCE_INSPECT_TASK_BO = "RESOURCE_INSPECT_TASK_BO";
public static final String DESCRIPTION = "DESCRIPTION";
public static final String INSPECT_METHOD = "INSPECT_METHOD";
public static final String INSPECT_DATA_TYPE = "INSPECT_DATA_TYPE";
public static final String PARAM_UNIT = "PARAM_UNIT";
public static final String REQUIRED = "REQUIRED";
public static final String MIN_VALUE = "MIN_VALUE";
@ -295,11 +296,9 @@ public static final String MAX_VALUE = "MAX_VALUE";
public static final String STANDARD_VALUE = "STANDARD_VALUE";
public static final String RESRCE_VALUE = "RESRCE_VALUE";
public static final String PARAM_UNIT = "PARAM_UNIT";
public static final String RESULT_VALUE = "RESULT_VALUE";
public static final String RESRCE = "RESRCE";
public static final String RESULT = "RESULT";
public static final String REMARK = "REMARK";
@ -321,19 +320,18 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
public String toString() {
return "ResourceInspectTaskParam{" +
"handle = " + handle +
", resourceInspectTaskBo = " + resourceInspectTaskBo +
", resourceBo = " + resourceBo +
", inspectNo = " + inspectNo +
", resourceInspectTaskBo = " + resourceInspectTaskBo +
", description = " + description +
", inspectMethod = " + inspectMethod +
", inspectDataType = " + inspectDataType +
", paramUnit = " + paramUnit +
", required = " + required +
", minValue = " + minValue +
", maxValue = " + maxValue +
", standardValue = " + standardValue +
", resrceValue = " + resrceValue +
", paramUnit = " + paramUnit +
", resrce = " + resrce +
", resultValue = " + resultValue +
", result = " + result +
", remark = " + remark +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +

@ -0,0 +1,246 @@
package com.foreverwin.mesnac.equip.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
* -
* </p>
*
* @author pavel.Liu
* @since 2021-07-01
*/
@TableName("Z_RESOURCE_INSPECT_TASK_SPARE")
public class ResourceInspectTaskSpare extends Model<ResourceInspectTaskSpare> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SPARE_NO")
private String spareNo;
/**
* HANDLE
*/
@TableField("RESOURCE_INSPECT_TASK_BO")
private String resourceInspectTaskBo;
/**
* HANDLE
*/
@TableField("ITEM_BO")
private String itemBo;
/**
*
*/
@TableField("DESCRIPTION")
private String description;
/**
*
*/
@TableField("QTY")
private Double qty;
/**
*
*/
@TableField("UNIT")
private String unit;
/**
*
*/
@TableField("REMARK")
private String remark;
/**
*
*/
@TableField("CREATE_USER")
private String createUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("MODIFY_USER")
private String modifyUser;
/**
*
*/
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
/**
*
* **/
@TableField(exist = false)
private Integer seq;
public Integer getSeq() {
return seq;
}
public void setSeq(Integer seq) {
this.seq = seq;
}
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getSpareNo() {
return spareNo;
}
public void setSpareNo(String spareNo) {
this.spareNo = spareNo;
}
public String getResourceInspectTaskBo() {
return resourceInspectTaskBo;
}
public void setResourceInspectTaskBo(String resourceInspectTaskBo) {
this.resourceInspectTaskBo = resourceInspectTaskBo;
}
public String getItemBo() {
return itemBo;
}
public void setItemBo(String itemBo) {
this.itemBo = itemBo;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Double getQty() {
return qty;
}
public void setQty(Double qty) {
this.qty = qty;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String SPARE_NO = "SPARE_NO";
public static final String RESOURCE_INSPECT_TASK_BO = "RESOURCE_INSPECT_TASK_BO";
public static final String ITEM_BO = "ITEM_BO";
public static final String DESCRIPTION = "DESCRIPTION";
public static final String QTY = "QTY";
public static final String UNIT = "UNIT";
public static final String REMARK = "REMARK";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "ResourceInspectTaskSpare{" +
"handle = " + handle +
", spareNo = " + spareNo +
", resourceInspectTaskBo = " + resourceInspectTaskBo +
", itemBo = " + itemBo +
", description = " + description +
", qty = " + qty +
", unit = " + unit +
", remark = " + remark +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -0,0 +1,30 @@
package com.foreverwin.mesnac.equip.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.equip.model.InspectPlanUserGroup;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author pavel.Liu
* @since 2021-06-18
*/
public interface InspectPlanUserGroupService extends IService<InspectPlanUserGroup> {
/**
*
* @param frontPage
* @return
*/
IPage<InspectPlanUserGroup> selectPage(FrontPage<InspectPlanUserGroup> frontPage, InspectPlanUserGroup inspectPlanUserGroup);
List<InspectPlanUserGroup> selectList(InspectPlanUserGroup inspectPlanUserGroup);
void deleteAll(InspectPlanUserGroup inspectPlanUserGroup);
}

@ -26,5 +26,12 @@ public interface ResourceInspectPlanService extends IService<ResourceInspectPlan
List<ResourceInspectPlan> selectList(ResourceInspectPlan resourceInspectPlan);
boolean saveResourcePlanData(ResourceInspectPlan resourceInspectPlan);
void saveResourcePlanData(ResourceInspectPlan resourceInspectPlan);
ResourceInspectPlan getInspectPlanByHandle(ResourceInspectPlan resourceInspectPlan);
void deleteInspectionPlanByHandle(ResourceInspectPlan resourceInspectPlan);
void autoCreateTaskByResourceInspectPlan(ResourceInspectPlan resourceInspectPlan);
}

@ -25,4 +25,7 @@ public interface ResourceInspectResourceService extends IService<ResourceInspect
IPage<ResourceInspectResource> selectPage(FrontPage<ResourceInspectResource> frontPage, ResourceInspectResource resourceInspectResource);
List<ResourceInspectResource> selectList(ResourceInspectResource resourceInspectResource);
void deleteAll(ResourceInspectResource resourceInspectResource);
}

@ -13,7 +13,7 @@ import java.util.List;
* </p>
*
* @author pavel.Liu
* @since 2021-06-10
* @since 2021-06-29
*/
public interface ResourceInspectTaskParamService extends IService<ResourceInspectTaskParam> {
@ -25,4 +25,7 @@ public interface ResourceInspectTaskParamService extends IService<ResourceInspec
IPage<ResourceInspectTaskParam> selectPage(FrontPage<ResourceInspectTaskParam> frontPage, ResourceInspectTaskParam resourceInspectTaskParam);
List<ResourceInspectTaskParam> selectList(ResourceInspectTaskParam resourceInspectTaskParam);
void removeAll(ResourceInspectTaskParam resourceInspectTaskParam);
}

@ -1,8 +1,10 @@
package com.foreverwin.mesnac.equip.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.equip.dto.ResourceInspectTaskDto;
import com.foreverwin.mesnac.equip.model.ResourceInspectTask;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.equip.model.ResourceInspectTaskParam;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
@ -13,7 +15,7 @@ import java.util.List;
* </p>
*
* @author pavel.Liu
* @since 2021-06-10
* @since 2021-06-24
*/
public interface ResourceInspectTaskService extends IService<ResourceInspectTask> {
@ -25,4 +27,24 @@ public interface ResourceInspectTaskService extends IService<ResourceInspectTask
IPage<ResourceInspectTask> selectPage(FrontPage<ResourceInspectTask> frontPage, ResourceInspectTask resourceInspectTask);
List<ResourceInspectTask> selectList(ResourceInspectTask resourceInspectTask);
/**
*
* @param resourceInspectTaskDto
* @return
*/
List<ResourceInspectTaskDto> findResourceInspectTaskList(ResourceInspectTaskDto resourceInspectTaskDto);
/**
*
* 1
* 2
* **/
ResourceInspectTask getResourceInspectTaskAll(ResourceInspectTask resourceInspectTask);
/**
*
*/
void saveOrUpdateTaskInfo(ResourceInspectTaskDto resourceInspectTaskDto);
}

@ -0,0 +1,31 @@
package com.foreverwin.mesnac.equip.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
* -
* </p>
*
* @author pavel.Liu
* @since 2021-06-30
*/
public interface ResourceInspectTaskSpareService extends IService<ResourceInspectTaskSpare> {
/**
*
* @param frontPage
* @return
*/
IPage<ResourceInspectTaskSpare> selectPage(FrontPage<ResourceInspectTaskSpare> frontPage, ResourceInspectTaskSpare resourceInspectTaskSpare);
List<ResourceInspectTaskSpare> selectList(ResourceInspectTaskSpare resourceInspectTaskSpare);
void removeAll(ResourceInspectTaskSpare resourceInspectTaskSpare);
}

@ -0,0 +1,53 @@
package com.foreverwin.mesnac.equip.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.equip.model.InspectPlanUserGroup;
import com.foreverwin.mesnac.equip.mapper.InspectPlanUserGroupMapper;
import com.foreverwin.mesnac.equip.service.InspectPlanUserGroupService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author pavel.Liu
* @since 2021-06-18
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class InspectPlanUserGroupServiceImpl extends ServiceImpl<InspectPlanUserGroupMapper, InspectPlanUserGroup> implements InspectPlanUserGroupService {
@Autowired
private InspectPlanUserGroupMapper inspectPlanUserGroupMapper;
@Override
public IPage<InspectPlanUserGroup> selectPage(FrontPage<InspectPlanUserGroup> frontPage, InspectPlanUserGroup inspectPlanUserGroup) {
QueryWrapper<InspectPlanUserGroup> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectPlanUserGroup);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<InspectPlanUserGroup> selectList(InspectPlanUserGroup inspectPlanUserGroup) {
QueryWrapper<InspectPlanUserGroup> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectPlanUserGroup);
return super.list(queryWrapper);
}
@Override
public void deleteAll(InspectPlanUserGroup inspectPlanUserGroup) {
QueryWrapper<InspectPlanUserGroup> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectPlanUserGroup);
super.remove(queryWrapper);
}
}

@ -1,25 +1,33 @@
package com.foreverwin.mesnac.equip.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.helper.NextNumberHelper;
import com.foreverwin.mesnac.common.model.InspectionItem;
import com.foreverwin.mesnac.common.model.InspectionItemDetail;
import com.foreverwin.mesnac.common.service.InspectionItemDetailService;
import com.foreverwin.mesnac.common.service.InspectionItemService;
import com.foreverwin.mesnac.equip.model.ResourceInspectResource;
import com.foreverwin.mesnac.equip.service.ResourceInspectResourceService;
import com.foreverwin.mesnac.common.service.NextNumberService;
import com.foreverwin.mesnac.equip.model.*;
import com.foreverwin.mesnac.equip.service.*;
import com.foreverwin.mesnac.meapi.model.UserGroup;
import com.foreverwin.mesnac.meapi.service.UserGroupService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.equip.model.ResourceInspectPlan;
import com.foreverwin.mesnac.equip.mapper.ResourceInspectPlanMapper;
import com.foreverwin.mesnac.equip.service.ResourceInspectPlanService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
/**
* <p>
@ -33,22 +41,24 @@ import java.util.List;
@Transactional(rollbackFor = Exception.class)
public class ResourceInspectPlanServiceImpl extends ServiceImpl<ResourceInspectPlanMapper, ResourceInspectPlan> implements ResourceInspectPlanService {
@Autowired
private ResourceInspectPlanMapper resourceInspectPlanMapper;
private NextNumberHelper nextNumberHelper;
@Autowired
public ResourceInspectPlanService resourceInspectPlanService;
@Autowired
public InspectionItemService inspectionItemService;
@Autowired
public InspectionItemDetailService inspectionItemDetailService;
@Autowired
public ResourceInspectResourceService resourceInspectResourceService;
@Autowired
public InspectPlanUserGroupService inspectPlanUserGroupService;
@Autowired
public UserGroupService userGroupService;
@Autowired
public ResourceInspectTaskService resourceInspectTaskService;
@Autowired
public ResourceInspectTaskParamService resourceInspectTaskParamService;
@Override
public IPage<ResourceInspectPlan> selectPage(FrontPage<ResourceInspectPlan> frontPage, ResourceInspectPlan resourceInspectPlan) {
@ -64,53 +74,363 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl<ResourceInspectP
return super.list(queryWrapper);
}
/**
*
* @param resourceInspectPlan
*/
@Override
public boolean saveResourcePlanData(ResourceInspectPlan resourceInspectPlan) {
// 创建人员
String user = CommonMethods.getUser();
public void saveResourcePlanData(ResourceInspectPlan resourceInspectPlan) {
// 判断检验项目清单HANDLE是否存在
String inspectionItemBo = resourceInspectPlan.getInspectionItemBo();
InspectionItem inspectionItem = inspectionItemService.getById(inspectionItemBo);
if (inspectionItem==null){
throw BusinessException.build("检验项目编号不存在!!!");
}
//查询设备计划是否存在
String site = CommonMethods.getSite();
resourceInspectPlan.setSite(site);
// 计划编号
String planNo = resourceInspectPlan.getPlanNo();
// 计划版本
String revision = resourceInspectPlan.getRevision();
String handle = HandleEnum.RESOURCE_INSPECT_PLAN.getHandle(site, planNo, revision);
ResourceInspectPlan resourceInspectPlanByBanlde = resourceInspectPlanService.getById(handle);
//计划是否已存在: 更新计划主表
//1、计划不存在 新增计划主表
if (resourceInspectPlanByBanlde==null){
ResourceInspectPlan planHanlde = resourceInspectPlanService.getById(handle);
// 创建/修改人员
String user = CommonMethods.getUser();
//计划是否已存在
if (planHanlde==null){
// 创建人员和创建时间
resourceInspectPlan.setCreatedDateTime(LocalDateTime.now());
resourceInspectPlan.setCreateUser(user);
}else{
// 保留创建人员和创建时间
String createUser = planHanlde.getCreateUser();
LocalDateTime createdDateTime = planHanlde.getCreatedDateTime();
resourceInspectPlan.setCreateUser(createUser);
resourceInspectPlan.setCreatedDateTime(createdDateTime);
// 更新修改人员和修改时间
resourceInspectPlan.setModifyUser(user);
resourceInspectPlan.setModifiedDateTime(LocalDateTime.now());
// 删除设备清单
deleteEquipList(handle);
/*ResourceInspectResource resourceInspect = new ResourceInspectResource();
resourceInspect.setResourceInspectPlanBo(handle);
QueryWrapper<ResourceInspectResource> resourceWrapper = new QueryWrapper<>();
resourceWrapper.setEntity(resourceInspect);
resourceInspectResourceService.remove(resourceWrapper);*/
// 删除用户组清单
InspectPlanUserGroup inspectPlanUserGroup = new InspectPlanUserGroup();
inspectPlanUserGroup.setResourceInspectPlanBo(handle);
inspectPlanUserGroupService.deleteAll(inspectPlanUserGroup);
}
//2、计划存在 更新计划主表
resourceInspectPlan.setHandle(handle);
// 任务数量-数字型
Long planTaskCount = resourceInspectPlan.getPlanTaskCount();
//保存计划下设备清单(全删全增)
// 1、全删
ResourceInspectResource resourceInspect = new ResourceInspectResource();
resourceInspect.setResourceInspectPlanBo(handle);
QueryWrapper<ResourceInspectResource> resourceWrapper = new QueryWrapper<>();
resourceWrapper.setEntity(resourceInspect);
// resourceInspectResourceService.remove(resourceWrapper);
// 2、全增
List<ResourceInspectResource> equips = resourceInspectPlan.getMaintainPlanEquipList();
if (equips.size()<1||equips.equals(null)){
throw BusinessException.build("未添加设备!!!");
}
for (ResourceInspectResource equip: equips) {
equip.setResourceInspectPlanBo(handle);
equip.setCreateUser(user);
equip.setCreatedDateTime(LocalDateTime.now());
// resourceInspectResourceService.save(equip);
equip.setHandle(handle+";"+equip.getResourceBo());
resourceInspectResourceService.save(equip);
}
// 保存用户组清单
List<InspectPlanUserGroup> userGroups = resourceInspectPlan.getInspectPlanUserGroupList();
if (userGroups.size()>0||userGroups!=null){
for (InspectPlanUserGroup userGroup: userGroups) {
userGroup.setResourceInspectPlanBo(handle);
userGroup.setCreateUser(user);
userGroup.setCreatedDateTime(LocalDateTime.now());
userGroup.setHandle(handle+";"+userGroup.getUserGroupBo());
inspectPlanUserGroupService.save(userGroup);
}
}
resourceInspectPlanService.saveOrUpdate(resourceInspectPlan);
// 当更新/保存计划时,自动创建任务
// 计划是否启用,非启用状态不创建
if (resourceInspectPlan.getStatus().equals("301")){
resourceInspectPlanService.autoCreateTaskByResourceInspectPlan(resourceInspectPlan);
}
}
// 判断检验项目清单HANDLE是否存在
/**
* HANDLE
* ResourceInspectPlan
* @param resourceInspectPlan
* @return
*/
@Override
public ResourceInspectPlan getInspectPlanByHandle(ResourceInspectPlan resourceInspectPlan) {
QueryWrapper<ResourceInspectPlan> planWrapper = new QueryWrapper<>();
planWrapper.setEntity(resourceInspectPlan);
List<ResourceInspectPlan> planList = resourceInspectPlanService.list(planWrapper);
// ResourceInspectPlan inspectPlanById = resourceInspectPlanService.getById(resourceInspectPlan.getHandle());
if (planList.size()<1||planList==null){
throw BusinessException.build("检验计划编号不存在!!!");
}
resourceInspectPlan = planList.get(0);
// 根据handle获取设备清单
String handle = resourceInspectPlan.getHandle();
ResourceInspectResource resourceInspectResource = new ResourceInspectResource();
resourceInspectResource.setResourceInspectPlanBo(handle);
List<ResourceInspectResource> resourceList = resourceInspectResourceService.selectList(resourceInspectResource);
resourceInspectPlan.setMaintainPlanEquipList(resourceList);
// 项目明细清单——根据项目handle获取
String inspectionItemBo = resourceInspectPlan.getInspectionItemBo();
InspectionItem inspectionItem = new InspectionItem();
inspectionItem.setHandle(inspectionItemBo);
QueryWrapper<InspectionItem> inspectionItemWrapper = new QueryWrapper<>();
inspectionItemWrapper.setEntity(inspectionItem);
List<InspectionItem> inspectionItems = inspectionItemService.list(inspectionItemWrapper);
// 如果不存在,则返回错误
if (inspectionItems==null||inspectionItems.size()<1){
return false;
InspectionItemDetail inspectionItemDetail = new InspectionItemDetail();
inspectionItemDetail.setInspectionItemBo(inspectionItemBo);
List<InspectionItemDetail> itemDetailList = inspectionItemDetailService.selectList(inspectionItemDetail);
resourceInspectPlan.setInspectionItemDetailList(itemDetailList);
// 用户组清单——根据项目计划handle获取
InspectPlanUserGroup inspectPlanUserGroup = new InspectPlanUserGroup();
inspectPlanUserGroup.setResourceInspectPlanBo(handle);
List<InspectPlanUserGroup> userGroupList = inspectPlanUserGroupService.selectList(inspectPlanUserGroup);
for (InspectPlanUserGroup userGroup:userGroupList) {
String userGroupBo = userGroup.getUserGroupBo();
UserGroup userGroupById = userGroupService.getById(userGroupBo);
userGroup.setDescription(userGroupById.getDescription());
userGroup.setUserGroupNo(userGroupById.getUserGroup());
}
resourceInspectPlanService.saveOrUpdate(resourceInspectPlan);
return false;
resourceInspectPlan.setInspectPlanUserGroupList(userGroupList);
return resourceInspectPlan;
}
/**
*
* @param resourceInspectPlan
*/
@Override
public void deleteInspectionPlanByHandle(ResourceInspectPlan resourceInspectPlan) {
String handle = resourceInspectPlan.getHandle();
ResourceInspectPlan inspectPlanById = resourceInspectPlanService.getById(handle);
if (inspectPlanById==null){
throw BusinessException.build("");
}
// 设备清单表数据删除
ResourceInspectResource resourceInspectResource = new ResourceInspectResource();
resourceInspectResource.setResourceInspectPlanBo(handle);
QueryWrapper<ResourceInspectResource> resourceQueryWrapper = new QueryWrapper<>();
resourceQueryWrapper.setEntity(resourceInspectResource);
resourceInspectResourceService.remove(resourceQueryWrapper);
// 用户组清单数据删除
InspectPlanUserGroup userGroup = new InspectPlanUserGroup();
userGroup.setResourceInspectPlanBo(handle);
QueryWrapper<InspectPlanUserGroup> userGroupWrapper = new QueryWrapper<>();
userGroupWrapper.setEntity(userGroup);
inspectPlanUserGroupService.remove(userGroupWrapper);
// 主表数据删除
resourceInspectPlan.getHandle();
QueryWrapper<ResourceInspectPlan> planQueryWrapper = new QueryWrapper<>();
planQueryWrapper.setEntity(resourceInspectPlan);
resourceInspectPlanService.remove(planQueryWrapper);
}
/**
*
* @param resourceInspectPlan
*/
@Override
public void autoCreateTaskByResourceInspectPlan(ResourceInspectPlan resourceInspectPlan) {
// 标记字段0为启用1为更新
Integer sign = 0;
// 基本数据
// 排程周期比较、有效期、任务数量
String site = resourceInspectPlan.getSite();
String frequencyUnit = resourceInspectPlan.getFrequencyUnit();
Double frequency = resourceInspectPlan.getFrequency();
LocalDateTime indateStart = resourceInspectPlan.getIndateStart();
LocalDateTime indateEnd = resourceInspectPlan.getIndateEnd();
Long planTaskCount = resourceInspectPlan.getPlanTaskCount();
Integer taskCount = Integer.valueOf(planTaskCount.toString());
// 检验项目清单handle
String planHanlde = resourceInspectPlan.getHandle();
// 计划状态
String planStatus = resourceInspectPlan.getStatus();
// 设备清单
List<ResourceInspectResource> maintainPlanEquipList = resourceInspectPlan.getMaintainPlanEquipList();
// 任务编号、任务handle
List<String> taskNoList = nextNumberHelper.getNextNumber(site, Constants.RESOURCE_INSPECT_TASK, maintainPlanEquipList.size()*taskCount);
// 遍历设备
int taskNoNum = 0;
for (ResourceInspectResource equip: maintainPlanEquipList) {
// 判断是否创建任务:状态,仅启用状态创建任务
String equipStatus = equip.getStatus();
if (!equipStatus.equals("301")){
continue;
}
String resourceHandle = equip.getResourceBo();
// 创建检验任务--用于模糊查询
ResourceInspectTask resourceInspectTask = new ResourceInspectTask();
// 外键HANDLE计划HANDLE、设备HANDLE
resourceInspectTask.setResourceInspectPlanBo(planHanlde);
resourceInspectTask.setResourceBo(resourceHandle);
/**
* handlehandle
* bug
*/
List<ResourceInspectTask> taskList = resourceInspectTaskService.selectList(resourceInspectTask);
// 遍历并选取状态为新建及处理中401新建 301启用
int taskNum = 0;
if (taskList.size()>0){
sign = 1;
}
for (ResourceInspectTask task: taskList) {
// 检验任务状态1、处理中501不变更任务2、新建301将任务状态变为取消
String taskStatus = task.getStatus();
if (taskStatus.equals("501")){
taskNum++;
}else {
if (taskStatus.equals("301")){
task.setStatus("401");
resourceInspectTaskService.saveOrUpdate(task);
}
}
}
if (taskNum < taskCount){
taskNum = taskCount - taskNum;
}else{
continue;
}
// 判断是否创建任务:任务生成时间在有效期内
LocalDateTime taskCreateDate = equip.getTaskCreateDate();
if (taskCreateDate.isAfter(indateStart) && taskCreateDate.isBefore(indateEnd)) {
Collection<ResourceInspectTask> resourceInspectTaskList = new ArrayList<>();
if (taskNum == taskCount){
while (taskNum>0){
resourceInspectTask.setTaskCreateDate(taskCreateDate);
ResourceInspectTask equipInspectTask = setResourceInspectTask(resourceInspectPlan, resourceInspectTask,sign);
resourceInspectTaskList.add(equipInspectTask);
taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate);
taskNum--;
}
}else{
// 获取处理中的任务数量
resourceInspectTask.setStatus("501");
List<ResourceInspectTask> taskList2 = resourceInspectTaskService.selectList(resourceInspectTask);
// 获取状态为处理中的最新的任务时间
LocalDateTime createdDateTime = taskList2.get(0).getCreatedDateTime();
for (ResourceInspectTask task: taskList2){
if (task.getCreatedDateTime().isAfter(createdDateTime)){
createdDateTime = task.getCreatedDateTime();
}
}
if (taskCreateDate.isAfter(createdDateTime)){
// 循环创建检验任务
for (int i = 0;i < taskNum;i++){
resourceInspectTask.setTaskCreateDate(taskCreateDate);
ResourceInspectTask equipInspectTask = setResourceInspectTask(resourceInspectPlan, resourceInspectTask,sign);
resourceInspectTaskList.add(equipInspectTask);
taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate);
}
}else {
while (taskCreateDate.isBefore(createdDateTime)){
taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate);
}
for (int i = 0;i < taskNum;i++){
resourceInspectTask.setTaskCreateDate(taskCreateDate);
ResourceInspectTask equipInspectTask = setResourceInspectTask(resourceInspectPlan, resourceInspectTask,sign);
resourceInspectTaskList.add(equipInspectTask);
taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate);
}
}
}
for (ResourceInspectTask task:resourceInspectTaskList) {
task.setTaskNo(taskNoList.get(taskNoNum));
task.setHandle(HandleEnum.RESOURCE_INSPECT_TASK.getHandle(site,taskNoList.get(taskNoNum)));
taskNoNum++;
}
resourceInspectTaskService.saveBatch(resourceInspectTaskList);
}
}
}
/**
*
*/
private void deleteEquipList(String ResourceInspectPlanBo){
ResourceInspectResource resourceInspectResource = new ResourceInspectResource();
resourceInspectResource.setResourceInspectPlanBo(ResourceInspectPlanBo);
QueryWrapper<ResourceInspectResource> resourceQueryWrapper = new QueryWrapper<>();
resourceQueryWrapper.setEntity(resourceInspectResource);
resourceInspectResourceService.remove(resourceQueryWrapper);
}
/**
*
*/
private void deleteUserGroupList(String ResourceInspectPlanBo){
InspectPlanUserGroup userGroup = new InspectPlanUserGroup();
userGroup.setResourceInspectPlanBo(ResourceInspectPlanBo);
QueryWrapper<InspectPlanUserGroup> userGroupWrapper = new QueryWrapper<>();
userGroupWrapper.setEntity(userGroup);
inspectPlanUserGroupService.remove(userGroupWrapper);
}
/**
* +
*
*/
private LocalDateTime addTime(String frequencyUnit,double frequency,LocalDateTime taskTime){
long minutes = 0;
switch (frequencyUnit){
case "D":
minutes = Math.round(frequency*60*24);
break;
case "H":
minutes = Math.round(frequency*60);
break;
case "W":
minutes = Math.round(frequency*60*24*7);
break;
case "M":
minutes = Math.round(frequency*60*24*7*30);
break;
}
return taskTime.plusMinutes(minutes);
}
/**
*
*/
private ResourceInspectTask setResourceInspectTask(ResourceInspectPlan resourceInspectPlan,ResourceInspectTask resourceInspectTask,Integer sign){
ResourceInspectTask inspectTask = new ResourceInspectTask();
// 基本字段录入站点、状态、计划HANDLE、检验项清单HANDLE、检验类型
inspectTask.setSite(resourceInspectPlan.getSite());
inspectTask.setStatus("301");
inspectTask.setResourceInspectPlanBo(resourceInspectPlan.getHandle());
inspectTask.setInspectionItemBo(resourceInspectPlan.getInspectionItemBo());
inspectTask.setCategory(resourceInspectPlan.getCategory());
// 设备HANDLE
inspectTask.setResourceBo(resourceInspectTask.getResourceBo());
// 任务创建时间
inspectTask.setTaskCreateDate(resourceInspectTask.getTaskCreateDate());
// 计划开始、计划完成时间
LocalDateTime taskCreateDate = inspectTask.getTaskCreateDate();
Long beforeTolerance = resourceInspectPlan.getBeforeTolerance();
Long afterTolerance = resourceInspectPlan.getAfterTolerance();
// 若不存在前后容差,则不提供计划完成时间;计划开始时间为任务创建时间
if (beforeTolerance == null || beforeTolerance < 0 ){
inspectTask.setPlanStartDate(taskCreateDate);
}else {
inspectTask.setPlanStartDate(taskCreateDate.minusDays(beforeTolerance));
}
if (!(afterTolerance < 0 || afterTolerance == null)){
inspectTask.setPlanCompleteDate(taskCreateDate.plusDays(afterTolerance));
}
// 创建人员、创建时间;修改人员、修改时间
if (sign==1){ // sign==1更新添加修改人员和修改时间
inspectTask.setModifyUser(resourceInspectPlan.getModifyUser());
inspectTask.setModifiedDateTime(resourceInspectPlan.getModifiedDateTime());
}
inspectTask.setCreateUser(resourceInspectPlan.getCreateUser());
inspectTask.setCreatedDateTime(LocalDateTime.now());
return inspectTask;
}

@ -42,5 +42,12 @@ public class ResourceInspectResourceServiceImpl extends ServiceImpl<ResourceInsp
return super.list(queryWrapper);
}
@Override
public void deleteAll(ResourceInspectResource resourceInspectResource) {
QueryWrapper<ResourceInspectResource> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(resourceInspectResource);
super.remove(queryWrapper);
}
}

@ -18,7 +18,7 @@ import java.util.List;
* </p>
*
* @author pavel.Liu
* @since 2021-06-10
* @since 2021-06-29
*/
@Service
@Transactional(rollbackFor = Exception.class)
@ -42,5 +42,12 @@ public class ResourceInspectTaskParamServiceImpl extends ServiceImpl<ResourceIns
return super.list(queryWrapper);
}
@Override
public void removeAll(ResourceInspectTaskParam resourceInspectTaskParam) {
QueryWrapper<ResourceInspectTaskParam> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(resourceInspectTaskParam);
super.remove(queryWrapper);
}
}

@ -1,5 +1,17 @@
package com.foreverwin.mesnac.equip.service.impl;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.model.InspectionItemDetail;
import com.foreverwin.mesnac.common.service.InspectionItemDetailService;
import com.foreverwin.mesnac.equip.dto.ResourceInspectTaskDto;
import com.foreverwin.mesnac.equip.model.ResourceInspectPlan;
import com.foreverwin.mesnac.equip.model.ResourceInspectTaskParam;
import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare;
import com.foreverwin.mesnac.equip.service.ResourceInspectPlanService;
import com.foreverwin.mesnac.equip.service.ResourceInspectTaskParamService;
import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -11,14 +23,19 @@ import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
/**
* <p>
*
* </p>
*
* @author pavel.Liu
* @since 2021-06-10
* @since 2021-06-24
*/
@Service
@Transactional(rollbackFor = Exception.class)
@ -27,6 +44,16 @@ public class ResourceInspectTaskServiceImpl extends ServiceImpl<ResourceInspectT
@Autowired
private ResourceInspectTaskMapper resourceInspectTaskMapper;
@Autowired
private ResourceInspectTaskService resourceInspectTaskService;
@Autowired
private ResourceInspectPlanService resourceInspectPlanService;
@Autowired
private ResourceInspectTaskParamService resourceInspectTaskParamService;
@Autowired
private InspectionItemDetailService inspectionItemDetailService;
@Autowired
private ResourceInspectTaskSpareService resourceInspectTaskSpareService;
@Override
public IPage<ResourceInspectTask> selectPage(FrontPage<ResourceInspectTask> frontPage, ResourceInspectTask resourceInspectTask) {
@ -42,5 +69,165 @@ public class ResourceInspectTaskServiceImpl extends ServiceImpl<ResourceInspectT
return super.list(queryWrapper);
}
@Override
public List<ResourceInspectTaskDto> findResourceInspectTaskList(ResourceInspectTaskDto resourceInspectTaskDto) {
String currentUser = CommonMethods.getUser();
String site = CommonMethods.getSite();
String userBo = HandleEnum.USR.getHandle(site, currentUser);
resourceInspectTaskDto.setCurrentUser(userBo);
resourceInspectTaskDto.setSite(site);
List<ResourceInspectTaskDto> list = resourceInspectTaskMapper.findResourceInspectTaskList(resourceInspectTaskDto);
for (ResourceInspectTaskDto task:list) {
task.setResourceTypeNo(task.getResourceTypeBo().split(",")[1]);
task.setCycle(getCycle(task));
task.setCurrentUser(currentUser);
}
return list;
}
@Override
public ResourceInspectTask getResourceInspectTaskAll(ResourceInspectTask resourceInspectTask) {
List<ResourceInspectTask> taskList = resourceInspectTaskService.selectList(resourceInspectTask);
if (taskList.size()==1){
resourceInspectTask = taskList.get(0);
}else {
throw BusinessException.build("无法获取任务详情!!!");
}
String taskHandle = resourceInspectTask.getHandle();
String taskStatus = resourceInspectTask.getStatus();
ResourceInspectTaskParam resourceInspectTaskParam = new ResourceInspectTaskParam();
resourceInspectTaskParam.setResourceInspectTaskBo(taskHandle);
if (taskStatus.equals("401")){
// 判断数据是否已创建
List<ResourceInspectTaskParam> taskParams = resourceInspectTaskParamService.selectList(resourceInspectTaskParam);
// 任务状态为新建时,判断检验项是否更新
String inspectionItemBo = resourceInspectTask.getInspectionItemBo();
String resourceInspectPlanBo = resourceInspectTask.getResourceInspectPlanBo();
ResourceInspectPlan resourceInspectPlan = resourceInspectPlanService.getById(resourceInspectPlanBo);
String planInspectionItemBo = resourceInspectPlan.getInspectionItemBo();
// 检验项目清单修改:更新明细表
if (inspectionItemBo.equals(planInspectionItemBo)){
// 数据未创建——>全增
if (taskParams.size() == 0){
createAndSaveItemParams(taskHandle,inspectionItemBo);
}
}else{
// 判断数据是否已存在1、存在则全删全增2、不存在全增
if ( taskParams.size() > 0 ){
resourceInspectTaskParamService.removeAll(resourceInspectTaskParam);
}
createAndSaveItemParams(taskHandle,planInspectionItemBo);
}
}
// 新建且检验项清单未变更/非新建状态,直接返回明细清单数据
List<ResourceInspectTaskParam> itemParamList = resourceInspectTaskParamService.selectList(resourceInspectTaskParam);
ResourceInspectTaskSpare resourceInspectTaskSpare = new ResourceInspectTaskSpare();
resourceInspectTaskSpare.setResourceInspectTaskBo(taskHandle);
List<ResourceInspectTaskSpare> taskSpareList = resourceInspectTaskSpareService.selectList(resourceInspectTaskSpare);
resourceInspectTask.setTaskItemDetailList(itemParamList);
resourceInspectTask.setTaskSpareList(taskSpareList);
return resourceInspectTask;
}
@Override
public void saveOrUpdateTaskInfo(ResourceInspectTaskDto resourceInspectTaskDto) {
// 站点、任务编号——任务handle
String site = CommonMethods.getSite();
String taskNo = resourceInspectTaskDto.getTaskNo();
String taskHandle = HandleEnum.RESOURCE_INSPECT_TASK.getHandle(site, taskNo);
String executor = resourceInspectTaskDto.getExecutor();
// 检验项、备品清单
List<ResourceInspectTaskParam> taskItemDetailList = resourceInspectTaskDto.getTaskItemDetailList();
List<ResourceInspectTaskSpare> taskSpareList = resourceInspectTaskDto.getTaskSpareList();
// 任务主表字段:任务状态、修改人员、修改时间
ResourceInspectTask task = resourceInspectTaskService.getById(taskHandle);
task.setStatus(resourceInspectTaskDto.getStatus());
task.setModifyUser(executor);
task.setModifiedDateTime(LocalDateTime.now());
resourceInspectTaskService.saveOrUpdate(task);
// 检验项全删、全增
ResourceInspectTaskParam resourceInspectTaskParam = new ResourceInspectTaskParam();
resourceInspectTaskParam.setResourceInspectTaskBo(taskHandle);
/*List<ResourceInspectTaskParam> taskParams = resourceInspectTaskParamService.selectList(resourceInspectTaskParam);
if ( taskParams.size() > 0 ){
}*/
resourceInspectTaskParamService.removeAll(resourceInspectTaskParam);
for (ResourceInspectTaskParam taskParam:taskItemDetailList) {
taskParam.setCreatedDateTime(LocalDateTime.now());
taskParam.setCreateUser(executor);
}
resourceInspectTaskParamService.saveBatch(taskItemDetailList);
// 备品全删、全增
ResourceInspectTaskSpare resourceInspectTaskSpare = new ResourceInspectTaskSpare();
resourceInspectTaskSpare.setResourceInspectTaskBo(taskHandle);
resourceInspectTaskSpareService.removeAll(resourceInspectTaskSpare);
for (ResourceInspectTaskSpare taskSpare:taskSpareList) {
if (taskSpare.getDescription()==null){
continue;
}
taskSpare.setResourceInspectTaskBo(taskHandle);
taskSpare.setHandle(HandleEnum.RESOURCE_INSPECT_TASK_SPARE.getHandle(site,UUID.randomUUID().toString()));
taskSpare.setCreatedDateTime(LocalDateTime.now());
taskSpare.setCreateUser(executor);
}
resourceInspectTaskSpareService.saveBatch(taskSpareList);
}
/***
*
*/
private String getCycle(ResourceInspectTaskDto task){
String frequencyUnit = task.getFrequencyUnit();
String frequency = task.getFrequency();
StringBuffer cycle = new StringBuffer("每");
switch (frequencyUnit){
case "D":
cycle = cycle.append(frequency).append("天");
break;
case "H":
cycle = cycle.append(frequency).append("时");
break;
case "W":
cycle = cycle.append(frequency).append("周");
break;
case "M":
cycle = cycle.append(frequency).append("月");
break;
}
return cycle.toString();
}
/***
*
*/
private void createAndSaveItemParams(String taskHandel,String inspectionItemBo){
InspectionItemDetail inspectionItemDetail = new InspectionItemDetail();
inspectionItemDetail.setInspectionItemBo(inspectionItemBo);
List<InspectionItemDetail> itemDetails = inspectionItemDetailService.selectList(inspectionItemDetail);
List<ResourceInspectTaskParam> paramList = new ArrayList<>();
for (InspectionItemDetail detail:itemDetails) {
ResourceInspectTaskParam resourceInspectTaskParam = new ResourceInspectTaskParam();
// 检验项编号、描述外键任务handle、设备handle
resourceInspectTaskParam.setHandle(taskHandel+";"+detail.getHandle());
resourceInspectTaskParam.setInspectNo(detail.getParamNo());
resourceInspectTaskParam.setDescription(detail.getDescription());
resourceInspectTaskParam.setResourceInspectTaskBo(taskHandel);
// 检验方法、数据类型、单位、
resourceInspectTaskParam.setInspectMethod(detail.getInspectionMethod());
resourceInspectTaskParam.setInspectDataType(detail.getParamType());
resourceInspectTaskParam.setParamUnit(detail.getParamUnit());
// 是否必填、最大最、最小值、标准值
resourceInspectTaskParam.setRequired(detail.getIsRequired());
resourceInspectTaskParam.setMaxValue(detail.getMaxValue());
resourceInspectTaskParam.setMinValue(detail.getMinValue());
resourceInspectTaskParam.setStandardValue(detail.getStandardValue());
resourceInspectTaskParam.setCreateUser("测试数据DEL");
resourceInspectTaskParam.setCreatedDateTime(LocalDateTime.now());
paramList.add(resourceInspectTaskParam);
}
resourceInspectTaskParamService.saveBatch(paramList);
}
}

@ -0,0 +1,53 @@
package com.foreverwin.mesnac.equip.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare;
import com.foreverwin.mesnac.equip.mapper.ResourceInspectTaskSpareMapper;
import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
* -
* </p>
*
* @author pavel.Liu
* @since 2021-06-30
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class ResourceInspectTaskSpareServiceImpl extends ServiceImpl<ResourceInspectTaskSpareMapper, ResourceInspectTaskSpare> implements ResourceInspectTaskSpareService {
@Autowired
private ResourceInspectTaskSpareMapper resourceInspectTaskSpareMapper;
@Override
public IPage<ResourceInspectTaskSpare> selectPage(FrontPage<ResourceInspectTaskSpare> frontPage, ResourceInspectTaskSpare resourceInspectTaskSpare) {
QueryWrapper<ResourceInspectTaskSpare> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(resourceInspectTaskSpare);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<ResourceInspectTaskSpare> selectList(ResourceInspectTaskSpare resourceInspectTaskSpare) {
QueryWrapper<ResourceInspectTaskSpare> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(resourceInspectTaskSpare);
return super.list(queryWrapper);
}
@Override
public void removeAll(ResourceInspectTaskSpare resourceInspectTaskSpare) {
QueryWrapper<ResourceInspectTaskSpare> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(resourceInspectTaskSpare);
super.remove(queryWrapper);
}
}

@ -0,0 +1,354 @@
<?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.foreverwin.mesnac.equip.mapper.InspectPlanUserGroupMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.equip.model.InspectPlanUserGroup">
<id column="HANDLE" property="handle" />
<result column="USER_GROUP_BO" property="userGroupBo" />
<result column="RESOURCE_INSPECT_PLAN_BO" property="resourceInspectPlanBo" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, USER_GROUP_BO, RESOURCE_INSPECT_PLAN_BO, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_INSPECT_PLAN_USER_GROUP WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_INSPECT_PLAN_USER_GROUP
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_INSPECT_PLAN_USER_GROUP WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_INSPECT_PLAN_USER_GROUP
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</if>
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_INSPECT_PLAN_USER_GROUP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</if>
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECT_PLAN_USER_GROUP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</if>
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECT_PLAN_USER_GROUP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</if>
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECT_PLAN_USER_GROUP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</if>
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECT_PLAN_USER_GROUP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</if>
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECT_PLAN_USER_GROUP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</if>
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.equip.model.InspectPlanUserGroup">
INSERT INTO Z_INSPECT_PLAN_USER_GROUP
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="userGroupBo!=null">USER_GROUP_BO,</if>
<if test="resourceInspectPlanBo!=null">RESOURCE_INSPECT_PLAN_BO,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifyUser!=null">MODIFY_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="userGroupBo!=null">#{userGroupBo},</if>
<if test="resourceInspectPlanBo!=null">#{resourceInspectPlanBo},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifyUser!=null">#{modifyUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.equip.model.InspectPlanUserGroup">
INSERT INTO Z_INSPECT_PLAN_USER_GROUP
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{userGroupBo},
#{resourceInspectPlanBo},
#{createUser},
#{createdDateTime},
#{modifyUser},
#{modifiedDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_INSPECT_PLAN_USER_GROUP <trim prefix="SET" suffixOverrides=",">
<if test="et.userGroupBo!=null">USER_GROUP_BO=#{et.userGroupBo},</if>
<if test="et.resourceInspectPlanBo!=null">RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_INSPECT_PLAN_USER_GROUP <trim prefix="SET" suffixOverrides=",">
USER_GROUP_BO=#{et.userGroupBo},
RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_INSPECT_PLAN_USER_GROUP <trim prefix="SET" suffixOverrides=",">
<if test="et.userGroupBo!=null">USER_GROUP_BO=#{et.userGroupBo},</if>
<if test="et.resourceInspectPlanBo!=null">RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</if>
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_INSPECT_PLAN_USER_GROUP WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_INSPECT_PLAN_USER_GROUP
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_INSPECT_PLAN_USER_GROUP
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</if>
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_INSPECT_PLAN_USER_GROUP WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -13,13 +13,15 @@
<result column="RESOURCE_INSPECT_PLAN_BO" property="resourceInspectPlanBo" />
<result column="INSPECTION_ITEM_BO" property="inspectionItemBo" />
<result column="RESOURCE_BO" property="resourceBo" />
<result column="RESULT" property="result" />
<result column="TASK_CREATE_DATE" property="taskCreateDate" />
<result column="PLAN_START_DATE" property="planStartDate" />
<result column="PLAN_COMPLETE_DATE" property="planCompleteDate" />
<result column="ACTUAL_START_DATE" property="actualStartDate" />
<result column="ACTUAL_COMPLETE_DATE" property="actualCompleteDate" />
<result column="EXECUTOR" property="executor" />
<result column="RESULT" property="result" />
<result column="REMARK" property="remark" />
<result column="REASON" property="reason" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
@ -28,7 +30,7 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, TASK_NO, CATEGORY, DESCRIPTION, STATUS, RESOURCE_INSPECT_PLAN_BO, INSPECTION_ITEM_BO, RESOURCE_BO, RESULT, PLAN_START_DATE, PLAN_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, EXECUTOR, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
HANDLE, SITE, TASK_NO, CATEGORY, DESCRIPTION, STATUS, RESOURCE_INSPECT_PLAN_BO, INSPECTION_ITEM_BO, RESOURCE_BO, TASK_CREATE_DATE, PLAN_START_DATE, PLAN_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, EXECUTOR, RESULT, REMARK, REASON, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
@ -71,13 +73,15 @@
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.taskCreateDate!=null"> AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}</if>
<if test="ew.entity.planStartDate!=null"> AND PLAN_START_DATE=#{ew.entity.planStartDate}</if>
<if test="ew.entity.planCompleteDate!=null"> AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.executor!=null"> AND EXECUTOR=#{ew.entity.executor}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
@ -101,13 +105,15 @@
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.taskCreateDate!=null"> AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}</if>
<if test="ew.entity.planStartDate!=null"> AND PLAN_START_DATE=#{ew.entity.planStartDate}</if>
<if test="ew.entity.planCompleteDate!=null"> AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.executor!=null"> AND EXECUTOR=#{ew.entity.executor}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
@ -139,13 +145,15 @@
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.taskCreateDate!=null"> AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}</if>
<if test="ew.entity.planStartDate!=null"> AND PLAN_START_DATE=#{ew.entity.planStartDate}</if>
<if test="ew.entity.planCompleteDate!=null"> AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.executor!=null"> AND EXECUTOR=#{ew.entity.executor}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
@ -177,13 +185,15 @@
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.taskCreateDate!=null"> AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}</if>
<if test="ew.entity.planStartDate!=null"> AND PLAN_START_DATE=#{ew.entity.planStartDate}</if>
<if test="ew.entity.planCompleteDate!=null"> AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.executor!=null"> AND EXECUTOR=#{ew.entity.executor}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
@ -215,13 +225,15 @@
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.taskCreateDate!=null"> AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}</if>
<if test="ew.entity.planStartDate!=null"> AND PLAN_START_DATE=#{ew.entity.planStartDate}</if>
<if test="ew.entity.planCompleteDate!=null"> AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.executor!=null"> AND EXECUTOR=#{ew.entity.executor}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
@ -253,13 +265,15 @@
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.taskCreateDate!=null"> AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}</if>
<if test="ew.entity.planStartDate!=null"> AND PLAN_START_DATE=#{ew.entity.planStartDate}</if>
<if test="ew.entity.planCompleteDate!=null"> AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.executor!=null"> AND EXECUTOR=#{ew.entity.executor}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
@ -291,13 +305,15 @@
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.taskCreateDate!=null"> AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}</if>
<if test="ew.entity.planStartDate!=null"> AND PLAN_START_DATE=#{ew.entity.planStartDate}</if>
<if test="ew.entity.planCompleteDate!=null"> AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.executor!=null"> AND EXECUTOR=#{ew.entity.executor}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
@ -325,13 +341,15 @@
<if test="resourceInspectPlanBo!=null">RESOURCE_INSPECT_PLAN_BO,</if>
<if test="inspectionItemBo!=null">INSPECTION_ITEM_BO,</if>
<if test="resourceBo!=null">RESOURCE_BO,</if>
<if test="result!=null">RESULT,</if>
<if test="taskCreateDate!=null">TASK_CREATE_DATE,</if>
<if test="planStartDate!=null">PLAN_START_DATE,</if>
<if test="planCompleteDate!=null">PLAN_COMPLETE_DATE,</if>
<if test="actualStartDate!=null">ACTUAL_START_DATE,</if>
<if test="actualCompleteDate!=null">ACTUAL_COMPLETE_DATE,</if>
<if test="executor!=null">EXECUTOR,</if>
<if test="result!=null">RESULT,</if>
<if test="remark!=null">REMARK,</if>
<if test="reason!=null">REASON,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifyUser!=null">MODIFY_USER,</if>
@ -347,13 +365,15 @@
<if test="resourceInspectPlanBo!=null">#{resourceInspectPlanBo},</if>
<if test="inspectionItemBo!=null">#{inspectionItemBo},</if>
<if test="resourceBo!=null">#{resourceBo},</if>
<if test="result!=null">#{result},</if>
<if test="taskCreateDate!=null">#{taskCreateDate},</if>
<if test="planStartDate!=null">#{planStartDate},</if>
<if test="planCompleteDate!=null">#{planCompleteDate},</if>
<if test="actualStartDate!=null">#{actualStartDate},</if>
<if test="actualCompleteDate!=null">#{actualCompleteDate},</if>
<if test="executor!=null">#{executor},</if>
<if test="result!=null">#{result},</if>
<if test="remark!=null">#{remark},</if>
<if test="reason!=null">#{reason},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifyUser!=null">#{modifyUser},</if>
@ -376,13 +396,15 @@
#{resourceInspectPlanBo},
#{inspectionItemBo},
#{resourceBo},
#{result},
#{taskCreateDate},
#{planStartDate},
#{planCompleteDate},
#{actualStartDate},
#{actualCompleteDate},
#{executor},
#{result},
#{remark},
#{reason},
#{createUser},
#{createdDateTime},
#{modifyUser},
@ -401,13 +423,15 @@
<if test="et.resourceInspectPlanBo!=null">RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo},</if>
<if test="et.inspectionItemBo!=null">INSPECTION_ITEM_BO=#{et.inspectionItemBo},</if>
<if test="et.resourceBo!=null">RESOURCE_BO=#{et.resourceBo},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.taskCreateDate!=null">TASK_CREATE_DATE=#{et.taskCreateDate},</if>
<if test="et.planStartDate!=null">PLAN_START_DATE=#{et.planStartDate},</if>
<if test="et.planCompleteDate!=null">PLAN_COMPLETE_DATE=#{et.planCompleteDate},</if>
<if test="et.actualStartDate!=null">ACTUAL_START_DATE=#{et.actualStartDate},</if>
<if test="et.actualCompleteDate!=null">ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate},</if>
<if test="et.executor!=null">EXECUTOR=#{et.executor},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.remark!=null">REMARK=#{et.remark},</if>
<if test="et.reason!=null">REASON=#{et.reason},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
@ -426,13 +450,15 @@
RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo},
INSPECTION_ITEM_BO=#{et.inspectionItemBo},
RESOURCE_BO=#{et.resourceBo},
RESULT=#{et.result},
TASK_CREATE_DATE=#{et.taskCreateDate},
PLAN_START_DATE=#{et.planStartDate},
PLAN_COMPLETE_DATE=#{et.planCompleteDate},
ACTUAL_START_DATE=#{et.actualStartDate},
ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate},
EXECUTOR=#{et.executor},
RESULT=#{et.result},
REMARK=#{et.remark},
REASON=#{et.reason},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
@ -451,13 +477,15 @@
<if test="et.resourceInspectPlanBo!=null">RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo},</if>
<if test="et.inspectionItemBo!=null">INSPECTION_ITEM_BO=#{et.inspectionItemBo},</if>
<if test="et.resourceBo!=null">RESOURCE_BO=#{et.resourceBo},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.taskCreateDate!=null">TASK_CREATE_DATE=#{et.taskCreateDate},</if>
<if test="et.planStartDate!=null">PLAN_START_DATE=#{et.planStartDate},</if>
<if test="et.planCompleteDate!=null">PLAN_COMPLETE_DATE=#{et.planCompleteDate},</if>
<if test="et.actualStartDate!=null">ACTUAL_START_DATE=#{et.actualStartDate},</if>
<if test="et.actualCompleteDate!=null">ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate},</if>
<if test="et.executor!=null">EXECUTOR=#{et.executor},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.remark!=null">REMARK=#{et.remark},</if>
<if test="et.reason!=null">REASON=#{et.reason},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
@ -475,13 +503,15 @@
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.taskCreateDate!=null"> AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}</if>
<if test="ew.entity.planStartDate!=null"> AND PLAN_START_DATE=#{ew.entity.planStartDate}</if>
<if test="ew.entity.planCompleteDate!=null"> AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.executor!=null"> AND EXECUTOR=#{ew.entity.executor}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
@ -530,13 +560,15 @@
<if test="ew.entity.resourceInspectPlanBo!=null"> AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.taskCreateDate!=null"> AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}</if>
<if test="ew.entity.planStartDate!=null"> AND PLAN_START_DATE=#{ew.entity.planStartDate}</if>
<if test="ew.entity.planCompleteDate!=null"> AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.executor!=null"> AND EXECUTOR=#{ew.entity.executor}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.reason!=null"> AND REASON=#{ew.entity.reason}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
@ -559,4 +591,50 @@
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<!--自定义sql-->
<select id="findResourceInspectTaskList" resultType="com.foreverwin.mesnac.equip.dto.ResourceInspectTaskDto">
SELECT ZK.* ,RIP.PLAN_NO AS PLAN_NO ,RIP.FREQUENCY ,RIP.FREQUENCY_UNIT ,
R.RESRCE AS RESOURCE_NO ,R.DESCRIPTION AS RESOURCE_DESCRIPTION ,
RTR.RESOURCE_TYPE_BO,WCT.DESCRIPTION AS WORK_CENTER
FROM ( SELECT * FROM Z_RESOURCE_INSPECT_TASK SD
WHERE SD.SITE = #{site}
<if test="taskNo != null and taskNo != ''">
AND SD.TASK_NO = #{taskNo}
</if>
<if test="category != null and category != ''">
AND SD.CATEGORY = #{category}
</if>
<if test="status != null and status != ''">
AND SD.STATUS = #{status}
</if>
<if test="resourceInspectPlanBo != null and resourceInspectPlanBo != ''">
AND SD.RESOURCE_INSPECT_PLAN_BO = #{resourceInspectPlanBo}
</if>
<if test="resourceBo != null and resourceBo != ''">
AND SD.RESOURCE_BO = #{resourceBo}
</if>
<if test="compareStartTime != null and compareStartTime != ''">
AND SD.TASK_CREATE_DATE &gt; #{compareStartTime}
</if>
<if test="compareEndTime != null and compareEndTime != ''">
AND SD.TASK_CREATE_DATE &lt; #{compareEndTime}
</if>
) ZK
LEFT JOIN Z_INSPECT_PLAN_USER_GROUP ZG ON ZG.RESOURCE_INSPECT_PLAN_BO = ZK.RESOURCE_INSPECT_PLAN_BO
LEFT JOIN USER_GROUP_MEMBER UGM ON UGM.USER_GROUP_BO = ZG.USER_GROUP_BO
LEFT JOIN Z_RESOURCE_INSPECT_PLAN RIP ON ZK.RESOURCE_INSPECT_PLAN_BO = RIP.HANDLE
LEFT JOIN RESRCE R ON R.HANDLE = ZK.RESOURCE_BO
LEFT JOIN WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = ZK.RESOURCE_BO
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCM.WORK_CENTER_BO
INNER JOIN RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = ZK.RESOURCE_BO
WHERE
(ZG.USER_GROUP_BO IS NULL OR (ZG.USER_GROUP_BO IS NOT NULL AND UGM.USER_OR_GROUP_GBO = #{currentUser}))
<if test="resourceTypeBo != null and resourceTypeBo != ''">
AND RTR.RESOURCE_TYPE_BO = #{resourceTypeBo}
</if>
<if test="workCenter != null and workCenter != ''">
AND WCM.WORK_CENTER_BO = #{workCenter}
</if>
</select>
<!--自定义sql-->
</mapper>

@ -4,20 +4,19 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.equip.model.ResourceInspectTaskParam">
<result column="HANDLE" property="handle" />
<result column="RESOURCE_INSPECT_TASK_BO" property="resourceInspectTaskBo" />
<result column="RESOURCE_BO" property="resourceBo" />
<id column="HANDLE" property="handle" />
<result column="INSPECT_NO" property="inspectNo" />
<result column="RESOURCE_INSPECT_TASK_BO" property="resourceInspectTaskBo" />
<result column="DESCRIPTION" property="description" />
<result column="INSPECT_METHOD" property="inspectMethod" />
<result column="INSPECT_DATA_TYPE" property="inspectDataType" />
<result column="PARAM_UNIT" property="paramUnit" />
<result column="REQUIRED" property="required" />
<result column="MIN_VALUE" property="minValue" />
<result column="MAX_VALUE" property="maxValue" />
<result column="STANDARD_VALUE" property="standardValue" />
<result column="RESRCE_VALUE" property="resrceValue" />
<result column="PARAM_UNIT" property="paramUnit" />
<result column="RESRCE" property="resrce" />
<result column="RESULT_VALUE" property="resultValue" />
<result column="RESULT" property="result" />
<result column="REMARK" property="remark" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
@ -27,10 +26,13 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, RESOURCE_INSPECT_TASK_BO, RESOURCE_BO, INSPECT_NO, DESCRIPTION, INSPECT_METHOD, INSPECT_DATA_TYPE, REQUIRED, MIN_VALUE, MAX_VALUE, STANDARD_VALUE, RESRCE_VALUE, PARAM_UNIT, RESRCE, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
HANDLE, INSPECT_NO, RESOURCE_INSPECT_TASK_BO, DESCRIPTION, INSPECT_METHOD, INSPECT_DATA_TYPE, PARAM_UNIT, REQUIRED, MIN_VALUE, MAX_VALUE, STANDARD_VALUE, RESULT_VALUE, RESULT, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_RESOURCE_INSPECT_TASK_PARAM WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
@ -46,6 +48,12 @@
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_RESOURCE_INSPECT_TASK_PARAM WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_RESOURCE_INSPECT_TASK_PARAM
@ -53,19 +61,18 @@
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.inspectNo!=null"> AND INSPECT_NO=#{ew.entity.inspectNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.inspectDataType!=null"> AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.required!=null"> AND REQUIRED=#{ew.entity.required}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.resrceValue!=null"> AND RESRCE_VALUE=#{ew.entity.resrceValue}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.resultValue!=null"> AND RESULT_VALUE=#{ew.entity.resultValue}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -82,19 +89,18 @@
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.inspectNo!=null"> AND INSPECT_NO=#{ew.entity.inspectNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.inspectDataType!=null"> AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.required!=null"> AND REQUIRED=#{ew.entity.required}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.resrceValue!=null"> AND RESRCE_VALUE=#{ew.entity.resrceValue}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.resultValue!=null"> AND RESULT_VALUE=#{ew.entity.resultValue}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -119,19 +125,18 @@
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.inspectNo!=null"> AND INSPECT_NO=#{ew.entity.inspectNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.inspectDataType!=null"> AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.required!=null"> AND REQUIRED=#{ew.entity.required}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.resrceValue!=null"> AND RESRCE_VALUE=#{ew.entity.resrceValue}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.resultValue!=null"> AND RESULT_VALUE=#{ew.entity.resultValue}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -156,19 +161,18 @@
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.inspectNo!=null"> AND INSPECT_NO=#{ew.entity.inspectNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.inspectDataType!=null"> AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.required!=null"> AND REQUIRED=#{ew.entity.required}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.resrceValue!=null"> AND RESRCE_VALUE=#{ew.entity.resrceValue}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.resultValue!=null"> AND RESULT_VALUE=#{ew.entity.resultValue}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -193,19 +197,18 @@
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.inspectNo!=null"> AND INSPECT_NO=#{ew.entity.inspectNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.inspectDataType!=null"> AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.required!=null"> AND REQUIRED=#{ew.entity.required}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.resrceValue!=null"> AND RESRCE_VALUE=#{ew.entity.resrceValue}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.resultValue!=null"> AND RESULT_VALUE=#{ew.entity.resultValue}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -230,19 +233,18 @@
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.inspectNo!=null"> AND INSPECT_NO=#{ew.entity.inspectNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.inspectDataType!=null"> AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.required!=null"> AND REQUIRED=#{ew.entity.required}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.resrceValue!=null"> AND RESRCE_VALUE=#{ew.entity.resrceValue}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.resultValue!=null"> AND RESULT_VALUE=#{ew.entity.resultValue}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -267,19 +269,18 @@
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.inspectNo!=null"> AND INSPECT_NO=#{ew.entity.inspectNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.inspectDataType!=null"> AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.required!=null"> AND REQUIRED=#{ew.entity.required}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.resrceValue!=null"> AND RESRCE_VALUE=#{ew.entity.resrceValue}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.resultValue!=null"> AND RESULT_VALUE=#{ew.entity.resultValue}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -300,19 +301,18 @@
INSERT INTO Z_RESOURCE_INSPECT_TASK_PARAM
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="resourceInspectTaskBo!=null">RESOURCE_INSPECT_TASK_BO,</if>
<if test="resourceBo!=null">RESOURCE_BO,</if>
<if test="inspectNo!=null">INSPECT_NO,</if>
<if test="resourceInspectTaskBo!=null">RESOURCE_INSPECT_TASK_BO,</if>
<if test="description!=null">DESCRIPTION,</if>
<if test="inspectMethod!=null">INSPECT_METHOD,</if>
<if test="inspectDataType!=null">INSPECT_DATA_TYPE,</if>
<if test="paramUnit!=null">PARAM_UNIT,</if>
<if test="required!=null">REQUIRED,</if>
<if test="minValue!=null">MIN_VALUE,</if>
<if test="maxValue!=null">MAX_VALUE,</if>
<if test="standardValue!=null">STANDARD_VALUE,</if>
<if test="resrceValue!=null">RESRCE_VALUE,</if>
<if test="paramUnit!=null">PARAM_UNIT,</if>
<if test="resrce!=null">RESRCE,</if>
<if test="resultValue!=null">RESULT_VALUE,</if>
<if test="result!=null">RESULT,</if>
<if test="remark!=null">REMARK,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
@ -321,19 +321,18 @@
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="resourceInspectTaskBo!=null">#{resourceInspectTaskBo},</if>
<if test="resourceBo!=null">#{resourceBo},</if>
<if test="inspectNo!=null">#{inspectNo},</if>
<if test="resourceInspectTaskBo!=null">#{resourceInspectTaskBo},</if>
<if test="description!=null">#{description},</if>
<if test="inspectMethod!=null">#{inspectMethod},</if>
<if test="inspectDataType!=null">#{inspectDataType},</if>
<if test="paramUnit!=null">#{paramUnit},</if>
<if test="required!=null">#{required},</if>
<if test="minValue!=null">#{minValue},</if>
<if test="maxValue!=null">#{maxValue},</if>
<if test="standardValue!=null">#{standardValue},</if>
<if test="resrceValue!=null">#{resrceValue},</if>
<if test="paramUnit!=null">#{paramUnit},</if>
<if test="resrce!=null">#{resrce},</if>
<if test="resultValue!=null">#{resultValue},</if>
<if test="result!=null">#{result},</if>
<if test="remark!=null">#{remark},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
@ -349,19 +348,18 @@
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{resourceInspectTaskBo},
#{resourceBo},
#{inspectNo},
#{resourceInspectTaskBo},
#{description},
#{inspectMethod},
#{inspectDataType},
#{paramUnit},
#{required},
#{minValue},
#{maxValue},
#{standardValue},
#{resrceValue},
#{paramUnit},
#{resrce},
#{resultValue},
#{result},
#{remark},
#{createUser},
#{createdDateTime},
@ -371,26 +369,66 @@
</insert>
<update id="updateById">
UPDATE Z_RESOURCE_INSPECT_TASK_PARAM <trim prefix="SET" suffixOverrides=",">
<if test="et.inspectNo!=null">INSPECT_NO=#{et.inspectNo},</if>
<if test="et.resourceInspectTaskBo!=null">RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},</if>
<if test="et.description!=null">DESCRIPTION=#{et.description},</if>
<if test="et.inspectMethod!=null">INSPECT_METHOD=#{et.inspectMethod},</if>
<if test="et.inspectDataType!=null">INSPECT_DATA_TYPE=#{et.inspectDataType},</if>
<if test="et.paramUnit!=null">PARAM_UNIT=#{et.paramUnit},</if>
<if test="et.required!=null">REQUIRED=#{et.required},</if>
<if test="et.minValue!=null">MIN_VALUE=#{et.minValue},</if>
<if test="et.maxValue!=null">MAX_VALUE=#{et.maxValue},</if>
<if test="et.standardValue!=null">STANDARD_VALUE=#{et.standardValue},</if>
<if test="et.resultValue!=null">RESULT_VALUE=#{et.resultValue},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.remark!=null">REMARK=#{et.remark},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_RESOURCE_INSPECT_TASK_PARAM <trim prefix="SET" suffixOverrides=",">
INSPECT_NO=#{et.inspectNo},
RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},
DESCRIPTION=#{et.description},
INSPECT_METHOD=#{et.inspectMethod},
INSPECT_DATA_TYPE=#{et.inspectDataType},
PARAM_UNIT=#{et.paramUnit},
REQUIRED=#{et.required},
MIN_VALUE=#{et.minValue},
MAX_VALUE=#{et.maxValue},
STANDARD_VALUE=#{et.standardValue},
RESULT_VALUE=#{et.resultValue},
RESULT=#{et.result},
REMARK=#{et.remark},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_RESOURCE_INSPECT_TASK_PARAM <trim prefix="SET" suffixOverrides=",">
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
<if test="et.resourceInspectTaskBo!=null">RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},</if>
<if test="et.resourceBo!=null">RESOURCE_BO=#{et.resourceBo},</if>
<if test="et.inspectNo!=null">INSPECT_NO=#{et.inspectNo},</if>
<if test="et.resourceInspectTaskBo!=null">RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},</if>
<if test="et.description!=null">DESCRIPTION=#{et.description},</if>
<if test="et.inspectMethod!=null">INSPECT_METHOD=#{et.inspectMethod},</if>
<if test="et.inspectDataType!=null">INSPECT_DATA_TYPE=#{et.inspectDataType},</if>
<if test="et.paramUnit!=null">PARAM_UNIT=#{et.paramUnit},</if>
<if test="et.required!=null">REQUIRED=#{et.required},</if>
<if test="et.minValue!=null">MIN_VALUE=#{et.minValue},</if>
<if test="et.maxValue!=null">MAX_VALUE=#{et.maxValue},</if>
<if test="et.standardValue!=null">STANDARD_VALUE=#{et.standardValue},</if>
<if test="et.resrceValue!=null">RESRCE_VALUE=#{et.resrceValue},</if>
<if test="et.paramUnit!=null">PARAM_UNIT=#{et.paramUnit},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.resultValue!=null">RESULT_VALUE=#{et.resultValue},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.remark!=null">REMARK=#{et.remark},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
@ -401,19 +439,18 @@
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.inspectNo!=null"> AND INSPECT_NO=#{ew.entity.inspectNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.inspectDataType!=null"> AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.required!=null"> AND REQUIRED=#{ew.entity.required}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.resrceValue!=null"> AND RESRCE_VALUE=#{ew.entity.resrceValue}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.resultValue!=null"> AND RESULT_VALUE=#{ew.entity.resultValue}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -430,6 +467,9 @@
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_RESOURCE_INSPECT_TASK_PARAM WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_RESOURCE_INSPECT_TASK_PARAM
@ -452,19 +492,18 @@
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.resourceBo!=null"> AND RESOURCE_BO=#{ew.entity.resourceBo}</if>
<if test="ew.entity.inspectNo!=null"> AND INSPECT_NO=#{ew.entity.inspectNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.inspectDataType!=null"> AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.required!=null"> AND REQUIRED=#{ew.entity.required}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.resrceValue!=null"> AND RESRCE_VALUE=#{ew.entity.resrceValue}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.resultValue!=null"> AND RESULT_VALUE=#{ew.entity.resultValue}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -481,6 +520,11 @@
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_RESOURCE_INSPECT_TASK_PARAM WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -0,0 +1,434 @@
<?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.foreverwin.mesnac.equip.mapper.ResourceInspectTaskSpareMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare">
<id column="HANDLE" property="handle" />
<result column="SPARE_NO" property="spareNo" />
<result column="RESOURCE_INSPECT_TASK_BO" property="resourceInspectTaskBo" />
<result column="ITEM_BO" property="itemBo" />
<result column="DESCRIPTION" property="description" />
<result column="QTY" property="qty" />
<result column="UNIT" property="unit" />
<result column="REMARK" property="remark" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SPARE_NO, RESOURCE_INSPECT_TASK_BO, ITEM_BO, DESCRIPTION, QTY, UNIT, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_RESOURCE_INSPECT_TASK_SPARE WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_RESOURCE_INSPECT_TASK_SPARE
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_RESOURCE_INSPECT_TASK_SPARE WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_RESOURCE_INSPECT_TASK_SPARE
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.spareNo!=null"> AND SPARE_NO=#{ew.entity.spareNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.unit!=null"> AND UNIT=#{ew.entity.unit}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_RESOURCE_INSPECT_TASK_SPARE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.spareNo!=null"> AND SPARE_NO=#{ew.entity.spareNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.unit!=null"> AND UNIT=#{ew.entity.unit}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_RESOURCE_INSPECT_TASK_SPARE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.spareNo!=null"> AND SPARE_NO=#{ew.entity.spareNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.unit!=null"> AND UNIT=#{ew.entity.unit}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_RESOURCE_INSPECT_TASK_SPARE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.spareNo!=null"> AND SPARE_NO=#{ew.entity.spareNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.unit!=null"> AND UNIT=#{ew.entity.unit}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_RESOURCE_INSPECT_TASK_SPARE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.spareNo!=null"> AND SPARE_NO=#{ew.entity.spareNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.unit!=null"> AND UNIT=#{ew.entity.unit}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_RESOURCE_INSPECT_TASK_SPARE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.spareNo!=null"> AND SPARE_NO=#{ew.entity.spareNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.unit!=null"> AND UNIT=#{ew.entity.unit}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_RESOURCE_INSPECT_TASK_SPARE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.spareNo!=null"> AND SPARE_NO=#{ew.entity.spareNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.unit!=null"> AND UNIT=#{ew.entity.unit}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare">
INSERT INTO Z_RESOURCE_INSPECT_TASK_SPARE
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="spareNo!=null">SPARE_NO,</if>
<if test="resourceInspectTaskBo!=null">RESOURCE_INSPECT_TASK_BO,</if>
<if test="itemBo!=null">ITEM_BO,</if>
<if test="description!=null">DESCRIPTION,</if>
<if test="qty!=null">QTY,</if>
<if test="unit!=null">UNIT,</if>
<if test="remark!=null">REMARK,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifyUser!=null">MODIFY_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="spareNo!=null">#{spareNo},</if>
<if test="resourceInspectTaskBo!=null">#{resourceInspectTaskBo},</if>
<if test="itemBo!=null">#{itemBo},</if>
<if test="description!=null">#{description},</if>
<if test="qty!=null">#{qty},</if>
<if test="unit!=null">#{unit},</if>
<if test="remark!=null">#{remark},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifyUser!=null">#{modifyUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare">
INSERT INTO Z_RESOURCE_INSPECT_TASK_SPARE
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{spareNo},
#{resourceInspectTaskBo},
#{itemBo},
#{description},
#{qty},
#{unit},
#{remark},
#{createUser},
#{createdDateTime},
#{modifyUser},
#{modifiedDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_RESOURCE_INSPECT_TASK_SPARE <trim prefix="SET" suffixOverrides=",">
<if test="et.spareNo!=null">SPARE_NO=#{et.spareNo},</if>
<if test="et.resourceInspectTaskBo!=null">RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},</if>
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.description!=null">DESCRIPTION=#{et.description},</if>
<if test="et.qty!=null">QTY=#{et.qty},</if>
<if test="et.unit!=null">UNIT=#{et.unit},</if>
<if test="et.remark!=null">REMARK=#{et.remark},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_RESOURCE_INSPECT_TASK_SPARE <trim prefix="SET" suffixOverrides=",">
SPARE_NO=#{et.spareNo},
RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},
ITEM_BO=#{et.itemBo},
DESCRIPTION=#{et.description},
QTY=#{et.qty},
UNIT=#{et.unit},
REMARK=#{et.remark},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_RESOURCE_INSPECT_TASK_SPARE <trim prefix="SET" suffixOverrides=",">
<if test="et.spareNo!=null">SPARE_NO=#{et.spareNo},</if>
<if test="et.resourceInspectTaskBo!=null">RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},</if>
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.description!=null">DESCRIPTION=#{et.description},</if>
<if test="et.qty!=null">QTY=#{et.qty},</if>
<if test="et.unit!=null">UNIT=#{et.unit},</if>
<if test="et.remark!=null">REMARK=#{et.remark},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.spareNo!=null"> AND SPARE_NO=#{ew.entity.spareNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.unit!=null"> AND UNIT=#{ew.entity.unit}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_RESOURCE_INSPECT_TASK_SPARE WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_RESOURCE_INSPECT_TASK_SPARE
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_RESOURCE_INSPECT_TASK_SPARE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.spareNo!=null"> AND SPARE_NO=#{ew.entity.spareNo}</if>
<if test="ew.entity.resourceInspectTaskBo!=null"> AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.unit!=null"> AND UNIT=#{ew.entity.unit}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_RESOURCE_INSPECT_TASK_SPARE WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -33,9 +33,9 @@ public class GeneratorApplication {
dataSourceConfig.setTypeConvert( new OracleTypeConvert() );
MpGenerator mpGenerator = mpGeneratorBuilder.dataSourceConfig(dataSourceConfig)
.tablePrefix( "APS_", "DS_", "Z_" )
.packageName( "com.foreverwin.mesnac.meapi" )
.tables("SFC_DATA")
.author("Leon.L")
.packageName( "com.foreverwin.mesnac.equip" )
.tables("Z_RESOURCE_INSPECT_TASK_SPARE")
.author("pavel.Liu")
.uiAppId("com.foreverwin.me")
.uiPackage("com.foreverwin.me.migration")
.build();

@ -1,218 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: com.foreverwin.modular:modular-core:1.0-SNAPSHOT.standlone-hana" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.5.22.RELEASE" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:1.5.22.RELEASE" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.43" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.tomcat:tomcat-annotations-api:8.5.43" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.43" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.43" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.3.6.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.11.3" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j2:1.5.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.7" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.7" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.7" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.26" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.26" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-test:1.5.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-test:1.5.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:1.5.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.jayway.jsonpath:json-path:2.2.0" level="project" />
<orderEntry type="library" name="Maven: net.minidev:json-smart:2.2.1" level="project" />
<orderEntry type="library" name="Maven: net.minidev:accessors-smart:1.1" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Maven: org.assertj:assertj-core:2.6.0" level="project" />
<orderEntry type="library" name="Maven: org.mockito:mockito-core:1.10.19" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.objenesis:objenesis:2.1" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
<orderEntry type="library" name="Maven: org.skyscreamer:jsonassert:1.4.0" level="project" />
<orderEntry type="library" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-test:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:dynamic-datasource-spring-boot-starter:2.5.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:1.5.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:1.5.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.14" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.2" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.1.0" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.1.0" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.1.0" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.1.0" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.1.0" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:1.4" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.0" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:2.5.1" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
<orderEntry type="library" name="Maven: ojdbc6:ojdbc6:11.2.0.4" level="project" />
<orderEntry type="library" name="Maven: com.sap:ngdbc:2.5.52" level="project" />
<orderEntry type="library" name="Maven: com.sap:sapdbc:7.9.09" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-legacy:1.1.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.0.6" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-typehandlers-jsr310:1.0.2" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.11" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.11" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.1.12" level="project" />
<orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.1.12" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.4.1" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.2.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.1.12" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.1.12" level="project" />
<orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.1.12" level="project" />
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" />
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.1.12" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.1.12" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.1.12" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.1.12" level="project" />
<orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-transports-http:3.1.12" level="project" />
<orderEntry type="library" name="Maven: com.sap:sapjco:NTAMD64-3.0.6" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-continuation:9.4.19.v20190610" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-http:9.4.19.v20190610" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-io:9.4.19.v20190610" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-server:9.4.19.v20190610" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-util:9.4.19.v20190610" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-websocket:8.2.0.v20160908" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.73" level="project" />
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.4" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:1.0.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.foreverwin.modular:modular-melib:15.4.0.2.RELEASE" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.activity.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.annotation.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.appconfig.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.backgroundprocess.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.browse.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.certification.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.collaboration.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.common.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.container.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.customdata.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.datacollection.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.dataformat.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.datatransfer.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.datatype.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.demand.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.document.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.extension.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.framework.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.framework.api-internal:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.framework.globalization:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.integration.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.integration.cncdnc.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.integration.erp.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.inventory.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.labor.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.legacy.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.messaging.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.nonconformance.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.numbering.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.plant.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.productdefinition.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.production.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.productiondate.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.reasoncode.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.reporting.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.resourcetracking.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.sampling.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.schedulingstandards.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.script.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.security.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.setpoint.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.status.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.timeelement.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.tooling.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.uom.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.user.api:154.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:service-core.api:3.4.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:common-libs:3.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:sap-usermanagement-api:1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sap:me.common.domain:154.0.2" level="project" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.15" level="project" />
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
<orderEntry type="module" module-name="meapi" />
<orderEntry type="module" module-name="common" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.8" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.8" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.8" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.3.0" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-activemq:2.1.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jms:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-messaging:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.activemq:activemq-broker:5.14.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.activemq:activemq-openwire-legacy:5.14.5" level="project" />
<orderEntry type="library" name="Maven: javax.jms:javax.jms-api:2.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.activemq:activemq-pool:5.13.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.activemq:activemq-jms-pool:5.14.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.activemq:activemq-client:5.14.5" level="project" />
<orderEntry type="library" name="Maven: org.fusesource.hawtbuf:hawtbuf:1.11" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:1.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.4.3" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.4" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:28.0-jre" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.8.1" level="project" />
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.2" level="project" />
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.mojo:animal-sniffer-annotations:1.17" level="project" />
<orderEntry type="library" name="Maven: javax.mail:mail:1.4.7" level="project" />
<orderEntry type="library" name="Maven: javax.activation:activation:1.1.1" level="project" />
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-quartz:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.5.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.5.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:1.5.22.RELEASE" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.17" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:4.3.25.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.3.0" level="project" />
<orderEntry type="library" name="Maven: com.mchange:mchange-commons-java:0.2.11" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.9" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
</component>
</module>

@ -32,6 +32,7 @@ public class ItemController {
@GetMapping("")
public R getItemList(Item item) {
List<Item> result;
item.setSite(CommonMethods.getSite());
QueryWrapper<Item> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(item);
result = itemService.list(queryWrapper);

@ -62,7 +62,28 @@ public class SfcController {
result = sfcService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/pageByResrce")
public R page(FrontPage<Sfc> frontPage, SfcDto sfc){
IPage result;
try {
String site = CommonMethods.getSite();
sfc.setSite(site);
QueryWrapper<SfcDto> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(sfc);
result = sfcService.pageByResrce(frontPage.getPagePlus(), queryWrapper);
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok(result);
}
/**
*
*

@ -1,20 +1,22 @@
package com.foreverwin.mesnac.meapi.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.UserGroup;
import com.foreverwin.mesnac.meapi.service.UserGroupService;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.meapi.service.UserGroupService;
import com.foreverwin.mesnac.meapi.model.UserGroup;
import java.util.List;
/**
*
* @author robert
* @since 2021-06-29
* @author pavel.Liu
* @since 2021-06-18
*/
@RestController
@RequestMapping("/USER-GROUP")

@ -23,4 +23,6 @@ public interface OperationMapper extends BaseMapper<Operation> {
Operation selectOperationBySfcBo(@Param("sfcBo") String sfcBo, @Param("locale") String locale);
Operation getCurrentRevisionRef(@Param("site") String site, @Param("operation") String operation);
}

@ -1,5 +1,8 @@
package com.foreverwin.mesnac.meapi.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.model.Sfc;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -24,4 +27,8 @@ public interface SfcMapper extends BaseMapper<Sfc> {
List<Sfc> getSfcListByResrceBO(String resrceBO);
SfcDto findSfcData(@Param("site") String site, @Param("sfc") String sfc);
Sfc findBySfc(@Param("sfc") Sfc sfc);
IPage pageByResrce(Page<Sfc> pagePlus,@Param("ew") QueryWrapper<SfcDto> queryWrapper,@Param("locale")String locale);
}

@ -6,6 +6,15 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
@ -22,7 +31,7 @@ public class UserGroup extends Model<UserGroup> {
private static final long serialVersionUID = 1L;
@TableField("HANDLE")
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
@TableField("CHANGE_STAMP")
private Long changeStamp;

@ -26,4 +26,6 @@ public interface OperationService extends IService<Operation> {
IPage<Operation> selectPage(Page<Operation> page, QueryWrapper<Operation> operation);
List<Operation> selectList(Operation operation);
Operation getCurrentRevisionRef(String site, String operation);
}

@ -1,7 +1,10 @@
package com.foreverwin.mesnac.meapi.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.modular.core.util.FrontPage;
@ -17,6 +20,7 @@ import java.util.List;
* @since 2021-06-02
*/
public interface SfcService extends IService<Sfc> {
IPage<Sfc> pageByResrce(Page<Sfc> pagePlus, QueryWrapper<SfcDto> queryWrapper);
/**
*
@ -45,4 +49,5 @@ public interface SfcService extends IService<Sfc> {
* @return
*/
SfcDto findSfcData(String site, String sfc);
}

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.meapi.mapper.OperationMapper;
import com.foreverwin.mesnac.meapi.model.Operation;
import com.foreverwin.mesnac.meapi.service.OperationService;
import com.foreverwin.modular.core.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
@ -46,5 +47,14 @@ public class OperationServiceImpl extends ServiceImpl<OperationMapper, Operation
return super.list(queryWrapper);
}
@Override
public Operation getCurrentRevisionRef(String site,String operation) {
Operation currentRevisionRef = operationMapper.getCurrentRevisionRef(site, operation);
if (currentRevisionRef==null){
throw new BaseException("未找到工序的当前版本");
}
return currentRevisionRef;
}
}

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.meapi.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -9,6 +10,7 @@ import com.foreverwin.mesnac.meapi.mapper.SfcMapper;
import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.mesnac.meapi.service.SfcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -29,6 +31,11 @@ public class SfcServiceImpl extends ServiceImpl<SfcMapper, Sfc> implements SfcSe
@Autowired
private SfcMapper sfcMapper;
@Override
public IPage pageByResrce(Page<Sfc> pagePlus, QueryWrapper<SfcDto> queryWrapper) {
return sfcMapper.pageByResrce(pagePlus, queryWrapper, LocaleContextHolder.getLocale().getLanguage());
}
@Override
public IPage<Sfc> selectPage(FrontPage<Sfc> frontPage, Sfc sfc) {
QueryWrapper<Sfc> queryWrapper = new QueryWrapper<>();

@ -253,7 +253,7 @@
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
<include refid="Full_Column_List"></include>
</otherwise>
</choose>
FROM ITEM I

@ -598,11 +598,21 @@
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectOperationBySfcBo" resultMap="BaseResultMap">
SELECT OP.HANDLE, OP.OPERATION,OT.DESCRIPTION FROM SFC_ROUTING SR
SELECT OP.HANDLE, OP.OPERATION,OT.DESCRIPTION ,SS.STEP_ID FROM SFC_ROUTING SR
JOIN SFC_ROUTER SR2 ON SR.HANDLE =SR2.SFC_ROUTING_BO AND SR2.IN_USE = 'true'
JOIN SFC_STEP SS ON SR2.HANDLE =SS.SFC_ROUTER_BO
JOIN OPERATION OP ON 'OperationBO:'|| OP.SITE ||','|| OP.OPERATION||',#'=SS.OPERATION_BO
LEFT JOIN OPERATION_T OT ON OP.HANDLE = OT.OPERATION_BO AND OT.LOCALE = #{locale}
WHERE SR.SFC_BO =#{sfcBo} AND (SS.QTY_IN_QUEUE>0 or SS.QTY_IN_WORK>0)
</select>
<select id="getCurrentRevisionRef" resultMap="BaseResultMap">
SELECT
HANDLE,OPERATION,
REVISION
FROM OPERATION
WHERE SITE = #{site}
AND OPERATION = #{operation}
AND CURRENT_REVISION = 'true'
</select>
</mapper>

@ -663,4 +663,12 @@
LEFT JOIN OPERATION_T OTT ON SPLIT(OTT.OPERATION_BO,2) = ZSD.PREPOSITION_OPERATION AND OTT.LOCALE = 'zh'
WHERE SC.SITE = #{site} AND SC.SFC = #{sfc}
</select>
<select id="pageByResrce" resultMap="FullResultMap">
SELECT S.SFC,S.QTY,IT.DESCRIPTION ITEM_DESCRIPTION FROM SFC S
LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.HANDLE AND IT.LOCALE=#{locale}
JOIN Z_SFC_DISPATCH zsd ON S.SFC=zsd.SFC AND S.SITE=zsd.SITE
WHERE S.SITE=#{ew.entity.site} AND ZSD.RESRCE=#{ew.entity.resrce} AND ZSD.DISPATCH_STATUS!='CANCEL'
AND S.STATUS_BO IN ('StatusBO:'||#{ew.entity.site}||',401','StatusBO:'||#{ew.entity.site}||',402','StatusBO:'||#{ew.entity.site}||',403')
</select>
</mapper>

@ -9,6 +9,9 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@RequestMapping("/sfcDataMains")
public class PodTemplateController {
@ -37,4 +40,27 @@ public class PodTemplateController {
public R sfcEnter(SfcDto sfcDto) {
return R.ok(podTemplateService.sfcEnter(sfcDto));
}
/**
* sfc
* @param sfcDtoList
* @return
*/
@ResponseBody
@GetMapping("/sfcStart")
public R sfcStart(List<SfcDto> sfcDtoList) {
podTemplateService.sfcStart(sfcDtoList);
return R.ok();
}
/**
*
* @param sfcDto
* @return
*/
@ResponseBody
@GetMapping("/getSfcInfo")
public R getSfcInfo(SfcDto sfcDto) {
return R.ok(podTemplateService.getSfcInfo(sfcDto));
}
}

@ -39,8 +39,6 @@ public interface SfcCrossMapper extends BaseMapper {
*/
List<StepOperation> findRouterOperationByRouterBo(@Param("site") String site, @Param("routerBo") String routerBo, @Param("locale") String locale);
// String getDoneSfcItemBo(IPage page, @Param("dataAttr") String dataAttr,
// @Param("site") String site, @Param("statusBo") String statusBo);
/**
@ -60,7 +58,6 @@ public interface SfcCrossMapper extends BaseMapper {
List<ShopOrder> findShopOrderListByStatus(@Param("plannedWorkCenterBo") String plannedWorkCenterBo,
@Param("status") String customStatus);
//List<Map<String, Object>> findSfcListBySnList(@Param("site") String site, @Param("snList") List<String> snList);
/**
* 线
@ -93,5 +90,7 @@ public interface SfcCrossMapper extends BaseMapper {
Map<String, Object> querySfcData(@Param("site")String site, @Param("locale")String locale, @Param("dto")SfcDto sfcDto);
List<Map<String, Object>> querySfcStep(@Param("site")String site, @Param("sfc")String sfc, @Param("operation")String operation);
Map<String, Object> getSfcInfo(@Param("site")String site, @Param("sfc")String sfc, @Param("operation")String operation);
Integer getSfcDispatch(@Param("site") String site, @Param("sfc") String sfc, @Param("operation") String operation, @Param("stepId") String stepId,@Param("resrce")String resrce);
}

@ -3,10 +3,15 @@ package com.foreverwin.mesnac.production.service;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
import java.util.List;
import java.util.Map;
public interface PodTemplateService {
Map<String, Object> resrceEnter(WorkCenterDto workCenterDto);
Map<String, Object> sfcEnter(SfcDto workCenterDto);
Object getSfcInfo(SfcDto sfcDto);
void sfcStart(List<SfcDto> sfcDto);
}

@ -0,0 +1,44 @@
package com.foreverwin.mesnac.production.service;
import java.math.BigDecimal;
/**
* :
* : philip
* : 2021-6-30
*/
public interface SfcCrossService {
/**
*
* @param site
* @param operationRef
* @param resource
* @param sfcRef
* @param qty
* @throws Exception
*/
void startAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception;
/**
*
* @param site
* @param operationRef
* @param resource
* @param sfcRef
* @param qty
* @throws Exception
*/
void completeAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception;
/**
* SFC
* @param site
* @param operationRef
* @param resource
* @param sfcRef
* @param qty
* @throws Exception
*/
void passAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception;
}

@ -2,16 +2,19 @@ package com.foreverwin.mesnac.production.service.impl;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.service.CommonService;
import com.foreverwin.mesnac.common.util.ExceptionUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
import com.foreverwin.mesnac.meapi.model.Operation;
import com.foreverwin.mesnac.meapi.model.Resrce;
import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.mesnac.meapi.service.OperationService;
import com.foreverwin.mesnac.meapi.service.ResrceService;
import com.foreverwin.mesnac.meapi.service.SfcService;
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
import com.foreverwin.mesnac.production.service.PodTemplateService;
import com.foreverwin.mesnac.production.service.SfcCrossService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.util.CommonMethods;
import org.springframework.beans.factory.annotation.Autowired;
@ -19,6 +22,8 @@ import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -35,24 +40,27 @@ public class PodTemplateServiceImpl implements PodTemplateService {
private CommonService commonService;
@Autowired
private SfcCrossMapper sfcCrossMapper;
@Autowired
private SfcCrossService sfcCrossService;
@Autowired
private OperationService operationService;
@Override
public Map<String, Object> resrceEnter(WorkCenterDto workCenterDto) {
String site = CommonMethods.getSite();
String resrce = workCenterDto.getResrce();
String resrceBO = HandleEnum.RESOURCE.getHandle(site, resrce);
Resrce model = resrceService.getById(resrceBO);
if (model==null){
throw new BaseException("资源 "+resrce+" 不存在");
if (model == null) {
throw new BaseException("资源 " + resrce + " 不存在");
}
String workCenter = workCenterDto.getWorkCenter();
//校验
String workShopBo = commonService.getWorkShopBo(resrceBO);
if (StringUtil.isBlank(workShopBo)){
throw new BaseException("资源 "+resrce+" 未匹配到车间");
if (StringUtil.isBlank(workShopBo)) {
throw new BaseException("资源 " + resrce + " 未匹配到车间");
}
if (!workCenter.equals(StringUtil.trimHandle(workShopBo))){
throw new BaseException("资源 "+resrce+" 与车间不匹配");
if (!workCenter.equals(StringUtil.trimHandle(workShopBo))) {
throw new BaseException("资源 " + resrce + " 与车间不匹配");
}
//查询在该设备存在活动中的SFC
@ -70,26 +78,36 @@ public class PodTemplateServiceImpl implements PodTemplateService {
String sfc = sfcDto.getSfc();
String operation = sfcDto.getOperation();
String locale = LocaleContextHolder.getLocale().getLanguage();
String resrce = sfcDto.getResrce();
//校验产品条码是否存在
Sfc sfcById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
if (sfcById==null){
throw new BaseException("产品条码"+sfc+"不存在");
if (sfcById == null) {
throw new BaseException("产品条码" + sfc + "不存在");
}
String status = StringUtil.trimHandle(sfcById.getStatusBo());
if (!status.equals("403") && !status.equals("401") && !status.equals("402")) {
throw new BaseException("产品条码" + sfc + "不在工作中或排队中");
}
//校验产品条码是否在当前工序排队
Operation operationBySfcBo = commonService.getOperationBySfcBo(sfcById.getHandle());
if (StringUtil.notBlank(operation)&&!operationBySfcBo.getOperation().equals(operation)){
/* if (StringUtil.notBlank(operation)&&!operationBySfcBo.getOperation().equals(operation)){
throw new BaseException("产品条码"+sfc+"在"+operationBySfcBo.getOperation()+"/"+operationBySfcBo.getDescription()+"工序");
}
}*/
//校验SFC+工序+设备+STEP_ID是否与当前设备确认的派工单匹配
Integer integer = sfcCrossMapper.getSfcDispatch(site, sfc, operationBySfcBo.getOperation(), operationBySfcBo.getStepId(), resrce);
if (integer < 1) {
throw new BaseException("产品条码与当前设备工序确认的派工单不匹配");
}
String substep = "";
String substepHandle = "";
//构造前台所需要的数据
Map<String, Object> resultMap = sfcCrossMapper.querySfcData(site,locale,sfcDto);
if(resultMap == null){
Map<String, Object> resultMap = sfcCrossMapper.querySfcData(site, locale, sfcDto);
if (resultMap == null) {
throw new BaseException("根据当前资源未找到条码[" + sfc + "]的基本信息!");
}
List<Map<String, Object>> substepList = sfcCrossMapper.querySfcStep(site, sfc, operation);
//List<Map<String, Object>> substepList = sfcCrossMapper.querySfcStep(site, sfc, operationBySfcBo.getOperation());
List<Map<String, Object>> substepList = new ArrayList<>();
resultMap.put("SFC_STEP_LIST", substepList);
String stepId = (String) resultMap.get("STEP_ID");
@ -194,6 +212,33 @@ public class PodTemplateServiceImpl implements PodTemplateService {
}*/
resultMap.put("IS_CREATE_H", isCreateH);
resultMap.put("IS_CREATE_Z", isCreateZ);
return null;
return resultMap;
}
@Override
public Object getSfcInfo(SfcDto sfcDto) {
String site = CommonMethods.getSite();
String operation = sfcDto.getOperation();
String sfc = sfcDto.getSfc();
Map<String, Object> substepList = sfcCrossMapper.getSfcInfo(site, sfc, operation);
return substepList;
}
@Override
public void sfcStart(List<SfcDto> sfcDtoList) {
sfcDtoList.forEach(sfcDto -> {
String site = CommonMethods.getSite();
String operation = sfcDto.getOperation();
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
String resrce = sfcDto.getResrce();
String sfc = sfcDto.getSfc();
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(sfc, sfc));
BigDecimal qty=new BigDecimal(sfcServiceById.getQty().toString());
try {
sfcCrossService.startAction(site, currentRevisionRef.getHandle(),resrce,sfcServiceById.getHandle(),qty);
} catch (Exception e) {
ExceptionUtil.throwException(e);
}
});
}
}

@ -0,0 +1,64 @@
package com.foreverwin.mesnac.production.service.impl;
import com.foreverwin.mesnac.production.service.SfcCrossService;
import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.CommonMethods;
import com.sap.me.plant.ResourceBOHandle;
import com.sap.me.production.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
/**
* :
* : philip
* : 2021-06-30
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SfcCrossServiceImpl implements SfcCrossService {
@Override
public void startAction(String site, String operationRef,
String resource, String sfcRef, BigDecimal qty) throws Exception {
SfcStartServiceInterface sfcStartService = MEServices.create("com.sap.me.production", "SfcStartService", site);
StartSfcRequest paramStartSfcRequest = new StartSfcRequest();
paramStartSfcRequest.setQty(qty);
paramStartSfcRequest.setOperationRef(operationRef);
paramStartSfcRequest.setResourceRef(new ResourceBOHandle(site, resource).getValue());
paramStartSfcRequest.setSfcRef(sfcRef);
paramStartSfcRequest.setUserRef(CommonMethods.getUserBo());
sfcStartService.startSfc(paramStartSfcRequest);
}
@Override
public void completeAction(String site, String operationRef,
String resource, String sfcRef, BigDecimal qty) throws Exception {
SfcCompleteServiceInterface sfcCompleteService = MEServices.create("com.sap.me.production", "SfcCompleteService", site);
CompleteSfcRequest paramCompleteSfcRequest = new CompleteSfcRequest();
paramCompleteSfcRequest.setOperationRef(operationRef);
paramCompleteSfcRequest.setResourceRef(new ResourceBOHandle(site, resource).getValue());
paramCompleteSfcRequest.setSfcRef(sfcRef);
if(qty != null) {
paramCompleteSfcRequest.setQuantity(qty);
}
paramCompleteSfcRequest.setLocation("");
sfcCompleteService.completeSfc(paramCompleteSfcRequest);
}
@Override
public void passAction(String site, String operationRef,
String resource, String sfcRef, BigDecimal qty) throws Exception {
SfcCompleteServiceInterface sfcCompleteService = MEServices.create("com.sap.me.production", "SfcCompleteService", site);
CompleteSfcQuickRequest paramCompleteSfcRequest = new CompleteSfcQuickRequest();
paramCompleteSfcRequest.setOperationRef(operationRef);
paramCompleteSfcRequest.setResourceRef(new ResourceBOHandle(site, resource).getValue());
paramCompleteSfcRequest.setSfcRef(sfcRef);
if(qty != null) {
paramCompleteSfcRequest.setQuantity(qty);
}
sfcCompleteService.completeSfcQuick(paramCompleteSfcRequest);
}
}

@ -139,8 +139,8 @@ WHERE sfc.site = #{site} and
RO_CF2.VALUE TOOL ,SOD.HANDLE SFC_DISPATCH_DETAIL_BO,
S.SFC,S.QTY SFC_QTY,RS.STEP_ID, SOD.DISPATCH_NO ,
TO_CHAR( SOD.PLANNED_START_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss')START_DATE,
TO_CHAR(SOD.PLANNED_COMPLETE_DATE + INTERVAL '8' HOUR ,'yyyy-mm-dd hh24:mi:ss')COMP_DATE,
TO_CHAR((SOD.PLANNED_COMPLETE_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H' ADD_DATE,
TO_CHAR(SOD.PLANNED_COMP_DATE + INTERVAL '8' HOUR ,'yyyy-mm-dd hh24:mi:ss')COMP_DATE,
TO_CHAR((SOD.PLANNED_COMP_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H' ADD_DATE,
CASE WHEN OT.DESCRIPTION LIKE 'CH%' THEN SUBSTR(OT.DESCRIPTION, 0, 3) ELSE N'' END SLOT
FROM SFC S
INNER JOIN STATUS ST ON ST.HANDLE = S.STATUS_BO
@ -159,7 +159,7 @@ WHERE sfc.site = #{site} and
INNER JOIN ITEM I ON I.HANDLE = S.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE =#{locale}
INNER JOIN (
SELECT SD.HANDLE, SD.SFC,SD.RESRCE,SD.OPERATION,SD.STEP_ID,SD.PLANNED_COMPLETE_DATE, SD.PLANNED_START_DATE,SD.DISPATCH_NO
SELECT SD.HANDLE, SD.SFC,SD.RESRCE,SD.OPERATION,SD.STEP_ID,SD.PLANNED_COMP_DATE, SD.PLANNED_START_DATE,SD.DISPATCH_NO
FROM Z_PROD_READY_TASK RB
INNER JOIN Z_SFC_DISPATCH SD ON SD.HANDLE = RB.SFC_DISPATCH_BO
WHERE RB.SITE =#{site} AND RB.STATUS = 'F'
@ -170,42 +170,28 @@ WHERE sfc.site = #{site} and
OP.OPERATION, OT.DESCRIPTION ,OP.OPERATION||'/'||RS.STEP_ID ,RO_CF2.VALUE,
S.SFC,S.QTY ,RS.STEP_ID,SOD.DISPATCH_NO , SOD.HANDLE ,
TO_CHAR( SOD.PLANNED_START_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss'),
TO_CHAR(SOD.PLANNED_COMPLETE_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss'),
TO_CHAR((SOD.PLANNED_COMPLETE_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H',
TO_CHAR(SOD.PLANNED_COMP_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss'),
TO_CHAR((SOD.PLANNED_COMP_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H',
CASE WHEN OT.DESCRIPTION LIKE 'CH%' THEN SUBSTR(OT.DESCRIPTION, 0, 3) ELSE N'' END
</select>
<select id="querySfcStep" resultType="map">
SELECT B1.OPERATION,B1.STEP_ID,B1.DESCRIPTION STEP_DESC,B1.STATE,
B1.HANDLE,B1."SEQUENCE",
CASE WHEN B1."SEQUENCE"=B1.MAXSEQ THEN 'true'
ELSE 'false' END IS_SEQTRUE,B1.LONG_DESCRIPTION,
CASE WHEN B1.STATE ='FINISHED' THEN N'已完工'
WHEN B1."SEQUENCE"=B1.MAXSEQ AND B1.STATE ='READY' AND B1.STATUS ='403' THEN N'加工中'
ELSE N'未加工'
END STEP_STATUS
FROM (
SELECT A1.*,MAX(A1.SELECTSEQ) OVER(PARTITION BY OPERATION) MAXSEQ
FROM (
SELECT O.OPERATION,SST.SUBSTEP STEP_ID,SS.STATE,
NVL(SST.DESCRIPTION,SU.DESCRIPTION) DESCRIPTION,
CASE WHEN SS.STATE ='FINISHED' THEN N'已完工' ELSE N'加工中' END STEP_STATUS,
SS.HANDLE,SS."SEQUENCE",
CASE WHEN SS.STATE='FINISHED' THEN SST."SEQUENCE"+1 ELSE 0 END SELECTSEQ,ST.STATUS,
NVL(SST.LONG_DESCRIPTION,SU.LONG_DESCRIPTION) LONG_DESCRIPTION
FROM SFC_SUBSTEP SS
INNER JOIN SFC_STEP SSTEP ON SS.SFC_STEP_BO=SSTEP.HANDLE AND SSTEP.DONE='false'
AND (SSTEP.QTY_IN_QUEUE > 0 OR SSTEP.QTY_IN_WORK > 0)
INNER JOIN SFC_ROUTER SR ON SR.HANDLE=SSTEP.SFC_ROUTER_BO
INNER JOIN SFC_ROUTING SRI ON SRI.HANDLE=SR.SFC_ROUTING_BO
INNER JOIN ROUTER_SUBSTEP SST ON SS.ROUTER_SUBSTEP_BO = SST.HANDLE
LEFT JOIN SUBSTEP SU ON SU.SUBSTEP = SST.SUBSTEP AND SU.CURRENT_REVISION = 'true' AND SU.SITE = #{site}
INNER JOIN SFC S ON S.HANDLE=SRI.SFC_BO
INNER JOIN STATUS ST ON ST.HANDLE = S.STATUS_BO
INNER JOIN OPERATION O ON O.OPERATION=SPLIT(SSTEP.OPERATION_BO,2) AND O.SITE=S.SITE AND O.CURRENT_REVISION = 'true'
AND #{operation} IS NULL OR #{operation} = O.OPERATION)
WHERE S.SFC=#{sfc} AND S.SITE= #{site} ORDER BY SST."SEQUENCE"
) A1
) B1 ORDER BY B1."SEQUENCE" ASC
<select id="getSfcInfo" resultType="map">
SELECT O.OPERATION,SSTEP.STEP_ID,IT.DESCRIPTION,S.SFC,S.QTY,
CASE WHEN SSTEP.QTY_IN_WORK > 0 THEN '工作中'
WHEN SSTEP.QTY_IN_QUEUE > 0 THEN '排队中'
ELSE '新建' END STEP_STATUS
FROM SFC S
LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.HANDLE AND IT.LOCALE='zh'
INNER JOIN SFC_ROUTING SRI ON S.HANDLE=SRI.SFC_BO
INNER JOIN SFC_ROUTER SR ON SRI.HANDLE=SR.SFC_ROUTING_BO AND SR.IN_USE='true'
INNER JOIN ROUTER_STEP RS ON RS.ROUTER_BO=sr.ROUTER_BO
INNER JOIN SFC_STEP SSTEP ON SSTEP.SFC_ROUTER_BO=SR.HANDLE AND RS.STEP_ID= SSTEP.STEP_ID
AND (SSTEP.QTY_IN_QUEUE > 0 OR SSTEP.QTY_IN_WORK > 0)
INNER JOIN STATUS ST ON ST.HANDLE = S.STATUS_BO
INNER JOIN OPERATION O ON O.OPERATION=SPLIT(SSTEP.OPERATION_BO,2) AND O.SITE=S.SITE AND O.CURRENT_REVISION = 'true'
AND #{operation} = O.OPERATION
WHERE S.SFC=#{sfc} AND S.SITE=#{site}
</select>
<select id="getSfcDispatch" resultType="java.lang.Integer">
SELECT COUNT(HANDLE) FROM Z_SFC_DISPATCH zsd WHERE OPERATION= #{operation} AND SFC= #{sfc} AND STEP_ID= #{stepId} AND SITE= #{site} AND RESRCE=#{resrce}
</select>
</mapper>

Loading…
Cancel
Save