主数据分页查询语句修改

Leon 4 years ago
commit 1bb8b80c23

@ -29,11 +29,6 @@
<artifactId>modular-melib</artifactId>
</dependency>
<dependency>
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>meapi</artifactId>
</dependency>
<!--poi support-->
<dependency>
<groupId>org.apache.poi</groupId>

@ -14,6 +14,15 @@ public enum HandleEnum {
/**车间作业控制*/
SFC( "SFCBO:", "SFCBO:{0},{1}" ),
/**zhaungtai**/
STATUS("StatusBO:", "StatusBO:{0},{1}"),
/**zhaungtai**/
RESOURCE_TYPE("ResourceTypeBO:", "ResourceTypeBO:{0},{1}"),
/****/
RESOURCE_TYPE_RESOURCEBO("ResourceTypeResourceBO","ResourceTypeResourceBO:{0},{1}"),
/**车间作业控制*/
SFC_BOM( "SFCBOMBO:", "SFCBOMBO:{0}" ),

@ -91,6 +91,19 @@ public class StringUtil
}
return -1;
}
static public boolean isBlank(String str)
{
boolean isBlank = false;
if( str == null ) isBlank = true;
else if( str.trim().equals( "" ) ) isBlank = true;
return isBlank;
}
static public boolean notBlank(String str)
{
return !isBlank(str);
}
public static boolean isEmpty(String str)
{

@ -34,6 +34,11 @@
<artifactId>modular-melib</artifactId>
</dependency>
<dependency>
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>common</artifactId>
</dependency>
<dependency>
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>meapi</artifactId>

@ -1,4 +0,0 @@
package com.foreverwin.com.equip.controller;
public class EquipTypeController {
}

@ -0,0 +1,64 @@
package com.foreverwin.mesnac.equip.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.mesnac.equip.model.EmailGroup;
import com.foreverwin.mesnac.equip.service.EmailGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
* @author Max
* @since 2021-03-11
*/
@RestController
@RequestMapping("/Z-EMAIL-GROUP")
public class EmailGroupController {
@Autowired
public EmailGroupService emailGroupService;
/**
* id
*
* @param emailGroup
* @return
*/
@ResponseBody
@GetMapping("/search/{emailGroup}")
public R getEmailGroupById(@PathVariable("emailGroup") String emailGroup) {
String site = CommonMethods.getSite();
EmailGroup _emailGroup = new EmailGroup();
_emailGroup.setSite( site );
_emailGroup.setEmailGroup( emailGroup );
QueryWrapper<EmailGroup> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity( _emailGroup );
EmailGroup eg = emailGroupService.getOne( queryWrapper );
if ( eg == null ) {
return R.failed( "邮件群组["+emailGroup+"]不存在" );
}
return R.ok(eg);
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getEmailGroupList(EmailGroup emailGroup){
String site = CommonMethods.getSite();
List<EmailGroup> result;
emailGroup.setSite( site );
QueryWrapper<EmailGroup> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(emailGroup);
result = emailGroupService.list(queryWrapper);
return R.ok(result);
}
}

@ -0,0 +1,193 @@
package com.foreverwin.mesnac.equip.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.foreverwin.mesnac.equip.model.Equip;
import com.foreverwin.mesnac.equip.model.EquipType;
import com.foreverwin.mesnac.equip.model.EquipTypeEquip;
import com.foreverwin.mesnac.equip.service.EquipService;
import com.foreverwin.mesnac.equip.service.EquipTypeEquipService;
import com.foreverwin.mesnac.equip.service.EquipTypeService;
import com.foreverwin.mesnac.meapi.model.CustomFields;
import com.foreverwin.mesnac.meapi.service.CustomFieldsService;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Collections;
import java.util.Date;
import java.util.List;
/**
*
* @author Max
* @since 2020-10-10
*/
@RestController
@RequestMapping("/EQUIP")
public class EquipController {
@Autowired
public EquipService equipService;
@Autowired
public EquipTypeEquipService equipTypeEquipService;
@Autowired
public CustomFieldsService customFieldsService;
@Autowired
public EquipTypeService equipTypeService;
/**
*
* @return
*/
@ResponseBody
@GetMapping("/search/{equip}")
public R getEquipById(@PathVariable("equip") String equip) {
String site = CommonMethods.getSite();
String handle = HandleEnum.RESOURCE.getHandle(site, equip);
String equipType = "";
Equip _equip = equipService.getById( handle );
if ( _equip == null ) {
return R.failed(null,"设备["+equip+"]不存在" );
}
QueryWrapper<EquipTypeEquip> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("EQUIP_BO",_equip.getHandle() );
EquipTypeEquip equipTypeEquip = equipTypeEquipService.getOne( queryWrapper );
if ( equipTypeEquip != null ) {
String equipTypeBo = equipTypeEquip.getEquipTypeBo();
equipType = (equipTypeBo.split(":")[1]).split(",")[1];
}
//查询设备自定义数据
List<CustomFields> statusList = customFieldsService.getCustomFields( handle,"STATUS" );
String status = "";
String department = "";
String serialNum = "";
if ( statusList.size() != 0 ) {
CustomFields statusField = statusList.get(0);
status = statusField.getValue();
}
List<CustomFields> departmentList = customFieldsService.getCustomFields( handle,"DEPARTMENT" );
if ( departmentList.size() != 0 ) {
CustomFields departmentField = departmentList.get(0);
department = departmentField.getValue();
}
List<CustomFields> serialNumberList = customFieldsService.getCustomFields( handle,"SERIAL_NUMBER" );
if ( serialNumberList.size() != 0 ) {
CustomFields serialNumberField = serialNumberList.get(0);
serialNum = serialNumberField.getValue();
}
_equip.setEquipType( equipType );
_equip.setStatus( status );
_equip.setDepartment( department );
_equip.setSerialNumber( serialNum );
return R.ok( _equip );
}
/**
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getEquipList(Equip equip){
String site = CommonMethods.getSite();
equip.setSite( site );
List<Equip> result;
QueryWrapper<Equip> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(equip);
result = equipService.list(queryWrapper);
Collections.sort(result);
return R.ok(result);
}
/**
*
* @param equip
* @return null
*/
@ResponseBody
@PostMapping("/save")
public R save(@RequestBody Equip equip) {
String site = CommonMethods.getSite();
//校验设备类型是否存在 2020/12/04
String equipType = equip.getEquipType();
if ( StringUtils.notEmpty( equipType ) ) {
QueryWrapper<EquipType> queryWrapper = new QueryWrapper<>();
EquipType et = new EquipType();
et.setSite(site);
et.setEquipType( equipType );
queryWrapper.setEntity(et);
EquipType _et = equipTypeService.getOne( queryWrapper );
if ( _et == null ) {
throw BusinessException.build("设备类型不存在:"+equipType);
}
}
//-----------------------------------------------------------------------------------------------
String handle = equip.getHandle();
String equipName = equip.getResrce();
String resourceHandle = HandleEnum.RESOURCE.getHandle(site, equipName);
equip.setHandle( resourceHandle );
String status = equip.getStatusBo();
String statusBo = HandleEnum.STATUS.getHandle(site, status);
equip.setSite( site );
equip.setStatusBo( statusBo );
equip.setCreatedDateTime( new Date() );
equip.setModifiedDateTime( new Date() );
//判断是更新还是新增 2020/12/01
Equip ep =equipService.getById( resourceHandle );
if ( ep != null && !ep.getHandle().equals(handle) ) {
throw BusinessException.build(equipName+" 已存在,请先检索");
}
//删除原先设备类型
QueryWrapper<EquipTypeEquip> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("EQUIP_BO", resourceHandle );
equipTypeEquipService.remove( queryWrapper );
//保存设备类型设备
String resourceType = equip.getEquipType();
if ( resourceType != null && !resourceType.equals("")) {
String resourceTypeHandle = HandleEnum.RESOURCE_TYPE.getHandle(site, resourceType);
// String resourceTypeResourceHandle = HandleUtil.buildResourceTypeResourceHandle(resourceTypeHandle, resourceHandle);
String resourceTypeResourceHandle = HandleEnum.RESOURCE_TYPE_RESOURCEBO.getHandle(resourceTypeHandle,resourceHandle);
EquipTypeEquip equipTypeEquip = new EquipTypeEquip();
equipTypeEquip.setHandle(resourceTypeResourceHandle);
equipTypeEquip.setEquipTypeBo(resourceTypeHandle);
equipTypeEquip.setEquipBo(resourceHandle);
equipTypeEquipService.save(equipTypeEquip);
}
//保存设备自定义数据
String _status = equip.getStatus();
String _serialNumber = equip.getSerialNumber();
String _department = equip.getDepartment();
if (StringUtils.notEmpty( _status )) {
customFieldsService.setCustom(resourceHandle,"STATUS",_status);
}
if (StringUtils.notEmpty( _serialNumber )) {
customFieldsService.setCustom(resourceHandle,"SERIAL_NUMBER",_serialNumber);
}
if (StringUtils.notEmpty( _department )) {
customFieldsService.setCustom(resourceHandle,"DEPARTMENT",_department);
}
//保存或更新设备
return R.ok(equipService.saveOrUpdate( equip ),"保存成功");
}
/**
*
* @return
*/
@ResponseBody
@GetMapping("/remove/{equip}")
public R removeById(@PathVariable("equip") String equip) {
String site = CommonMethods.getSite();
String handle = HandleEnum.RESOURCE.getHandle(site,equip);
//删除与设备类型的关系
QueryWrapper<EquipTypeEquip> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("EQUIP_BO",handle );
equipTypeEquipService.remove( queryWrapper );
//删除设备
return R.ok( equipService.removeById( handle ),"删除成功" );
}
}

@ -0,0 +1,125 @@
package com.foreverwin.mesnac.equip.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.mesnac.equip.model.Equip;
import com.foreverwin.mesnac.equip.model.EquipType;
import com.foreverwin.mesnac.equip.model.EquipTypeEquip;
import com.foreverwin.mesnac.equip.service.EquipTypeEquipService;
import com.foreverwin.mesnac.equip.service.EquipTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
*
* @author Max
* @since 2020-10-10
*/
@RestController
@RequestMapping("/Z-EQUIP-TYPE")
public class EquipTypeController {
@Autowired
public EquipTypeService equipTypeService;
@Autowired
public EquipTypeEquipService equipTypeEquipService;
/**
*
* @return
*/
@ResponseBody
@GetMapping("/search/{equipType}")
public R getEquipTypeById(@PathVariable("equipType") String equipType) {
String site = CommonMethods.getSite();
String handle = HandleEnum.RESOURCE_TYPE.getHandle(site,equipType);
EquipType _equipType = equipTypeService.getById( handle );
if ( _equipType == null ) {
return R.failed( null,"设备类型不存在" );
}
return R.ok( _equipType,"检索成功" );
}
/**
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getEquipTypeList(EquipType equipType){
String site = CommonMethods.getSite();
equipType.setSite( site );
List<EquipType> result;
QueryWrapper<EquipType> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(equipType);
result = equipTypeService.list( queryWrapper );
return R.ok( result );
}
/**
*
* @return
*/
@ResponseBody
@GetMapping("/equip")
public R getEquipTypeByEquip(Equip equip){
String site = CommonMethods.getSite();
String resource = equip.getResrce();
String resourceBo = HandleEnum.RESOURCE.getHandle(site,resource);
EquipTypeEquip equipTypeEquip = new EquipTypeEquip();
equipTypeEquip.setEquipBo( resourceBo );
QueryWrapper<EquipTypeEquip> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity( equipTypeEquip );
EquipTypeEquip _equipTypeEquip = equipTypeEquipService.getOne( queryWrapper );
if ( _equipTypeEquip == null ) {
return R.failed(null,"当前设备["+resource+"]未维护设备类型");
}
return R.ok( _equipTypeEquip);
}
/**
*
*/
@ResponseBody
@PostMapping("/save")
public R save(@RequestBody EquipType equipType) {
String site = CommonMethods.getSite();
String _handle = equipType.getHandle();
String equipTypeName = equipType.getEquipType();
String handle = HandleEnum.RESOURCE_TYPE.getHandle(site,equipTypeName);
equipType.setHandle( handle );
equipType.setSite( site );
equipType.setCreatedDateTime( new Date() );
equipType.setModifiedDateTime( new Date() );
//判断是更新还是新增 2020/12/01
EquipType et =equipTypeService.getById( handle );
if ( et != null && !et.getHandle().equals(_handle) ) {
throw BusinessException.build(equipTypeName+" 已存在,请先检索");
}
return R.ok( equipTypeService.saveOrUpdate(equipType),"保存成功" );
}
/**
*
* @return
*/
@ResponseBody
@GetMapping("/remove/{equipType}")
public R removeById(@PathVariable("equipType") String equipType) {
String site = CommonMethods.getSite();
String handle = HandleEnum.RESOURCE_TYPE.getHandle(site,equipType);
//删除与设备的关系
QueryWrapper<EquipTypeEquip> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("EQUIP_TYPE_BO",handle );
equipTypeEquipService.remove( queryWrapper );
//删除设备类型
return R.ok( equipTypeService.removeById( handle ),"删除成功" );
}
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.equip.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.equip.model.EmailGroup;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author Max
* @since 2021-03-11
*/
@Repository
public interface EmailGroupMapper extends BaseMapper<EmailGroup> {
}

@ -0,0 +1,22 @@
package com.foreverwin.mesnac.equip.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.equip.model.Equip;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
* </p>
*
* @author Max
* @since 2020-10-10
*/
@Repository
public interface EquipMapper extends BaseMapper<Equip> {
List<Equip> selectBySiteType(@Param("site") String site, @Param("type") String type);
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.equip.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.equip.model.EquipTypeEquip;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author Max
* @since 2020-10-10
*/
@Repository
public interface EquipTypeEquipMapper extends BaseMapper<EquipTypeEquip> {
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.equip.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.equip.model.EquipType;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author Max
* @since 2020-10-10
*/
@Repository
public interface EquipTypeMapper extends BaseMapper<EquipType> {
}

@ -0,0 +1,123 @@
package com.foreverwin.mesnac.equip.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author Max
* @since 2021-03-11
*/
@TableName("Z_EMAIL_GROUP")
public class EmailGroup extends Model<EmailGroup> {
private static final long serialVersionUID = 1L;
/**
* EmailGroupBO:SITE,EMAIL_GROUP
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("EMAIL_GROUP")
private String emailGroup;
/**
*
*/
@TableField("DESCRIPTION")
private String description;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("CREATED_USER")
private String createdUser;
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 getEmailGroup() {
return emailGroup;
}
public void setEmailGroup(String emailGroup) {
this.emailGroup = emailGroup;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public String getCreatedUser() {
return createdUser;
}
public void setCreatedUser(String createdUser) {
this.createdUser = createdUser;
}
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "EmailGroup{" +
"handle = " + handle +
", site = " + site +
", emailGroup = " + emailGroup +
", description = " + description +
", createdDateTime = " + createdDateTime +
", createdUser = " + createdUser +
"}";
}
}

@ -0,0 +1,161 @@
package com.foreverwin.mesnac.equip.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author Max
* @since 2020-10-10
*/
@TableName("RESRCE")
public class Equip extends Model<Equip> implements Comparable<Equip> {
private static final long serialVersionUID = 1L;
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
@TableField("SITE")
private String site;
@TableField("RESRCE")
private String resrce;
@TableField("DESCRIPTION")
private String description;
@TableField("STATUS_BO")
private String statusBo;
@TableField(exist = false)
private String equipType;
@TableField("CREATED_DATE_TIME")
private Date createdDateTime;
@TableField("MODIFIED_DATE_TIME")
private Date modifiedDateTime;
@TableField(exist = false)
private String status;
@TableField(exist = false)
private String department;
@TableField(exist = false)
private String serialNumber;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getSerialNumber() {
return serialNumber;
}
public void setSerialNumber(String serialNumber) {
this.serialNumber = serialNumber;
}
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 getResrce() {
return resrce;
}
public void setResrce(String resrce) {
this.resrce = resrce;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getStatusBo() {
return statusBo;
}
public void setStatusBo(String statusBo) {
this.statusBo = statusBo;
}
public String getEquipType() {
return equipType;
}
public void setEquipType(String equipType) {
this.equipType = equipType;
}
public Date getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(Date createdDateTime) {
this.createdDateTime = createdDateTime;
}
public Date getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(Date modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "Equip{" +
"handle = " + handle +
", site = " + site +
", resrce = " + resrce +
", description = " + description +
", statusBo = " + statusBo +
", createdDateTime = " + createdDateTime +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
@Override
public int compareTo(Equip o) {
return this.getResrce().compareTo(o.getResrce());
}
}

@ -0,0 +1,106 @@
package com.foreverwin.mesnac.equip.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author Max
* @since 2020-10-10
*/
@TableName("Z_PMS_EQUIP_TYPE")
public class EquipType extends Model<EquipType> {
private static final long serialVersionUID = 1L;
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
@TableField("SITE")
private String site;
@TableField("EQUIP_TYPE")
private String equipType;
@TableField("DESCRIPTION")
private String description;
@TableField("CREATED_DATE_TIME")
private Date createdDateTime;
@TableField("MODIFIED_DATE_TIME")
private Date modifiedDateTime;
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 getEquipType() {
return equipType;
}
public void setEquipType(String equipType) {
this.equipType = equipType;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Date getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(Date createdDateTime) {
this.createdDateTime = createdDateTime;
}
public Date getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(Date modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "EquipType{" +
"handle = " + handle +
", site = " + site +
", equipType = " + equipType +
", description = " + description +
", createdDateTime = " + createdDateTime +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -0,0 +1,71 @@
package com.foreverwin.mesnac.equip.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author Max
* @since 2020-10-10
*/
@TableName("Z_PMS_EQUIP_TYPE_EQUIP")
public class EquipTypeEquip extends Model<EquipTypeEquip> {
private static final long serialVersionUID = 1L;
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
@TableField("EQUIP_TYPE_BO")
private String equipTypeBo;
@TableField("EQUIP_BO")
private String equipBo;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getEquipTypeBo() {
return equipTypeBo;
}
public void setEquipTypeBo(String equipTypeBo) {
this.equipTypeBo = equipTypeBo;
}
public String getEquipBo() {
return equipBo;
}
public void setEquipBo(String equipBo) {
this.equipBo = equipBo;
}
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "EquipTypeEquip{" +
"handle = " + handle +
", equipTypeBo = " + equipTypeBo +
", equipBo = " + equipBo +
"}";
}
}

@ -0,0 +1,28 @@
package com.foreverwin.mesnac.equip.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.equip.model.EmailGroup;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Max
* @since 2021-03-11
*/
public interface EmailGroupService extends IService<EmailGroup> {
/**
*
* @param frontPage
* @return
*/
IPage<EmailGroup> selectPage(FrontPage<EmailGroup> frontPage, EmailGroup emailGroup);
List<EmailGroup> selectList(EmailGroup emailGroup);
}

@ -0,0 +1,30 @@
package com.foreverwin.mesnac.equip.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.equip.model.Equip;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Max
* @since 2020-10-10
*/
public interface EquipService extends IService<Equip> {
/**
*
* @param frontPage
* @return
*/
IPage<Equip> selectPage(FrontPage<Equip> frontPage, Equip equip);
List<Equip> selectList(Equip equip);
List<Equip> selectBySiteType(String site, String type);
}

@ -0,0 +1,30 @@
package com.foreverwin.mesnac.equip.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.equip.model.EquipTypeEquip;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Max
* @since 2020-10-10
*/
public interface EquipTypeEquipService extends IService<EquipTypeEquip> {
/**
*
* @param frontPage
* @return
*/
IPage<EquipTypeEquip> selectPage(FrontPage<EquipTypeEquip> frontPage, EquipTypeEquip equipTypeEquip);
List<EquipTypeEquip> selectList(EquipTypeEquip equipTypeEquip);
String selectEquipTypeByEquip ( String site,String equip );
}

@ -0,0 +1,26 @@
package com.foreverwin.mesnac.equip.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.equip.model.EquipType;
import com.foreverwin.modular.core.util.FrontPage;
/**
* <p>
*
* </p>
*
* @author Max
* @since 2020-10-10
*/
public interface EquipTypeService extends IService<EquipType> {
/**
*
* @param frontPage
* @return
*/
IPage<EquipType> selectPage(FrontPage<EquipType> frontPage, EquipType equipType);
//List<EquipType> selectList(EquipType equipType);
}

@ -0,0 +1,48 @@
package com.foreverwin.mesnac.equip.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.equip.mapper.EmailGroupMapper;
import com.foreverwin.mesnac.equip.model.EmailGroup;
import com.foreverwin.mesnac.equip.service.EmailGroupService;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Max
* @since 2021-03-11
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class EmailGroupServiceImpl extends ServiceImpl<EmailGroupMapper, EmailGroup> implements EmailGroupService {
@Autowired
private EmailGroupMapper emailGroupMapper;
@Override
public IPage<EmailGroup> selectPage(FrontPage<EmailGroup> frontPage, EmailGroup emailGroup) {
QueryWrapper<EmailGroup> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(emailGroup);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<EmailGroup> selectList(EmailGroup emailGroup) {
QueryWrapper<EmailGroup> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(emailGroup);
return super.list(queryWrapper);
}
}

@ -0,0 +1,50 @@
package com.foreverwin.mesnac.equip.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.equip.mapper.EquipMapper;
import com.foreverwin.mesnac.equip.model.Equip;
import com.foreverwin.mesnac.equip.service.EquipService;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Max
* @since 2020-10-10
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class EquipServiceImpl extends ServiceImpl<EquipMapper, Equip> implements EquipService {
@Autowired
private EquipMapper equipMapper;
@Override
public IPage<Equip> selectPage(FrontPage<Equip> frontPage, Equip equip) {
QueryWrapper<Equip> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(equip);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<Equip> selectList(Equip equip) {
QueryWrapper<Equip> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(equip);
return super.list(queryWrapper);
}
@Override
public List<Equip> selectBySiteType(String site, String type) {
return baseMapper.selectBySiteType(site, type);
}
}

@ -0,0 +1,69 @@
package com.foreverwin.mesnac.equip.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.equip.mapper.EquipTypeEquipMapper;
import com.foreverwin.mesnac.equip.model.EquipTypeEquip;
import com.foreverwin.mesnac.equip.service.EquipTypeEquipService;
import com.foreverwin.mesnac.equip.util.ConstantUtil;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Max
* @since 2020-10-10
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class EquipTypeEquipServiceImpl extends ServiceImpl<EquipTypeEquipMapper, EquipTypeEquip> implements EquipTypeEquipService {
@Autowired
private EquipTypeEquipMapper equipTypeEquipMapper;
@Override
public IPage<EquipTypeEquip> selectPage(FrontPage<EquipTypeEquip> frontPage, EquipTypeEquip equipTypeEquip) {
QueryWrapper<EquipTypeEquip> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(equipTypeEquip);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<EquipTypeEquip> selectList(EquipTypeEquip equipTypeEquip) {
QueryWrapper<EquipTypeEquip> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(equipTypeEquip);
return super.list(queryWrapper);
}
@Override
public String selectEquipTypeByEquip( String site,String equip ) {
//
String equipBo = HandleEnum.RESOURCE+site+","+equip;
String equipType = "";
EquipTypeEquip equipTypeEquip = new EquipTypeEquip();
equipTypeEquip.setEquipBo( equipBo );
QueryWrapper<EquipTypeEquip> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity( equipTypeEquip );
equipTypeEquip = super.getOne( queryWrapper );
if ( equipTypeEquip == null ) {
return null;
}
if ( StringUtil.notEmpty( equipTypeEquip.getEquipTypeBo() ) ) {
equipType = equipTypeEquip.getEquipTypeBo().split(",")[1];
}
return equipType;
}
}

@ -0,0 +1,45 @@
package com.foreverwin.mesnac.equip.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.equip.mapper.EquipTypeMapper;
import com.foreverwin.mesnac.equip.model.EquipType;
import com.foreverwin.mesnac.equip.service.EquipTypeService;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* <p>
*
* </p>
*
* @author Max
* @since 2020-10-10
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class EquipTypeServiceImpl extends ServiceImpl<EquipTypeMapper, EquipType> implements EquipTypeService {
@Autowired
private EquipTypeMapper equipTypeMapper;
@Override
public IPage<EquipType> selectPage(FrontPage<EquipType> frontPage, EquipType equipType) {
QueryWrapper<EquipType> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(equipType);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
/*@Override
public List<EquipType> selectList(EquipType equipType) {
QueryWrapper<EquipType> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(equipType);
return super.list(queryWrapper);
}*/
}

@ -0,0 +1,100 @@
package com.foreverwin.mesnac.equip.util;
import java.util.LinkedHashMap;
import java.util.Map;
public class ConstantUtil {
public static final String KEYWORD_TRUE = "TRUE";
public static final String KEYWORD_FALSE = "FALSE";
public static final String ATTACHED_EQUIP = "1";
public static final String ATTACHED_EQUIP_TYPE = "2"
;
public static final String MAINTAIN_PLAN_UNIT_1 = "1";
public static final String MAINTAIN_PLAN_UNIT_2 = "2";
public static final String MAINTAIN_PLAN_UNIT_3 = "3";
public static final String MAINTAIN_PLAN_UNIT_4 = "4";
public static final String MAINTAIN_PLAN_UNIT_5 = "5";
public static final String ACTION_NAME_CYCLE = "1";
public static final String ACTION_NAME_INTERVAL = "2";
public static final String LIST_TYPE_INSPECT = "I";
public static final String LIST_TYPE_MAINTAIN = "M";
public static final String TOOL_MAINTAIN_LIST_RESULT_TYPE_BOOL = "1";
public static final String TOOL_MAINTAIN_LIST_RESULT_TYPE_TEXT = "2";
public static final String TOOL_MAINTAIN_LIST_RESULT_TYPE_NUMBER = "3";
public static final Integer EXT_POSITION_1 = 1;
public static final Integer EXT_POSITION_2 = 2;
public static final Integer EXT_POSITION_3 = 3;
public static final String STATUS_ENABLED = "301";
public static final String STATUS_DISABLED = "302";
public static final String STATUS_NEW = "401";
public static final String STATUS_IN_QUEUE = "402";
public static final String TASK_STATUS_1 = "1";
public static final String TASK_STATUS_2 = "2";
public static final String TASK_STATUS_3 = "3";
public static final String TASK_STATUS_4 = "4";
public static final String REPAIR_STATUS_1 = "1";
public static final String REPAIR_STATUS_2 = "2";
public static final String REPAIR_STATUS_3 = "3";
public static final String REPAIR_STATUS_4 = "4";
public static final String REPAIR_STATUS_5 = "5";
public static final String REPAIR_STATUS_6 = "6";
public static final String REPAIR_STATUS_7 = "7";
public static final String REPAIR_STATUS_8 = "8";
public static final String MAINTAIN_TASK_TYPE_1 = "1";
public static final String MAINTAIN_TASK_TYPE_2 = "2";
public static final String MAINTAIN_TASK_TYPE_3 = "3";
public static final String MAINTAIN_TASK_TYPE_4 = "4";
public static final Map<String, String> MAINTAIN_PLAN_UNITS = new LinkedHashMap<String, String>();
public static final Map<String, String> TASK_STATUSES = new LinkedHashMap<String, String>();
public static final Map<String, String> TOOL_MAINTAIN_LIST_RESULT_TYPES = new LinkedHashMap<String, String>();
public static final Map<String, String> REPAIR_STATUS = new LinkedHashMap<String, String>();
public static final Map<String, String> MAINTAIN_TASK_TYPE = new LinkedHashMap<String, String>();
public static final Map<String, String> PLAN_STATUS = new LinkedHashMap<String, String>();
static {
//----------------------------------------------------------------------------------------------------------------------------------
MAINTAIN_PLAN_UNITS.put(MAINTAIN_PLAN_UNIT_1, "小时");
MAINTAIN_PLAN_UNITS.put(MAINTAIN_PLAN_UNIT_2, "日");
MAINTAIN_PLAN_UNITS.put(MAINTAIN_PLAN_UNIT_3, "周");
MAINTAIN_PLAN_UNITS.put(MAINTAIN_PLAN_UNIT_4, "月");
MAINTAIN_PLAN_UNITS.put(MAINTAIN_PLAN_UNIT_5, "年");
//----------------------------------------------------------------------------------------------------------------------------------
TASK_STATUSES.put(TASK_STATUS_1, "未开始");
TASK_STATUSES.put(TASK_STATUS_2, "进行中");
TASK_STATUSES.put(TASK_STATUS_3, "关闭");
TASK_STATUSES.put(TASK_STATUS_4, "完成");
//----------------------------------------------------------------------------------------------------------------------------------
TOOL_MAINTAIN_LIST_RESULT_TYPES.put(TOOL_MAINTAIN_LIST_RESULT_TYPE_BOOL, "布尔值");
TOOL_MAINTAIN_LIST_RESULT_TYPES.put(TOOL_MAINTAIN_LIST_RESULT_TYPE_TEXT, "文本");
TOOL_MAINTAIN_LIST_RESULT_TYPES.put(TOOL_MAINTAIN_LIST_RESULT_TYPE_NUMBER, "数字");
//----------------------------------------------------------------------------------------------------------------
REPAIR_STATUS.put(REPAIR_STATUS_1,"新建");
REPAIR_STATUS.put(REPAIR_STATUS_2,"已报修");
REPAIR_STATUS.put(REPAIR_STATUS_3,"维修中");
REPAIR_STATUS.put(REPAIR_STATUS_4,"维修完成");
REPAIR_STATUS.put(REPAIR_STATUS_5,"待生产确认");
REPAIR_STATUS.put(REPAIR_STATUS_6,"待品质确认");
REPAIR_STATUS.put(REPAIR_STATUS_7,"确认完成");
REPAIR_STATUS.put(REPAIR_STATUS_8,"关闭");//取消或者重修的任务状态
//-------------------------------------------------------------------------------------------------------------------
MAINTAIN_TASK_TYPE.put(MAINTAIN_TASK_TYPE_1,"周保养");
MAINTAIN_TASK_TYPE.put(MAINTAIN_TASK_TYPE_2,"月保养");
MAINTAIN_TASK_TYPE.put(MAINTAIN_TASK_TYPE_3,"季保养");
MAINTAIN_TASK_TYPE.put(MAINTAIN_TASK_TYPE_4,"年保养");
//-------------------------------------------------------------------------------------------------------------------
PLAN_STATUS.put( STATUS_ENABLED,"启动" );
PLAN_STATUS.put( STATUS_DISABLED,"禁止" );
PLAN_STATUS.put( STATUS_NEW,"新建" );
}
}

@ -0,0 +1,14 @@
<?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.pms.mapper.EquipMapper">
<select id="selectBySiteType" resultType="com.foreverwin.mesnac.equip.model.Equip">
SELECT R.*
FROM RESRCE R
INNER JOIN Z_PMS_EQUIP_TYPE_EQUIP ETE
ON R.HANDLE = ETE.EQUIP_BO
INNER JOIN Z_PMS_EQUIP_TYPE ET
ON ET.HANDLE = ETE.EQUIP_TYPE_BO
WHERE R.SITE = #{site} AND ET.SITE = #{site} AND ET.EQUIP_TYPE = #{type}
</select>
</mapper>

@ -28,5 +28,10 @@
<groupId>com.foreverwin.modular</groupId>
<artifactId>modular-melib</artifactId>
</dependency>
<dependency>
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>common</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,120 @@
package com.foreverwin.mesnac.meapi.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.meapi.service.CustomFieldsService;
import com.foreverwin.mesnac.meapi.model.CustomFields;
import java.util.List;
/**
*
* @author LZP
* @since 2021-06-01
*/
@RestController
@RequestMapping("/CUSTOM-FIELDS")
public class CustomFieldsController {
@Autowired
public CustomFieldsService customFieldsService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getCustomFieldsById(@PathVariable String id) {
return R.ok( customFieldsService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getCustomFieldsList(CustomFields customFields){
List<CustomFields> result;
QueryWrapper<CustomFields> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(customFields);
result = customFieldsService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<CustomFields> frontPage, CustomFields customFields){
IPage result;
QueryWrapper<CustomFields> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(customFields);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(CustomFields::getHandle, frontPage.getGlobalQuery())
.or().like(CustomFields::getAttribute, frontPage.getGlobalQuery())
.or().like(CustomFields::getValue, frontPage.getGlobalQuery())
);
}
result = customFieldsService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param customFields
* @return null
*/
@PostMapping
public R save(@RequestBody CustomFields customFields) {
return R.ok(customFieldsService.save(customFields));
}
/**
*
* @param customFields
* @return null
*/
@PutMapping
public R updateById(@RequestBody CustomFields customFields) {
return R.ok(customFieldsService.updateById(customFields));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(customFieldsService.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(customFieldsService.removeByIds(ids));
}
}

@ -2,7 +2,6 @@ package com.foreverwin.mesnac.meapi.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.mesnac.meapi.model.Item;
import com.foreverwin.mesnac.meapi.service.ItemService;
import com.foreverwin.modular.core.util.CommonMethods;
@ -24,18 +23,6 @@ public class ItemController {
@Autowired
public ItemService itemService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getItemById(@PathVariable String id) {
return R.ok(itemService.getById(id));
}
/**
*
*
@ -51,86 +38,33 @@ public class ItemController {
return R.ok(result);
}
/**
* -
*
* @return
*/
@ResponseBody
@GetMapping("/item-select")
public R getItemselect(Item item) {
List<Item> result;
QueryWrapper<Item> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(item);
result = itemService.selectList(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<Item> frontPage, Item item) {
@GetMapping("/getItemPageList")
public R getItemPageList(FrontPage<Item> frontPage, Item item){
IPage result;
QueryWrapper<Item> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(item);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(Item::getHandle, frontPage.getGlobalQuery())
.or().like(Item::getSite, frontPage.getGlobalQuery())
.or().like(Item::getItem, frontPage.getGlobalQuery())
.or().like(Item::getStatusBo, frontPage.getGlobalQuery())
.or().like(Item::getItemType, frontPage.getGlobalQuery())
.or().like(Item::getErpGtin, frontPage.getGlobalQuery())
.or().like(Item::getAinModelExternalId, frontPage.getGlobalQuery())
.or().like(Item::getQuantityRestriction, frontPage.getGlobalQuery())
.or().like(Item::getRouterBo, frontPage.getGlobalQuery())
.or().like(Item::getBomBo, frontPage.getGlobalQuery())
.or().like(Item::getComponentGroupBo, frontPage.getGlobalQuery())
.or().like(Item::getItemGroupBo, frontPage.getGlobalQuery())
.or().like(Item::getAssyDataTypeBo, frontPage.getGlobalQuery())
.or().like(Item::getPreAssembled, frontPage.getGlobalQuery())
.or().like(Item::getRevision, frontPage.getGlobalQuery())
.or().like(Item::getCurrentRevision, frontPage.getGlobalQuery())
.or().like(Item::getSelectorActivityBo, frontPage.getGlobalQuery())
.or().like(Item::getSelectorNote, frontPage.getGlobalQuery())
.or().like(Item::getAssignSerialAtRelease, frontPage.getGlobalQuery())
.or().like(Item::getDrawingName, frontPage.getGlobalQuery())
.or().like(Item::getUseCompFromDrawing, frontPage.getGlobalQuery())
.or().like(Item::getPanel, frontPage.getGlobalQuery())
.or().like(Item::getRemovalAssyDataTypeBo, frontPage.getGlobalQuery())
.or().like(Item::getInvAssyDataTypeBo, frontPage.getGlobalQuery())
.or().like(Item::getOriginalStatusBo, frontPage.getGlobalQuery())
.or().like(Item::getCreateTrackableSfc, frontPage.getGlobalQuery())
.or().like(Item::getMaskGroupBo, frontPage.getGlobalQuery())
.or().like(Item::getTransferItemGroupBo, frontPage.getGlobalQuery())
.or().like(Item::getUnitOfMeasure, frontPage.getGlobalQuery())
.or().like(Item::getCollectParentSerial, frontPage.getGlobalQuery())
.or().like(Item::getReqSerialChange, frontPage.getGlobalQuery())
.or().like(Item::getIsCollector, frontPage.getGlobalQuery())
.or().like(Item::getIncBatchNumber, frontPage.getGlobalQuery())
.or().like(Item::getTimeSensitive, frontPage.getGlobalQuery())
.or().like(Item::getMaxShelfLifeUnits, frontPage.getGlobalQuery())
.or().like(Item::getMaxFloorLifeUnits, frontPage.getGlobalQuery())
.or().like(Item::getNotes, frontPage.getGlobalQuery())
.or().like(Item::getTbCompType, frontPage.getGlobalQuery())
.or().like(Item::getErpBackflushing, frontPage.getGlobalQuery())
.or().like(Item::getStorageLocationBo, frontPage.getGlobalQuery())
.or().like(Item::getErpPutawayStorloc, frontPage.getGlobalQuery())
.or().like(Item::getProductionSupplyArea, frontPage.getGlobalQuery())
.or().like(Item::getUseOrderIdRel1, frontPage.getGlobalQuery())
.or().like(Item::getMaterialType, frontPage.getGlobalQuery())
.or().like(Item::getProcurementType, frontPage.getGlobalQuery())
.or().like(Item::getOrigin, frontPage.getGlobalQuery())
);
try {
String site = CommonMethods.getSite();
item.setSite(site);
QueryWrapper<Item> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(item);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
queryWrapper
.like(Item.ITEM, frontPage.getGlobalQuery())
.or().like("DESCRIPTION", frontPage.getGlobalQuery())
.or().like(Item.STATUS_BO, frontPage.getGlobalQuery())
.or().like(Item.ITEM_TYPE, frontPage.getGlobalQuery());
}
result = itemService.selectPage(frontPage.getPagePlus(), queryWrapper);
} catch (Exception e) {
return R.failed(e.getMessage());
}
result = itemService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
@ -156,66 +90,4 @@ public class ItemController {
return R.ok(itemService.updateById(item));
}
/**
* id
*
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id) {
return R.ok(itemService.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(itemService.removeByIds(ids));
}
/**
*
*
* @param item
* @return null
*/
@GetMapping("/selectItemByDesc")
public R selectItemByDesc(Item item) {
try {
return R.ok(itemService.selectItemWithDesc(item));
} catch (Exception e) {
return R.failed(e.getMessage());
}
}
@GetMapping("/getItemDetailList")
public R getItemDetailList() {
return R.ok(itemService.getItemDetailList());
}
@GetMapping("/getBklasItem")
public R getBklasItem(FrontPage<Item> frontPage) {
return R.ok(itemService.getBklasItem(frontPage.getPagePlus(), frontPage.getGlobalQuery()));
}
@ResponseBody
@GetMapping("/getRawMaterial")
public R getRawMaterial(FrontPage frontPage) {
String global = frontPage.getGlobalQuery();
return R.ok(itemService.getRawMaterial(frontPage.getPagePlus(), global));
}
}

@ -62,31 +62,29 @@ public class ResrceController {
@GetMapping("/page")
public R page(FrontPage<Resrce> frontPage, Resrce resrce){
IPage result;
QueryWrapper<Resrce> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(resrce);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(Resrce::getHandle, frontPage.getGlobalQuery())
.or().like(Resrce::getSite, frontPage.getGlobalQuery())
.or().like(Resrce::getResrce, frontPage.getGlobalQuery())
.or().like(Resrce::getDescription, frontPage.getGlobalQuery())
.or().like(Resrce::getStatusBo, frontPage.getGlobalQuery())
.or().like(Resrce::getProcessResource, frontPage.getGlobalQuery())
.or().like(Resrce::getOperationBo, frontPage.getGlobalQuery())
.or().like(Resrce::getSetupState, frontPage.getGlobalQuery())
.or().like(Resrce::getSetupDescription, frontPage.getGlobalQuery())
.or().like(Resrce::getCncMachine, frontPage.getGlobalQuery())
.or().like(Resrce::getPendingStatusBo, frontPage.getGlobalQuery())
.or().like(Resrce::getPendingReasonCodeBo, frontPage.getGlobalQuery())
.or().like(Resrce::getPendingResourceRcBo, frontPage.getGlobalQuery())
.or().like(Resrce::getPendingComments, frontPage.getGlobalQuery())
.or().like(Resrce::getErpPlantMaintOrder, frontPage.getGlobalQuery())
.or().like(Resrce::getErpEquipmentNumber, frontPage.getGlobalQuery())
.or().like(Resrce::getErpCapacityCategory, frontPage.getGlobalQuery())
);
try {
String site = CommonMethods.getSite();
resrce.setSite(site);
QueryWrapper<Resrce> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(resrce);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
queryWrapper
.like(Resrce.HANDLE, frontPage.getGlobalQuery())
.or().like(Resrce.SITE, frontPage.getGlobalQuery())
.or().like(Resrce.RESRCE, frontPage.getGlobalQuery())
.or().like(Resrce.DESCRIPTION, frontPage.getGlobalQuery())
.or().like(Resrce.STATUS_BO, frontPage.getGlobalQuery())
.or().like(Resrce.PROCESS_RESOURCE, frontPage.getGlobalQuery())
.or().like(Resrce.OPERATION_BO, frontPage.getGlobalQuery())
.or().like(Resrce.SETUP_STATE, frontPage.getGlobalQuery())
.or().like(Resrce.SETUP_DESCRIPTION, frontPage.getGlobalQuery())
.or().like(Resrce.CNC_MACHINE, frontPage.getGlobalQuery());
}
result = resrceService.page(frontPage.getPagePlus(), queryWrapper);
} catch (Exception e) {
return R.failed(e.getMessage());
}
result = resrceService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}

@ -0,0 +1,70 @@
package com.foreverwin.mesnac.meapi.controller;
import com.foreverwin.mesnac.common.enums.HandleEnum;
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.meapi.service.ShopOrderService;
import com.foreverwin.mesnac.meapi.model.ShopOrder;
/**
*
* @author Leon.L
* @since 2021-06-01
*/
@RestController
@RequestMapping("/SHOP-ORDER")
public class ShopOrderController {
@Autowired
public ShopOrderService shopOrderService;
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/getShopOrderPageList")
public R getShopOrderPageList(FrontPage<ShopOrder> frontPage, ShopOrder shopOrder){
IPage result;
try {
String site = CommonMethods.getSite();
//只查询 可下达 状态的
String status501Bo = HandleEnum.STATUS.getHandle(site, "501");
shopOrder.setSite(site);
shopOrder.setStatusBo(status501Bo);
QueryWrapper<ShopOrder> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(shopOrder);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
queryWrapper
.like(ShopOrder.SHOP_ORDER, frontPage.getGlobalQuery())
.or().like(ShopOrder.STATUS_BO, frontPage.getGlobalQuery())
.or().like(ShopOrder.SHOP_ORDER_TYPE_BO, frontPage.getGlobalQuery())
.or().like(ShopOrder.PLANNED_WORK_CENTER_BO, frontPage.getGlobalQuery())
.or().like(ShopOrder.PLANNED_ITEM_BO, frontPage.getGlobalQuery())
.or().like(ShopOrder.PLANNED_BOM_BO, frontPage.getGlobalQuery())
.or().like(ShopOrder.PLANNED_ROUTER_BO, frontPage.getGlobalQuery())
.or().like(ShopOrder.ITEM_BO, frontPage.getGlobalQuery())
.or().like(ShopOrder.BOM_BO, frontPage.getGlobalQuery())
.or().like(ShopOrder.ROUTER_BO, frontPage.getGlobalQuery())
.or().like(ShopOrder.QTY_TO_BUILD, frontPage.getGlobalQuery())
.or().like(ShopOrder.CUSTOMER, frontPage.getGlobalQuery())
.or().like(ShopOrder.CUSTOMER_ORDER, frontPage.getGlobalQuery());
}
result = shopOrderService.page(frontPage.getPagePlus(), queryWrapper);
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok(result);
}
}

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.WorkCenter;
import com.foreverwin.mesnac.meapi.service.WorkCenterService;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
@ -23,17 +24,6 @@ public class WorkCenterController {
@Autowired
public WorkCenterService workCenterService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getWorkCenterById(@PathVariable String id) {
return R.ok( workCenterService.getById(id));
}
/**
*
@ -60,28 +50,28 @@ public class WorkCenterController {
@GetMapping("/page")
public R page(FrontPage<WorkCenter> frontPage, WorkCenter workCenter){
IPage result;
QueryWrapper<WorkCenter> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(workCenter);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(WorkCenter::getHandle, frontPage.getGlobalQuery())
.or().like(WorkCenter::getSite, frontPage.getGlobalQuery())
.or().like(WorkCenter::getWorkCenter, frontPage.getGlobalQuery())
.or().like(WorkCenter::getRouterBo, frontPage.getGlobalQuery())
.or().like(WorkCenter::getCanBeReleasedTo, frontPage.getGlobalQuery())
.or().like(WorkCenter::getWcCategory, frontPage.getGlobalQuery())
.or().like(WorkCenter::getStatusBo, frontPage.getGlobalQuery())
.or().like(WorkCenter::getWcType, frontPage.getGlobalQuery())
.or().like(WorkCenter::getAssignmentEnforcement, frontPage.getGlobalQuery())
.or().like(WorkCenter::getIsErpWorkCenter, frontPage.getGlobalQuery())
.or().like(WorkCenter::getErpWorkCenter, frontPage.getGlobalQuery())
.or().like(WorkCenter::getErpCapacityCategory, frontPage.getGlobalQuery())
.or().like(WorkCenter::getProductionSupplyArea, frontPage.getGlobalQuery())
.or().like(WorkCenter::getStandardValueKeyBo, frontPage.getGlobalQuery())
);
try {
String site = CommonMethods.getSite();
workCenter.setSite(site);
QueryWrapper<WorkCenter> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(workCenter);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
queryWrapper
.like(WorkCenter.HANDLE, frontPage.getGlobalQuery())
.or().like(WorkCenter.SITE, frontPage.getGlobalQuery())
.or().like(WorkCenter.WORK_CENTER, frontPage.getGlobalQuery())
.or().like(WorkCenter.ROUTER_BO, frontPage.getGlobalQuery())
.or().like(WorkCenter.CAN_BE_RELEASED_TO, frontPage.getGlobalQuery())
.or().like(WorkCenter.WC_CATEGORY, frontPage.getGlobalQuery())
.or().like(WorkCenter.STATUS_BO, frontPage.getGlobalQuery())
.or().like(WorkCenter.WC_TYPE, frontPage.getGlobalQuery());
}
result = workCenterService.page(frontPage.getPagePlus(), queryWrapper);
} catch (Exception e) {
return R.failed(e.getMessage());
}
result = workCenterService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
@ -104,39 +94,4 @@ public class WorkCenterController {
public R updateById(@RequestBody WorkCenter workCenter) {
return R.ok(workCenterService.updateById(workCenter));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(workCenterService.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(workCenterService.removeByIds(ids));
}
/**
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/SelectWorkCenter")
public R getWorkCenterWcList(FrontPage frontPage){
List<WorkCenter> result;
String workCenter=frontPage.getGlobalQuery();
return R.ok(workCenterService.workCenterlist(frontPage.getPagePlus(),workCenter));
}
}

@ -0,0 +1,45 @@
package com.foreverwin.mesnac.meapi.mapper;
import com.foreverwin.mesnac.meapi.model.CustomFields;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
* <p>
* Mapper
* </p>
*
* @author LZP
* @since 2021-06-01
*/
@Repository
public interface CustomFieldsMapper extends BaseMapper<CustomFields> {
String selectCustomFieldsValue(@Param("handle") String handle,
@Param("attribute") String attribute);
List<CustomFields> selectCustomFieldsByHandle(@Param("handle") String handle);
List<CustomFields> selectCustomFields(@Param("handle") String handle,
@Param("attribute") String attribute);
List<Map<String,Object>> selectEquipType(@Param("site") String site,
@Param("equipType") String equipType);
Map<String,Object> getCustom(@Param("handle") String handle, @Param("attr") String attr);
List<Map<String,Object>> getCustoms(@Param("handles") List<String> handles, @Param("attr") String attr);
Map<String, Object> selectItemGroupPrintTemplate(@Param("sfcBo") String sfcBo);
Map<String, Object> selectItemGroupPrintTemplateByItemBo(@Param("itemBo") String itemBo);
void setCustom(@Param("handle") String handle, @Param("attribute") String attribute, @Param("value") String value);
void clearCustom(@Param("handle") String handle, @Param("attr") String attr);
String selectWidthValue(@Param("site") String site, @Param("itemBo") String itemBo);
String selectAttributeByItemBo(@Param("itemBo") String shopOrder);
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.meapi.mapper;
import com.foreverwin.mesnac.meapi.model.ShopOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author Leon.L
* @since 2021-06-01
*/
@Repository
public interface ShopOrderMapper extends BaseMapper<ShopOrder> {
}

@ -0,0 +1,106 @@
package com.foreverwin.mesnac.meapi.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
*
* </p>
*
* @author LZP
* @since 2021-06-01
*/
@TableName("CUSTOM_FIELDS")
public class CustomFields extends Model<CustomFields> {
private static final long serialVersionUID = 1L;
@TableField("HANDLE")
private String handle;
@TableField("ATTRIBUTE")
private String attribute;
@TableField("VALUE")
private String value;
@TableField("CREATED_DATE_TIME")
private Date createdDateTime;
@TableField("MODIFIED_DATE_TIME")
private Date modifiedDateTime;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getAttribute() {
return attribute;
}
public void setAttribute(String attribute) {
this.attribute = attribute;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public Date getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(Date createdDateTime) {
this.createdDateTime = createdDateTime;
}
public Date getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(Date modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String ATTRIBUTE = "ATTRIBUTE";
public static final String VALUE = "VALUE";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "CustomFields{" +
"handle = " + handle +
", attribute = " + attribute +
", value = " + value +
", createdDateTime = " + createdDateTime +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -0,0 +1,755 @@
package com.foreverwin.mesnac.meapi.model;
import java.io.Serializable;
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>
*
* </p>
*
* @author Leon.L
* @since 2021-06-01
*/
@TableName("SHOP_ORDER")
public class ShopOrder extends Model<ShopOrder> {
private static final long serialVersionUID = 1L;
@TableField("HANDLE")
private String handle;
@TableField("CHANGE_STAMP")
private Long changeStamp;
@TableField("SITE")
private String site;
@TableField("SHOP_ORDER")
private String shopOrder;
@TableField("STATUS_BO")
private String statusBo;
@TableField("PRIORITY")
private Long priority;
@TableField("PLANNED_WORK_CENTER_BO")
private String plannedWorkCenterBo;
@TableField("PLANNED_ITEM_BO")
private String plannedItemBo;
@TableField("PLANNED_BOM_BO")
private String plannedBomBo;
@TableField("PLANNED_ROUTER_BO")
private String plannedRouterBo;
@TableField("ITEM_BO")
private String itemBo;
@TableField("BOM_BO")
private String bomBo;
@TableField("ROUTER_BO")
private String routerBo;
@TableField("QTY_TO_BUILD")
private Double qtyToBuild;
@TableField("QTY_ORDERED")
private Double qtyOrdered;
@TableField("QTY_RELEASED")
private Double qtyReleased;
@TableField("RELEASED_DATE")
private LocalDateTime releasedDate;
@TableField("PLANNED_START_DATE")
private LocalDateTime plannedStartDate;
@TableField("PLANNED_COMP_DATE")
private LocalDateTime plannedCompDate;
@TableField("SCHEDULED_START_DATE")
private LocalDateTime scheduledStartDate;
@TableField("SCHEDULED_COMP_DATE")
private LocalDateTime scheduledCompDate;
@TableField("ACTUAL_START_DATE")
private LocalDateTime actualStartDate;
@TableField("ACTUAL_COMP_DATE")
private LocalDateTime actualCompDate;
@TableField("QTY_DONE")
private Double qtyDone;
@TableField("QTY_SCRAPPED")
private Double qtyScrapped;
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
@TableField("CUSTOMER")
private String customer;
@TableField("CUSTOMER_ORDER")
private String customerOrder;
@TableField("RMA_SFC_DATA_TYPE_BO")
private String rmaSfcDataTypeBo;
@TableField("RMA_SHOP_ORDER_DATA_TYPE_BO")
private String rmaShopOrderDataTypeBo;
@TableField("ORIGINAL_STATUS_BO")
private String originalStatusBo;
@TableField("TRANSFER_SITE")
private String transferSite;
@TableField("TRANSFER_TYPE")
private String transferType;
@TableField("LCC_BO")
private String lccBo;
@TableField("SHOP_ORDER_TYPE_BO")
private String shopOrderTypeBo;
@TableField("HOLD_ID")
private Long holdId;
@TableField("END_UNIT_NUMBER")
private String endUnitNumber;
@TableField("REQ_SERIAL_CHANGE")
private String reqSerialChange;
@TableField("COLLECT_PARENT_SERIAL")
private String collectParentSerial;
@TableField("BATCH_NUMBER")
private String batchNumber;
@TableField("ERP_ORDER")
private String erpOrder;
@TableField("ERP_PRODUCTION_VERSION")
private String erpProductionVersion;
@TableField("ERP_UNIT_OF_MEASURE")
private String erpUnitOfMeasure;
@TableField("PARTITION_DATE")
private LocalDateTime partitionDate;
@TableField("INSPECTION_LOT")
private String inspectionLot;
@TableField("INSPECTION_GROUP_SIZE")
private Long inspectionGroupSize;
@TableField("ERP_PUTAWAY_STORLOC")
private String erpPutawayStorloc;
@TableField("WAREHOUSE_NUMBER")
private String warehouseNumber;
@TableField("UNDERDELIVERY_TOLERANCE")
private Double underdeliveryTolerance;
@TableField("OVERDELIVERY_TOLERANCE")
private Double overdeliveryTolerance;
@TableField("UNLIMITED_OVERDELIVERY")
private String unlimitedOverdelivery;
@TableField("MINIMUM_DELIVERY_QTY")
private Double minimumDeliveryQty;
@TableField("MAXIMUM_DELIVERY_QTY")
private Double maximumDeliveryQty;
@TableField("TOLERANCE_DEFINED_IN")
private String toleranceDefinedIn;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public Long getChangeStamp() {
return changeStamp;
}
public void setChangeStamp(Long changeStamp) {
this.changeStamp = changeStamp;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getShopOrder() {
return shopOrder;
}
public void setShopOrder(String shopOrder) {
this.shopOrder = shopOrder;
}
public String getStatusBo() {
return statusBo;
}
public void setStatusBo(String statusBo) {
this.statusBo = statusBo;
}
public Long getPriority() {
return priority;
}
public void setPriority(Long priority) {
this.priority = priority;
}
public String getPlannedWorkCenterBo() {
return plannedWorkCenterBo;
}
public void setPlannedWorkCenterBo(String plannedWorkCenterBo) {
this.plannedWorkCenterBo = plannedWorkCenterBo;
}
public String getPlannedItemBo() {
return plannedItemBo;
}
public void setPlannedItemBo(String plannedItemBo) {
this.plannedItemBo = plannedItemBo;
}
public String getPlannedBomBo() {
return plannedBomBo;
}
public void setPlannedBomBo(String plannedBomBo) {
this.plannedBomBo = plannedBomBo;
}
public String getPlannedRouterBo() {
return plannedRouterBo;
}
public void setPlannedRouterBo(String plannedRouterBo) {
this.plannedRouterBo = plannedRouterBo;
}
public String getItemBo() {
return itemBo;
}
public void setItemBo(String itemBo) {
this.itemBo = itemBo;
}
public String getBomBo() {
return bomBo;
}
public void setBomBo(String bomBo) {
this.bomBo = bomBo;
}
public String getRouterBo() {
return routerBo;
}
public void setRouterBo(String routerBo) {
this.routerBo = routerBo;
}
public Double getQtyToBuild() {
return qtyToBuild;
}
public void setQtyToBuild(Double qtyToBuild) {
this.qtyToBuild = qtyToBuild;
}
public Double getQtyOrdered() {
return qtyOrdered;
}
public void setQtyOrdered(Double qtyOrdered) {
this.qtyOrdered = qtyOrdered;
}
public Double getQtyReleased() {
return qtyReleased;
}
public void setQtyReleased(Double qtyReleased) {
this.qtyReleased = qtyReleased;
}
public LocalDateTime getReleasedDate() {
return releasedDate;
}
public void setReleasedDate(LocalDateTime releasedDate) {
this.releasedDate = releasedDate;
}
public LocalDateTime getPlannedStartDate() {
return plannedStartDate;
}
public void setPlannedStartDate(LocalDateTime plannedStartDate) {
this.plannedStartDate = plannedStartDate;
}
public LocalDateTime getPlannedCompDate() {
return plannedCompDate;
}
public void setPlannedCompDate(LocalDateTime plannedCompDate) {
this.plannedCompDate = plannedCompDate;
}
public LocalDateTime getScheduledStartDate() {
return scheduledStartDate;
}
public void setScheduledStartDate(LocalDateTime scheduledStartDate) {
this.scheduledStartDate = scheduledStartDate;
}
public LocalDateTime getScheduledCompDate() {
return scheduledCompDate;
}
public void setScheduledCompDate(LocalDateTime scheduledCompDate) {
this.scheduledCompDate = scheduledCompDate;
}
public LocalDateTime getActualStartDate() {
return actualStartDate;
}
public void setActualStartDate(LocalDateTime actualStartDate) {
this.actualStartDate = actualStartDate;
}
public LocalDateTime getActualCompDate() {
return actualCompDate;
}
public void setActualCompDate(LocalDateTime actualCompDate) {
this.actualCompDate = actualCompDate;
}
public Double getQtyDone() {
return qtyDone;
}
public void setQtyDone(Double qtyDone) {
this.qtyDone = qtyDone;
}
public Double getQtyScrapped() {
return qtyScrapped;
}
public void setQtyScrapped(Double qtyScrapped) {
this.qtyScrapped = qtyScrapped;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public String getCustomer() {
return customer;
}
public void setCustomer(String customer) {
this.customer = customer;
}
public String getCustomerOrder() {
return customerOrder;
}
public void setCustomerOrder(String customerOrder) {
this.customerOrder = customerOrder;
}
public String getRmaSfcDataTypeBo() {
return rmaSfcDataTypeBo;
}
public void setRmaSfcDataTypeBo(String rmaSfcDataTypeBo) {
this.rmaSfcDataTypeBo = rmaSfcDataTypeBo;
}
public String getRmaShopOrderDataTypeBo() {
return rmaShopOrderDataTypeBo;
}
public void setRmaShopOrderDataTypeBo(String rmaShopOrderDataTypeBo) {
this.rmaShopOrderDataTypeBo = rmaShopOrderDataTypeBo;
}
public String getOriginalStatusBo() {
return originalStatusBo;
}
public void setOriginalStatusBo(String originalStatusBo) {
this.originalStatusBo = originalStatusBo;
}
public String getTransferSite() {
return transferSite;
}
public void setTransferSite(String transferSite) {
this.transferSite = transferSite;
}
public String getTransferType() {
return transferType;
}
public void setTransferType(String transferType) {
this.transferType = transferType;
}
public String getLccBo() {
return lccBo;
}
public void setLccBo(String lccBo) {
this.lccBo = lccBo;
}
public String getShopOrderTypeBo() {
return shopOrderTypeBo;
}
public void setShopOrderTypeBo(String shopOrderTypeBo) {
this.shopOrderTypeBo = shopOrderTypeBo;
}
public Long getHoldId() {
return holdId;
}
public void setHoldId(Long holdId) {
this.holdId = holdId;
}
public String getEndUnitNumber() {
return endUnitNumber;
}
public void setEndUnitNumber(String endUnitNumber) {
this.endUnitNumber = endUnitNumber;
}
public String getReqSerialChange() {
return reqSerialChange;
}
public void setReqSerialChange(String reqSerialChange) {
this.reqSerialChange = reqSerialChange;
}
public String getCollectParentSerial() {
return collectParentSerial;
}
public void setCollectParentSerial(String collectParentSerial) {
this.collectParentSerial = collectParentSerial;
}
public String getBatchNumber() {
return batchNumber;
}
public void setBatchNumber(String batchNumber) {
this.batchNumber = batchNumber;
}
public String getErpOrder() {
return erpOrder;
}
public void setErpOrder(String erpOrder) {
this.erpOrder = erpOrder;
}
public String getErpProductionVersion() {
return erpProductionVersion;
}
public void setErpProductionVersion(String erpProductionVersion) {
this.erpProductionVersion = erpProductionVersion;
}
public String getErpUnitOfMeasure() {
return erpUnitOfMeasure;
}
public void setErpUnitOfMeasure(String erpUnitOfMeasure) {
this.erpUnitOfMeasure = erpUnitOfMeasure;
}
public LocalDateTime getPartitionDate() {
return partitionDate;
}
public void setPartitionDate(LocalDateTime partitionDate) {
this.partitionDate = partitionDate;
}
public String getInspectionLot() {
return inspectionLot;
}
public void setInspectionLot(String inspectionLot) {
this.inspectionLot = inspectionLot;
}
public Long getInspectionGroupSize() {
return inspectionGroupSize;
}
public void setInspectionGroupSize(Long inspectionGroupSize) {
this.inspectionGroupSize = inspectionGroupSize;
}
public String getErpPutawayStorloc() {
return erpPutawayStorloc;
}
public void setErpPutawayStorloc(String erpPutawayStorloc) {
this.erpPutawayStorloc = erpPutawayStorloc;
}
public String getWarehouseNumber() {
return warehouseNumber;
}
public void setWarehouseNumber(String warehouseNumber) {
this.warehouseNumber = warehouseNumber;
}
public Double getUnderdeliveryTolerance() {
return underdeliveryTolerance;
}
public void setUnderdeliveryTolerance(Double underdeliveryTolerance) {
this.underdeliveryTolerance = underdeliveryTolerance;
}
public Double getOverdeliveryTolerance() {
return overdeliveryTolerance;
}
public void setOverdeliveryTolerance(Double overdeliveryTolerance) {
this.overdeliveryTolerance = overdeliveryTolerance;
}
public String getUnlimitedOverdelivery() {
return unlimitedOverdelivery;
}
public void setUnlimitedOverdelivery(String unlimitedOverdelivery) {
this.unlimitedOverdelivery = unlimitedOverdelivery;
}
public Double getMinimumDeliveryQty() {
return minimumDeliveryQty;
}
public void setMinimumDeliveryQty(Double minimumDeliveryQty) {
this.minimumDeliveryQty = minimumDeliveryQty;
}
public Double getMaximumDeliveryQty() {
return maximumDeliveryQty;
}
public void setMaximumDeliveryQty(Double maximumDeliveryQty) {
this.maximumDeliveryQty = maximumDeliveryQty;
}
public String getToleranceDefinedIn() {
return toleranceDefinedIn;
}
public void setToleranceDefinedIn(String toleranceDefinedIn) {
this.toleranceDefinedIn = toleranceDefinedIn;
}
public static final String HANDLE = "HANDLE";
public static final String CHANGE_STAMP = "CHANGE_STAMP";
public static final String SITE = "SITE";
public static final String SHOP_ORDER = "SHOP_ORDER";
public static final String STATUS_BO = "STATUS_BO";
public static final String PRIORITY = "PRIORITY";
public static final String PLANNED_WORK_CENTER_BO = "PLANNED_WORK_CENTER_BO";
public static final String PLANNED_ITEM_BO = "PLANNED_ITEM_BO";
public static final String PLANNED_BOM_BO = "PLANNED_BOM_BO";
public static final String PLANNED_ROUTER_BO = "PLANNED_ROUTER_BO";
public static final String ITEM_BO = "ITEM_BO";
public static final String BOM_BO = "BOM_BO";
public static final String ROUTER_BO = "ROUTER_BO";
public static final String QTY_TO_BUILD = "QTY_TO_BUILD";
public static final String QTY_ORDERED = "QTY_ORDERED";
public static final String QTY_RELEASED = "QTY_RELEASED";
public static final String RELEASED_DATE = "RELEASED_DATE";
public static final String PLANNED_START_DATE = "PLANNED_START_DATE";
public static final String PLANNED_COMP_DATE = "PLANNED_COMP_DATE";
public static final String SCHEDULED_START_DATE = "SCHEDULED_START_DATE";
public static final String SCHEDULED_COMP_DATE = "SCHEDULED_COMP_DATE";
public static final String ACTUAL_START_DATE = "ACTUAL_START_DATE";
public static final String ACTUAL_COMP_DATE = "ACTUAL_COMP_DATE";
public static final String QTY_DONE = "QTY_DONE";
public static final String QTY_SCRAPPED = "QTY_SCRAPPED";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
public static final String CUSTOMER = "CUSTOMER";
public static final String CUSTOMER_ORDER = "CUSTOMER_ORDER";
public static final String RMA_SFC_DATA_TYPE_BO = "RMA_SFC_DATA_TYPE_BO";
public static final String RMA_SHOP_ORDER_DATA_TYPE_BO = "RMA_SHOP_ORDER_DATA_TYPE_BO";
public static final String ORIGINAL_STATUS_BO = "ORIGINAL_STATUS_BO";
public static final String TRANSFER_SITE = "TRANSFER_SITE";
public static final String TRANSFER_TYPE = "TRANSFER_TYPE";
public static final String LCC_BO = "LCC_BO";
public static final String SHOP_ORDER_TYPE_BO = "SHOP_ORDER_TYPE_BO";
public static final String HOLD_ID = "HOLD_ID";
public static final String END_UNIT_NUMBER = "END_UNIT_NUMBER";
public static final String REQ_SERIAL_CHANGE = "REQ_SERIAL_CHANGE";
public static final String COLLECT_PARENT_SERIAL = "COLLECT_PARENT_SERIAL";
public static final String BATCH_NUMBER = "BATCH_NUMBER";
public static final String ERP_ORDER = "ERP_ORDER";
public static final String ERP_PRODUCTION_VERSION = "ERP_PRODUCTION_VERSION";
public static final String ERP_UNIT_OF_MEASURE = "ERP_UNIT_OF_MEASURE";
public static final String PARTITION_DATE = "PARTITION_DATE";
public static final String INSPECTION_LOT = "INSPECTION_LOT";
public static final String INSPECTION_GROUP_SIZE = "INSPECTION_GROUP_SIZE";
public static final String ERP_PUTAWAY_STORLOC = "ERP_PUTAWAY_STORLOC";
public static final String WAREHOUSE_NUMBER = "WAREHOUSE_NUMBER";
public static final String UNDERDELIVERY_TOLERANCE = "UNDERDELIVERY_TOLERANCE";
public static final String OVERDELIVERY_TOLERANCE = "OVERDELIVERY_TOLERANCE";
public static final String UNLIMITED_OVERDELIVERY = "UNLIMITED_OVERDELIVERY";
public static final String MINIMUM_DELIVERY_QTY = "MINIMUM_DELIVERY_QTY";
public static final String MAXIMUM_DELIVERY_QTY = "MAXIMUM_DELIVERY_QTY";
public static final String TOLERANCE_DEFINED_IN = "TOLERANCE_DEFINED_IN";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "ShopOrder{" +
"handle = " + handle +
", changeStamp = " + changeStamp +
", site = " + site +
", shopOrder = " + shopOrder +
", statusBo = " + statusBo +
", priority = " + priority +
", plannedWorkCenterBo = " + plannedWorkCenterBo +
", plannedItemBo = " + plannedItemBo +
", plannedBomBo = " + plannedBomBo +
", plannedRouterBo = " + plannedRouterBo +
", itemBo = " + itemBo +
", bomBo = " + bomBo +
", routerBo = " + routerBo +
", qtyToBuild = " + qtyToBuild +
", qtyOrdered = " + qtyOrdered +
", qtyReleased = " + qtyReleased +
", releasedDate = " + releasedDate +
", plannedStartDate = " + plannedStartDate +
", plannedCompDate = " + plannedCompDate +
", scheduledStartDate = " + scheduledStartDate +
", scheduledCompDate = " + scheduledCompDate +
", actualStartDate = " + actualStartDate +
", actualCompDate = " + actualCompDate +
", qtyDone = " + qtyDone +
", qtyScrapped = " + qtyScrapped +
", createdDateTime = " + createdDateTime +
", modifiedDateTime = " + modifiedDateTime +
", customer = " + customer +
", customerOrder = " + customerOrder +
", rmaSfcDataTypeBo = " + rmaSfcDataTypeBo +
", rmaShopOrderDataTypeBo = " + rmaShopOrderDataTypeBo +
", originalStatusBo = " + originalStatusBo +
", transferSite = " + transferSite +
", transferType = " + transferType +
", lccBo = " + lccBo +
", shopOrderTypeBo = " + shopOrderTypeBo +
", holdId = " + holdId +
", endUnitNumber = " + endUnitNumber +
", reqSerialChange = " + reqSerialChange +
", collectParentSerial = " + collectParentSerial +
", batchNumber = " + batchNumber +
", erpOrder = " + erpOrder +
", erpProductionVersion = " + erpProductionVersion +
", erpUnitOfMeasure = " + erpUnitOfMeasure +
", partitionDate = " + partitionDate +
", inspectionLot = " + inspectionLot +
", inspectionGroupSize = " + inspectionGroupSize +
", erpPutawayStorloc = " + erpPutawayStorloc +
", warehouseNumber = " + warehouseNumber +
", underdeliveryTolerance = " + underdeliveryTolerance +
", overdeliveryTolerance = " + overdeliveryTolerance +
", unlimitedOverdelivery = " + unlimitedOverdelivery +
", minimumDeliveryQty = " + minimumDeliveryQty +
", maximumDeliveryQty = " + maximumDeliveryQty +
", toleranceDefinedIn = " + toleranceDefinedIn +
"}";
}
}

@ -0,0 +1,104 @@
package com.foreverwin.mesnac.meapi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.CustomFields;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* <p>
*
* </p>
*
* @author LZP
* @since 2021-06-01
*/
public interface CustomFieldsService extends IService<CustomFields> {
/**
*
* @param frontPage
* @return
*/
IPage<CustomFields> selectPage(FrontPage<CustomFields> frontPage, CustomFields customFields);
List<CustomFields> selectList(CustomFields customFields);
/**
*
* @param customFields
* @return
*/
CustomFields selectOne(CustomFields customFields);
/**
* @Author zero
*
* @return
*/
String getCustomFieldsValue(String handle, String attribute);
/**
*
* @param site
* @param resourceType
* @return
*/
List<Map<String,Object>> getEquipType(String site, String resourceType);
/**
* @Author zero
*
* @param handle
* @param attribute
* @return
*/
List<CustomFields> getCustomFields(String handle, String attribute);
/**
*
* @param handle
* @return
*/
List<CustomFields> getCustomFieldsByHandle(String handle);
@Transactional(propagation = Propagation.REQUIRES_NEW)
void setCustomWithNewTransaction(String handle, String attribute, String value);
/**
*
* @param handle
* @param attribute
* @param value
*/
void setCustom(String handle, String attribute, String value);
/**
*
* @param sfcBo
* @return
*/
Map<String, Object> getItemGroupPrintTemplate(String sfcBo);
/**
*
* @param itemBo
* @return
*/
Map<String, Object> getItemGroupPrintTemplateByItemBo(String itemBo);
/**
*
* @param itemBo
* @return
*/
String selectWidthValue(String site, String itemBo);
String selectAttributeByItemBo(String itemBo);
}

@ -0,0 +1,28 @@
package com.foreverwin.mesnac.meapi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.ShopOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-06-01
*/
public interface ShopOrderService extends IService<ShopOrder> {
/**
*
* @param frontPage
* @return
*/
IPage<ShopOrder> selectPage(FrontPage<ShopOrder> frontPage, ShopOrder shopOrder);
List<ShopOrder> selectList(ShopOrder shopOrder);
}

@ -0,0 +1,135 @@
package com.foreverwin.mesnac.meapi.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.meapi.model.CustomFields;
import com.foreverwin.mesnac.meapi.mapper.CustomFieldsMapper;
import com.foreverwin.mesnac.meapi.service.CustomFieldsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* <p>
*
* </p>
*
* @author LZP
* @since 2021-06-01
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CustomFieldsServiceImpl extends ServiceImpl<CustomFieldsMapper, CustomFields> implements CustomFieldsService {
private static Logger logger = LogManager.getLogger(CustomFieldsServiceImpl.class);
@Autowired
private CustomFieldsMapper customFieldsMapper;
@Autowired
private CustomFieldsService customFieldsService;
@Override
public CustomFields selectOne(CustomFields customFields) {
QueryWrapper<CustomFields> qw = new QueryWrapper();
qw.setEntity( customFields );
return customFieldsMapper.selectOne( qw );
}
@Override
public String getCustomFieldsValue(String handle, String attribute) {
return customFieldsMapper.selectCustomFieldsValue(handle, attribute);
}
@Override
public List<Map<String, Object>> getEquipType(String site, String equipType) {
return customFieldsMapper.selectEquipType(site,equipType);
}
@Override
public List<CustomFields> getCustomFields(String handle,String attribute) {
return customFieldsMapper.selectCustomFields(handle,attribute);
}
@Override
public List<CustomFields> getCustomFieldsByHandle(String handle) {
return customFieldsMapper.selectCustomFieldsByHandle(handle);
}
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void setCustomWithNewTransaction(String handle, String attribute, String value) {
setCustom(handle, attribute, value);
}
public void setCustom(String handle, String attribute, String value) {
Date nowDate = new Date();
QueryWrapper<CustomFields> customFieldsWrapper = new QueryWrapper<>();
customFieldsWrapper.eq("HANDLE",handle);
customFieldsWrapper.eq("ATTRIBUTE",attribute);
List<CustomFields> list= customFieldsMapper.selectList(customFieldsWrapper);
//实体赋值
CustomFields customFields = new CustomFields();
customFields.setHandle(handle);
customFields.setAttribute(attribute);
customFields.setValue(value);
if(list.isEmpty()){
customFields.setCreatedDateTime(nowDate);
customFields.setModifiedDateTime(nowDate);
customFieldsMapper.insert(customFields);//insertAllColumn
}else{
customFields.setModifiedDateTime(nowDate);
customFieldsMapper.update(customFields,customFieldsWrapper);
}
logger.info("custom fields created: {}, {}", handle, list.isEmpty());
}
@Override
public Map<String, Object> getItemGroupPrintTemplate(String sfcBo) {
return customFieldsMapper.selectItemGroupPrintTemplate(sfcBo);
}
@Override
public Map<String, Object> getItemGroupPrintTemplateByItemBo(String itemBo) {
return customFieldsMapper.selectItemGroupPrintTemplateByItemBo(itemBo);
}
@Override
public String selectWidthValue(String site, String itemBo) {
return customFieldsMapper.selectWidthValue(site, itemBo);
}
@Override
public String selectAttributeByItemBo(String itemBo) {
return customFieldsMapper.selectAttributeByItemBo(itemBo);
}
@Override
public IPage<CustomFields> selectPage(FrontPage<CustomFields> frontPage, CustomFields customFields) {
QueryWrapper<CustomFields> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(customFields);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<CustomFields> selectList(CustomFields customFields) {
QueryWrapper<CustomFields> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(customFields);
return super.list(queryWrapper);
}
}

@ -0,0 +1,46 @@
package com.foreverwin.mesnac.meapi.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.meapi.model.ShopOrder;
import com.foreverwin.mesnac.meapi.mapper.ShopOrderMapper;
import com.foreverwin.mesnac.meapi.service.ShopOrderService;
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 Leon.L
* @since 2021-06-01
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder> implements ShopOrderService {
@Autowired
private ShopOrderMapper shopOrderMapper;
@Override
public IPage<ShopOrder> selectPage(FrontPage<ShopOrder> frontPage, ShopOrder shopOrder) {
QueryWrapper<ShopOrder> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(shopOrder);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<ShopOrder> selectList(ShopOrder shopOrder) {
QueryWrapper<ShopOrder> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(shopOrder);
return super.list(queryWrapper);
}
}

@ -0,0 +1,290 @@
<?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.meapi.mapper.CustomFieldsMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.CustomFields">
<result column="HANDLE" property="handle" />
<result column="ATTRIBUTE" property="attribute" />
<result column="VALUE" property="value" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, ATTRIBUTE, VALUE, CREATED_DATE_TIME, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM CUSTOM_FIELDS
<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="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM CUSTOM_FIELDS
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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 CUSTOM_FIELDS
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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 CUSTOM_FIELDS
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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 CUSTOM_FIELDS
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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 CUSTOM_FIELDS
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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 CUSTOM_FIELDS
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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 CUSTOM_FIELDS
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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.meapi.model.CustomFields">
INSERT INTO CUSTOM_FIELDS
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="attribute!=null">ATTRIBUTE,</if>
<if test="value!=null">VALUE,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="attribute!=null">#{attribute},</if>
<if test="value!=null">#{value},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.CustomFields">
INSERT INTO CUSTOM_FIELDS
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{attribute},
#{value},
#{createdDateTime},
#{modifiedDateTime},
</trim>
</insert>
<update id="update">
UPDATE CUSTOM_FIELDS <trim prefix="SET" suffixOverrides=",">
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
<if test="et.attribute!=null">ATTRIBUTE=#{et.attribute},</if>
<if test="et.value!=null">VALUE=#{et.value},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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="deleteByMap">
DELETE FROM CUSTOM_FIELDS
<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 CUSTOM_FIELDS
<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.attribute!=null"> AND ATTRIBUTE=#{ew.entity.attribute}</if>
<if test="ew.entity.value!=null"> AND VALUE=#{ew.entity.value}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</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>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -249,128 +249,46 @@
</select>
<select id="selectList" resultMap="BaseResultMap">
select I.*, IT.DESCRIPTION from (
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose> FROM ITEM
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM ITEM I
LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO AND IT.LOCALE = 'zh'
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.itemType!=null"> AND ITEM_TYPE=#{ew.entity.itemType}</if>
<if test="ew.entity.erpGtin!=null"> AND ERP_GTIN=#{ew.entity.erpGtin}</if>
<if test="ew.entity.ainModelExternalId!=null"> AND AIN_MODEL_EXTERNAL_ID=#{ew.entity.ainModelExternalId}</if>
<if test="ew.entity.effStartSeq!=null"> AND EFF_START_SEQ=#{ew.entity.effStartSeq}</if>
<if test="ew.entity.effEndSeq!=null"> AND EFF_END_SEQ=#{ew.entity.effEndSeq}</if>
<if test="ew.entity.lotSize!=null"> AND LOT_SIZE=#{ew.entity.lotSize}</if>
<if test="ew.entity.quantityRestriction!=null"> AND QUANTITY_RESTRICTION=#{ew.entity.quantityRestriction}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.bomBo!=null"> AND BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.componentGroupBo!=null"> AND COMPONENT_GROUP_BO=#{ew.entity.componentGroupBo}</if>
<if test="ew.entity.itemGroupBo!=null"> AND ITEM_GROUP_BO=#{ew.entity.itemGroupBo}</if>
<if test="ew.entity.lastReleasedDate!=null"> AND LAST_RELEASED_DATE=#{ew.entity.lastReleasedDate}</if>
<if test="ew.entity.assyDataTypeBo!=null"> AND ASSY_DATA_TYPE_BO=#{ew.entity.assyDataTypeBo}</if>
<if test="ew.entity.preAssembled!=null"> AND PRE_ASSEMBLED=#{ew.entity.preAssembled}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
<if test="ew.entity.effStartDate!=null"> AND EFF_START_DATE=#{ew.entity.effStartDate}</if>
<if test="ew.entity.effEndDate!=null"> AND EFF_END_DATE=#{ew.entity.effEndDate}</if>
<if test="ew.entity.selectorActivityBo!=null"> AND SELECTOR_ACTIVITY_BO=#{ew.entity.selectorActivityBo}</if>
<if test="ew.entity.selectorNote!=null"> AND SELECTOR_NOTE=#{ew.entity.selectorNote}</if>
<if test="ew.entity.assignSerialAtRelease!=null"> AND ASSIGN_SERIAL_AT_RELEASE=#{ew.entity.assignSerialAtRelease}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.drawingName!=null"> AND DRAWING_NAME=#{ew.entity.drawingName}</if>
<if test="ew.entity.maximumUsage!=null"> AND MAXIMUM_USAGE=#{ew.entity.maximumUsage}</if>
<if test="ew.entity.useCompFromDrawing!=null"> AND USE_COMP_FROM_DRAWING=#{ew.entity.useCompFromDrawing}</if>
<if test="ew.entity.panel!=null"> AND PANEL=#{ew.entity.panel}</if>
<if test="ew.entity.removalAssyDataTypeBo!=null"> AND REMOVAL_ASSY_DATA_TYPE_BO=#{ew.entity.removalAssyDataTypeBo}</if>
<if test="ew.entity.invAssyDataTypeBo!=null"> AND INV_ASSY_DATA_TYPE_BO=#{ew.entity.invAssyDataTypeBo}</if>
<if test="ew.entity.originalStatusBo!=null"> AND ORIGINAL_STATUS_BO=#{ew.entity.originalStatusBo}</if>
<if test="ew.entity.qtyMultiplier!=null"> AND QTY_MULTIPLIER=#{ew.entity.qtyMultiplier}</if>
<if test="ew.entity.createTrackableSfc!=null"> AND CREATE_TRACKABLE_SFC=#{ew.entity.createTrackableSfc}</if>
<if test="ew.entity.maskGroupBo!=null"> AND MASK_GROUP_BO=#{ew.entity.maskGroupBo}</if>
<if test="ew.entity.transferItemGroupBo!=null"> AND TRANSFER_ITEM_GROUP_BO=#{ew.entity.transferItemGroupBo}</if>
<if test="ew.entity.unitOfMeasure!=null"> AND UNIT_OF_MEASURE=#{ew.entity.unitOfMeasure}</if>
<if test="ew.entity.holdId!=null"> AND HOLD_ID=#{ew.entity.holdId}</if>
<if test="ew.entity.collectParentSerial!=null"> AND COLLECT_PARENT_SERIAL=#{ew.entity.collectParentSerial}</if>
<if test="ew.entity.reqSerialChange!=null"> AND REQ_SERIAL_CHANGE=#{ew.entity.reqSerialChange}</if>
<if test="ew.entity.isCollector!=null"> AND IS_COLLECTOR=#{ew.entity.isCollector}</if>
<if test="ew.entity.incBatchNumber!=null"> AND INC_BATCH_NUMBER=#{ew.entity.incBatchNumber}</if>
<if test="ew.entity.timeSensitive!=null"> AND TIME_SENSITIVE=#{ew.entity.timeSensitive}</if>
<if test="ew.entity.maxShelfLife!=null"> AND MAX_SHELF_LIFE=#{ew.entity.maxShelfLife}</if>
<if test="ew.entity.maxShelfLifeUnits!=null"> AND MAX_SHELF_LIFE_UNITS=#{ew.entity.maxShelfLifeUnits}</if>
<if test="ew.entity.maxFloorLife!=null"> AND MAX_FLOOR_LIFE=#{ew.entity.maxFloorLife}</if>
<if test="ew.entity.maxFloorLifeUnits!=null"> AND MAX_FLOOR_LIFE_UNITS=#{ew.entity.maxFloorLifeUnits}</if>
<if test="ew.entity.notes!=null"> AND NOTES=#{ew.entity.notes}</if>
<if test="ew.entity.tbCompType!=null"> AND TB_COMP_TYPE=#{ew.entity.tbCompType}</if>
<if test="ew.entity.consumptionTol!=null"> AND CONSUMPTION_TOL=#{ew.entity.consumptionTol}</if>
<if test="ew.entity.erpBackflushing!=null"> AND ERP_BACKFLUSHING=#{ew.entity.erpBackflushing}</if>
<if test="ew.entity.storageLocationBo!=null"> AND STORAGE_LOCATION_BO=#{ew.entity.storageLocationBo}</if>
<if test="ew.entity.erpPutawayStorloc!=null"> AND ERP_PUTAWAY_STORLOC=#{ew.entity.erpPutawayStorloc}</if>
<if test="ew.entity.productionSupplyArea!=null"> AND PRODUCTION_SUPPLY_AREA=#{ew.entity.productionSupplyArea}</if>
<if test="ew.entity.useOrderIdRel1!=null"> AND USE_ORDER_ID_REL1=#{ew.entity.useOrderIdRel1}</if>
<if test="ew.entity.materialType!=null"> AND MATERIAL_TYPE=#{ew.entity.materialType}</if>
<if test="ew.entity.procurementType!=null"> AND PROCUREMENT_TYPE=#{ew.entity.procurementType}</if>
<if test="ew.entity.origin!=null"> AND ORIGIN=#{ew.entity.origin}</if>
<if test="ew.entity.handle!=null">I.HANDLE=#{ew.entity.handle}</if>
<if test="ew.entity.site!=null"> AND I.SITE=#{ew.entity.site}</if>
<if test="ew.entity.item!=null"> AND I.ITEM=#{ew.entity.item}</if>
<if test="ew.entity.statusBo!=null"> AND I.STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.itemType!=null"> AND I.ITEM_TYPE=#{ew.entity.itemType}</if>
<if test="ew.entity.lotSize!=null"> AND I.LOT_SIZE=#{ew.entity.lotSize}</if>
<if test="ew.entity.quantityRestriction!=null"> AND I.QUANTITY_RESTRICTION=#{ew.entity.quantityRestriction}</if>
<if test="ew.entity.routerBo!=null"> AND I.ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.bomBo!=null"> AND I.BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.componentGroupBo!=null"> AND I.COMPONENT_GROUP_BO=#{ew.entity.componentGroupBo}</if>
<if test="ew.entity.itemGroupBo!=null"> AND I.ITEM_GROUP_BO=#{ew.entity.itemGroupBo}</if>
<if test="ew.entity.revision!=null"> AND I.REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND I.CURRENT_REVISION=#{ew.entity.currentRevision}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
)I
LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO AND IT.LOCALE = #{locale}
</select>
<select id="selectItemBo" resultMap="BaseResultMap">
SELECT * FROM ITEM i WHERE SITE = #{site} AND ITEM = #{item} AND CURRENT_REVISION = TRUE
</select>
<!--查询物料详情-->
<select id="getItemDetailList" resultMap="BaseResultMap">
select a.item ,b.description
from item a
left join item_t b on a.handle=b.item_bo
WHERE a.CURRENT_REVISION ='true'
and a.SITE =#{site}
and b.LOCALE =#{local}
order by a.item ,b.description
</select>
<select id="getItemDescription" resultMap="BaseResultMap">
select a.handle,a.item ,b.description
from item a
left join item_t b on a.handle=b.item_bo
where a.item=#{item}
AND b.LOCALE =#{locale}
and a.SITE =#{site}
and a.CURRENT_REVISION ='true'
</select>
<select id="selectBatchReview" resultMap="BaseResultMap">
SELECT TOP 1 zil.ITEM,zild.PRODUCTION_BATCH DESCRIPTION FROM Z_ITEM_LABEL zil
LEFT JOIN Z_ITEM_LABEL_DETAIL zild ON zil.LABEL_ID = zild.LABEL_ID AND zil.SITE = zild.SITE
WHERE zil.SITE =#{site} AND zil.STATUS ='N'
AND zil.LABEL_TYPE ='2' AND IFNULL(zild.SN,'') = ''
AND zil.QUALITY_TYPE !='SCRAP'
AND IFNULL(zild.PRODUCTION_BATCH,'') !=''
AND zil.ITEM =#{item}
ORDER BY zild.UPDATED_DATE_TIME DESC
</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 ITEM
<where>
@ -530,82 +448,33 @@ ORDER BY zild.UPDATED_DATE_TIME DESC
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Full_Column_List"></include></otherwise></choose> FROM ITEM
left join ITEM_T IT on I.HANDLE = IT.ITEM_BO and IT.LOCALE = #{locale}
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Full_Column_List"></include></otherwise></choose>
FROM ITEM I
LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO AND IT.LOCALE = 'zh'
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.itemType!=null"> AND ITEM_TYPE=#{ew.entity.itemType}</if>
<if test="ew.entity.erpGtin!=null"> AND ERP_GTIN=#{ew.entity.erpGtin}</if>
<if test="ew.entity.ainModelExternalId!=null"> AND AIN_MODEL_EXTERNAL_ID=#{ew.entity.ainModelExternalId}</if>
<if test="ew.entity.effStartSeq!=null"> AND EFF_START_SEQ=#{ew.entity.effStartSeq}</if>
<if test="ew.entity.effEndSeq!=null"> AND EFF_END_SEQ=#{ew.entity.effEndSeq}</if>
<if test="ew.entity.lotSize!=null"> AND LOT_SIZE=#{ew.entity.lotSize}</if>
<if test="ew.entity.quantityRestriction!=null"> AND QUANTITY_RESTRICTION=#{ew.entity.quantityRestriction}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.bomBo!=null"> AND BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.componentGroupBo!=null"> AND COMPONENT_GROUP_BO=#{ew.entity.componentGroupBo}</if>
<if test="ew.entity.itemGroupBo!=null"> AND ITEM_GROUP_BO=#{ew.entity.itemGroupBo}</if>
<if test="ew.entity.lastReleasedDate!=null"> AND LAST_RELEASED_DATE=#{ew.entity.lastReleasedDate}</if>
<if test="ew.entity.assyDataTypeBo!=null"> AND ASSY_DATA_TYPE_BO=#{ew.entity.assyDataTypeBo}</if>
<if test="ew.entity.preAssembled!=null"> AND PRE_ASSEMBLED=#{ew.entity.preAssembled}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
<if test="ew.entity.effStartDate!=null"> AND EFF_START_DATE=#{ew.entity.effStartDate}</if>
<if test="ew.entity.effEndDate!=null"> AND EFF_END_DATE=#{ew.entity.effEndDate}</if>
<if test="ew.entity.selectorActivityBo!=null"> AND SELECTOR_ACTIVITY_BO=#{ew.entity.selectorActivityBo}</if>
<if test="ew.entity.selectorNote!=null"> AND SELECTOR_NOTE=#{ew.entity.selectorNote}</if>
<if test="ew.entity.assignSerialAtRelease!=null"> AND ASSIGN_SERIAL_AT_RELEASE=#{ew.entity.assignSerialAtRelease}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.drawingName!=null"> AND DRAWING_NAME=#{ew.entity.drawingName}</if>
<if test="ew.entity.maximumUsage!=null"> AND MAXIMUM_USAGE=#{ew.entity.maximumUsage}</if>
<if test="ew.entity.useCompFromDrawing!=null"> AND USE_COMP_FROM_DRAWING=#{ew.entity.useCompFromDrawing}</if>
<if test="ew.entity.panel!=null"> AND PANEL=#{ew.entity.panel}</if>
<if test="ew.entity.removalAssyDataTypeBo!=null"> AND REMOVAL_ASSY_DATA_TYPE_BO=#{ew.entity.removalAssyDataTypeBo}</if>
<if test="ew.entity.invAssyDataTypeBo!=null"> AND INV_ASSY_DATA_TYPE_BO=#{ew.entity.invAssyDataTypeBo}</if>
<if test="ew.entity.originalStatusBo!=null"> AND ORIGINAL_STATUS_BO=#{ew.entity.originalStatusBo}</if>
<if test="ew.entity.qtyMultiplier!=null"> AND QTY_MULTIPLIER=#{ew.entity.qtyMultiplier}</if>
<if test="ew.entity.createTrackableSfc!=null"> AND CREATE_TRACKABLE_SFC=#{ew.entity.createTrackableSfc}</if>
<if test="ew.entity.maskGroupBo!=null"> AND MASK_GROUP_BO=#{ew.entity.maskGroupBo}</if>
<if test="ew.entity.transferItemGroupBo!=null"> AND TRANSFER_ITEM_GROUP_BO=#{ew.entity.transferItemGroupBo}</if>
<if test="ew.entity.unitOfMeasure!=null"> AND UNIT_OF_MEASURE=#{ew.entity.unitOfMeasure}</if>
<if test="ew.entity.holdId!=null"> AND HOLD_ID=#{ew.entity.holdId}</if>
<if test="ew.entity.collectParentSerial!=null"> AND COLLECT_PARENT_SERIAL=#{ew.entity.collectParentSerial}</if>
<if test="ew.entity.reqSerialChange!=null"> AND REQ_SERIAL_CHANGE=#{ew.entity.reqSerialChange}</if>
<if test="ew.entity.isCollector!=null"> AND IS_COLLECTOR=#{ew.entity.isCollector}</if>
<if test="ew.entity.incBatchNumber!=null"> AND INC_BATCH_NUMBER=#{ew.entity.incBatchNumber}</if>
<if test="ew.entity.timeSensitive!=null"> AND TIME_SENSITIVE=#{ew.entity.timeSensitive}</if>
<if test="ew.entity.maxShelfLife!=null"> AND MAX_SHELF_LIFE=#{ew.entity.maxShelfLife}</if>
<if test="ew.entity.maxShelfLifeUnits!=null"> AND MAX_SHELF_LIFE_UNITS=#{ew.entity.maxShelfLifeUnits}</if>
<if test="ew.entity.maxFloorLife!=null"> AND MAX_FLOOR_LIFE=#{ew.entity.maxFloorLife}</if>
<if test="ew.entity.maxFloorLifeUnits!=null"> AND MAX_FLOOR_LIFE_UNITS=#{ew.entity.maxFloorLifeUnits}</if>
<if test="ew.entity.notes!=null"> AND NOTES=#{ew.entity.notes}</if>
<if test="ew.entity.tbCompType!=null"> AND TB_COMP_TYPE=#{ew.entity.tbCompType}</if>
<if test="ew.entity.consumptionTol!=null"> AND CONSUMPTION_TOL=#{ew.entity.consumptionTol}</if>
<if test="ew.entity.erpBackflushing!=null"> AND ERP_BACKFLUSHING=#{ew.entity.erpBackflushing}</if>
<if test="ew.entity.storageLocationBo!=null"> AND STORAGE_LOCATION_BO=#{ew.entity.storageLocationBo}</if>
<if test="ew.entity.erpPutawayStorloc!=null"> AND ERP_PUTAWAY_STORLOC=#{ew.entity.erpPutawayStorloc}</if>
<if test="ew.entity.productionSupplyArea!=null"> AND PRODUCTION_SUPPLY_AREA=#{ew.entity.productionSupplyArea}</if>
<if test="ew.entity.useOrderIdRel1!=null"> AND USE_ORDER_ID_REL1=#{ew.entity.useOrderIdRel1}</if>
<if test="ew.entity.materialType!=null"> AND MATERIAL_TYPE=#{ew.entity.materialType}</if>
<if test="ew.entity.procurementType!=null"> AND PROCUREMENT_TYPE=#{ew.entity.procurementType}</if>
<if test="ew.entity.origin!=null"> AND ORIGIN=#{ew.entity.origin}</if>
<if test="ew.entity.handle!=null"> I.HANDLE=#{ew.entity.handle}</if>
<if test="ew.entity.site!=null"> AND I.SITE=#{ew.entity.site}</if>
<if test="ew.entity.item!=null"> AND I.ITEM=#{ew.entity.item}</if>
<if test="ew.entity.statusBo!=null"> AND I.STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.itemType!=null"> AND I.ITEM_TYPE=#{ew.entity.itemType}</if>
<if test="ew.entity.lotSize!=null"> AND I.LOT_SIZE=#{ew.entity.lotSize}</if>
<if test="ew.entity.quantityRestriction!=null"> AND I.QUANTITY_RESTRICTION=#{ew.entity.quantityRestriction}</if>
<if test="ew.entity.routerBo!=null"> AND I.ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.bomBo!=null"> AND I.BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.componentGroupBo!=null"> AND I.COMPONENT_GROUP_BO=#{ew.entity.componentGroupBo}</if>
<if test="ew.entity.itemGroupBo!=null"> AND I.ITEM_GROUP_BO=#{ew.entity.itemGroupBo}</if>
<if test="ew.entity.revision!=null"> AND I.REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND I.CURRENT_REVISION=#{ew.entity.currentRevision}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</select>

@ -247,7 +247,8 @@
</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 RESRCE
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose>
FROM RESRCE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -278,12 +279,12 @@
<if test="ew.entity.erpCapacityCategory!=null"> AND ERP_CAPACITY_CATEGORY=#{ew.entity.erpCapacityCategory}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</select>

@ -0,0 +1,990 @@
<?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.meapi.mapper.ShopOrderMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.ShopOrder">
<result column="HANDLE" property="handle" />
<result column="CHANGE_STAMP" property="changeStamp" />
<result column="SITE" property="site" />
<result column="SHOP_ORDER" property="shopOrder" />
<result column="STATUS_BO" property="statusBo" />
<result column="PRIORITY" property="priority" />
<result column="PLANNED_WORK_CENTER_BO" property="plannedWorkCenterBo" />
<result column="PLANNED_ITEM_BO" property="plannedItemBo" />
<result column="PLANNED_BOM_BO" property="plannedBomBo" />
<result column="PLANNED_ROUTER_BO" property="plannedRouterBo" />
<result column="ITEM_BO" property="itemBo" />
<result column="BOM_BO" property="bomBo" />
<result column="ROUTER_BO" property="routerBo" />
<result column="QTY_TO_BUILD" property="qtyToBuild" />
<result column="QTY_ORDERED" property="qtyOrdered" />
<result column="QTY_RELEASED" property="qtyReleased" />
<result column="RELEASED_DATE" property="releasedDate" />
<result column="PLANNED_START_DATE" property="plannedStartDate" />
<result column="PLANNED_COMP_DATE" property="plannedCompDate" />
<result column="SCHEDULED_START_DATE" property="scheduledStartDate" />
<result column="SCHEDULED_COMP_DATE" property="scheduledCompDate" />
<result column="ACTUAL_START_DATE" property="actualStartDate" />
<result column="ACTUAL_COMP_DATE" property="actualCompDate" />
<result column="QTY_DONE" property="qtyDone" />
<result column="QTY_SCRAPPED" property="qtyScrapped" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
<result column="CUSTOMER" property="customer" />
<result column="CUSTOMER_ORDER" property="customerOrder" />
<result column="RMA_SFC_DATA_TYPE_BO" property="rmaSfcDataTypeBo" />
<result column="RMA_SHOP_ORDER_DATA_TYPE_BO" property="rmaShopOrderDataTypeBo" />
<result column="ORIGINAL_STATUS_BO" property="originalStatusBo" />
<result column="TRANSFER_SITE" property="transferSite" />
<result column="TRANSFER_TYPE" property="transferType" />
<result column="LCC_BO" property="lccBo" />
<result column="SHOP_ORDER_TYPE_BO" property="shopOrderTypeBo" />
<result column="HOLD_ID" property="holdId" />
<result column="END_UNIT_NUMBER" property="endUnitNumber" />
<result column="REQ_SERIAL_CHANGE" property="reqSerialChange" />
<result column="COLLECT_PARENT_SERIAL" property="collectParentSerial" />
<result column="BATCH_NUMBER" property="batchNumber" />
<result column="ERP_ORDER" property="erpOrder" />
<result column="ERP_PRODUCTION_VERSION" property="erpProductionVersion" />
<result column="ERP_UNIT_OF_MEASURE" property="erpUnitOfMeasure" />
<result column="PARTITION_DATE" property="partitionDate" />
<result column="INSPECTION_LOT" property="inspectionLot" />
<result column="INSPECTION_GROUP_SIZE" property="inspectionGroupSize" />
<result column="ERP_PUTAWAY_STORLOC" property="erpPutawayStorloc" />
<result column="WAREHOUSE_NUMBER" property="warehouseNumber" />
<result column="UNDERDELIVERY_TOLERANCE" property="underdeliveryTolerance" />
<result column="OVERDELIVERY_TOLERANCE" property="overdeliveryTolerance" />
<result column="UNLIMITED_OVERDELIVERY" property="unlimitedOverdelivery" />
<result column="MINIMUM_DELIVERY_QTY" property="minimumDeliveryQty" />
<result column="MAXIMUM_DELIVERY_QTY" property="maximumDeliveryQty" />
<result column="TOLERANCE_DEFINED_IN" property="toleranceDefinedIn" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, CHANGE_STAMP, SITE, SHOP_ORDER, STATUS_BO, PRIORITY, PLANNED_WORK_CENTER_BO, PLANNED_ITEM_BO, PLANNED_BOM_BO, PLANNED_ROUTER_BO, ITEM_BO, BOM_BO, ROUTER_BO, QTY_TO_BUILD, QTY_ORDERED, QTY_RELEASED, RELEASED_DATE, PLANNED_START_DATE, PLANNED_COMP_DATE, SCHEDULED_START_DATE, SCHEDULED_COMP_DATE, ACTUAL_START_DATE, ACTUAL_COMP_DATE, QTY_DONE, QTY_SCRAPPED, CREATED_DATE_TIME, MODIFIED_DATE_TIME, CUSTOMER, CUSTOMER_ORDER, RMA_SFC_DATA_TYPE_BO, RMA_SHOP_ORDER_DATA_TYPE_BO, ORIGINAL_STATUS_BO, TRANSFER_SITE, TRANSFER_TYPE, LCC_BO, SHOP_ORDER_TYPE_BO, HOLD_ID, END_UNIT_NUMBER, REQ_SERIAL_CHANGE, COLLECT_PARENT_SERIAL, BATCH_NUMBER, ERP_ORDER, ERP_PRODUCTION_VERSION, ERP_UNIT_OF_MEASURE, PARTITION_DATE, INSPECTION_LOT, INSPECTION_GROUP_SIZE, ERP_PUTAWAY_STORLOC, WAREHOUSE_NUMBER, UNDERDELIVERY_TOLERANCE, OVERDELIVERY_TOLERANCE, UNLIMITED_OVERDELIVERY, MINIMUM_DELIVERY_QTY, MAXIMUM_DELIVERY_QTY, TOLERANCE_DEFINED_IN
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM SHOP_ORDER
<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="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM SHOP_ORDER
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.priority!=null"> AND PRIORITY=#{ew.entity.priority}</if>
<if test="ew.entity.plannedWorkCenterBo!=null"> AND PLANNED_WORK_CENTER_BO=#{ew.entity.plannedWorkCenterBo}</if>
<if test="ew.entity.plannedItemBo!=null"> AND PLANNED_ITEM_BO=#{ew.entity.plannedItemBo}</if>
<if test="ew.entity.plannedBomBo!=null"> AND PLANNED_BOM_BO=#{ew.entity.plannedBomBo}</if>
<if test="ew.entity.plannedRouterBo!=null"> AND PLANNED_ROUTER_BO=#{ew.entity.plannedRouterBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.bomBo!=null"> AND BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.qtyToBuild!=null"> AND QTY_TO_BUILD=#{ew.entity.qtyToBuild}</if>
<if test="ew.entity.qtyOrdered!=null"> AND QTY_ORDERED=#{ew.entity.qtyOrdered}</if>
<if test="ew.entity.qtyReleased!=null"> AND QTY_RELEASED=#{ew.entity.qtyReleased}</if>
<if test="ew.entity.releasedDate!=null"> AND RELEASED_DATE=#{ew.entity.releasedDate}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.scheduledStartDate!=null"> AND SCHEDULED_START_DATE=#{ew.entity.scheduledStartDate}</if>
<if test="ew.entity.scheduledCompDate!=null"> AND SCHEDULED_COMP_DATE=#{ew.entity.scheduledCompDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompDate!=null"> AND ACTUAL_COMP_DATE=#{ew.entity.actualCompDate}</if>
<if test="ew.entity.qtyDone!=null"> AND QTY_DONE=#{ew.entity.qtyDone}</if>
<if test="ew.entity.qtyScrapped!=null"> AND QTY_SCRAPPED=#{ew.entity.qtyScrapped}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.customer!=null"> AND CUSTOMER=#{ew.entity.customer}</if>
<if test="ew.entity.customerOrder!=null"> AND CUSTOMER_ORDER=#{ew.entity.customerOrder}</if>
<if test="ew.entity.rmaSfcDataTypeBo!=null"> AND RMA_SFC_DATA_TYPE_BO=#{ew.entity.rmaSfcDataTypeBo}</if>
<if test="ew.entity.rmaShopOrderDataTypeBo!=null"> AND RMA_SHOP_ORDER_DATA_TYPE_BO=#{ew.entity.rmaShopOrderDataTypeBo}</if>
<if test="ew.entity.originalStatusBo!=null"> AND ORIGINAL_STATUS_BO=#{ew.entity.originalStatusBo}</if>
<if test="ew.entity.transferSite!=null"> AND TRANSFER_SITE=#{ew.entity.transferSite}</if>
<if test="ew.entity.transferType!=null"> AND TRANSFER_TYPE=#{ew.entity.transferType}</if>
<if test="ew.entity.lccBo!=null"> AND LCC_BO=#{ew.entity.lccBo}</if>
<if test="ew.entity.shopOrderTypeBo!=null"> AND SHOP_ORDER_TYPE_BO=#{ew.entity.shopOrderTypeBo}</if>
<if test="ew.entity.holdId!=null"> AND HOLD_ID=#{ew.entity.holdId}</if>
<if test="ew.entity.endUnitNumber!=null"> AND END_UNIT_NUMBER=#{ew.entity.endUnitNumber}</if>
<if test="ew.entity.reqSerialChange!=null"> AND REQ_SERIAL_CHANGE=#{ew.entity.reqSerialChange}</if>
<if test="ew.entity.collectParentSerial!=null"> AND COLLECT_PARENT_SERIAL=#{ew.entity.collectParentSerial}</if>
<if test="ew.entity.batchNumber!=null"> AND BATCH_NUMBER=#{ew.entity.batchNumber}</if>
<if test="ew.entity.erpOrder!=null"> AND ERP_ORDER=#{ew.entity.erpOrder}</if>
<if test="ew.entity.erpProductionVersion!=null"> AND ERP_PRODUCTION_VERSION=#{ew.entity.erpProductionVersion}</if>
<if test="ew.entity.erpUnitOfMeasure!=null"> AND ERP_UNIT_OF_MEASURE=#{ew.entity.erpUnitOfMeasure}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.inspectionLot!=null"> AND INSPECTION_LOT=#{ew.entity.inspectionLot}</if>
<if test="ew.entity.inspectionGroupSize!=null"> AND INSPECTION_GROUP_SIZE=#{ew.entity.inspectionGroupSize}</if>
<if test="ew.entity.erpPutawayStorloc!=null"> AND ERP_PUTAWAY_STORLOC=#{ew.entity.erpPutawayStorloc}</if>
<if test="ew.entity.warehouseNumber!=null"> AND WAREHOUSE_NUMBER=#{ew.entity.warehouseNumber}</if>
<if test="ew.entity.underdeliveryTolerance!=null"> AND UNDERDELIVERY_TOLERANCE=#{ew.entity.underdeliveryTolerance}</if>
<if test="ew.entity.overdeliveryTolerance!=null"> AND OVERDELIVERY_TOLERANCE=#{ew.entity.overdeliveryTolerance}</if>
<if test="ew.entity.unlimitedOverdelivery!=null"> AND UNLIMITED_OVERDELIVERY=#{ew.entity.unlimitedOverdelivery}</if>
<if test="ew.entity.minimumDeliveryQty!=null"> AND MINIMUM_DELIVERY_QTY=#{ew.entity.minimumDeliveryQty}</if>
<if test="ew.entity.maximumDeliveryQty!=null"> AND MAXIMUM_DELIVERY_QTY=#{ew.entity.maximumDeliveryQty}</if>
<if test="ew.entity.toleranceDefinedIn!=null"> AND TOLERANCE_DEFINED_IN=#{ew.entity.toleranceDefinedIn}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM SHOP_ORDER
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.priority!=null"> AND PRIORITY=#{ew.entity.priority}</if>
<if test="ew.entity.plannedWorkCenterBo!=null"> AND PLANNED_WORK_CENTER_BO=#{ew.entity.plannedWorkCenterBo}</if>
<if test="ew.entity.plannedItemBo!=null"> AND PLANNED_ITEM_BO=#{ew.entity.plannedItemBo}</if>
<if test="ew.entity.plannedBomBo!=null"> AND PLANNED_BOM_BO=#{ew.entity.plannedBomBo}</if>
<if test="ew.entity.plannedRouterBo!=null"> AND PLANNED_ROUTER_BO=#{ew.entity.plannedRouterBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.bomBo!=null"> AND BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.qtyToBuild!=null"> AND QTY_TO_BUILD=#{ew.entity.qtyToBuild}</if>
<if test="ew.entity.qtyOrdered!=null"> AND QTY_ORDERED=#{ew.entity.qtyOrdered}</if>
<if test="ew.entity.qtyReleased!=null"> AND QTY_RELEASED=#{ew.entity.qtyReleased}</if>
<if test="ew.entity.releasedDate!=null"> AND RELEASED_DATE=#{ew.entity.releasedDate}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.scheduledStartDate!=null"> AND SCHEDULED_START_DATE=#{ew.entity.scheduledStartDate}</if>
<if test="ew.entity.scheduledCompDate!=null"> AND SCHEDULED_COMP_DATE=#{ew.entity.scheduledCompDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompDate!=null"> AND ACTUAL_COMP_DATE=#{ew.entity.actualCompDate}</if>
<if test="ew.entity.qtyDone!=null"> AND QTY_DONE=#{ew.entity.qtyDone}</if>
<if test="ew.entity.qtyScrapped!=null"> AND QTY_SCRAPPED=#{ew.entity.qtyScrapped}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.customer!=null"> AND CUSTOMER=#{ew.entity.customer}</if>
<if test="ew.entity.customerOrder!=null"> AND CUSTOMER_ORDER=#{ew.entity.customerOrder}</if>
<if test="ew.entity.rmaSfcDataTypeBo!=null"> AND RMA_SFC_DATA_TYPE_BO=#{ew.entity.rmaSfcDataTypeBo}</if>
<if test="ew.entity.rmaShopOrderDataTypeBo!=null"> AND RMA_SHOP_ORDER_DATA_TYPE_BO=#{ew.entity.rmaShopOrderDataTypeBo}</if>
<if test="ew.entity.originalStatusBo!=null"> AND ORIGINAL_STATUS_BO=#{ew.entity.originalStatusBo}</if>
<if test="ew.entity.transferSite!=null"> AND TRANSFER_SITE=#{ew.entity.transferSite}</if>
<if test="ew.entity.transferType!=null"> AND TRANSFER_TYPE=#{ew.entity.transferType}</if>
<if test="ew.entity.lccBo!=null"> AND LCC_BO=#{ew.entity.lccBo}</if>
<if test="ew.entity.shopOrderTypeBo!=null"> AND SHOP_ORDER_TYPE_BO=#{ew.entity.shopOrderTypeBo}</if>
<if test="ew.entity.holdId!=null"> AND HOLD_ID=#{ew.entity.holdId}</if>
<if test="ew.entity.endUnitNumber!=null"> AND END_UNIT_NUMBER=#{ew.entity.endUnitNumber}</if>
<if test="ew.entity.reqSerialChange!=null"> AND REQ_SERIAL_CHANGE=#{ew.entity.reqSerialChange}</if>
<if test="ew.entity.collectParentSerial!=null"> AND COLLECT_PARENT_SERIAL=#{ew.entity.collectParentSerial}</if>
<if test="ew.entity.batchNumber!=null"> AND BATCH_NUMBER=#{ew.entity.batchNumber}</if>
<if test="ew.entity.erpOrder!=null"> AND ERP_ORDER=#{ew.entity.erpOrder}</if>
<if test="ew.entity.erpProductionVersion!=null"> AND ERP_PRODUCTION_VERSION=#{ew.entity.erpProductionVersion}</if>
<if test="ew.entity.erpUnitOfMeasure!=null"> AND ERP_UNIT_OF_MEASURE=#{ew.entity.erpUnitOfMeasure}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.inspectionLot!=null"> AND INSPECTION_LOT=#{ew.entity.inspectionLot}</if>
<if test="ew.entity.inspectionGroupSize!=null"> AND INSPECTION_GROUP_SIZE=#{ew.entity.inspectionGroupSize}</if>
<if test="ew.entity.erpPutawayStorloc!=null"> AND ERP_PUTAWAY_STORLOC=#{ew.entity.erpPutawayStorloc}</if>
<if test="ew.entity.warehouseNumber!=null"> AND WAREHOUSE_NUMBER=#{ew.entity.warehouseNumber}</if>
<if test="ew.entity.underdeliveryTolerance!=null"> AND UNDERDELIVERY_TOLERANCE=#{ew.entity.underdeliveryTolerance}</if>
<if test="ew.entity.overdeliveryTolerance!=null"> AND OVERDELIVERY_TOLERANCE=#{ew.entity.overdeliveryTolerance}</if>
<if test="ew.entity.unlimitedOverdelivery!=null"> AND UNLIMITED_OVERDELIVERY=#{ew.entity.unlimitedOverdelivery}</if>
<if test="ew.entity.minimumDeliveryQty!=null"> AND MINIMUM_DELIVERY_QTY=#{ew.entity.minimumDeliveryQty}</if>
<if test="ew.entity.maximumDeliveryQty!=null"> AND MAXIMUM_DELIVERY_QTY=#{ew.entity.maximumDeliveryQty}</if>
<if test="ew.entity.toleranceDefinedIn!=null"> AND TOLERANCE_DEFINED_IN=#{ew.entity.toleranceDefinedIn}</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 SHOP_ORDER
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.priority!=null"> AND PRIORITY=#{ew.entity.priority}</if>
<if test="ew.entity.plannedWorkCenterBo!=null"> AND PLANNED_WORK_CENTER_BO=#{ew.entity.plannedWorkCenterBo}</if>
<if test="ew.entity.plannedItemBo!=null"> AND PLANNED_ITEM_BO=#{ew.entity.plannedItemBo}</if>
<if test="ew.entity.plannedBomBo!=null"> AND PLANNED_BOM_BO=#{ew.entity.plannedBomBo}</if>
<if test="ew.entity.plannedRouterBo!=null"> AND PLANNED_ROUTER_BO=#{ew.entity.plannedRouterBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.bomBo!=null"> AND BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.qtyToBuild!=null"> AND QTY_TO_BUILD=#{ew.entity.qtyToBuild}</if>
<if test="ew.entity.qtyOrdered!=null"> AND QTY_ORDERED=#{ew.entity.qtyOrdered}</if>
<if test="ew.entity.qtyReleased!=null"> AND QTY_RELEASED=#{ew.entity.qtyReleased}</if>
<if test="ew.entity.releasedDate!=null"> AND RELEASED_DATE=#{ew.entity.releasedDate}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.scheduledStartDate!=null"> AND SCHEDULED_START_DATE=#{ew.entity.scheduledStartDate}</if>
<if test="ew.entity.scheduledCompDate!=null"> AND SCHEDULED_COMP_DATE=#{ew.entity.scheduledCompDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompDate!=null"> AND ACTUAL_COMP_DATE=#{ew.entity.actualCompDate}</if>
<if test="ew.entity.qtyDone!=null"> AND QTY_DONE=#{ew.entity.qtyDone}</if>
<if test="ew.entity.qtyScrapped!=null"> AND QTY_SCRAPPED=#{ew.entity.qtyScrapped}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.customer!=null"> AND CUSTOMER=#{ew.entity.customer}</if>
<if test="ew.entity.customerOrder!=null"> AND CUSTOMER_ORDER=#{ew.entity.customerOrder}</if>
<if test="ew.entity.rmaSfcDataTypeBo!=null"> AND RMA_SFC_DATA_TYPE_BO=#{ew.entity.rmaSfcDataTypeBo}</if>
<if test="ew.entity.rmaShopOrderDataTypeBo!=null"> AND RMA_SHOP_ORDER_DATA_TYPE_BO=#{ew.entity.rmaShopOrderDataTypeBo}</if>
<if test="ew.entity.originalStatusBo!=null"> AND ORIGINAL_STATUS_BO=#{ew.entity.originalStatusBo}</if>
<if test="ew.entity.transferSite!=null"> AND TRANSFER_SITE=#{ew.entity.transferSite}</if>
<if test="ew.entity.transferType!=null"> AND TRANSFER_TYPE=#{ew.entity.transferType}</if>
<if test="ew.entity.lccBo!=null"> AND LCC_BO=#{ew.entity.lccBo}</if>
<if test="ew.entity.shopOrderTypeBo!=null"> AND SHOP_ORDER_TYPE_BO=#{ew.entity.shopOrderTypeBo}</if>
<if test="ew.entity.holdId!=null"> AND HOLD_ID=#{ew.entity.holdId}</if>
<if test="ew.entity.endUnitNumber!=null"> AND END_UNIT_NUMBER=#{ew.entity.endUnitNumber}</if>
<if test="ew.entity.reqSerialChange!=null"> AND REQ_SERIAL_CHANGE=#{ew.entity.reqSerialChange}</if>
<if test="ew.entity.collectParentSerial!=null"> AND COLLECT_PARENT_SERIAL=#{ew.entity.collectParentSerial}</if>
<if test="ew.entity.batchNumber!=null"> AND BATCH_NUMBER=#{ew.entity.batchNumber}</if>
<if test="ew.entity.erpOrder!=null"> AND ERP_ORDER=#{ew.entity.erpOrder}</if>
<if test="ew.entity.erpProductionVersion!=null"> AND ERP_PRODUCTION_VERSION=#{ew.entity.erpProductionVersion}</if>
<if test="ew.entity.erpUnitOfMeasure!=null"> AND ERP_UNIT_OF_MEASURE=#{ew.entity.erpUnitOfMeasure}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.inspectionLot!=null"> AND INSPECTION_LOT=#{ew.entity.inspectionLot}</if>
<if test="ew.entity.inspectionGroupSize!=null"> AND INSPECTION_GROUP_SIZE=#{ew.entity.inspectionGroupSize}</if>
<if test="ew.entity.erpPutawayStorloc!=null"> AND ERP_PUTAWAY_STORLOC=#{ew.entity.erpPutawayStorloc}</if>
<if test="ew.entity.warehouseNumber!=null"> AND WAREHOUSE_NUMBER=#{ew.entity.warehouseNumber}</if>
<if test="ew.entity.underdeliveryTolerance!=null"> AND UNDERDELIVERY_TOLERANCE=#{ew.entity.underdeliveryTolerance}</if>
<if test="ew.entity.overdeliveryTolerance!=null"> AND OVERDELIVERY_TOLERANCE=#{ew.entity.overdeliveryTolerance}</if>
<if test="ew.entity.unlimitedOverdelivery!=null"> AND UNLIMITED_OVERDELIVERY=#{ew.entity.unlimitedOverdelivery}</if>
<if test="ew.entity.minimumDeliveryQty!=null"> AND MINIMUM_DELIVERY_QTY=#{ew.entity.minimumDeliveryQty}</if>
<if test="ew.entity.maximumDeliveryQty!=null"> AND MAXIMUM_DELIVERY_QTY=#{ew.entity.maximumDeliveryQty}</if>
<if test="ew.entity.toleranceDefinedIn!=null"> AND TOLERANCE_DEFINED_IN=#{ew.entity.toleranceDefinedIn}</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 SHOP_ORDER
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.priority!=null"> AND PRIORITY=#{ew.entity.priority}</if>
<if test="ew.entity.plannedWorkCenterBo!=null"> AND PLANNED_WORK_CENTER_BO=#{ew.entity.plannedWorkCenterBo}</if>
<if test="ew.entity.plannedItemBo!=null"> AND PLANNED_ITEM_BO=#{ew.entity.plannedItemBo}</if>
<if test="ew.entity.plannedBomBo!=null"> AND PLANNED_BOM_BO=#{ew.entity.plannedBomBo}</if>
<if test="ew.entity.plannedRouterBo!=null"> AND PLANNED_ROUTER_BO=#{ew.entity.plannedRouterBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.bomBo!=null"> AND BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.qtyToBuild!=null"> AND QTY_TO_BUILD=#{ew.entity.qtyToBuild}</if>
<if test="ew.entity.qtyOrdered!=null"> AND QTY_ORDERED=#{ew.entity.qtyOrdered}</if>
<if test="ew.entity.qtyReleased!=null"> AND QTY_RELEASED=#{ew.entity.qtyReleased}</if>
<if test="ew.entity.releasedDate!=null"> AND RELEASED_DATE=#{ew.entity.releasedDate}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.scheduledStartDate!=null"> AND SCHEDULED_START_DATE=#{ew.entity.scheduledStartDate}</if>
<if test="ew.entity.scheduledCompDate!=null"> AND SCHEDULED_COMP_DATE=#{ew.entity.scheduledCompDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompDate!=null"> AND ACTUAL_COMP_DATE=#{ew.entity.actualCompDate}</if>
<if test="ew.entity.qtyDone!=null"> AND QTY_DONE=#{ew.entity.qtyDone}</if>
<if test="ew.entity.qtyScrapped!=null"> AND QTY_SCRAPPED=#{ew.entity.qtyScrapped}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.customer!=null"> AND CUSTOMER=#{ew.entity.customer}</if>
<if test="ew.entity.customerOrder!=null"> AND CUSTOMER_ORDER=#{ew.entity.customerOrder}</if>
<if test="ew.entity.rmaSfcDataTypeBo!=null"> AND RMA_SFC_DATA_TYPE_BO=#{ew.entity.rmaSfcDataTypeBo}</if>
<if test="ew.entity.rmaShopOrderDataTypeBo!=null"> AND RMA_SHOP_ORDER_DATA_TYPE_BO=#{ew.entity.rmaShopOrderDataTypeBo}</if>
<if test="ew.entity.originalStatusBo!=null"> AND ORIGINAL_STATUS_BO=#{ew.entity.originalStatusBo}</if>
<if test="ew.entity.transferSite!=null"> AND TRANSFER_SITE=#{ew.entity.transferSite}</if>
<if test="ew.entity.transferType!=null"> AND TRANSFER_TYPE=#{ew.entity.transferType}</if>
<if test="ew.entity.lccBo!=null"> AND LCC_BO=#{ew.entity.lccBo}</if>
<if test="ew.entity.shopOrderTypeBo!=null"> AND SHOP_ORDER_TYPE_BO=#{ew.entity.shopOrderTypeBo}</if>
<if test="ew.entity.holdId!=null"> AND HOLD_ID=#{ew.entity.holdId}</if>
<if test="ew.entity.endUnitNumber!=null"> AND END_UNIT_NUMBER=#{ew.entity.endUnitNumber}</if>
<if test="ew.entity.reqSerialChange!=null"> AND REQ_SERIAL_CHANGE=#{ew.entity.reqSerialChange}</if>
<if test="ew.entity.collectParentSerial!=null"> AND COLLECT_PARENT_SERIAL=#{ew.entity.collectParentSerial}</if>
<if test="ew.entity.batchNumber!=null"> AND BATCH_NUMBER=#{ew.entity.batchNumber}</if>
<if test="ew.entity.erpOrder!=null"> AND ERP_ORDER=#{ew.entity.erpOrder}</if>
<if test="ew.entity.erpProductionVersion!=null"> AND ERP_PRODUCTION_VERSION=#{ew.entity.erpProductionVersion}</if>
<if test="ew.entity.erpUnitOfMeasure!=null"> AND ERP_UNIT_OF_MEASURE=#{ew.entity.erpUnitOfMeasure}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.inspectionLot!=null"> AND INSPECTION_LOT=#{ew.entity.inspectionLot}</if>
<if test="ew.entity.inspectionGroupSize!=null"> AND INSPECTION_GROUP_SIZE=#{ew.entity.inspectionGroupSize}</if>
<if test="ew.entity.erpPutawayStorloc!=null"> AND ERP_PUTAWAY_STORLOC=#{ew.entity.erpPutawayStorloc}</if>
<if test="ew.entity.warehouseNumber!=null"> AND WAREHOUSE_NUMBER=#{ew.entity.warehouseNumber}</if>
<if test="ew.entity.underdeliveryTolerance!=null"> AND UNDERDELIVERY_TOLERANCE=#{ew.entity.underdeliveryTolerance}</if>
<if test="ew.entity.overdeliveryTolerance!=null"> AND OVERDELIVERY_TOLERANCE=#{ew.entity.overdeliveryTolerance}</if>
<if test="ew.entity.unlimitedOverdelivery!=null"> AND UNLIMITED_OVERDELIVERY=#{ew.entity.unlimitedOverdelivery}</if>
<if test="ew.entity.minimumDeliveryQty!=null"> AND MINIMUM_DELIVERY_QTY=#{ew.entity.minimumDeliveryQty}</if>
<if test="ew.entity.maximumDeliveryQty!=null"> AND MAXIMUM_DELIVERY_QTY=#{ew.entity.maximumDeliveryQty}</if>
<if test="ew.entity.toleranceDefinedIn!=null"> AND TOLERANCE_DEFINED_IN=#{ew.entity.toleranceDefinedIn}</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 SHOP_ORDER
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.priority!=null"> AND PRIORITY=#{ew.entity.priority}</if>
<if test="ew.entity.plannedWorkCenterBo!=null"> AND PLANNED_WORK_CENTER_BO=#{ew.entity.plannedWorkCenterBo}</if>
<if test="ew.entity.plannedItemBo!=null"> AND PLANNED_ITEM_BO=#{ew.entity.plannedItemBo}</if>
<if test="ew.entity.plannedBomBo!=null"> AND PLANNED_BOM_BO=#{ew.entity.plannedBomBo}</if>
<if test="ew.entity.plannedRouterBo!=null"> AND PLANNED_ROUTER_BO=#{ew.entity.plannedRouterBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.bomBo!=null"> AND BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.qtyToBuild!=null"> AND QTY_TO_BUILD=#{ew.entity.qtyToBuild}</if>
<if test="ew.entity.qtyOrdered!=null"> AND QTY_ORDERED=#{ew.entity.qtyOrdered}</if>
<if test="ew.entity.qtyReleased!=null"> AND QTY_RELEASED=#{ew.entity.qtyReleased}</if>
<if test="ew.entity.releasedDate!=null"> AND RELEASED_DATE=#{ew.entity.releasedDate}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.scheduledStartDate!=null"> AND SCHEDULED_START_DATE=#{ew.entity.scheduledStartDate}</if>
<if test="ew.entity.scheduledCompDate!=null"> AND SCHEDULED_COMP_DATE=#{ew.entity.scheduledCompDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompDate!=null"> AND ACTUAL_COMP_DATE=#{ew.entity.actualCompDate}</if>
<if test="ew.entity.qtyDone!=null"> AND QTY_DONE=#{ew.entity.qtyDone}</if>
<if test="ew.entity.qtyScrapped!=null"> AND QTY_SCRAPPED=#{ew.entity.qtyScrapped}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.customer!=null"> AND CUSTOMER=#{ew.entity.customer}</if>
<if test="ew.entity.customerOrder!=null"> AND CUSTOMER_ORDER=#{ew.entity.customerOrder}</if>
<if test="ew.entity.rmaSfcDataTypeBo!=null"> AND RMA_SFC_DATA_TYPE_BO=#{ew.entity.rmaSfcDataTypeBo}</if>
<if test="ew.entity.rmaShopOrderDataTypeBo!=null"> AND RMA_SHOP_ORDER_DATA_TYPE_BO=#{ew.entity.rmaShopOrderDataTypeBo}</if>
<if test="ew.entity.originalStatusBo!=null"> AND ORIGINAL_STATUS_BO=#{ew.entity.originalStatusBo}</if>
<if test="ew.entity.transferSite!=null"> AND TRANSFER_SITE=#{ew.entity.transferSite}</if>
<if test="ew.entity.transferType!=null"> AND TRANSFER_TYPE=#{ew.entity.transferType}</if>
<if test="ew.entity.lccBo!=null"> AND LCC_BO=#{ew.entity.lccBo}</if>
<if test="ew.entity.shopOrderTypeBo!=null"> AND SHOP_ORDER_TYPE_BO=#{ew.entity.shopOrderTypeBo}</if>
<if test="ew.entity.holdId!=null"> AND HOLD_ID=#{ew.entity.holdId}</if>
<if test="ew.entity.endUnitNumber!=null"> AND END_UNIT_NUMBER=#{ew.entity.endUnitNumber}</if>
<if test="ew.entity.reqSerialChange!=null"> AND REQ_SERIAL_CHANGE=#{ew.entity.reqSerialChange}</if>
<if test="ew.entity.collectParentSerial!=null"> AND COLLECT_PARENT_SERIAL=#{ew.entity.collectParentSerial}</if>
<if test="ew.entity.batchNumber!=null"> AND BATCH_NUMBER=#{ew.entity.batchNumber}</if>
<if test="ew.entity.erpOrder!=null"> AND ERP_ORDER=#{ew.entity.erpOrder}</if>
<if test="ew.entity.erpProductionVersion!=null"> AND ERP_PRODUCTION_VERSION=#{ew.entity.erpProductionVersion}</if>
<if test="ew.entity.erpUnitOfMeasure!=null"> AND ERP_UNIT_OF_MEASURE=#{ew.entity.erpUnitOfMeasure}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.inspectionLot!=null"> AND INSPECTION_LOT=#{ew.entity.inspectionLot}</if>
<if test="ew.entity.inspectionGroupSize!=null"> AND INSPECTION_GROUP_SIZE=#{ew.entity.inspectionGroupSize}</if>
<if test="ew.entity.erpPutawayStorloc!=null"> AND ERP_PUTAWAY_STORLOC=#{ew.entity.erpPutawayStorloc}</if>
<if test="ew.entity.warehouseNumber!=null"> AND WAREHOUSE_NUMBER=#{ew.entity.warehouseNumber}</if>
<if test="ew.entity.underdeliveryTolerance!=null"> AND UNDERDELIVERY_TOLERANCE=#{ew.entity.underdeliveryTolerance}</if>
<if test="ew.entity.overdeliveryTolerance!=null"> AND OVERDELIVERY_TOLERANCE=#{ew.entity.overdeliveryTolerance}</if>
<if test="ew.entity.unlimitedOverdelivery!=null"> AND UNLIMITED_OVERDELIVERY=#{ew.entity.unlimitedOverdelivery}</if>
<if test="ew.entity.minimumDeliveryQty!=null"> AND MINIMUM_DELIVERY_QTY=#{ew.entity.minimumDeliveryQty}</if>
<if test="ew.entity.maximumDeliveryQty!=null"> AND MAXIMUM_DELIVERY_QTY=#{ew.entity.maximumDeliveryQty}</if>
<if test="ew.entity.toleranceDefinedIn!=null"> AND TOLERANCE_DEFINED_IN=#{ew.entity.toleranceDefinedIn}</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 SHOP_ORDER
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.priority!=null"> AND PRIORITY=#{ew.entity.priority}</if>
<if test="ew.entity.plannedWorkCenterBo!=null"> AND PLANNED_WORK_CENTER_BO=#{ew.entity.plannedWorkCenterBo}</if>
<if test="ew.entity.plannedItemBo!=null"> AND PLANNED_ITEM_BO=#{ew.entity.plannedItemBo}</if>
<if test="ew.entity.plannedBomBo!=null"> AND PLANNED_BOM_BO=#{ew.entity.plannedBomBo}</if>
<if test="ew.entity.plannedRouterBo!=null"> AND PLANNED_ROUTER_BO=#{ew.entity.plannedRouterBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.bomBo!=null"> AND BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.qtyToBuild!=null"> AND QTY_TO_BUILD=#{ew.entity.qtyToBuild}</if>
<if test="ew.entity.qtyOrdered!=null"> AND QTY_ORDERED=#{ew.entity.qtyOrdered}</if>
<if test="ew.entity.qtyReleased!=null"> AND QTY_RELEASED=#{ew.entity.qtyReleased}</if>
<if test="ew.entity.releasedDate!=null"> AND RELEASED_DATE=#{ew.entity.releasedDate}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.scheduledStartDate!=null"> AND SCHEDULED_START_DATE=#{ew.entity.scheduledStartDate}</if>
<if test="ew.entity.scheduledCompDate!=null"> AND SCHEDULED_COMP_DATE=#{ew.entity.scheduledCompDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompDate!=null"> AND ACTUAL_COMP_DATE=#{ew.entity.actualCompDate}</if>
<if test="ew.entity.qtyDone!=null"> AND QTY_DONE=#{ew.entity.qtyDone}</if>
<if test="ew.entity.qtyScrapped!=null"> AND QTY_SCRAPPED=#{ew.entity.qtyScrapped}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.customer!=null"> AND CUSTOMER=#{ew.entity.customer}</if>
<if test="ew.entity.customerOrder!=null"> AND CUSTOMER_ORDER=#{ew.entity.customerOrder}</if>
<if test="ew.entity.rmaSfcDataTypeBo!=null"> AND RMA_SFC_DATA_TYPE_BO=#{ew.entity.rmaSfcDataTypeBo}</if>
<if test="ew.entity.rmaShopOrderDataTypeBo!=null"> AND RMA_SHOP_ORDER_DATA_TYPE_BO=#{ew.entity.rmaShopOrderDataTypeBo}</if>
<if test="ew.entity.originalStatusBo!=null"> AND ORIGINAL_STATUS_BO=#{ew.entity.originalStatusBo}</if>
<if test="ew.entity.transferSite!=null"> AND TRANSFER_SITE=#{ew.entity.transferSite}</if>
<if test="ew.entity.transferType!=null"> AND TRANSFER_TYPE=#{ew.entity.transferType}</if>
<if test="ew.entity.lccBo!=null"> AND LCC_BO=#{ew.entity.lccBo}</if>
<if test="ew.entity.shopOrderTypeBo!=null"> AND SHOP_ORDER_TYPE_BO=#{ew.entity.shopOrderTypeBo}</if>
<if test="ew.entity.holdId!=null"> AND HOLD_ID=#{ew.entity.holdId}</if>
<if test="ew.entity.endUnitNumber!=null"> AND END_UNIT_NUMBER=#{ew.entity.endUnitNumber}</if>
<if test="ew.entity.reqSerialChange!=null"> AND REQ_SERIAL_CHANGE=#{ew.entity.reqSerialChange}</if>
<if test="ew.entity.collectParentSerial!=null"> AND COLLECT_PARENT_SERIAL=#{ew.entity.collectParentSerial}</if>
<if test="ew.entity.batchNumber!=null"> AND BATCH_NUMBER=#{ew.entity.batchNumber}</if>
<if test="ew.entity.erpOrder!=null"> AND ERP_ORDER=#{ew.entity.erpOrder}</if>
<if test="ew.entity.erpProductionVersion!=null"> AND ERP_PRODUCTION_VERSION=#{ew.entity.erpProductionVersion}</if>
<if test="ew.entity.erpUnitOfMeasure!=null"> AND ERP_UNIT_OF_MEASURE=#{ew.entity.erpUnitOfMeasure}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.inspectionLot!=null"> AND INSPECTION_LOT=#{ew.entity.inspectionLot}</if>
<if test="ew.entity.inspectionGroupSize!=null"> AND INSPECTION_GROUP_SIZE=#{ew.entity.inspectionGroupSize}</if>
<if test="ew.entity.erpPutawayStorloc!=null"> AND ERP_PUTAWAY_STORLOC=#{ew.entity.erpPutawayStorloc}</if>
<if test="ew.entity.warehouseNumber!=null"> AND WAREHOUSE_NUMBER=#{ew.entity.warehouseNumber}</if>
<if test="ew.entity.underdeliveryTolerance!=null"> AND UNDERDELIVERY_TOLERANCE=#{ew.entity.underdeliveryTolerance}</if>
<if test="ew.entity.overdeliveryTolerance!=null"> AND OVERDELIVERY_TOLERANCE=#{ew.entity.overdeliveryTolerance}</if>
<if test="ew.entity.unlimitedOverdelivery!=null"> AND UNLIMITED_OVERDELIVERY=#{ew.entity.unlimitedOverdelivery}</if>
<if test="ew.entity.minimumDeliveryQty!=null"> AND MINIMUM_DELIVERY_QTY=#{ew.entity.minimumDeliveryQty}</if>
<if test="ew.entity.maximumDeliveryQty!=null"> AND MAXIMUM_DELIVERY_QTY=#{ew.entity.maximumDeliveryQty}</if>
<if test="ew.entity.toleranceDefinedIn!=null"> AND TOLERANCE_DEFINED_IN=#{ew.entity.toleranceDefinedIn}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
AND ${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
AND ${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 SHOP_ORDER
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.priority!=null"> AND PRIORITY=#{ew.entity.priority}</if>
<if test="ew.entity.plannedWorkCenterBo!=null"> AND PLANNED_WORK_CENTER_BO=#{ew.entity.plannedWorkCenterBo}</if>
<if test="ew.entity.plannedItemBo!=null"> AND PLANNED_ITEM_BO=#{ew.entity.plannedItemBo}</if>
<if test="ew.entity.plannedBomBo!=null"> AND PLANNED_BOM_BO=#{ew.entity.plannedBomBo}</if>
<if test="ew.entity.plannedRouterBo!=null"> AND PLANNED_ROUTER_BO=#{ew.entity.plannedRouterBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.bomBo!=null"> AND BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.qtyToBuild!=null"> AND QTY_TO_BUILD=#{ew.entity.qtyToBuild}</if>
<if test="ew.entity.qtyOrdered!=null"> AND QTY_ORDERED=#{ew.entity.qtyOrdered}</if>
<if test="ew.entity.qtyReleased!=null"> AND QTY_RELEASED=#{ew.entity.qtyReleased}</if>
<if test="ew.entity.releasedDate!=null"> AND RELEASED_DATE=#{ew.entity.releasedDate}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.scheduledStartDate!=null"> AND SCHEDULED_START_DATE=#{ew.entity.scheduledStartDate}</if>
<if test="ew.entity.scheduledCompDate!=null"> AND SCHEDULED_COMP_DATE=#{ew.entity.scheduledCompDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompDate!=null"> AND ACTUAL_COMP_DATE=#{ew.entity.actualCompDate}</if>
<if test="ew.entity.qtyDone!=null"> AND QTY_DONE=#{ew.entity.qtyDone}</if>
<if test="ew.entity.qtyScrapped!=null"> AND QTY_SCRAPPED=#{ew.entity.qtyScrapped}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.customer!=null"> AND CUSTOMER=#{ew.entity.customer}</if>
<if test="ew.entity.customerOrder!=null"> AND CUSTOMER_ORDER=#{ew.entity.customerOrder}</if>
<if test="ew.entity.rmaSfcDataTypeBo!=null"> AND RMA_SFC_DATA_TYPE_BO=#{ew.entity.rmaSfcDataTypeBo}</if>
<if test="ew.entity.rmaShopOrderDataTypeBo!=null"> AND RMA_SHOP_ORDER_DATA_TYPE_BO=#{ew.entity.rmaShopOrderDataTypeBo}</if>
<if test="ew.entity.originalStatusBo!=null"> AND ORIGINAL_STATUS_BO=#{ew.entity.originalStatusBo}</if>
<if test="ew.entity.transferSite!=null"> AND TRANSFER_SITE=#{ew.entity.transferSite}</if>
<if test="ew.entity.transferType!=null"> AND TRANSFER_TYPE=#{ew.entity.transferType}</if>
<if test="ew.entity.lccBo!=null"> AND LCC_BO=#{ew.entity.lccBo}</if>
<if test="ew.entity.shopOrderTypeBo!=null"> AND SHOP_ORDER_TYPE_BO=#{ew.entity.shopOrderTypeBo}</if>
<if test="ew.entity.holdId!=null"> AND HOLD_ID=#{ew.entity.holdId}</if>
<if test="ew.entity.endUnitNumber!=null"> AND END_UNIT_NUMBER=#{ew.entity.endUnitNumber}</if>
<if test="ew.entity.reqSerialChange!=null"> AND REQ_SERIAL_CHANGE=#{ew.entity.reqSerialChange}</if>
<if test="ew.entity.collectParentSerial!=null"> AND COLLECT_PARENT_SERIAL=#{ew.entity.collectParentSerial}</if>
<if test="ew.entity.batchNumber!=null"> AND BATCH_NUMBER=#{ew.entity.batchNumber}</if>
<if test="ew.entity.erpOrder!=null"> AND ERP_ORDER=#{ew.entity.erpOrder}</if>
<if test="ew.entity.erpProductionVersion!=null"> AND ERP_PRODUCTION_VERSION=#{ew.entity.erpProductionVersion}</if>
<if test="ew.entity.erpUnitOfMeasure!=null"> AND ERP_UNIT_OF_MEASURE=#{ew.entity.erpUnitOfMeasure}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.inspectionLot!=null"> AND INSPECTION_LOT=#{ew.entity.inspectionLot}</if>
<if test="ew.entity.inspectionGroupSize!=null"> AND INSPECTION_GROUP_SIZE=#{ew.entity.inspectionGroupSize}</if>
<if test="ew.entity.erpPutawayStorloc!=null"> AND ERP_PUTAWAY_STORLOC=#{ew.entity.erpPutawayStorloc}</if>
<if test="ew.entity.warehouseNumber!=null"> AND WAREHOUSE_NUMBER=#{ew.entity.warehouseNumber}</if>
<if test="ew.entity.underdeliveryTolerance!=null"> AND UNDERDELIVERY_TOLERANCE=#{ew.entity.underdeliveryTolerance}</if>
<if test="ew.entity.overdeliveryTolerance!=null"> AND OVERDELIVERY_TOLERANCE=#{ew.entity.overdeliveryTolerance}</if>
<if test="ew.entity.unlimitedOverdelivery!=null"> AND UNLIMITED_OVERDELIVERY=#{ew.entity.unlimitedOverdelivery}</if>
<if test="ew.entity.minimumDeliveryQty!=null"> AND MINIMUM_DELIVERY_QTY=#{ew.entity.minimumDeliveryQty}</if>
<if test="ew.entity.maximumDeliveryQty!=null"> AND MAXIMUM_DELIVERY_QTY=#{ew.entity.maximumDeliveryQty}</if>
<if test="ew.entity.toleranceDefinedIn!=null"> AND TOLERANCE_DEFINED_IN=#{ew.entity.toleranceDefinedIn}</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.meapi.model.ShopOrder">
INSERT INTO SHOP_ORDER
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="changeStamp!=null">CHANGE_STAMP,</if>
<if test="site!=null">SITE,</if>
<if test="shopOrder!=null">SHOP_ORDER,</if>
<if test="statusBo!=null">STATUS_BO,</if>
<if test="priority!=null">PRIORITY,</if>
<if test="plannedWorkCenterBo!=null">PLANNED_WORK_CENTER_BO,</if>
<if test="plannedItemBo!=null">PLANNED_ITEM_BO,</if>
<if test="plannedBomBo!=null">PLANNED_BOM_BO,</if>
<if test="plannedRouterBo!=null">PLANNED_ROUTER_BO,</if>
<if test="itemBo!=null">ITEM_BO,</if>
<if test="bomBo!=null">BOM_BO,</if>
<if test="routerBo!=null">ROUTER_BO,</if>
<if test="qtyToBuild!=null">QTY_TO_BUILD,</if>
<if test="qtyOrdered!=null">QTY_ORDERED,</if>
<if test="qtyReleased!=null">QTY_RELEASED,</if>
<if test="releasedDate!=null">RELEASED_DATE,</if>
<if test="plannedStartDate!=null">PLANNED_START_DATE,</if>
<if test="plannedCompDate!=null">PLANNED_COMP_DATE,</if>
<if test="scheduledStartDate!=null">SCHEDULED_START_DATE,</if>
<if test="scheduledCompDate!=null">SCHEDULED_COMP_DATE,</if>
<if test="actualStartDate!=null">ACTUAL_START_DATE,</if>
<if test="actualCompDate!=null">ACTUAL_COMP_DATE,</if>
<if test="qtyDone!=null">QTY_DONE,</if>
<if test="qtyScrapped!=null">QTY_SCRAPPED,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
<if test="customer!=null">CUSTOMER,</if>
<if test="customerOrder!=null">CUSTOMER_ORDER,</if>
<if test="rmaSfcDataTypeBo!=null">RMA_SFC_DATA_TYPE_BO,</if>
<if test="rmaShopOrderDataTypeBo!=null">RMA_SHOP_ORDER_DATA_TYPE_BO,</if>
<if test="originalStatusBo!=null">ORIGINAL_STATUS_BO,</if>
<if test="transferSite!=null">TRANSFER_SITE,</if>
<if test="transferType!=null">TRANSFER_TYPE,</if>
<if test="lccBo!=null">LCC_BO,</if>
<if test="shopOrderTypeBo!=null">SHOP_ORDER_TYPE_BO,</if>
<if test="holdId!=null">HOLD_ID,</if>
<if test="endUnitNumber!=null">END_UNIT_NUMBER,</if>
<if test="reqSerialChange!=null">REQ_SERIAL_CHANGE,</if>
<if test="collectParentSerial!=null">COLLECT_PARENT_SERIAL,</if>
<if test="batchNumber!=null">BATCH_NUMBER,</if>
<if test="erpOrder!=null">ERP_ORDER,</if>
<if test="erpProductionVersion!=null">ERP_PRODUCTION_VERSION,</if>
<if test="erpUnitOfMeasure!=null">ERP_UNIT_OF_MEASURE,</if>
<if test="partitionDate!=null">PARTITION_DATE,</if>
<if test="inspectionLot!=null">INSPECTION_LOT,</if>
<if test="inspectionGroupSize!=null">INSPECTION_GROUP_SIZE,</if>
<if test="erpPutawayStorloc!=null">ERP_PUTAWAY_STORLOC,</if>
<if test="warehouseNumber!=null">WAREHOUSE_NUMBER,</if>
<if test="underdeliveryTolerance!=null">UNDERDELIVERY_TOLERANCE,</if>
<if test="overdeliveryTolerance!=null">OVERDELIVERY_TOLERANCE,</if>
<if test="unlimitedOverdelivery!=null">UNLIMITED_OVERDELIVERY,</if>
<if test="minimumDeliveryQty!=null">MINIMUM_DELIVERY_QTY,</if>
<if test="maximumDeliveryQty!=null">MAXIMUM_DELIVERY_QTY,</if>
<if test="toleranceDefinedIn!=null">TOLERANCE_DEFINED_IN,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="changeStamp!=null">#{changeStamp},</if>
<if test="site!=null">#{site},</if>
<if test="shopOrder!=null">#{shopOrder},</if>
<if test="statusBo!=null">#{statusBo},</if>
<if test="priority!=null">#{priority},</if>
<if test="plannedWorkCenterBo!=null">#{plannedWorkCenterBo},</if>
<if test="plannedItemBo!=null">#{plannedItemBo},</if>
<if test="plannedBomBo!=null">#{plannedBomBo},</if>
<if test="plannedRouterBo!=null">#{plannedRouterBo},</if>
<if test="itemBo!=null">#{itemBo},</if>
<if test="bomBo!=null">#{bomBo},</if>
<if test="routerBo!=null">#{routerBo},</if>
<if test="qtyToBuild!=null">#{qtyToBuild},</if>
<if test="qtyOrdered!=null">#{qtyOrdered},</if>
<if test="qtyReleased!=null">#{qtyReleased},</if>
<if test="releasedDate!=null">#{releasedDate},</if>
<if test="plannedStartDate!=null">#{plannedStartDate},</if>
<if test="plannedCompDate!=null">#{plannedCompDate},</if>
<if test="scheduledStartDate!=null">#{scheduledStartDate},</if>
<if test="scheduledCompDate!=null">#{scheduledCompDate},</if>
<if test="actualStartDate!=null">#{actualStartDate},</if>
<if test="actualCompDate!=null">#{actualCompDate},</if>
<if test="qtyDone!=null">#{qtyDone},</if>
<if test="qtyScrapped!=null">#{qtyScrapped},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
<if test="customer!=null">#{customer},</if>
<if test="customerOrder!=null">#{customerOrder},</if>
<if test="rmaSfcDataTypeBo!=null">#{rmaSfcDataTypeBo},</if>
<if test="rmaShopOrderDataTypeBo!=null">#{rmaShopOrderDataTypeBo},</if>
<if test="originalStatusBo!=null">#{originalStatusBo},</if>
<if test="transferSite!=null">#{transferSite},</if>
<if test="transferType!=null">#{transferType},</if>
<if test="lccBo!=null">#{lccBo},</if>
<if test="shopOrderTypeBo!=null">#{shopOrderTypeBo},</if>
<if test="holdId!=null">#{holdId},</if>
<if test="endUnitNumber!=null">#{endUnitNumber},</if>
<if test="reqSerialChange!=null">#{reqSerialChange},</if>
<if test="collectParentSerial!=null">#{collectParentSerial},</if>
<if test="batchNumber!=null">#{batchNumber},</if>
<if test="erpOrder!=null">#{erpOrder},</if>
<if test="erpProductionVersion!=null">#{erpProductionVersion},</if>
<if test="erpUnitOfMeasure!=null">#{erpUnitOfMeasure},</if>
<if test="partitionDate!=null">#{partitionDate},</if>
<if test="inspectionLot!=null">#{inspectionLot},</if>
<if test="inspectionGroupSize!=null">#{inspectionGroupSize},</if>
<if test="erpPutawayStorloc!=null">#{erpPutawayStorloc},</if>
<if test="warehouseNumber!=null">#{warehouseNumber},</if>
<if test="underdeliveryTolerance!=null">#{underdeliveryTolerance},</if>
<if test="overdeliveryTolerance!=null">#{overdeliveryTolerance},</if>
<if test="unlimitedOverdelivery!=null">#{unlimitedOverdelivery},</if>
<if test="minimumDeliveryQty!=null">#{minimumDeliveryQty},</if>
<if test="maximumDeliveryQty!=null">#{maximumDeliveryQty},</if>
<if test="toleranceDefinedIn!=null">#{toleranceDefinedIn},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.ShopOrder">
INSERT INTO SHOP_ORDER
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{changeStamp},
#{site},
#{shopOrder},
#{statusBo},
#{priority},
#{plannedWorkCenterBo},
#{plannedItemBo},
#{plannedBomBo},
#{plannedRouterBo},
#{itemBo},
#{bomBo},
#{routerBo},
#{qtyToBuild},
#{qtyOrdered},
#{qtyReleased},
#{releasedDate},
#{plannedStartDate},
#{plannedCompDate},
#{scheduledStartDate},
#{scheduledCompDate},
#{actualStartDate},
#{actualCompDate},
#{qtyDone},
#{qtyScrapped},
#{createdDateTime},
#{modifiedDateTime},
#{customer},
#{customerOrder},
#{rmaSfcDataTypeBo},
#{rmaShopOrderDataTypeBo},
#{originalStatusBo},
#{transferSite},
#{transferType},
#{lccBo},
#{shopOrderTypeBo},
#{holdId},
#{endUnitNumber},
#{reqSerialChange},
#{collectParentSerial},
#{batchNumber},
#{erpOrder},
#{erpProductionVersion},
#{erpUnitOfMeasure},
#{partitionDate},
#{inspectionLot},
#{inspectionGroupSize},
#{erpPutawayStorloc},
#{warehouseNumber},
#{underdeliveryTolerance},
#{overdeliveryTolerance},
#{unlimitedOverdelivery},
#{minimumDeliveryQty},
#{maximumDeliveryQty},
#{toleranceDefinedIn},
</trim>
</insert>
<update id="update">
UPDATE SHOP_ORDER <trim prefix="SET" suffixOverrides=",">
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
<if test="et.changeStamp!=null">CHANGE_STAMP=#{et.changeStamp},</if>
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
<if test="et.statusBo!=null">STATUS_BO=#{et.statusBo},</if>
<if test="et.priority!=null">PRIORITY=#{et.priority},</if>
<if test="et.plannedWorkCenterBo!=null">PLANNED_WORK_CENTER_BO=#{et.plannedWorkCenterBo},</if>
<if test="et.plannedItemBo!=null">PLANNED_ITEM_BO=#{et.plannedItemBo},</if>
<if test="et.plannedBomBo!=null">PLANNED_BOM_BO=#{et.plannedBomBo},</if>
<if test="et.plannedRouterBo!=null">PLANNED_ROUTER_BO=#{et.plannedRouterBo},</if>
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.bomBo!=null">BOM_BO=#{et.bomBo},</if>
<if test="et.routerBo!=null">ROUTER_BO=#{et.routerBo},</if>
<if test="et.qtyToBuild!=null">QTY_TO_BUILD=#{et.qtyToBuild},</if>
<if test="et.qtyOrdered!=null">QTY_ORDERED=#{et.qtyOrdered},</if>
<if test="et.qtyReleased!=null">QTY_RELEASED=#{et.qtyReleased},</if>
<if test="et.releasedDate!=null">RELEASED_DATE=#{et.releasedDate},</if>
<if test="et.plannedStartDate!=null">PLANNED_START_DATE=#{et.plannedStartDate},</if>
<if test="et.plannedCompDate!=null">PLANNED_COMP_DATE=#{et.plannedCompDate},</if>
<if test="et.scheduledStartDate!=null">SCHEDULED_START_DATE=#{et.scheduledStartDate},</if>
<if test="et.scheduledCompDate!=null">SCHEDULED_COMP_DATE=#{et.scheduledCompDate},</if>
<if test="et.actualStartDate!=null">ACTUAL_START_DATE=#{et.actualStartDate},</if>
<if test="et.actualCompDate!=null">ACTUAL_COMP_DATE=#{et.actualCompDate},</if>
<if test="et.qtyDone!=null">QTY_DONE=#{et.qtyDone},</if>
<if test="et.qtyScrapped!=null">QTY_SCRAPPED=#{et.qtyScrapped},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
<if test="et.customer!=null">CUSTOMER=#{et.customer},</if>
<if test="et.customerOrder!=null">CUSTOMER_ORDER=#{et.customerOrder},</if>
<if test="et.rmaSfcDataTypeBo!=null">RMA_SFC_DATA_TYPE_BO=#{et.rmaSfcDataTypeBo},</if>
<if test="et.rmaShopOrderDataTypeBo!=null">RMA_SHOP_ORDER_DATA_TYPE_BO=#{et.rmaShopOrderDataTypeBo},</if>
<if test="et.originalStatusBo!=null">ORIGINAL_STATUS_BO=#{et.originalStatusBo},</if>
<if test="et.transferSite!=null">TRANSFER_SITE=#{et.transferSite},</if>
<if test="et.transferType!=null">TRANSFER_TYPE=#{et.transferType},</if>
<if test="et.lccBo!=null">LCC_BO=#{et.lccBo},</if>
<if test="et.shopOrderTypeBo!=null">SHOP_ORDER_TYPE_BO=#{et.shopOrderTypeBo},</if>
<if test="et.holdId!=null">HOLD_ID=#{et.holdId},</if>
<if test="et.endUnitNumber!=null">END_UNIT_NUMBER=#{et.endUnitNumber},</if>
<if test="et.reqSerialChange!=null">REQ_SERIAL_CHANGE=#{et.reqSerialChange},</if>
<if test="et.collectParentSerial!=null">COLLECT_PARENT_SERIAL=#{et.collectParentSerial},</if>
<if test="et.batchNumber!=null">BATCH_NUMBER=#{et.batchNumber},</if>
<if test="et.erpOrder!=null">ERP_ORDER=#{et.erpOrder},</if>
<if test="et.erpProductionVersion!=null">ERP_PRODUCTION_VERSION=#{et.erpProductionVersion},</if>
<if test="et.erpUnitOfMeasure!=null">ERP_UNIT_OF_MEASURE=#{et.erpUnitOfMeasure},</if>
<if test="et.partitionDate!=null">PARTITION_DATE=#{et.partitionDate},</if>
<if test="et.inspectionLot!=null">INSPECTION_LOT=#{et.inspectionLot},</if>
<if test="et.inspectionGroupSize!=null">INSPECTION_GROUP_SIZE=#{et.inspectionGroupSize},</if>
<if test="et.erpPutawayStorloc!=null">ERP_PUTAWAY_STORLOC=#{et.erpPutawayStorloc},</if>
<if test="et.warehouseNumber!=null">WAREHOUSE_NUMBER=#{et.warehouseNumber},</if>
<if test="et.underdeliveryTolerance!=null">UNDERDELIVERY_TOLERANCE=#{et.underdeliveryTolerance},</if>
<if test="et.overdeliveryTolerance!=null">OVERDELIVERY_TOLERANCE=#{et.overdeliveryTolerance},</if>
<if test="et.unlimitedOverdelivery!=null">UNLIMITED_OVERDELIVERY=#{et.unlimitedOverdelivery},</if>
<if test="et.minimumDeliveryQty!=null">MINIMUM_DELIVERY_QTY=#{et.minimumDeliveryQty},</if>
<if test="et.maximumDeliveryQty!=null">MAXIMUM_DELIVERY_QTY=#{et.maximumDeliveryQty},</if>
<if test="et.toleranceDefinedIn!=null">TOLERANCE_DEFINED_IN=#{et.toleranceDefinedIn},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.priority!=null"> AND PRIORITY=#{ew.entity.priority}</if>
<if test="ew.entity.plannedWorkCenterBo!=null"> AND PLANNED_WORK_CENTER_BO=#{ew.entity.plannedWorkCenterBo}</if>
<if test="ew.entity.plannedItemBo!=null"> AND PLANNED_ITEM_BO=#{ew.entity.plannedItemBo}</if>
<if test="ew.entity.plannedBomBo!=null"> AND PLANNED_BOM_BO=#{ew.entity.plannedBomBo}</if>
<if test="ew.entity.plannedRouterBo!=null"> AND PLANNED_ROUTER_BO=#{ew.entity.plannedRouterBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.bomBo!=null"> AND BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.qtyToBuild!=null"> AND QTY_TO_BUILD=#{ew.entity.qtyToBuild}</if>
<if test="ew.entity.qtyOrdered!=null"> AND QTY_ORDERED=#{ew.entity.qtyOrdered}</if>
<if test="ew.entity.qtyReleased!=null"> AND QTY_RELEASED=#{ew.entity.qtyReleased}</if>
<if test="ew.entity.releasedDate!=null"> AND RELEASED_DATE=#{ew.entity.releasedDate}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.scheduledStartDate!=null"> AND SCHEDULED_START_DATE=#{ew.entity.scheduledStartDate}</if>
<if test="ew.entity.scheduledCompDate!=null"> AND SCHEDULED_COMP_DATE=#{ew.entity.scheduledCompDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompDate!=null"> AND ACTUAL_COMP_DATE=#{ew.entity.actualCompDate}</if>
<if test="ew.entity.qtyDone!=null"> AND QTY_DONE=#{ew.entity.qtyDone}</if>
<if test="ew.entity.qtyScrapped!=null"> AND QTY_SCRAPPED=#{ew.entity.qtyScrapped}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.customer!=null"> AND CUSTOMER=#{ew.entity.customer}</if>
<if test="ew.entity.customerOrder!=null"> AND CUSTOMER_ORDER=#{ew.entity.customerOrder}</if>
<if test="ew.entity.rmaSfcDataTypeBo!=null"> AND RMA_SFC_DATA_TYPE_BO=#{ew.entity.rmaSfcDataTypeBo}</if>
<if test="ew.entity.rmaShopOrderDataTypeBo!=null"> AND RMA_SHOP_ORDER_DATA_TYPE_BO=#{ew.entity.rmaShopOrderDataTypeBo}</if>
<if test="ew.entity.originalStatusBo!=null"> AND ORIGINAL_STATUS_BO=#{ew.entity.originalStatusBo}</if>
<if test="ew.entity.transferSite!=null"> AND TRANSFER_SITE=#{ew.entity.transferSite}</if>
<if test="ew.entity.transferType!=null"> AND TRANSFER_TYPE=#{ew.entity.transferType}</if>
<if test="ew.entity.lccBo!=null"> AND LCC_BO=#{ew.entity.lccBo}</if>
<if test="ew.entity.shopOrderTypeBo!=null"> AND SHOP_ORDER_TYPE_BO=#{ew.entity.shopOrderTypeBo}</if>
<if test="ew.entity.holdId!=null"> AND HOLD_ID=#{ew.entity.holdId}</if>
<if test="ew.entity.endUnitNumber!=null"> AND END_UNIT_NUMBER=#{ew.entity.endUnitNumber}</if>
<if test="ew.entity.reqSerialChange!=null"> AND REQ_SERIAL_CHANGE=#{ew.entity.reqSerialChange}</if>
<if test="ew.entity.collectParentSerial!=null"> AND COLLECT_PARENT_SERIAL=#{ew.entity.collectParentSerial}</if>
<if test="ew.entity.batchNumber!=null"> AND BATCH_NUMBER=#{ew.entity.batchNumber}</if>
<if test="ew.entity.erpOrder!=null"> AND ERP_ORDER=#{ew.entity.erpOrder}</if>
<if test="ew.entity.erpProductionVersion!=null"> AND ERP_PRODUCTION_VERSION=#{ew.entity.erpProductionVersion}</if>
<if test="ew.entity.erpUnitOfMeasure!=null"> AND ERP_UNIT_OF_MEASURE=#{ew.entity.erpUnitOfMeasure}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.inspectionLot!=null"> AND INSPECTION_LOT=#{ew.entity.inspectionLot}</if>
<if test="ew.entity.inspectionGroupSize!=null"> AND INSPECTION_GROUP_SIZE=#{ew.entity.inspectionGroupSize}</if>
<if test="ew.entity.erpPutawayStorloc!=null"> AND ERP_PUTAWAY_STORLOC=#{ew.entity.erpPutawayStorloc}</if>
<if test="ew.entity.warehouseNumber!=null"> AND WAREHOUSE_NUMBER=#{ew.entity.warehouseNumber}</if>
<if test="ew.entity.underdeliveryTolerance!=null"> AND UNDERDELIVERY_TOLERANCE=#{ew.entity.underdeliveryTolerance}</if>
<if test="ew.entity.overdeliveryTolerance!=null"> AND OVERDELIVERY_TOLERANCE=#{ew.entity.overdeliveryTolerance}</if>
<if test="ew.entity.unlimitedOverdelivery!=null"> AND UNLIMITED_OVERDELIVERY=#{ew.entity.unlimitedOverdelivery}</if>
<if test="ew.entity.minimumDeliveryQty!=null"> AND MINIMUM_DELIVERY_QTY=#{ew.entity.minimumDeliveryQty}</if>
<if test="ew.entity.maximumDeliveryQty!=null"> AND MAXIMUM_DELIVERY_QTY=#{ew.entity.maximumDeliveryQty}</if>
<if test="ew.entity.toleranceDefinedIn!=null"> AND TOLERANCE_DEFINED_IN=#{ew.entity.toleranceDefinedIn}</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="deleteByMap">
DELETE FROM SHOP_ORDER
<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 SHOP_ORDER
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.priority!=null"> AND PRIORITY=#{ew.entity.priority}</if>
<if test="ew.entity.plannedWorkCenterBo!=null"> AND PLANNED_WORK_CENTER_BO=#{ew.entity.plannedWorkCenterBo}</if>
<if test="ew.entity.plannedItemBo!=null"> AND PLANNED_ITEM_BO=#{ew.entity.plannedItemBo}</if>
<if test="ew.entity.plannedBomBo!=null"> AND PLANNED_BOM_BO=#{ew.entity.plannedBomBo}</if>
<if test="ew.entity.plannedRouterBo!=null"> AND PLANNED_ROUTER_BO=#{ew.entity.plannedRouterBo}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.bomBo!=null"> AND BOM_BO=#{ew.entity.bomBo}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.qtyToBuild!=null"> AND QTY_TO_BUILD=#{ew.entity.qtyToBuild}</if>
<if test="ew.entity.qtyOrdered!=null"> AND QTY_ORDERED=#{ew.entity.qtyOrdered}</if>
<if test="ew.entity.qtyReleased!=null"> AND QTY_RELEASED=#{ew.entity.qtyReleased}</if>
<if test="ew.entity.releasedDate!=null"> AND RELEASED_DATE=#{ew.entity.releasedDate}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.scheduledStartDate!=null"> AND SCHEDULED_START_DATE=#{ew.entity.scheduledStartDate}</if>
<if test="ew.entity.scheduledCompDate!=null"> AND SCHEDULED_COMP_DATE=#{ew.entity.scheduledCompDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompDate!=null"> AND ACTUAL_COMP_DATE=#{ew.entity.actualCompDate}</if>
<if test="ew.entity.qtyDone!=null"> AND QTY_DONE=#{ew.entity.qtyDone}</if>
<if test="ew.entity.qtyScrapped!=null"> AND QTY_SCRAPPED=#{ew.entity.qtyScrapped}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.customer!=null"> AND CUSTOMER=#{ew.entity.customer}</if>
<if test="ew.entity.customerOrder!=null"> AND CUSTOMER_ORDER=#{ew.entity.customerOrder}</if>
<if test="ew.entity.rmaSfcDataTypeBo!=null"> AND RMA_SFC_DATA_TYPE_BO=#{ew.entity.rmaSfcDataTypeBo}</if>
<if test="ew.entity.rmaShopOrderDataTypeBo!=null"> AND RMA_SHOP_ORDER_DATA_TYPE_BO=#{ew.entity.rmaShopOrderDataTypeBo}</if>
<if test="ew.entity.originalStatusBo!=null"> AND ORIGINAL_STATUS_BO=#{ew.entity.originalStatusBo}</if>
<if test="ew.entity.transferSite!=null"> AND TRANSFER_SITE=#{ew.entity.transferSite}</if>
<if test="ew.entity.transferType!=null"> AND TRANSFER_TYPE=#{ew.entity.transferType}</if>
<if test="ew.entity.lccBo!=null"> AND LCC_BO=#{ew.entity.lccBo}</if>
<if test="ew.entity.shopOrderTypeBo!=null"> AND SHOP_ORDER_TYPE_BO=#{ew.entity.shopOrderTypeBo}</if>
<if test="ew.entity.holdId!=null"> AND HOLD_ID=#{ew.entity.holdId}</if>
<if test="ew.entity.endUnitNumber!=null"> AND END_UNIT_NUMBER=#{ew.entity.endUnitNumber}</if>
<if test="ew.entity.reqSerialChange!=null"> AND REQ_SERIAL_CHANGE=#{ew.entity.reqSerialChange}</if>
<if test="ew.entity.collectParentSerial!=null"> AND COLLECT_PARENT_SERIAL=#{ew.entity.collectParentSerial}</if>
<if test="ew.entity.batchNumber!=null"> AND BATCH_NUMBER=#{ew.entity.batchNumber}</if>
<if test="ew.entity.erpOrder!=null"> AND ERP_ORDER=#{ew.entity.erpOrder}</if>
<if test="ew.entity.erpProductionVersion!=null"> AND ERP_PRODUCTION_VERSION=#{ew.entity.erpProductionVersion}</if>
<if test="ew.entity.erpUnitOfMeasure!=null"> AND ERP_UNIT_OF_MEASURE=#{ew.entity.erpUnitOfMeasure}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.inspectionLot!=null"> AND INSPECTION_LOT=#{ew.entity.inspectionLot}</if>
<if test="ew.entity.inspectionGroupSize!=null"> AND INSPECTION_GROUP_SIZE=#{ew.entity.inspectionGroupSize}</if>
<if test="ew.entity.erpPutawayStorloc!=null"> AND ERP_PUTAWAY_STORLOC=#{ew.entity.erpPutawayStorloc}</if>
<if test="ew.entity.warehouseNumber!=null"> AND WAREHOUSE_NUMBER=#{ew.entity.warehouseNumber}</if>
<if test="ew.entity.underdeliveryTolerance!=null"> AND UNDERDELIVERY_TOLERANCE=#{ew.entity.underdeliveryTolerance}</if>
<if test="ew.entity.overdeliveryTolerance!=null"> AND OVERDELIVERY_TOLERANCE=#{ew.entity.overdeliveryTolerance}</if>
<if test="ew.entity.unlimitedOverdelivery!=null"> AND UNLIMITED_OVERDELIVERY=#{ew.entity.unlimitedOverdelivery}</if>
<if test="ew.entity.minimumDeliveryQty!=null"> AND MINIMUM_DELIVERY_QTY=#{ew.entity.minimumDeliveryQty}</if>
<if test="ew.entity.maximumDeliveryQty!=null"> AND MAXIMUM_DELIVERY_QTY=#{ew.entity.maximumDeliveryQty}</if>
<if test="ew.entity.toleranceDefinedIn!=null"> AND TOLERANCE_DEFINED_IN=#{ew.entity.toleranceDefinedIn}</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>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -30,6 +30,10 @@
HANDLE, CHANGE_STAMP, SITE, WORK_CENTER, ROUTER_BO, CAN_BE_RELEASED_TO, WC_CATEGORY, STATUS_BO, WC_TYPE, ASSIGNMENT_ENFORCEMENT, CREATED_DATE_TIME, MODIFIED_DATE_TIME, ERP_INTERNAL_ID, IS_ERP_WORK_CENTER, ERP_WORK_CENTER, ERP_CAPACITY_CATEGORY, PRODUCTION_SUPPLY_AREA, STANDARD_VALUE_KEY_BO
</sql>
<sql id="Full_Column_List">
W.HANDLE, W.CHANGE_STAMP, W.SITE, W.WORK_CENTER, WT.DESCRIPTION, W.ROUTER_BO, W.CAN_BE_RELEASED_TO, W.WC_CATEGORY, W.STATUS_BO, W.WC_TYPE, W.ASSIGNMENT_ENFORCEMENT, W.CREATED_DATE_TIME, W.MODIFIED_DATE_TIME, W.ERP_INTERNAL_ID, W.IS_ERP_WORK_CENTER, ERP_WORK_CENTER, ERP_CAPACITY_CATEGORY, W.PRODUCTION_SUPPLY_AREA, W.STANDARD_VALUE_KEY_BO
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectByMap" resultMap="BaseResultMap">
@ -229,30 +233,26 @@
</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 WORK_CENTER
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Full_Column_List"></include></otherwise></choose>
FROM WORK_CENTER W
LEFT JOIN WORK_CENTER_T WT ON W.HANDLE = WT.WORK_CENTER_BO AND WT.LOCALE = 'zh'
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.canBeReleasedTo!=null"> AND CAN_BE_RELEASED_TO=#{ew.entity.canBeReleasedTo}</if>
<if test="ew.entity.wcCategory!=null"> AND WC_CATEGORY=#{ew.entity.wcCategory}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.wcType!=null"> AND WC_TYPE=#{ew.entity.wcType}</if>
<if test="ew.entity.assignmentEnforcement!=null"> AND ASSIGNMENT_ENFORCEMENT=#{ew.entity.assignmentEnforcement}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.erpInternalId!=null"> AND ERP_INTERNAL_ID=#{ew.entity.erpInternalId}</if>
<if test="ew.entity.isErpWorkCenter!=null"> AND IS_ERP_WORK_CENTER=#{ew.entity.isErpWorkCenter}</if>
<if test="ew.entity.erpWorkCenter!=null"> AND ERP_WORK_CENTER=#{ew.entity.erpWorkCenter}</if>
<if test="ew.entity.erpCapacityCategory!=null"> AND ERP_CAPACITY_CATEGORY=#{ew.entity.erpCapacityCategory}</if>
<if test="ew.entity.productionSupplyArea!=null"> AND PRODUCTION_SUPPLY_AREA=#{ew.entity.productionSupplyArea}</if>
<if test="ew.entity.standardValueKeyBo!=null"> AND STANDARD_VALUE_KEY_BO=#{ew.entity.standardValueKeyBo}</if>
<if test="ew.entity.changeStamp!=null"> AND W.CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND W.SITE=#{ew.entity.site}</if>
<if test="ew.entity.workCenter!=null"> AND W.WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.routerBo!=null"> AND W.ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.canBeReleasedTo!=null"> AND W.CAN_BE_RELEASED_TO=#{ew.entity.canBeReleasedTo}</if>
<if test="ew.entity.wcCategory!=null"> AND W.WC_CATEGORY=#{ew.entity.wcCategory}</if>
<if test="ew.entity.statusBo!=null"> AND W.STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.wcType!=null"> AND W.WC_TYPE=#{ew.entity.wcType}</if>
<if test="ew.entity.assignmentEnforcement!=null"> AND W.ASSIGNMENT_ENFORCEMENT=#{ew.entity.assignmentEnforcement}</if>
<if test="ew.entity.createdDateTime!=null"> AND W.CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND W.MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
AND ${ew.sqlSegment}

Loading…
Cancel
Save