You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

623 lines
38 KiB
XML

<?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.dispatch.mapper.CallItemMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.dispatch.model.CallItem">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="SFC_DISPATCH_BO" property="sfcDispatchBo" />
<result column="CALL_ITEM_NO" property="callItemNo" />
<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="COMPONENT_BO" property="componentBo" />
<result column="CALL_TYPE" property="callType" />
<result column="REQUIRED_QTY" property="requiredQty" />
<result column="REQUIRED_DATE_TIME" property="requiredDateTime" />
<result column="STATUS" property="status" />
<result column="CALL_STATUS" property="callStatus" />
<result column="ISSUE_STATUS" property="issueStatus" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="UPDATE_USER" property="updateUser" />
<result column="UPDATED_DATE_TIME" property="updatedDateTime" />
<result column="WORK_ORDER" property="workOrder" />
<result column="RESOURCE_TYPE" property="resourceType" />
<result column="DISPATCH_QTY" property="dispatchQty" />
<result column="BLANKING_SIZE" property="blankingSize" />
<result column="ITEM_DESCRIPTION" property="itemDescription" />
<result column="OPERATION_DESCRIPTION" property="operationDescription" />
<result column="REMARK" property="remark" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, SFC_DISPATCH_BO, CALL_ITEM_NO, SHOP_ORDER, SFC, OPERATION, STEP_ID, RESRCE, COMPONENT_BO, CALL_TYPE, REQUIRED_QTY, REQUIRED_DATE_TIME, STATUS, CALL_STATUS, ISSUE_STATUS, CREATE_USER, CREATED_DATE_TIME, UPDATE_USER, UPDATED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_CALL_ITEM WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_CALL_ITEM
<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_CALL_ITEM 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_CALL_ITEM
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</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.componentBo!=null"> AND COMPONENT_BO=#{ew.entity.componentBo}</if>
<if test="ew.entity.callType!=null"> AND CALL_TYPE=#{ew.entity.callType}</if>
<if test="ew.entity.requiredQty!=null"> AND REQUIRED_QTY=#{ew.entity.requiredQty}</if>
<if test="ew.entity.requiredDateTime!=null"> AND REQUIRED_DATE_TIME=#{ew.entity.requiredDateTime}</if>
<if test="ew.entity.issueQty!=null"> AND ISSUE_QTY=#{ew.entity.issueQty}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.callStatus!=null"> AND CALL_STATUS=#{ew.entity.callStatus}</if>
<if test="ew.entity.issueStatus!=null"> AND ISSUE_STATUS=#{ew.entity.issueStatus}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.updateUser!=null"> AND UPDATE_USER=#{ew.entity.updateUser}</if>
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_CALL_ITEM
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</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.componentBo!=null"> AND COMPONENT_BO=#{ew.entity.componentBo}</if>
<if test="ew.entity.callType!=null"> AND CALL_TYPE=#{ew.entity.callType}</if>
<if test="ew.entity.requiredQty!=null"> AND REQUIRED_QTY=#{ew.entity.requiredQty}</if>
<if test="ew.entity.requiredDateTime!=null"> AND REQUIRED_DATE_TIME=#{ew.entity.requiredDateTime}</if>
<if test="ew.entity.issueQty!=null"> AND ISSUE_QTY=#{ew.entity.issueQty}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.callStatus!=null"> AND CALL_STATUS=#{ew.entity.callStatus}</if>
<if test="ew.entity.issueStatus!=null"> AND ISSUE_STATUS=#{ew.entity.issueStatus}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.updateUser!=null"> AND UPDATE_USER=#{ew.entity.updateUser}</if>
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_CALL_ITEM
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</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.componentBo!=null"> AND COMPONENT_BO=#{ew.entity.componentBo}</if>
<if test="ew.entity.callType!=null"> AND CALL_TYPE=#{ew.entity.callType}</if>
<if test="ew.entity.requiredQty!=null"> AND REQUIRED_QTY=#{ew.entity.requiredQty}</if>
<if test="ew.entity.requiredDateTime!=null"> AND REQUIRED_DATE_TIME=#{ew.entity.requiredDateTime}</if>
<if test="ew.entity.issueQty!=null"> AND ISSUE_QTY=#{ew.entity.issueQty}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.callStatus!=null"> AND CALL_STATUS=#{ew.entity.callStatus}</if>
<if test="ew.entity.issueStatus!=null"> AND ISSUE_STATUS=#{ew.entity.issueStatus}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.updateUser!=null"> AND UPDATE_USER=#{ew.entity.updateUser}</if>
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_CALL_ITEM
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</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.componentBo!=null"> AND COMPONENT_BO=#{ew.entity.componentBo}</if>
<if test="ew.entity.callType!=null"> AND CALL_TYPE=#{ew.entity.callType}</if>
<if test="ew.entity.requiredQty!=null"> AND REQUIRED_QTY=#{ew.entity.requiredQty}</if>
<if test="ew.entity.requiredDateTime!=null"> AND REQUIRED_DATE_TIME=#{ew.entity.requiredDateTime}</if>
<if test="ew.entity.issueQty!=null"> AND ISSUE_QTY=#{ew.entity.issueQty}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.callStatus!=null"> AND CALL_STATUS=#{ew.entity.callStatus}</if>
<if test="ew.entity.issueStatus!=null"> AND ISSUE_STATUS=#{ew.entity.issueStatus}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.updateUser!=null"> AND UPDATE_USER=#{ew.entity.updateUser}</if>
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_CALL_ITEM
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</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.componentBo!=null"> AND COMPONENT_BO=#{ew.entity.componentBo}</if>
<if test="ew.entity.callType!=null"> AND CALL_TYPE=#{ew.entity.callType}</if>
<if test="ew.entity.requiredQty!=null"> AND REQUIRED_QTY=#{ew.entity.requiredQty}</if>
<if test="ew.entity.requiredDateTime!=null"> AND REQUIRED_DATE_TIME=#{ew.entity.requiredDateTime}</if>
<if test="ew.entity.issueQty!=null"> AND ISSUE_QTY=#{ew.entity.issueQty}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.callStatus!=null"> AND CALL_STATUS=#{ew.entity.callStatus}</if>
<if test="ew.entity.issueStatus!=null"> AND ISSUE_STATUS=#{ew.entity.issueStatus}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.updateUser!=null"> AND UPDATE_USER=#{ew.entity.updateUser}</if>
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_CALL_ITEM
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</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.componentBo!=null"> AND COMPONENT_BO=#{ew.entity.componentBo}</if>
<if test="ew.entity.callType!=null"> AND CALL_TYPE=#{ew.entity.callType}</if>
<if test="ew.entity.requiredQty!=null"> AND REQUIRED_QTY=#{ew.entity.requiredQty}</if>
<if test="ew.entity.requiredDateTime!=null"> AND REQUIRED_DATE_TIME=#{ew.entity.requiredDateTime}</if>
<if test="ew.entity.issueQty!=null"> AND ISSUE_QTY=#{ew.entity.issueQty}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.callStatus!=null"> AND CALL_STATUS=#{ew.entity.callStatus}</if>
<if test="ew.entity.issueStatus!=null"> AND ISSUE_STATUS=#{ew.entity.issueStatus}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.updateUser!=null"> AND UPDATE_USER=#{ew.entity.updateUser}</if>
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_CALL_ITEM
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</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.componentBo!=null"> AND COMPONENT_BO=#{ew.entity.componentBo}</if>
<if test="ew.entity.callType!=null"> AND CALL_TYPE=#{ew.entity.callType}</if>
<if test="ew.entity.requiredQty!=null"> AND REQUIRED_QTY=#{ew.entity.requiredQty}</if>
<if test="ew.entity.requiredDateTime!=null"> AND REQUIRED_DATE_TIME=#{ew.entity.requiredDateTime}</if>
<if test="ew.entity.issueQty!=null"> AND ISSUE_QTY=#{ew.entity.issueQty}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.callStatus!=null"> AND CALL_STATUS=#{ew.entity.callStatus}</if>
<if test="ew.entity.issueStatus!=null"> AND ISSUE_STATUS=#{ew.entity.issueStatus}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.updateUser!=null"> AND UPDATE_USER=#{ew.entity.updateUser}</if>
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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.dispatch.model.CallItem">
INSERT INTO Z_CALL_ITEM
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="sfcDispatchBo!=null">SFC_DISPATCH_BO,</if>
<if test="callItemNo!=null">CALL_ITEM_NO,</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="componentBo!=null">COMPONENT_BO,</if>
<if test="callType!=null">CALL_TYPE,</if>
<if test="requiredQty!=null">REQUIRED_QTY,</if>
<if test="requiredDateTime!=null">REQUIRED_DATE_TIME,</if>
<if test="issueQty!=null">ISSUE_QTY,</if>
<if test="status!=null">STATUS,</if>
<if test="callStatus!=null">CALL_STATUS,</if>
<if test="issueStatus!=null">ISSUE_STATUS,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="updateUser!=null">UPDATE_USER,</if>
<if test="updatedDateTime!=null">UPDATED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="sfcDispatchBo!=null">#{sfcDispatchBo},</if>
<if test="callItemNo!=null">#{callItemNo},</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="componentBo!=null">#{componentBo},</if>
<if test="callType!=null">#{callType},</if>
<if test="requiredQty!=null">#{requiredQty},</if>
<if test="requiredDateTime!=null">#{requiredDateTime},</if>
<if test="issueQty!=null">#{issueQty},</if>
<if test="status!=null">#{status},</if>
<if test="callStatus!=null">#{callStatus},</if>
<if test="issueStatus!=null">#{issueStatus},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="updateUser!=null">#{updateUser},</if>
<if test="updatedDateTime!=null">#{updatedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.dispatch.model.CallItem">
INSERT INTO Z_CALL_ITEM
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{sfcDispatchBo},
#{callItemNo},
#{shopOrder},
#{sfc},
#{operation},
#{stepId},
#{resrce},
#{componentBo},
#{callType},
#{requiredQty},
#{requiredDateTime},
#{issueQty},
#{status},
#{callStatus},
#{issueStatus},
#{createUser},
#{createdDateTime},
#{updateUser},
#{updatedDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_CALL_ITEM <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.callItemNo!=null">CALL_ITEM_NO=#{et.callItemNo},</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.componentBo!=null">COMPONENT_BO=#{et.componentBo},</if>
<if test="et.callType!=null">CALL_TYPE=#{et.callType},</if>
<if test="et.requiredQty!=null">REQUIRED_QTY=#{et.requiredQty},</if>
<if test="et.requiredDateTime!=null">REQUIRED_DATE_TIME=#{et.requiredDateTime},</if>
<if test="et.issueQty!=null">ISSUE_QTY=#{et.issueQty},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.callStatus!=null">CALL_STATUS=#{et.callStatus},</if>
<if test="et.issueStatus!=null">ISSUE_STATUS=#{et.issueStatus},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.updateUser!=null">UPDATE_USER=#{et.updateUser},</if>
<if test="et.updatedDateTime!=null">UPDATED_DATE_TIME=#{et.updatedDateTime},</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_CALL_ITEM <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
SFC_DISPATCH_BO=#{et.sfcDispatchBo},
CALL_ITEM_NO=#{et.callItemNo},
SHOP_ORDER=#{et.shopOrder},
SFC=#{et.sfc},
OPERATION=#{et.operation},
STEP_ID=#{et.stepId},
RESRCE=#{et.resrce},
COMPONENT_BO=#{et.componentBo},
CALL_TYPE=#{et.callType},
REQUIRED_QTY=#{et.requiredQty},
REQUIRED_DATE_TIME=#{et.requiredDateTime},
ISSUE_QTY=#{et.issueQty},
STATUS=#{et.status},
CALL_STATUS=#{et.callStatus},
ISSUE_STATUS=#{et.issueStatus},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
UPDATE_USER=#{et.updateUser},
UPDATED_DATE_TIME=#{et.updatedDateTime},
</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_CALL_ITEM <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.callItemNo!=null">CALL_ITEM_NO=#{et.callItemNo},</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.componentBo!=null">COMPONENT_BO=#{et.componentBo},</if>
<if test="et.callType!=null">CALL_TYPE=#{et.callType},</if>
<if test="et.requiredQty!=null">REQUIRED_QTY=#{et.requiredQty},</if>
<if test="et.requiredDateTime!=null">REQUIRED_DATE_TIME=#{et.requiredDateTime},</if>
<if test="et.issueQty!=null">ISSUE_QTY=#{et.issueQty},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.callStatus!=null">CALL_STATUS=#{et.callStatus},</if>
<if test="et.issueStatus!=null">ISSUE_STATUS=#{et.issueStatus},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.updateUser!=null">UPDATE_USER=#{et.updateUser},</if>
<if test="et.updatedDateTime!=null">UPDATED_DATE_TIME=#{et.updatedDateTime},</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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</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.componentBo!=null"> AND COMPONENT_BO=#{ew.entity.componentBo}</if>
<if test="ew.entity.callType!=null"> AND CALL_TYPE=#{ew.entity.callType}</if>
<if test="ew.entity.requiredQty!=null"> AND REQUIRED_QTY=#{ew.entity.requiredQty}</if>
<if test="ew.entity.requiredDateTime!=null"> AND REQUIRED_DATE_TIME=#{ew.entity.requiredDateTime}</if>
<if test="ew.entity.issueQty!=null"> AND ISSUE_QTY=#{ew.entity.issueQty}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.callStatus!=null"> AND CALL_STATUS=#{ew.entity.callStatus}</if>
<if test="ew.entity.issueStatus!=null"> AND ISSUE_STATUS=#{ew.entity.issueStatus}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.updateUser!=null"> AND UPDATE_USER=#{ew.entity.updateUser}</if>
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_CALL_ITEM WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_CALL_ITEM
<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_CALL_ITEM
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</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.componentBo!=null"> AND COMPONENT_BO=#{ew.entity.componentBo}</if>
<if test="ew.entity.callType!=null"> AND CALL_TYPE=#{ew.entity.callType}</if>
<if test="ew.entity.requiredQty!=null"> AND REQUIRED_QTY=#{ew.entity.requiredQty}</if>
<if test="ew.entity.requiredDateTime!=null"> AND REQUIRED_DATE_TIME=#{ew.entity.requiredDateTime}</if>
<if test="ew.entity.issueQty!=null"> AND ISSUE_QTY=#{ew.entity.issueQty}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.callStatus!=null"> AND CALL_STATUS=#{ew.entity.callStatus}</if>
<if test="ew.entity.issueStatus!=null"> AND ISSUE_STATUS=#{ew.entity.issueStatus}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.updateUser!=null"> AND UPDATE_USER=#{ew.entity.updateUser}</if>
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_CALL_ITEM WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<delete id="deleteDispatchCallItem">
DELETE FROM Z_CALL_ITEM WHERE SFC_DISPATCH_BO IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item.handle}
</foreach>
</delete>
<select id="selectDispatchCallItem" resultMap="BaseResultMap">
SELECT ZSD.HANDLE SFC_DISPATCH_BO, ZSD.SITE, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, ZSD.OPERATION, ZSD.STEP_ID, ZSD.RESRCE, BC.COMPONENT_GBO COMPONENT_BO,
SC.QTY*BC.QTY REQUIRED_QTY, ZSD.PLANNED_START_DATE REQUIRED_DATE_TIME
FROM Z_SFC_DISPATCH ZSD
INNER JOIN SFC SC ON SC.SITE = ZSD.SITE AND SC.SFC = ZSD.SFC
INNER JOIN SFC_BOM SB ON SB.SFC_BO = SC.HANDLE
INNER JOIN BOM_COMPONENT BC ON BC.BOM_BO = SB.BOM_BO
INNER JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO
INNER JOIN BOM_OPERATION BO ON BO.BOM_COMPONENT_BO = BC.HANDLE AND BO.OPERATION_BO = 'OperationBO:'||SC.SITE||','||ZSD.OPERATION||',#'
INNER JOIN CUSTOM_FIELDS CF ON CF.HANDLE = BC.HANDLE AND CF."ATTRIBUTE" = 'STEP_ID' AND CF.VALUE = ZSD.STEP_ID
WHERE ZSD.HANDLE IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item.handle}
</foreach>
</select>
<select id="findCallItemList" resultMap="BaseResultMap">
SELECT ZCI.HANDLE, ZCI.SITE, CF.VALUE WORK_ORDER, ZSD.WORK_CENTER, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, CP.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, ZSD.BLANKING_SIZE,
ZSD.DISPATCH_STATUS, ZCI.OPERATION, OPT.DESCRIPTION OPERATION_DESCRIPTION, ZSD.RESOURCE_TYPE, ZCI.RESRCE, ZSD.DISPATCH_QTY, ZSD.PLANNED_START_DATE, ZSD.REMARK
FROM Z_SFC_DISPATCH ZSD
INNER JOIN Z_CALL_ITEM ZCI ON ZCI.SFC_DISPATCH_BO = ZSD.HANDLE
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE AND ZSD.SHOP_ORDER = SO.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF.ATTRIBUTE = 'WORK_ORDER'
INNER JOIN ITEM CP ON CP.HANDLE = ZCI.COMPONENT_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = CP.HANDLE AND IT.LOCALE = 'zh'
INNER JOIN OPERATION OP ON OP.SITE = ZCI.SITE AND OP.OPERATION = ZCI.OPERATION AND OP.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OPT ON OPT.OPERATION_BO = OP.HANDLE AND OPT.LOCALE = 'zh'
ORDER BY ZSD.SFC, ZSD.STEP_ID, ZCI.CALL_TYPE
</select>
</mapper>