parent
9e2fda10ac
commit
fd818a5a37
@ -0,0 +1,135 @@
|
||||
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.meapi.dto.SfcDto;
|
||||
import com.foreverwin.mesnac.production.model.SfcDataAssemble;
|
||||
import com.foreverwin.mesnac.production.service.SfcDataAssembleService;
|
||||
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-07-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/Z-SFC-DATA-ASSEMBLE")
|
||||
public class SfcDataAssembleController {
|
||||
|
||||
@Autowired
|
||||
public SfcDataAssembleService sfcDataAssembleService;
|
||||
|
||||
|
||||
/**
|
||||
* sfc回车
|
||||
* @param sfcDto
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/loadSfcAssemble")
|
||||
public R loadSfcAssemble(SfcDto sfcDto) {
|
||||
return R.ok(sfcDataAssembleService.loadSfcAssemble(sfcDto));
|
||||
}
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/{id:.+}")
|
||||
public R getSfcDataAssembleById(@PathVariable String id) {
|
||||
return R.ok( sfcDataAssembleService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("")
|
||||
public R getSfcDataAssembleList(SfcDataAssemble sfcDataAssemble){
|
||||
List<SfcDataAssemble> result;
|
||||
QueryWrapper<SfcDataAssemble> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(sfcDataAssemble);
|
||||
result = sfcDataAssembleService.list(queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param frontPage 分页信息
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage<SfcDataAssemble> frontPage, SfcDataAssemble sfcDataAssemble){
|
||||
IPage result;
|
||||
QueryWrapper<SfcDataAssemble> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(sfcDataAssemble);
|
||||
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
|
||||
//TODO modify global query
|
||||
queryWrapper.lambda().and(wrapper -> wrapper
|
||||
.like(SfcDataAssemble::getHandle, frontPage.getGlobalQuery())
|
||||
.or().like(SfcDataAssemble::getSite, frontPage.getGlobalQuery())
|
||||
.or().like(SfcDataAssemble::getSfcDispatchBo, frontPage.getGlobalQuery())
|
||||
.or().like(SfcDataAssemble::getStatus, frontPage.getGlobalQuery())
|
||||
.or().like(SfcDataAssemble::getInventoryBo, frontPage.getGlobalQuery())
|
||||
.or().like(SfcDataAssemble::getItemBo, frontPage.getGlobalQuery())
|
||||
.or().like(SfcDataAssemble::getCreatedUser, frontPage.getGlobalQuery())
|
||||
.or().like(SfcDataAssemble::getModifyUser, frontPage.getGlobalQuery())
|
||||
);
|
||||
}
|
||||
result = sfcDataAssembleService.page(frontPage.getPagePlus(), queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param sfcDataAssemble 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PostMapping
|
||||
public R save(@RequestBody SfcDataAssemble sfcDataAssemble) {
|
||||
return R.ok(sfcDataAssembleService.save(sfcDataAssemble));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param sfcDataAssemble 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody SfcDataAssemble sfcDataAssemble) {
|
||||
return R.ok(sfcDataAssembleService.updateById(sfcDataAssemble));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除对象
|
||||
* @param id 实体ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
|
||||
public R removeById(@PathVariable("id") String id){
|
||||
return R.ok(sfcDataAssembleService.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(sfcDataAssembleService.removeByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.foreverwin.mesnac.production.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.foreverwin.mesnac.production.model.SfcDataAssemble;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 生产执行数据装配 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-07-19
|
||||
*/
|
||||
@Repository
|
||||
public interface SfcDataAssembleMapper extends BaseMapper<SfcDataAssemble> {
|
||||
/**
|
||||
* 初始化查询装配数据
|
||||
* @param sfcDispatchBo 生产操作面板主表BO
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> querySfcAssemble(@Param("sfcDispatchBo") String sfcDispatchBo);
|
||||
|
||||
/**
|
||||
* 拆机是查询是否已装配
|
||||
* @param site
|
||||
* @param sfc
|
||||
* @param inventoryId
|
||||
* @param itemBo
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> queryAssembleDate(@Param("site") String site, @Param("sfc") String sfc, @Param("inventoryId") String inventoryId, @Param("itemBo") String itemBo);
|
||||
|
||||
/**
|
||||
* 查询物料消耗数据
|
||||
* @param handle
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> sfcAssembleDate(@Param("handle") String handle);
|
||||
|
||||
/**
|
||||
* 校验条码装配
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> validateSfcAssemble(@Param(value = "site") String site, @Param(value = "inventoryId") String inventoryId, @Param(value = "handle") String handle);
|
||||
|
||||
/**
|
||||
* 查询拆机数据
|
||||
* @param handle
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> querySfcDismantling(@Param("handle") String handle);
|
||||
|
||||
List<Map<String, Object>> selectInventoryAnomaly(@Param("site") String site, @Param("inventory") String inventory);
|
||||
|
||||
List<Map<String, Object>> selectSfcBomComponent(@Param("sfcDataMainBo") String sfcDataMainBo, @Param("sfcBo") String sfcBo, @Param("stepId") String stepId, @Param("item") String item);
|
||||
/**
|
||||
* 根据 sfc 和物料条码 查询图号
|
||||
* @param site
|
||||
* @param sfcorinv
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> queryDrawBySfcOrInv(@Param("site") String site, @Param("sfcorinv") String sfcorinv);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.foreverwin.mesnac.production.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.meapi.dto.SfcDto;
|
||||
import com.foreverwin.mesnac.production.model.SfcDataAssemble;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.modular.core.exception.BaseException;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 生产执行数据装配 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-07-19
|
||||
*/
|
||||
public interface SfcDataAssembleService extends IService<SfcDataAssemble> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param frontPage
|
||||
* @return
|
||||
*/
|
||||
IPage<SfcDataAssemble> selectPage(FrontPage<SfcDataAssemble> frontPage, SfcDataAssemble sfcDataAssemble);
|
||||
|
||||
List<SfcDataAssemble> selectList(SfcDataAssemble sfcDataAssemble);
|
||||
|
||||
Object loadSfcAssemble(SfcDto sfcDto);
|
||||
|
||||
Map<String, Object> assembleInventory(Map<String, Object> paramMap) throws BaseException;
|
||||
}
|
@ -0,0 +1,458 @@
|
||||
<?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.SfcDataAssembleMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.production.model.SfcDataAssemble">
|
||||
<id column="HANDLE" property="handle" />
|
||||
<result column="SITE" property="site" />
|
||||
<result column="SFC_DISPATCH_BO" property="sfcDispatchBo" />
|
||||
<result column="STATUS" property="status" />
|
||||
<result column="INVENTORY_BO" property="inventoryBo" />
|
||||
<result column="ASSEMBLE_QTY" property="assembleQty" />
|
||||
<result column="ITEM_BO" property="itemBo" />
|
||||
<result column="CREATED_DATE_TIME" property="createdDateTime" />
|
||||
<result column="CREATED_USER" property="createdUser" />
|
||||
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
|
||||
<result column="MODIFY_USER" property="modifyUser" />
|
||||
<result column="SEQ" property="seq" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, SITE, SFC_DISPATCH_BO, STATUS, INVENTORY_BO, ASSEMBLE_QTY, ITEM_BO, CREATED_DATE_TIME, CREATED_USER, MODIFIED_DATE_TIME, MODIFY_USER, SEQ
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_SFC_DATA_ASSEMBLE WHERE HANDLE=#{handle}
|
||||
</select>
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_SFC_DATA_ASSEMBLE
|
||||
<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_SFC_DATA_ASSEMBLE 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_SFC_DATA_ASSEMBLE
|
||||
<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.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
|
||||
<if test="ew.entity.assembleQty!=null"> AND ASSEMBLE_QTY=#{ew.entity.assembleQty}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCount" resultType="Integer">
|
||||
SELECT COUNT(1) FROM Z_SFC_DATA_ASSEMBLE
|
||||
<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.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
|
||||
<if test="ew.entity.assembleQty!=null"> AND ASSEMBLE_QTY=#{ew.entity.assembleQty}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</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_SFC_DATA_ASSEMBLE
|
||||
<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.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
|
||||
<if test="ew.entity.assembleQty!=null"> AND ASSEMBLE_QTY=#{ew.entity.assembleQty}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</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_SFC_DATA_ASSEMBLE
|
||||
<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.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
|
||||
<if test="ew.entity.assembleQty!=null"> AND ASSEMBLE_QTY=#{ew.entity.assembleQty}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</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_SFC_DATA_ASSEMBLE
|
||||
<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.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
|
||||
<if test="ew.entity.assembleQty!=null"> AND ASSEMBLE_QTY=#{ew.entity.assembleQty}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</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_SFC_DATA_ASSEMBLE
|
||||
<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.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
|
||||
<if test="ew.entity.assembleQty!=null"> AND ASSEMBLE_QTY=#{ew.entity.assembleQty}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</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_SFC_DATA_ASSEMBLE
|
||||
<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.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
|
||||
<if test="ew.entity.assembleQty!=null"> AND ASSEMBLE_QTY=#{ew.entity.assembleQty}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</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.SfcDataAssemble">
|
||||
INSERT INTO Z_SFC_DATA_ASSEMBLE
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="site!=null">SITE,</if>
|
||||
<if test="sfcDispatchBo!=null">SFC_DISPATCH_BO,</if>
|
||||
<if test="status!=null">STATUS,</if>
|
||||
<if test="inventoryBo!=null">INVENTORY_BO,</if>
|
||||
<if test="assembleQty!=null">ASSEMBLE_QTY,</if>
|
||||
<if test="itemBo!=null">ITEM_BO,</if>
|
||||
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
||||
<if test="createdUser!=null">CREATED_USER,</if>
|
||||
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
|
||||
<if test="modifyUser!=null">MODIFY_USER,</if>
|
||||
<if test="seq!=null">SEQ,</if>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
<if test="site!=null">#{site},</if>
|
||||
<if test="sfcDispatchBo!=null">#{sfcDispatchBo},</if>
|
||||
<if test="status!=null">#{status},</if>
|
||||
<if test="inventoryBo!=null">#{inventoryBo},</if>
|
||||
<if test="assembleQty!=null">#{assembleQty},</if>
|
||||
<if test="itemBo!=null">#{itemBo},</if>
|
||||
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
||||
<if test="createdUser!=null">#{createdUser},</if>
|
||||
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
|
||||
<if test="modifyUser!=null">#{modifyUser},</if>
|
||||
<if test="seq!=null">#{seq},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.production.model.SfcDataAssemble">
|
||||
INSERT INTO Z_SFC_DATA_ASSEMBLE
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{site},
|
||||
#{sfcDispatchBo},
|
||||
#{status},
|
||||
#{inventoryBo},
|
||||
#{assembleQty},
|
||||
#{itemBo},
|
||||
#{createdDateTime},
|
||||
#{createdUser},
|
||||
#{modifiedDateTime},
|
||||
#{modifyUser},
|
||||
#{seq},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateById">
|
||||
UPDATE Z_SFC_DATA_ASSEMBLE <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
|
||||
<if test="et.status!=null">STATUS=#{et.status},</if>
|
||||
<if test="et.inventoryBo!=null">INVENTORY_BO=#{et.inventoryBo},</if>
|
||||
<if test="et.assembleQty!=null">ASSEMBLE_QTY=#{et.assembleQty},</if>
|
||||
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
|
||||
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
|
||||
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
|
||||
<if test="et.seq!=null">SEQ=#{et.seq},</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_SFC_DATA_ASSEMBLE <trim prefix="SET" suffixOverrides=",">
|
||||
SITE=#{et.site},
|
||||
SFC_DISPATCH_BO=#{et.sfcDispatchBo},
|
||||
STATUS=#{et.status},
|
||||
INVENTORY_BO=#{et.inventoryBo},
|
||||
ASSEMBLE_QTY=#{et.assembleQty},
|
||||
ITEM_BO=#{et.itemBo},
|
||||
CREATED_DATE_TIME=#{et.createdDateTime},
|
||||
CREATED_USER=#{et.createdUser},
|
||||
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
|
||||
MODIFY_USER=#{et.modifyUser},
|
||||
SEQ=#{et.seq},
|
||||
</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_SFC_DATA_ASSEMBLE <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
|
||||
<if test="et.status!=null">STATUS=#{et.status},</if>
|
||||
<if test="et.inventoryBo!=null">INVENTORY_BO=#{et.inventoryBo},</if>
|
||||
<if test="et.assembleQty!=null">ASSEMBLE_QTY=#{et.assembleQty},</if>
|
||||
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
|
||||
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
|
||||
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
|
||||
<if test="et.seq!=null">SEQ=#{et.seq},</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.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
|
||||
<if test="ew.entity.assembleQty!=null"> AND ASSEMBLE_QTY=#{ew.entity.assembleQty}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</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_SFC_DATA_ASSEMBLE WHERE HANDLE=#{handle}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByMap">
|
||||
DELETE FROM Z_SFC_DATA_ASSEMBLE
|
||||
<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_SFC_DATA_ASSEMBLE
|
||||
<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.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
|
||||
<if test="ew.entity.assembleQty!=null"> AND ASSEMBLE_QTY=#{ew.entity.assembleQty}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
||||
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</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_SFC_DATA_ASSEMBLE WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</delete>
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<select id="querySfcAssemble" resultType="map">
|
||||
WITH SFC_DATA AS(
|
||||
SELECT DA.ITEM_BO,DA.SEQ, SUM(DA.ASSEMBLE_QTY) ASSEMBLE_QTY FROM Z_SFC_DATA_ASSEMBLE DA
|
||||
WHERE DA.SFC_DISPATCH_BO = #{sfcDispatchBo}
|
||||
GROUP BY DA.ITEM_BO, DA.SEQ
|
||||
)
|
||||
SELECT CASE WHEN CF2.VALUE='Y' THEN N'-' ELSE N'+' END || N'物料:'||I.ITEM||'/'||I.REVISION||N' 数量:'|| S.QTY * BC.QTY ITEM_REVISION,
|
||||
S.QTY * BC.QTY QTY,NVL(SD.ASSEMBLE_QTY,0) ASSEMBLE_QTY,I.HANDLE ITEM_BO,I.ITEM,IT.DESCRIPTION ITEM_DESC,
|
||||
CASE WHEN NVL(SD.ASSEMBLE_QTY,0) = 0 THEN 'WHITE'
|
||||
WHEN NVL(SD.ASSEMBLE_QTY,0) = S.QTY * BC.QTY THEN 'GREEN'
|
||||
ELSE 'YELLOW' END IS_ASSEMBLE,BC.HANDLE BOM_COMPONENT_BO,
|
||||
CASE WHEN CF2.VALUE='Y' THEN 'Y' ELSE 'N' END IS_DISMANTLING, BC."SEQUENCE" SEQ
|
||||
FROM Z_SFC_DISPATCH DM
|
||||
INNER JOIN SFC S ON S.SITE = DM.SITE AND S.SFC = DM.SFC
|
||||
INNER JOIN SFC_BOM SB ON SB.SFC_BO = S.HANDLE
|
||||
INNER JOIN BOM_COMPONENT BC ON BC.BOM_BO = SB.BOM_BO
|
||||
INNER JOIN ITEM I ON I.HANDLE = BC.COMPONENT_GBO
|
||||
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE ='zh'
|
||||
INNER JOIN CUSTOM_FIELDS I_CF ON I_CF.HANDLE = I.HANDLE AND I_CF."ATTRIBUTE" = 'ACCESSORY_TYPE' AND I_CF.VALUE ='9'
|
||||
INNER JOIN BOM_OPERATION BO ON BO.BOM_COMPONENT_BO = BC.HANDLE
|
||||
AND BO.OPERATION_BO = 'OperationBO:'||S.SITE||','||DM.OPERATION||',#'
|
||||
INNER JOIN CUSTOM_FIELDS CF ON CF.HANDLE = BC.HANDLE AND CF."ATTRIBUTE" = 'STEP_ID' AND CF.VALUE = DM.STEP_ID
|
||||
LEFT JOIN SFC_DATA SD ON SD.ITEM_BO = I.HANDLE AND BC."SEQUENCE" = SD.SEQ
|
||||
WHERE DM.HANDLE = #{sfcDispatchBo}
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue