<?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.LogisticsTurnoverMapper" >
<!-- 通用查询映射结果 -->
<resultMap id= "BaseResultMap" type= "com.foreverwin.mesnac.meapi.model.LogisticsTurnover" >
<id column= "HANDLE" property= "handle" />
<result column= "SFC_DISPATCH_BO" property= "sfcDispatchBo" />
<result column= "STATUS" property= "status" />
<result column= "CREATED_DATE_TIME" property= "createdDateTime" />
<result column= "USER_ID" property= "userId" />
<result column= "USER_NAME" property= "userName" />
<result column= "OTHER1" property= "other1" />
<result column= "OTHER2" property= "other2" />
<result column= "OTHER3" property= "other3" />
<result column= "STORAGE_LOCATION" property= "storageLocation" />
<result column= "TURNOVER_WORK_CENTER" property= "turnoverWorkCenter" />
<result column= "COM_DATE_TIME" property= "comDateTime" />
<result column= "IS_RECEIVE" property= "isReceive" />
<result column= "TURNOUT_WORKCENTER" property= "turnoutWorkcenter" />
<result column= "TURNOUT_ITEM" property= "turnoutItem" />
<result column= "OTHER4" property= "other4" />
<result column= "OTHER5" property= "other5" />
<result column= "OTHER6" property= "other6" />
<result column= "NEXT_WORK_CENTER" property= "nextWorkcenter" />
<result column= "SFC" property= "sfc" />
<result column= "WORK_ORDER" property= "workOrder" />
<result column= "ITEM_DESC" property= "itemdesc" />
<result column= "TEXTURE" property= "texture" />
<result column= "BLANKING_SIZE" property= "blankingSize" />
<result column= "QTY_TO_BUILD" property= "qtyToBuild" />
<result column= "SHOP_ORDER" property= "shopOrder" />
<result column= "SFC" property= "sfc" />
<result column= "DELETE_USER" property= "deleteUser" />
<result column= "DELETE_DATE_TIME" property= "deleteDateTime" />
<result column= "CREATED_USER" property= "createdUser" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id= "Base_Column_List" >
HANDLE, SFC_DISPATCH_BO, STATUS, CREATED_DATE_TIME, USER_ID, USER_NAME, OTHER1, OTHER2, OTHER3, STORAGE_LOCATION, TURNOVER_WORK_CENTER, COM_DATE_TIME, IS_RECEIVE, TURNOUT_WORKCENTER, TURNOUT_ITEM, OTHER4, OTHER5, OTHER6, SHOP_ORDER, SFC, DELETE_USER, DELETE_DATE_TIME, CREATED_USER
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id= "selectById" resultMap= "BaseResultMap" >
SELECT <include refid= "Base_Column_List" > </include> FROM Z_LOGISTICS_TURNOVER WHERE HANDLE=#{handle}
</select>
<select id= "selectByMap" resultMap= "BaseResultMap" >
SELECT <include refid= "Base_Column_List" > </include>
FROM Z_LOGISTICS_TURNOVER
<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_LOGISTICS_TURNOVER 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_LOGISTICS_TURNOVER
<where >
<if test= "ew.entity.handle!=null" >
HANDLE=#{ew.handle}
</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.createdDateTime!=null" > AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test= "ew.entity.userId!=null" > AND USER_ID=#{ew.entity.userId}</if>
<if test= "ew.entity.userName!=null" > AND USER_NAME=#{ew.entity.userName}</if>
<if test= "ew.entity.other1!=null" > AND OTHER1=#{ew.entity.other1}</if>
<if test= "ew.entity.other2!=null" > AND OTHER2=#{ew.entity.other2}</if>
<if test= "ew.entity.other3!=null" > AND OTHER3=#{ew.entity.other3}</if>
<if test= "ew.entity.storageLocation!=null" > AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test= "ew.entity.turnoverWorkCenter!=null" > AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test= "ew.entity.comDateTime!=null" > AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test= "ew.entity.isReceive!=null" > AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test= "ew.entity.turnoutWorkcenter!=null" > AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test= "ew.entity.turnoutItem!=null" > AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test= "ew.entity.other4!=null" > AND OTHER4=#{ew.entity.other4}</if>
<if test= "ew.entity.other5!=null" > AND OTHER5=#{ew.entity.other5}</if>
<if test= "ew.entity.other6!=null" > AND OTHER6=#{ew.entity.other6}</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.deleteUser!=null" > AND DELETE_USER=#{ew.entity.deleteUser}</if>
<if test= "ew.entity.deleteDateTime!=null" > AND DELETE_DATE_TIME=#{ew.entity.deleteDateTime}</if>
<if test= "ew.entity.createdUser!=null" > AND CREATED_USER=#{ew.entity.createdUser}</if>
</where>
</select>
<select id= "selectCount" resultType= "Integer" >
SELECT COUNT(1) FROM Z_LOGISTICS_TURNOVER
<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.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.createdDateTime!=null" > AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test= "ew.entity.userId!=null" > AND USER_ID=#{ew.entity.userId}</if>
<if test= "ew.entity.userName!=null" > AND USER_NAME=#{ew.entity.userName}</if>
<if test= "ew.entity.other1!=null" > AND OTHER1=#{ew.entity.other1}</if>
<if test= "ew.entity.other2!=null" > AND OTHER2=#{ew.entity.other2}</if>
<if test= "ew.entity.other3!=null" > AND OTHER3=#{ew.entity.other3}</if>
<if test= "ew.entity.storageLocation!=null" > AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test= "ew.entity.turnoverWorkCenter!=null" > AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test= "ew.entity.comDateTime!=null" > AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test= "ew.entity.isReceive!=null" > AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test= "ew.entity.turnoutWorkcenter!=null" > AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test= "ew.entity.turnoutItem!=null" > AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test= "ew.entity.other4!=null" > AND OTHER4=#{ew.entity.other4}</if>
<if test= "ew.entity.other5!=null" > AND OTHER5=#{ew.entity.other5}</if>
<if test= "ew.entity.other6!=null" > AND OTHER6=#{ew.entity.other6}</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.deleteUser!=null" > AND DELETE_USER=#{ew.entity.deleteUser}</if>
<if test= "ew.entity.deleteDateTime!=null" > AND DELETE_DATE_TIME=#{ew.entity.deleteDateTime}</if>
<if test= "ew.entity.createdUser!=null" > AND CREATED_USER=#{ew.entity.createdUser}</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_LOGISTICS_TURNOVER
<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.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.createdDateTime!=null" > AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test= "ew.entity.userId!=null" > AND USER_ID=#{ew.entity.userId}</if>
<if test= "ew.entity.userName!=null" > AND USER_NAME=#{ew.entity.userName}</if>
<if test= "ew.entity.other1!=null" > AND OTHER1=#{ew.entity.other1}</if>
<if test= "ew.entity.other2!=null" > AND OTHER2=#{ew.entity.other2}</if>
<if test= "ew.entity.other3!=null" > AND OTHER3=#{ew.entity.other3}</if>
<if test= "ew.entity.storageLocation!=null" > AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test= "ew.entity.turnoverWorkCenter!=null" > AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test= "ew.entity.comDateTime!=null" > AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test= "ew.entity.isReceive!=null" > AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test= "ew.entity.turnoutWorkcenter!=null" > AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test= "ew.entity.turnoutItem!=null" > AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test= "ew.entity.other4!=null" > AND OTHER4=#{ew.entity.other4}</if>
<if test= "ew.entity.other5!=null" > AND OTHER5=#{ew.entity.other5}</if>
<if test= "ew.entity.other6!=null" > AND OTHER6=#{ew.entity.other6}</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.deleteUser!=null" > AND DELETE_USER=#{ew.entity.deleteUser}</if>
<if test= "ew.entity.deleteDateTime!=null" > AND DELETE_DATE_TIME=#{ew.entity.deleteDateTime}</if>
<if test= "ew.entity.createdUser!=null" > AND CREATED_USER=#{ew.entity.createdUser}</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_LOGISTICS_TURNOVER
<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.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.createdDateTime!=null" > AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test= "ew.entity.userId!=null" > AND USER_ID=#{ew.entity.userId}</if>
<if test= "ew.entity.userName!=null" > AND USER_NAME=#{ew.entity.userName}</if>
<if test= "ew.entity.other1!=null" > AND OTHER1=#{ew.entity.other1}</if>
<if test= "ew.entity.other2!=null" > AND OTHER2=#{ew.entity.other2}</if>
<if test= "ew.entity.other3!=null" > AND OTHER3=#{ew.entity.other3}</if>
<if test= "ew.entity.storageLocation!=null" > AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test= "ew.entity.turnoverWorkCenter!=null" > AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test= "ew.entity.comDateTime!=null" > AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test= "ew.entity.isReceive!=null" > AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test= "ew.entity.turnoutWorkcenter!=null" > AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test= "ew.entity.turnoutItem!=null" > AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test= "ew.entity.other4!=null" > AND OTHER4=#{ew.entity.other4}</if>
<if test= "ew.entity.other5!=null" > AND OTHER5=#{ew.entity.other5}</if>
<if test= "ew.entity.other6!=null" > AND OTHER6=#{ew.entity.other6}</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.deleteUser!=null" > AND DELETE_USER=#{ew.entity.deleteUser}</if>
<if test= "ew.entity.deleteDateTime!=null" > AND DELETE_DATE_TIME=#{ew.entity.deleteDateTime}</if>
<if test= "ew.entity.createdUser!=null" > AND CREATED_USER=#{ew.entity.createdUser}</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_LOGISTICS_TURNOVER
<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.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.createdDateTime!=null" > AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test= "ew.entity.userId!=null" > AND USER_ID=#{ew.entity.userId}</if>
<if test= "ew.entity.userName!=null" > AND USER_NAME=#{ew.entity.userName}</if>
<if test= "ew.entity.other1!=null" > AND OTHER1=#{ew.entity.other1}</if>
<if test= "ew.entity.other2!=null" > AND OTHER2=#{ew.entity.other2}</if>
<if test= "ew.entity.other3!=null" > AND OTHER3=#{ew.entity.other3}</if>
<if test= "ew.entity.storageLocation!=null" > AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test= "ew.entity.turnoverWorkCenter!=null" > AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test= "ew.entity.comDateTime!=null" > AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test= "ew.entity.isReceive!=null" > AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test= "ew.entity.turnoutWorkcenter!=null" > AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test= "ew.entity.turnoutItem!=null" > AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test= "ew.entity.other4!=null" > AND OTHER4=#{ew.entity.other4}</if>
<if test= "ew.entity.other5!=null" > AND OTHER5=#{ew.entity.other5}</if>
<if test= "ew.entity.other6!=null" > AND OTHER6=#{ew.entity.other6}</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.deleteUser!=null" > AND DELETE_USER=#{ew.entity.deleteUser}</if>
<if test= "ew.entity.deleteDateTime!=null" > AND DELETE_DATE_TIME=#{ew.entity.deleteDateTime}</if>
<if test= "ew.entity.createdUser!=null" > AND CREATED_USER=#{ew.entity.createdUser}</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_LOGISTICS_TURNOVER
<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.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.createdDateTime!=null" > AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test= "ew.entity.userId!=null" > AND USER_ID=#{ew.entity.userId}</if>
<if test= "ew.entity.userName!=null" > AND USER_NAME=#{ew.entity.userName}</if>
<if test= "ew.entity.other1!=null" > AND OTHER1=#{ew.entity.other1}</if>
<if test= "ew.entity.other2!=null" > AND OTHER2=#{ew.entity.other2}</if>
<if test= "ew.entity.other3!=null" > AND OTHER3=#{ew.entity.other3}</if>
<if test= "ew.entity.storageLocation!=null" > AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test= "ew.entity.turnoverWorkCenter!=null" > AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test= "ew.entity.comDateTime!=null" > AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test= "ew.entity.isReceive!=null" > AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test= "ew.entity.turnoutWorkcenter!=null" > AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test= "ew.entity.turnoutItem!=null" > AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test= "ew.entity.other4!=null" > AND OTHER4=#{ew.entity.other4}</if>
<if test= "ew.entity.other5!=null" > AND OTHER5=#{ew.entity.other5}</if>
<if test= "ew.entity.other6!=null" > AND OTHER6=#{ew.entity.other6}</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.deleteUser!=null" > AND DELETE_USER=#{ew.entity.deleteUser}</if>
<if test= "ew.entity.deleteDateTime!=null" > AND DELETE_DATE_TIME=#{ew.entity.deleteDateTime}</if>
<if test= "ew.entity.createdUser!=null" > AND CREATED_USER=#{ew.entity.createdUser}</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_LOGISTICS_TURNOVER
<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.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.createdDateTime!=null" > AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test= "ew.entity.userId!=null" > AND USER_ID=#{ew.entity.userId}</if>
<if test= "ew.entity.userName!=null" > AND USER_NAME=#{ew.entity.userName}</if>
<if test= "ew.entity.other1!=null" > AND OTHER1=#{ew.entity.other1}</if>
<if test= "ew.entity.other2!=null" > AND OTHER2=#{ew.entity.other2}</if>
<if test= "ew.entity.other3!=null" > AND OTHER3=#{ew.entity.other3}</if>
<if test= "ew.entity.storageLocation!=null" > AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test= "ew.entity.turnoverWorkCenter!=null" > AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test= "ew.entity.comDateTime!=null" > AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test= "ew.entity.isReceive!=null" > AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test= "ew.entity.turnoutWorkcenter!=null" > AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test= "ew.entity.turnoutItem!=null" > AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test= "ew.entity.other4!=null" > AND OTHER4=#{ew.entity.other4}</if>
<if test= "ew.entity.other5!=null" > AND OTHER5=#{ew.entity.other5}</if>
<if test= "ew.entity.other6!=null" > AND OTHER6=#{ew.entity.other6}</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.deleteUser!=null" > AND DELETE_USER=#{ew.entity.deleteUser}</if>
<if test= "ew.entity.deleteDateTime!=null" > AND DELETE_DATE_TIME=#{ew.entity.deleteDateTime}</if>
<if test= "ew.entity.createdUser!=null" > AND CREATED_USER=#{ew.entity.createdUser}</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.LogisticsTurnover" >
INSERT INTO Z_LOGISTICS_TURNOVER
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
HANDLE,
<if test= "sfcDispatchBo!=null" > SFC_DISPATCH_BO,</if>
<if test= "status!=null" > STATUS,</if>
<if test= "createdDateTime!=null" > CREATED_DATE_TIME,</if>
<if test= "userId!=null" > USER_ID,</if>
<if test= "userName!=null" > USER_NAME,</if>
<if test= "other1!=null" > OTHER1,</if>
<if test= "other2!=null" > OTHER2,</if>
<if test= "other3!=null" > OTHER3,</if>
<if test= "storageLocation!=null" > STORAGE_LOCATION,</if>
<if test= "turnoverWorkCenter!=null" > TURNOVER_WORK_CENTER,</if>
<if test= "comDateTime!=null" > COM_DATE_TIME,</if>
<if test= "isReceive!=null" > IS_RECEIVE,</if>
<if test= "turnoutWorkcenter!=null" > TURNOUT_WORKCENTER,</if>
<if test= "turnoutItem!=null" > TURNOUT_ITEM,</if>
<if test= "other4!=null" > OTHER4,</if>
<if test= "other5!=null" > OTHER5,</if>
<if test= "other6!=null" > OTHER6,</if>
<if test= "shopOrder!=null" > SHOP_ORDER,</if>
<if test= "sfc!=null" > SFC,</if>
<if test= "deleteUser!=null" > DELETE_USER,</if>
<if test= "deleteDateTime!=null" > DELETE_DATE_TIME,</if>
<if test= "createdUser!=null" > CREATED_USER,</if>
<if test= "nextStep!=null" > NEXT_STEP,</if>
</trim> VALUES
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
#{handle},
<if test= "sfcDispatchBo!=null" > #{sfcDispatchBo},</if>
<if test= "status!=null" > #{status},</if>
<if test= "createdDateTime!=null" > #{createdDateTime},</if>
<if test= "userId!=null" > #{userId},</if>
<if test= "userName!=null" > #{userName},</if>
<if test= "other1!=null" > #{other1},</if>
<if test= "other2!=null" > #{other2},</if>
<if test= "other3!=null" > #{other3},</if>
<if test= "storageLocation!=null" > #{storageLocation},</if>
<if test= "turnoverWorkCenter!=null" > #{turnoverWorkCenter},</if>
<if test= "comDateTime!=null" > #{comDateTime},</if>
<if test= "isReceive!=null" > #{isReceive},</if>
<if test= "turnoutWorkcenter!=null" > #{turnoutWorkcenter},</if>
<if test= "turnoutItem!=null" > #{turnoutItem},</if>
<if test= "other4!=null" > #{other4},</if>
<if test= "other5!=null" > #{other5},</if>
<if test= "other6!=null" > #{other6},</if>
<if test= "shopOrder!=null" > #{shopOrder},</if>
<if test= "sfc!=null" > #{sfc},</if>
<if test= "deleteUser!=null" > #{deleteUser},</if>
<if test= "deleteDateTime!=null" > #{deleteDateTime},</if>
<if test= "createdUser!=null" > #{createdUser},</if>
<if test= "nextStep!=null" > #{nextStep},</if>
</trim>
</insert>
<insert id= "insertAllColumn" parameterType= "com.foreverwin.mesnac.meapi.model.LogisticsTurnover" >
INSERT INTO Z_LOGISTICS_TURNOVER
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<include refid= "Base_Column_List" > </include>
</trim> VALUES
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
#{handle},
#{sfcDispatchBo},
#{status},
#{createdDateTime},
#{userId},
#{userName},
#{other1},
#{other2},
#{other3},
#{storageLocation},
#{turnoverWorkCenter},
#{comDateTime},
#{isReceive},
#{turnoutWorkcenter},
#{turnoutItem},
#{other4},
#{other5},
#{other6},
#{shopOrder},
#{sfc},
#{deleteUser},
#{deleteDateTime},
#{createdUser},
</trim>
</insert>
<update id= "updateById" >
UPDATE Z_LOGISTICS_TURNOVER <trim prefix= "SET" suffixOverrides= "," >
<if test= "et.sfcDispatchBo!=null" > SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
<if test= "et.status!=null" > STATUS=#{et.status},</if>
<if test= "et.createdDateTime!=null" > CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test= "et.userId!=null" > USER_ID=#{et.userId},</if>
<if test= "et.userName!=null" > USER_NAME=#{et.userName},</if>
<if test= "et.other1!=null" > OTHER1=#{et.other1},</if>
<if test= "et.other2!=null" > OTHER2=#{et.other2},</if>
<if test= "et.other3!=null" > OTHER3=#{et.other3},</if>
<if test= "et.storageLocation!=null" > STORAGE_LOCATION=#{et.storageLocation},</if>
<if test= "et.turnoverWorkCenter!=null" > TURNOVER_WORK_CENTER=#{et.turnoverWorkCenter},</if>
<if test= "et.comDateTime!=null" > COM_DATE_TIME=#{et.comDateTime},</if>
<if test= "et.isReceive!=null" > IS_RECEIVE=#{et.isReceive},</if>
<if test= "et.turnoutWorkcenter!=null" > TURNOUT_WORKCENTER=#{et.turnoutWorkcenter},</if>
<if test= "et.turnoutItem!=null" > TURNOUT_ITEM=#{et.turnoutItem},</if>
<if test= "et.other4!=null" > OTHER4=#{et.other4},</if>
<if test= "et.other5!=null" > OTHER5=#{et.other5},</if>
<if test= "et.other6!=null" > OTHER6=#{et.other6},</if>
<if test= "et.shopOrder!=null" > SHOP_ORDER=#{et.shopOrder},</if>
<if test= "et.sfc!=null" > SFC=#{et.sfc},</if>
<if test= "et.deleteUser!=null" > DELETE_USER=#{et.deleteUser},</if>
<if test= "et.deleteDateTime!=null" > DELETE_DATE_TIME=#{et.deleteDateTime},</if>
<if test= "et.createdUser!=null" > CREATED_USER=#{et.createdUser},</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_LOGISTICS_TURNOVER <trim prefix= "SET" suffixOverrides= "," >
SFC_DISPATCH_BO=#{et.sfcDispatchBo},
STATUS=#{et.status},
CREATED_DATE_TIME=#{et.createdDateTime},
USER_ID=#{et.userId},
USER_NAME=#{et.userName},
OTHER1=#{et.other1},
OTHER2=#{et.other2},
OTHER3=#{et.other3},
STORAGE_LOCATION=#{et.storageLocation},
TURNOVER_WORK_CENTER=#{et.turnoverWorkCenter},
COM_DATE_TIME=#{et.comDateTime},
IS_RECEIVE=#{et.isReceive},
TURNOUT_WORKCENTER=#{et.turnoutWorkcenter},
TURNOUT_ITEM=#{et.turnoutItem},
OTHER4=#{et.other4},
OTHER5=#{et.other5},
OTHER6=#{et.other6},
SHOP_ORDER=#{et.shopOrder},
SFC=#{et.sfc},
DELETE_USER=#{et.deleteUser},
DELETE_DATE_TIME=#{et.deleteDateTime},
CREATED_USER=#{et.createdUser},
</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_LOGISTICS_TURNOVER <trim prefix= "SET" suffixOverrides= "," >
<if test= "et.sfcDispatchBo!=null" > SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
<if test= "et.status!=null" > STATUS=#{et.status},</if>
<if test= "et.createdDateTime!=null" > CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test= "et.userId!=null" > USER_ID=#{et.userId},</if>
<if test= "et.userName!=null" > USER_NAME=#{et.userName},</if>
<if test= "et.other1!=null" > OTHER1=#{et.other1},</if>
<if test= "et.other2!=null" > OTHER2=#{et.other2},</if>
<if test= "et.other3!=null" > OTHER3=#{et.other3},</if>
<if test= "et.storageLocation!=null" > STORAGE_LOCATION=#{et.storageLocation},</if>
<if test= "et.turnoverWorkCenter!=null" > TURNOVER_WORK_CENTER=#{et.turnoverWorkCenter},</if>
<if test= "et.comDateTime!=null" > COM_DATE_TIME=#{et.comDateTime},</if>
<if test= "et.isReceive!=null" > IS_RECEIVE=#{et.isReceive},</if>
<if test= "et.turnoutWorkcenter!=null" > TURNOUT_WORKCENTER=#{et.turnoutWorkcenter},</if>
<if test= "et.turnoutItem!=null" > TURNOUT_ITEM=#{et.turnoutItem},</if>
<if test= "et.other4!=null" > OTHER4=#{et.other4},</if>
<if test= "et.other5!=null" > OTHER5=#{et.other5},</if>
<if test= "et.other6!=null" > OTHER6=#{et.other6},</if>
<if test= "et.shopOrder!=null" > SHOP_ORDER=#{et.shopOrder},</if>
<if test= "et.sfc!=null" > SFC=#{et.sfc},</if>
<if test= "et.deleteUser!=null" > DELETE_USER=#{et.deleteUser},</if>
<if test= "et.deleteDateTime!=null" > DELETE_DATE_TIME=#{et.deleteDateTime},</if>
<if test= "et.createdUser!=null" > CREATED_USER=#{et.createdUser},</if>
</trim>
<where >
<if test= "ew!=null" >
<if test= "ew.entity!=null" >
HANDLE=#{ew.entity.handle}
<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.createdDateTime!=null" > AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test= "ew.entity.userId!=null" > AND USER_ID=#{ew.entity.userId}</if>
<if test= "ew.entity.userName!=null" > AND USER_NAME=#{ew.entity.userName}</if>
<if test= "ew.entity.other1!=null" > AND OTHER1=#{ew.entity.other1}</if>
<if test= "ew.entity.other2!=null" > AND OTHER2=#{ew.entity.other2}</if>
<if test= "ew.entity.other3!=null" > AND OTHER3=#{ew.entity.other3}</if>
<if test= "ew.entity.storageLocation!=null" > AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test= "ew.entity.turnoverWorkCenter!=null" > AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test= "ew.entity.comDateTime!=null" > AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test= "ew.entity.isReceive!=null" > AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test= "ew.entity.turnoutWorkcenter!=null" > AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test= "ew.entity.turnoutItem!=null" > AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test= "ew.entity.other4!=null" > AND OTHER4=#{ew.entity.other4}</if>
<if test= "ew.entity.other5!=null" > AND OTHER5=#{ew.entity.other5}</if>
<if test= "ew.entity.other6!=null" > AND OTHER6=#{ew.entity.other6}</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.deleteUser!=null" > AND DELETE_USER=#{ew.entity.deleteUser}</if>
<if test= "ew.entity.deleteDateTime!=null" > AND DELETE_DATE_TIME=#{ew.entity.deleteDateTime}</if>
<if test= "ew.entity.createdUser!=null" > AND CREATED_USER=#{ew.entity.createdUser}</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_LOGISTICS_TURNOVER WHERE HANDLE=#{handle}
</delete>
<delete id= "deleteByMap" >
DELETE FROM Z_LOGISTICS_TURNOVER
<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_LOGISTICS_TURNOVER
<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.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.createdDateTime!=null" > AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test= "ew.entity.userId!=null" > AND USER_ID=#{ew.entity.userId}</if>
<if test= "ew.entity.userName!=null" > AND USER_NAME=#{ew.entity.userName}</if>
<if test= "ew.entity.other1!=null" > AND OTHER1=#{ew.entity.other1}</if>
<if test= "ew.entity.other2!=null" > AND OTHER2=#{ew.entity.other2}</if>
<if test= "ew.entity.other3!=null" > AND OTHER3=#{ew.entity.other3}</if>
<if test= "ew.entity.storageLocation!=null" > AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test= "ew.entity.turnoverWorkCenter!=null" > AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test= "ew.entity.comDateTime!=null" > AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test= "ew.entity.isReceive!=null" > AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test= "ew.entity.turnoutWorkcenter!=null" > AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test= "ew.entity.turnoutItem!=null" > AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test= "ew.entity.other4!=null" > AND OTHER4=#{ew.entity.other4}</if>
<if test= "ew.entity.other5!=null" > AND OTHER5=#{ew.entity.other5}</if>
<if test= "ew.entity.other6!=null" > AND OTHER6=#{ew.entity.other6}</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.deleteUser!=null" > AND DELETE_USER=#{ew.entity.deleteUser}</if>
<if test= "ew.entity.deleteDateTime!=null" > AND DELETE_DATE_TIME=#{ew.entity.deleteDateTime}</if>
<if test= "ew.entity.createdUser!=null" > AND CREATED_USER=#{ew.entity.createdUser}</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_LOGISTICS_TURNOVER WHERE HANDLE IN (
<foreach item= "item" index= "index" collection= "coll" separator= "," > #{item}
</foreach> )
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<select id= "queryNewtistTurnoverTask" resultType= "com.foreverwin.mesnac.meapi.model.LogisticsTurnover" >
SELECT
*
FROM
(
SELECT
ZLT.HANDLE,
ZLT.TURNOVER_WORK_CENTER NEXT_WORK_CENTER,
WCT.DESCRIPTION TURNOVER_WORK_CENTER
FROM
Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZLT.TURNOVER_WORK_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WC.HANDLE = WCT.WORK_CENTER_BO
WHERE
ZLT.SFC_DISPATCH_BO = #{sfcDispatchBo}
ORDER BY
ZLT.CREATED_DATE_TIME DESC
)
WHERE
ROWNUM = 1
</select>
<select id= "queryLogisticsTurnoverList" resultType= "com.foreverwin.mesnac.meapi.dto.LogisticsDto" >
SELECT
row_number ( ) OVER ( PARTITION BY ZLT.TURNOVER_WORK_CENTER ORDER BY ZLT.CREATED_DATE_TIME DESC ),
WCT.DESCRIPTION NEXT_WORK_CENTER,
ZSD.SFC,
C1.VALUE WORK_ORDER,
IT.DESCRIPTION ITEM_DESCRIPTION,
ZSD.BLANKING_SIZE,
ZSD.DISPATCH_QTY,
OT1.DESCRIPTION OVER_OPERATION,
CASE WHEN OT.DESCRIPTION = '虚拟工序' AND CF.VALUE IS NOT NULL THEN concat(OT.DESCRIPTION,'('|| CF.VALUE ||')') ELSE OT.DESCRIPTION END NEXT_OPERATION,
ZSD.EMPLOYEE_DESCRIPTION,
ZLT.TURNOVER_WORK_CENTER,
ZLT.CREATED_DATE_TIME
FROM
Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZLT.TURNOVER_WORK_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
LEFT JOIN Z_SFC_DISPATCH ZSD ON ZLT.SFC_DISPATCH_BO = ZSD.HANDLE
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = 'RouterOperationBO:RouterStepBO:' || ZSD.ROUTER_BO || ',' || ZLT.NEXT_STEP AND CF.ATTRIBUTE='SOURCE_DESCRIPTION'
LEFT JOIN OPERATION O1 ON O1.OPERATION = ZSD.OPERATION
LEFT JOIN OPERATION_T OT1 ON OT1.OPERATION_BO = O1.HANDLE
LEFT JOIN OPERATION O ON O.OPERATION = ZLT.OTHER1
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE
AND SO.SHOP_ORDER = ZSD.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE
AND C1."ATTRIBUTE" = 'WORK_ORDER'
INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE
AND IT.LOCALE = 'zh'
INNER JOIN OPERATION O ON O.SITE = ZSD.SITE
AND O.OPERATION = ZSD.OPERATION
AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
AND OT.LOCALE = 'zh'
WHERE ZLT.STATUS = 'NEW' AND ZLT.OTHER6 = '0'
<if test= "HJHJ!=null" > AND ZLT.TURNOUT_ITEM like '02%' AND ZLT.TURNOUT_WORKCENTER = 'HJ' </if>
<if test= "HJXL!=null" > AND (ZLT.TURNOUT_ITEM like '03%' OR ZLT.TURNOUT_ITEM like '06%') AND ZLT.TURNOUT_WORKCENTER = 'HJ' </if>
<if test= "JJ!=null" > AND ZLT.TURNOUT_WORKCENTER = 'JJ' </if>
<if test= "WX!=null" > AND ZLT.TURNOUT_WORKCENTER = 'WX' </if>
<if test= "RC!=null" > AND ZLT.TURNOUT_WORKCENTER = 'RC' </if>
<if test= "ZP!=null" > AND ZLT.TURNOUT_WORKCENTER = 'ZP' </if>
</select>
<sql id= "Select_LogisticsTurnOver_List" >
WCT.DESCRIPTION NEXT_WORK_CENTER,
ZSD.SFC,
C1.VALUE WORK_ORDER,
IT.DESCRIPTION ITEM_DESCRIPTION,
ZSD.BLANKING_SIZE,
ZSD.DISPATCH_QTY,
OT1.DESCRIPTION OVER_OPERATION,
OT.DESCRIPTION NEXT_OPERATION,
ZSD.EMPLOYEE_DESCRIPTION,
ZLT.TURNOVER_WORK_CENTER,
ZLT.CREATED_DATE_TIME
</sql>
<select id= "selectLogisticsDtoPage" resultType= "com.foreverwin.mesnac.meapi.dto.LogisticsDto" >
SELECT <include refid= "Select_LogisticsTurnOver_List" > </include> FROM Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZLT.TURNOVER_WORK_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
LEFT JOIN Z_SFC_DISPATCH ZSD ON ZLT.SFC_DISPATCH_BO = ZSD.HANDLE
LEFT JOIN OPERATION O1 ON O1.OPERATION = ZSD.OPERATION
LEFT JOIN OPERATION_T OT1 ON OT1.OPERATION_BO = O1.HANDLE
LEFT JOIN OPERATION O ON O.OPERATION = ZLT.OTHER1
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE
AND SO.SHOP_ORDER = ZSD.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE
AND C1."ATTRIBUTE" = 'WORK_ORDER'
INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE
AND IT.LOCALE = 'zh'
INNER JOIN OPERATION O ON O.SITE = ZSD.SITE
AND O.OPERATION = ZSD.OPERATION
AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
AND OT.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.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.createdDateTime!=null" > AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test= "ew.entity.userId!=null" > AND USER_ID=#{ew.entity.userId}</if>
<if test= "ew.entity.userName!=null" > AND USER_NAME=#{ew.entity.userName}</if>
<if test= "ew.entity.other1!=null" > AND OTHER1=#{ew.entity.other1}</if>
<if test= "ew.entity.other2!=null" > AND OTHER2=#{ew.entity.other2}</if>
<if test= "ew.entity.other3!=null" > AND OTHER3=#{ew.entity.other3}</if>
<if test= "ew.entity.storageLocation!=null" > AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test= "ew.entity.turnoverWorkCenter!=null" > AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test= "ew.entity.comDateTime!=null" > AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test= "ew.entity.isReceive!=null" > AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test= "ew.entity.turnoutWorkcenter!=null" > AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test= "ew.entity.turnoutItem!=null" > AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test= "ew.entity.other4!=null" > AND OTHER4=#{ew.entity.other4}</if>
<if test= "ew.entity.other5!=null" > AND OTHER5=#{ew.entity.other5}</if>
<if test= "ew.entity.other6!=null" > AND OTHER6=#{ew.entity.other6}</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= "selectlogisticsturnoverlist" resultType= "com.foreverwin.mesnac.meapi.dto.LogisticsDto" parameterType= "com.foreverwin.mesnac.meapi.dto.LogisticsDto" >
SELECT distinct
ZLT.HANDLE,
WCT.DESCRIPTION NEXT_WORK_CENTER,
WCT2.DESCRIPTION TURNOUT_WORKCENTER,
ZSD.SFC,
C1.VALUE WORK_ORDER,
IT.DESCRIPTION ITEM_DESCRIPTION,
ZSD.BLANKING_SIZE,
ZSD.DISPATCH_QTY,
OT1.DESCRIPTION OVER_OPERATION,
CASE WHEN OT.DESCRIPTION = '虚拟工序' AND CF.VALUE IS NOT NULL THEN concat(OT.DESCRIPTION,'('|| CF.VALUE ||')') ELSE OT.DESCRIPTION END NEXT_OPERATION,
ZSD.EMPLOYEE_DESCRIPTION,
ZLT.TURNOVER_WORK_CENTER,
ZLT.CREATED_DATE_TIME,
C2.VALUE TEXTURE,
SO.QTY_TO_BUILD,
SO.SHOP_ORDER,
ZL.DESCRIPTION ZL_DESCRIPTION,
ZLT.STATUS,
CASE WHEN ZLT.IS_RECEIVE = 'Y' THEN '已接收' ELSE '未接收' END IS_RECEIVE,
ZNU.FULL_NAME COMFIRM_USER,
ZNU2.FULL_NAME DELETE_USER,
ZLT.COM_DATE_TIME,
ZLT.OTHER4,
CASE WHEN ZLT.OTHER6 ='1' THEN '已删除' ELSE '' END OTHER6
FROM
Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN Z_NWA_USER ZNU ON ZLT.OTHER5 = ZNU.USER_NAME
LEFT JOIN Z_NWA_USER ZNU2 ON ZLT.DELETE_USER = ZNU2.USER_NAME
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZLT.TURNOVER_WORK_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
LEFT JOIN WORK_CENTER WC1 ON WC1.WORK_CENTER = ZLT.TURNOUT_WORKCENTER
LEFT JOIN WORK_CENTER_T WCT2 ON WCT2.WORK_CENTER_BO = WC1.HANDLE
LEFT JOIN Z_SFC_DISPATCH ZSD ON ZLT.SFC_DISPATCH_BO = ZSD.HANDLE
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = 'RouterOperationBO:RouterStepBO:' || ZSD.ROUTER_BO || ',' || ZLT.NEXT_STEP AND CF.ATTRIBUTE='SOURCE_DESCRIPTION'
LEFT JOIN OPERATION O1 ON O1.OPERATION = ZSD.OPERATION
LEFT JOIN OPERATION_T OT1 ON OT1.OPERATION_BO = O1.HANDLE
LEFT JOIN OPERATION O ON O.OPERATION = ZLT.OTHER1
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
LEFT JOIN Z_LOCATION ZL ON ZL.LOCATION_CODE = ZLT.STORAGE_LOCATION
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE
AND SO.SHOP_ORDER = ZSD.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE
AND C1."ATTRIBUTE" = 'WORK_ORDER'
INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO
LEFT JOIN CUSTOM_FIELDS C2 ON C2.HANDLE = IM.HANDLE AND C2.ATTRIBUTE = 'TEXTTURE'
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE
AND IT.LOCALE = 'zh'
INNER JOIN OPERATION O ON O.SITE = ZSD.SITE
AND O.OPERATION = ZSD.OPERATION
AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
AND OT.LOCALE = 'zh'
<where >
ZSD.SITE='1000'
<if test= "other6!=null and other6 != ''" > AND ZLT.OTHER6 = #{other6}</if>
<if test= "status!=null" > AND STATUS=#{status}</if>
<if test= "turnoutWorkcenter!=null" > AND TURNOUT_WORKCENTER=#{turnoutWorkcenter}</if>
<if test= "nextWorkCenter!=null" > AND TURNOVER_WORK_CENTER=#{nextWorkCenter}</if>
<if test= "isReceive!=null" > AND IS_RECEIVE=#{isReceive}</if>
<if test= "turnoutItem!=null" > AND TURNOUT_ITEM=#{turnoutItem}</if>
<if test= "itemDescription!=null" > AND IT.DESCRIPTION LIKE '%'||#{itemDescription}||'%'</if>
<if test= "workOrder!=null" > AND C1.VALUE LIKE '%'||#{workOrder}||'%'</if>
<if test= "shopOrder!=null" > AND SO.SHOP_ORDER=#{shopOrder}</if>
<if test= "sfc!=null" > AND ZSD.SFC LIKE '%'||#{sfc}||'%'</if>
<if test= "startFromDate != null" >
AND ZLT.COM_DATE_TIME >= TO_DATE(#{startFromDate}, 'YYYY-MM-DD')
</if>
<if test= "startToDate != null" >
AND ZLT.COM_DATE_TIME < = TO_DATE(#{startToDate}|| '15:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
<if test= "completeFromDate != null" >
AND ZLT.OTHER4 >= TO_DATE(#{completeFromDate}, 'YYYY-MM-DD')
</if>
<if test= "completeToDate != null" >
AND ZLT.OTHER4 < = TO_DATE(#{completeToDate}|| '15:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
ORDER BY ZLT.COM_DATE_TIME DESC
</where>
</select>
<resultMap id= "StoreSfcInfoM" type= "com.foreverwin.mesnac.meapi.model.StoreSfcInfo" >
<result column= "SFC" property= "sfc" />
<result column= "DISPATCH_QTY" property= "dispatch_qty" />
<result column= "ITEM_BO" property= "item_bo" />
<result column= "DESCRIPTION" property= "description" />
<result column= "WORK_ORDER" property= "work_order" />
<result column= "ITEM_NUMBER" property= "item_number" />
<result column= "zs_qty" property= "zs_qty" />
<result column= "ls_qty" property= "ls_qty" />
</resultMap>
<select id= "storeSelectSfc" resultMap= "StoreSfcInfoM" >
SELECT *
FROM (SELECT zsd.sfc,
DISPATCH_QTY,
so.SHOP_ORDER,
substr(it.ITEM_BO,
instr(it.ITEM_BO, ',', 1, 1) + 1,
instr(it.ITEM_BO, ',', 1, 2) - instr(it.ITEM_BO, ',', 1, 1) - 1) as ITEM_BO,
it.DESCRIPTION,
ATTRIBUTE,
VALUE ,
IN_QTY,
IN_TYPE
FROM (select *
from (SELECT sfc, DISPATCH_QTY, SHOP_ORDER
FROM Z_SFC_DISPATCH
WHERE SFC = #{sfc}
ORDER BY ACTUAL_COMPLETE_DATE DESC)
where ROWNUM = 1) zsd
left join SHOP_ORDER so on so.SHOP_ORDER = zsd.SHOP_ORDER
left join ITEM_T it on it.ITEM_BO = so.ITEM_BO
LEFT JOIN CUSTOM_FIELDS cf
ON cf.HANDLE = SO.HANDLE AND cf.ATTRIBUTE in ('WORK_ORDER', 'ITEM_NUMBER')
left join STORE_RECORD_IN ri on ri.SFC = zsd.SFC
) a PIVOT (max(VALUE) FOR ATTRIBUTE IN ('WORK_ORDER' AS WORK_ORDER,'ITEM_NUMBER' AS ITEM_NUMBER))
PIVOT (sum(IN_QTY) FOR IN_TYPE IN ('0' AS zs_qty,'1' AS ls_qty) )
</select>
<insert id= "insertRecordInStore" >
INSERT INTO WIP.STORE_RECORD_IN (SFC, IN_QTY, STORE_LOCATION, WORK_USER, IN_TYPE)
VALUES (#{sfc}, #{qty}, #{storeLocation}, #{user}, #{inStoreType})
</insert>
<select id= "countLedgerBySfc" resultType= "integer" >
select count(1) from STORE_RECORD_LEDGER where SFC=#{sfc}
</select>
<select id= "messageMap" resultType= "java.util.Map" >
</select>
<insert id= "insertRecordLedger" >
INSERT INTO WIP.STORE_RECORD_LEDGER (SFC, IN_QTY, STORE_LOCATION) VALUES (#{sfc}, #{qty}, #{storeLocation})
</insert>
<update id= "updateRecordLedger" >
update WIP.STORE_RECORD_LEDGER set IN_QTY=IN_QTY+#{qty} where SFC=#{sfc}
</update>
</mapper>