产前准备任务检索修改

master
philip 3 years ago
parent 7980402005
commit 96369b1a62

@ -20,7 +20,7 @@ import java.util.Map;
@Repository
public interface ProdReadyTaskMapper extends BaseMapper<ProdReadyTask> {
List<ProdReadyTask> getTaskList(@Param("entity")ProdReadyTask prodReadyTask, @Param("locale") String locale);
List<ProdReadyTask> getTaskList(@Param("entity")ProdReadyTask prodReadyTask, @Param("locale") String locale,@Param("admin") Integer admin,@Param("user") String user);
ProdReadyTask loadProExecute(@Param("site")String site, @Param("taskBo")String taskBo, @Param("locale") String language);

@ -23,6 +23,7 @@ import com.foreverwin.mesnac.common.util.ActiveMQUtil;
import com.foreverwin.mesnac.common.util.DateUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.BomComponentDto;
import com.foreverwin.mesnac.meapi.mapper.UserGroupMapper;
import com.foreverwin.mesnac.meapi.mapper.WorkCenterMapper;
import com.foreverwin.mesnac.meapi.model.*;
import com.foreverwin.mesnac.meapi.service.*;
@ -82,6 +83,8 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
@Autowired
private BomComponentService bomComponentService;
@Autowired
private UserGroupMapper userGroupMapper;
@Autowired
private WorkCenterMapper workCenterMapper;
@Autowired
private CustomFieldsService customFieldsService;
@ -254,7 +257,10 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
@Override
public List<ProdReadyTask> getTaskList(ProdReadyTask prodReadyTask) {
return prodReadyTaskMapper.getTaskList(prodReadyTask, LocaleContextHolder.getLocale().getLanguage());
String user = CommonMethods.getUser();
String site = CommonMethods.getSite();
Integer admin = userGroupMapper.getUserGroupByUser(HandleEnum.USER.getHandle(site, user), new UserGroupBOHandle(site, "ADMINISTRATORS").getValue());
return prodReadyTaskMapper.getTaskList(prodReadyTask, LocaleContextHolder.getLocale().getLanguage(),admin,user);
}
@Override

@ -637,6 +637,7 @@
LEFT JOIN ITEM_T ITT ON ITT.ITEM_BO = I.HANDLE AND ITT.LOCALE =#{locale}
JOIN RESRCE RES ON RES.RESRCE = zprt.RESRCE AND RES.SITE = zprt.SITE
WHERE ZPRT.SITE=#{entity.site}
<if test="admin == 0"> AND ZSD.EMPLOYEE LIKE '%${user}%' </if>
<if test="entity.workCenter!=null and entity.workCenter!='' "> AND ZPRT.WORK_CENTER=#{entity.workCenter}</if>
<if test="entity.resrce!=null and entity.resrce!='' "> AND ZPRT.RESRCE=#{entity.resrce}</if>
<if test="entity.dispatchNo!=null and entity.dispatchNo!='' "> AND ZSD.DISPATCH_NO=#{entity.dispatchNo}</if>

@ -1,24 +1,24 @@
package com.foreverwin.mesnac.dispatch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.erp.ZprodordconfStruIn;
import com.foreverwin.mesnac.common.erp.ZprodordconfStruOut;
import com.foreverwin.mesnac.common.erp.holders.TableOfZprodordconfStruInHolder;
import com.foreverwin.mesnac.common.erp.holders.TableOfZprodordconfStruOutHolder;
import com.foreverwin.mesnac.common.util.ERPAPI;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.mesnac.dispatch.model.ItemBatch;
import com.foreverwin.mesnac.dispatch.service.ItemBatchService;
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 com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.dispatch.service.ItemBatchService;
import com.foreverwin.mesnac.dispatch.model.ItemBatch;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.List;
/**
*
@ -32,6 +32,14 @@ public class ItemBatchController {
@Autowired
public ItemBatchService itemBatchService;
@ResponseBody
@GetMapping("/getItemBatch")
public R getItemBatch(ItemBatch itemBatch){
QueryWrapper<ItemBatch> queryWrapper=new QueryWrapper<>();
itemBatch.setSite(CommonMethods.getSite());
queryWrapper.setEntity(itemBatch);
return R.ok(itemBatchService.list(queryWrapper));
}
/**
*
*

@ -26,4 +26,5 @@ public interface UserGroupMapper extends BaseMapper<UserGroup> {
UserGroup getCustomFieldByGroup(@Param("site")String site,
@Param("userGroup")String userGroup);
Integer getUserGroupByUser(@Param("userBO")String userBO,@Param("userGroupBO")String userGroupBO);
}

@ -25,4 +25,6 @@ public interface UserGroupService extends IService<UserGroup> {
IPage<UserGroup> selectPage(FrontPage<UserGroup> frontPage, UserGroup userGroup);
List<UserGroup> selectList(UserGroup userGroup);
Integer getUserGroupByUser(String userBO,String userGroupBO);
}

@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
@ -42,5 +43,9 @@ public class UserGroupServiceImpl extends ServiceImpl<UserGroupMapper, UserGroup
return super.list(queryWrapper);
}
@Override
public Integer getUserGroupByUser(String userBO, String userGroupBO) {
return userGroupMapper.getUserGroupByUser(userBO,userGroupBO);
}
}

@ -358,4 +358,9 @@
LEFT JOIN CUSTOM_FIELDS CF2 ON CF2.HANDLE = UG.HANDLE AND CF2."ATTRIBUTE" = 'MESSAGE_NOTICE_TIME'
WHERE UG.USER_GROUP = #{userGroup} AND UG.SITE = #{site}
</select>
<select id="getUserGroupByUser" resultType="Integer">
SELECT COUNT(HANDLE) FROM USER_GROUP_MEMBER ugm
WHERE ugm.USER_OR_GROUP_GBO=#{userBO} AND USER_GROUP_BO=#{userGroupBO}
</select>
</mapper>

@ -0,0 +1,128 @@
package com.foreverwin.mesnac.production.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.production.model.AccessoryLog;
import com.foreverwin.mesnac.production.service.AccessoryLogService;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
* @author Philip
* @since 2021-08-12
*/
@RestController
@RequestMapping("/Z-ACCESSORY-LOG")
public class AccessoryLogController {
@Autowired
public AccessoryLogService accessoryLogService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getAccessoryLogById(@PathVariable String id) {
return R.ok( accessoryLogService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getAccessoryLogList(AccessoryLog accessoryLog){
List<AccessoryLog> result;
QueryWrapper<AccessoryLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(accessoryLog);
result = accessoryLogService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<AccessoryLog> frontPage, AccessoryLog accessoryLog){
IPage result;
QueryWrapper<AccessoryLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(accessoryLog);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(AccessoryLog::getHandle, frontPage.getGlobalQuery())
.or().like(AccessoryLog::getSite, frontPage.getGlobalQuery())
.or().like(AccessoryLog::getWorkCenter, frontPage.getGlobalQuery())
.or().like(AccessoryLog::getShopOrder, frontPage.getGlobalQuery())
.or().like(AccessoryLog::getSfc, frontPage.getGlobalQuery())
.or().like(AccessoryLog::getOperation, frontPage.getGlobalQuery())
.or().like(AccessoryLog::getStepId, frontPage.getGlobalQuery())
.or().like(AccessoryLog::getResrce, frontPage.getGlobalQuery())
.or().like(AccessoryLog::getLabel, frontPage.getGlobalQuery())
.or().like(AccessoryLog::getBatch, frontPage.getGlobalQuery())
.or().like(AccessoryLog::getItem, frontPage.getGlobalQuery())
.or().like(AccessoryLog::getRevision, frontPage.getGlobalQuery())
.or().like(AccessoryLog::getCreateUser, frontPage.getGlobalQuery())
);
}
result = accessoryLogService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param accessoryLog
* @return null
*/
@PostMapping
public R save(@RequestBody AccessoryLog accessoryLog) {
return R.ok(accessoryLogService.save(accessoryLog));
}
/**
*
* @param accessoryLog
* @return null
*/
@PutMapping
public R updateById(@RequestBody AccessoryLog accessoryLog) {
return R.ok(accessoryLogService.updateById(accessoryLog));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(accessoryLogService.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(accessoryLogService.removeByIds(ids));
}
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.production.mapper;
import com.foreverwin.mesnac.production.model.AccessoryLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 使 Mapper
* </p>
*
* @author Philip
* @since 2021-08-12
*/
@Repository
public interface AccessoryLogMapper extends BaseMapper<AccessoryLog> {
}

@ -0,0 +1,280 @@
package com.foreverwin.mesnac.production.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 Philip
* @since 2021-08-12
*/
@TableName("Z_ACCESSORY_LOG")
public class AccessoryLog extends Model<AccessoryLog> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("WORK_CENTER")
private String workCenter;
/**
*
*/
@TableField("SHOP_ORDER")
private String shopOrder;
/**
*
*/
@TableField("SFC")
private String sfc;
/**
*
*/
@TableField("OPERATION")
private String operation;
/**
*
*/
@TableField("STEP_ID")
private String stepId;
/**
*
*/
@TableField("RESRCE")
private String resrce;
/**
*
*/
@TableField("LABEL")
private String label;
/**
*
*/
@TableField("BATCH")
private String batch;
/**
*
*/
@TableField("ITEM")
private String item;
/**
*
*/
@TableField("REVISION")
private String revision;
/**
* 使
*/
@TableField("QTY")
private Double qty;
/**
*
*/
@TableField("CREATE_USER")
private String createUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
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 getWorkCenter() {
return workCenter;
}
public void setWorkCenter(String workCenter) {
this.workCenter = workCenter;
}
public String getShopOrder() {
return shopOrder;
}
public void setShopOrder(String shopOrder) {
this.shopOrder = shopOrder;
}
public String getSfc() {
return sfc;
}
public void setSfc(String sfc) {
this.sfc = sfc;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public String getStepId() {
return stepId;
}
public void setStepId(String stepId) {
this.stepId = stepId;
}
public String getResrce() {
return resrce;
}
public void setResrce(String resrce) {
this.resrce = resrce;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getBatch() {
return batch;
}
public void setBatch(String batch) {
this.batch = batch;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public String getRevision() {
return revision;
}
public void setRevision(String revision) {
this.revision = revision;
}
public Double getQty() {
return qty;
}
public void setQty(Double qty) {
this.qty = qty;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String WORK_CENTER = "WORK_CENTER";
public static final String SHOP_ORDER = "SHOP_ORDER";
public static final String SFC = "SFC";
public static final String OPERATION = "OPERATION";
public static final String STEP_ID = "STEP_ID";
public static final String RESRCE = "RESRCE";
public static final String LABEL = "LABEL";
public static final String BATCH = "BATCH";
public static final String ITEM = "ITEM";
public static final String REVISION = "REVISION";
public static final String QTY = "QTY";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "AccessoryLog{" +
"handle = " + handle +
", site = " + site +
", workCenter = " + workCenter +
", shopOrder = " + shopOrder +
", sfc = " + sfc +
", operation = " + operation +
", stepId = " + stepId +
", resrce = " + resrce +
", label = " + label +
", batch = " + batch +
", item = " + item +
", revision = " + revision +
", qty = " + qty +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
"}";
}
}

@ -0,0 +1,28 @@
package com.foreverwin.mesnac.production.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.production.model.AccessoryLog;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
* 使
* </p>
*
* @author Philip
* @since 2021-08-12
*/
public interface AccessoryLogService extends IService<AccessoryLog> {
/**
*
* @param frontPage
* @return
*/
IPage<AccessoryLog> selectPage(FrontPage<AccessoryLog> frontPage, AccessoryLog accessoryLog);
List<AccessoryLog> selectList(AccessoryLog accessoryLog);
}

@ -0,0 +1,46 @@
package com.foreverwin.mesnac.production.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.production.model.AccessoryLog;
import com.foreverwin.mesnac.production.mapper.AccessoryLogMapper;
import com.foreverwin.mesnac.production.service.AccessoryLogService;
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 Philip
* @since 2021-08-12
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class AccessoryLogServiceImpl extends ServiceImpl<AccessoryLogMapper, AccessoryLog> implements AccessoryLogService {
@Autowired
private AccessoryLogMapper accessoryLogMapper;
@Override
public IPage<AccessoryLog> selectPage(FrontPage<AccessoryLog> frontPage, AccessoryLog accessoryLog) {
QueryWrapper<AccessoryLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(accessoryLog);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<AccessoryLog> selectList(AccessoryLog accessoryLog) {
QueryWrapper<AccessoryLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(accessoryLog);
return super.list(queryWrapper);
}
}

@ -332,7 +332,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
}
}
//报工
//sendErp(postMapList);
sendErp(postMapList);
}
public void materialConsumption(String site, String operation, String sfcBo, String stepId, String resource) {
@ -468,7 +468,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
struOut.setAufnr("");
struOut.setVornr("");
struOut.setAueru("1");
struOut.setLmnga(new BigDecimal(1));
struOut.setLmnga(BigDecimal.ZERO);
struOut.setRet("");
struOut.setMsg("");
outs[0] = struOut;

@ -0,0 +1,482 @@
<?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.production.mapper.AccessoryLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.production.model.AccessoryLog">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="WORK_CENTER" property="workCenter" />
<result column="SHOP_ORDER" property="shopOrder" />
<result column="SFC" property="sfc" />
<result column="OPERATION" property="operation" />
<result column="STEP_ID" property="stepId" />
<result column="RESRCE" property="resrce" />
<result column="LABEL" property="label" />
<result column="BATCH" property="batch" />
<result column="ITEM" property="item" />
<result column="REVISION" property="revision" />
<result column="QTY" property="qty" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, WORK_CENTER, SHOP_ORDER, SFC, OPERATION, STEP_ID, RESRCE, LABEL, BATCH, ITEM, REVISION, QTY, CREATE_USER, CREATED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_ACCESSORY_LOG WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_ACCESSORY_LOG
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_ACCESSORY_LOG WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_ACCESSORY_LOG
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</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.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_ACCESSORY_LOG
<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.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.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ACCESSORY_LOG
<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.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.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ACCESSORY_LOG
<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.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.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ACCESSORY_LOG
<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.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.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ACCESSORY_LOG
<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.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.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ACCESSORY_LOG
<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.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.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<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.production.model.AccessoryLog">
INSERT INTO Z_ACCESSORY_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="workCenter!=null">WORK_CENTER,</if>
<if test="shopOrder!=null">SHOP_ORDER,</if>
<if test="sfc!=null">SFC,</if>
<if test="operation!=null">OPERATION,</if>
<if test="stepId!=null">STEP_ID,</if>
<if test="resrce!=null">RESRCE,</if>
<if test="label!=null">LABEL,</if>
<if test="batch!=null">BATCH,</if>
<if test="item!=null">ITEM,</if>
<if test="revision!=null">REVISION,</if>
<if test="qty!=null">QTY,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="workCenter!=null">#{workCenter},</if>
<if test="shopOrder!=null">#{shopOrder},</if>
<if test="sfc!=null">#{sfc},</if>
<if test="operation!=null">#{operation},</if>
<if test="stepId!=null">#{stepId},</if>
<if test="resrce!=null">#{resrce},</if>
<if test="label!=null">#{label},</if>
<if test="batch!=null">#{batch},</if>
<if test="item!=null">#{item},</if>
<if test="revision!=null">#{revision},</if>
<if test="qty!=null">#{qty},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.production.model.AccessoryLog">
INSERT INTO Z_ACCESSORY_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{workCenter},
#{shopOrder},
#{sfc},
#{operation},
#{stepId},
#{resrce},
#{label},
#{batch},
#{item},
#{revision},
#{qty},
#{createUser},
#{createdDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_ACCESSORY_LOG <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.label!=null">LABEL=#{et.label},</if>
<if test="et.batch!=null">BATCH=#{et.batch},</if>
<if test="et.item!=null">ITEM=#{et.item},</if>
<if test="et.revision!=null">REVISION=#{et.revision},</if>
<if test="et.qty!=null">QTY=#{et.qty},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_ACCESSORY_LOG <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
WORK_CENTER=#{et.workCenter},
SHOP_ORDER=#{et.shopOrder},
SFC=#{et.sfc},
OPERATION=#{et.operation},
STEP_ID=#{et.stepId},
RESRCE=#{et.resrce},
LABEL=#{et.label},
BATCH=#{et.batch},
ITEM=#{et.item},
REVISION=#{et.revision},
QTY=#{et.qty},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_ACCESSORY_LOG <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.label!=null">LABEL=#{et.label},</if>
<if test="et.batch!=null">BATCH=#{et.batch},</if>
<if test="et.item!=null">ITEM=#{et.item},</if>
<if test="et.revision!=null">REVISION=#{et.revision},</if>
<if test="et.qty!=null">QTY=#{et.qty},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<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.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_ACCESSORY_LOG WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_ACCESSORY_LOG
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_ACCESSORY_LOG
<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.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.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.label!=null"> AND LABEL=#{ew.entity.label}</if>
<if test="ew.entity.batch!=null"> AND BATCH=#{ew.entity.batch}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_ACCESSORY_LOG WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>
Loading…
Cancel
Save