INBOUND_ID, INBOUND_TYPE, INBOUND_NUMBER,INBOUND_DISTRIBUTE_ID, GRID_ID,INBOUND_GROUP_ID,PERSONNEL_WORKSHOPID,RESULT_NUMBER, RESULT_STATUS, MATERIAL_ID, INBOUND_ISCOMPLETE,
RESULT_DELETED, INBOUND_TIME, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
INSERT_UPDATE_REMARK, PERSONNEL_TEAM,, PERSONNEL_SHIFTS
t.INBOUND_ID, t.INBOUND_TYPE, t.INBOUND_NUMBER,t.INBOUND_DISTRIBUTE_ID, t.GRID_ID,INBOUND_GROUP_ID,t.PERSONNEL_WORKSHOPID,t.RESULT_NUMBER, t.RESULT_STATUS, t.MATERIAL_ID,
t.INBOUND_ISCOMPLETE, t.RESULT_DELETED, t.INBOUND_TIME, t.INSERT_USERNAME, t.INSERT_TIME,
t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.PERSONNEL_TEAM, ,
t.PERSONNEL_SHIFTS
SELECT FROM WMSP_INBOUND_RESULT
SELECT FROM WMSP_INBOUND_RESULT t
and INBOUND_ID = #{inboundId}
and INBOUND_TYPE = #{inboundType}
and INBOUND_NUMBER = #{inboundNumber}
and INBOUND_DISTRIBUTE_ID = #{inboundDistributeId}
and GRID_ID = #{gridId}
and INBOUND_GROUP_ID = #{inboundGroupId}
and PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
and RESULT_NUMBER = #{resultNumber}
and RESULT_STATUS = #{resultStatus}
and MATERIAL_ID = #{materialId}
and INBOUND_ISCOMPLETE = #{inboundIscomplete}
and RESULT_DELETED = #{resultDeleted}
and TO_CHAR(INBOUND_TIME,'yyyy-MM-dd') = #{inboundTime}
and INSERT_USERNAME = #{insertUsername}
and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
and UPDATE_USERNAME = #{updateUsername}
and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
and PERSONNEL_TEAM = #{personnelTeam}
and PERSONNEL_SHIFTS = #{personnelShifts}
and INBOUND_ID = #{inboundId}
and INBOUND_TYPE = #{inboundType}
and INBOUND_NUMBER LIKE '%${inboundNumber}%'
and INBOUND_DISTRIBUTE_ID LIKE '%${inboundDistributeId}%'
and GRID_ID = #{gridId}
and INBOUND_GROUP_ID = #{inboundGroupId}
and PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
and RESULT_NUMBER = #{resultNumber}
and RESULT_STATUS = #{resultStatus}
and MATERIAL_ID = #{materialId}
and INBOUND_ISCOMPLETE = #{inboundIscomplete}
and RESULT_DELETED = #{resultDeleted}
and TO_CHAR(INBOUND_TIME,'yyyy-MM-dd') = #{inboundTime}
and INSERT_USERNAME LIKE '%${insertUsername}%'
and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
and UPDATE_USERNAME LIKE '%${updateUsername}%'
and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
and PERSONNEL_TEAM LIKE '%${personnelTeam}%'
and PERSONNEL_SHIFTS LIKE '%${personnelShifts}%'
delete from WMSP_INBOUND_RESULT
where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
delete from WMSP_INBOUND_RESULT
where 1!=1
or INBOUND_TYPE = #{inboundType}
or INBOUND_NUMBER = #{inboundNumber}
or INBOUND_DISTRIBUTE_ID = #{inboundDistributeId}
or GRID_ID = #{gridId}
or INBOUND_GROUP_ID = #{inboundGroupId}
or PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
or RESULT_NUMBER = #{resultNumber}
or RESULT_STATUS = #{resultStatus}
or MATERIAL_ID = #{materialId}
or INBOUND_ISCOMPLETE = #{inboundIscomplete}
or RESULT_DELETED = #{resultDeleted}
or TO_CHAR(INBOUND_TIME,'yyyy-MM-dd') = '#{inboundTime}'
or INSERT_USERNAME = #{insertUsername}
or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
or UPDATE_USERNAME = #{updateUsername}
or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
or PERSONNEL_TEAM = #{personnelTeam}
or PERSONNEL_SHIFTS = #{personnelShifts}
insert into WMSP_INBOUND_RESULT (INBOUND_ID, INBOUND_TYPE, INBOUND_NUMBER, INBOUND_DISTRIBUTE_ID,
GRID_ID,INBOUND_GROUP_ID, PERSONNEL_WORKSHOPID,RESULT_NUMBER,RESULT_STATUS, MATERIAL_ID,
INBOUND_ISCOMPLETE, RESULT_DELETED, INBOUND_TIME,
INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
UPDATE_TIME, INSERT_UPDATE_REMARK, PERSONNEL_TEAM,
PERSONNEL_SHIFTS)
values (#{inboundId,jdbcType=DECIMAL}, #{inboundType,jdbcType=DECIMAL}, #{inboundNumber,jdbcType=VARCHAR},#{inboundDistributeId,jdbcType=DECIMAL},
#{gridId,jdbcType=DECIMAL},#{inboundGroupId,jdbcType=DECIMAL},#{personnelWorkshopid,jdbcType=DECIMAL},#{resultNumber,jdbcType=DECIMAL}, #{resultStatus,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL},
#{inboundIscomplete,jdbcType=DECIMAL}, #{resultDeleted,jdbcType=DECIMAL}, #{inboundTime,jdbcType=TIMESTAMP},
#{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{personnelTeam,jdbcType=VARCHAR},
#{personnelShifts,jdbcType=VARCHAR})
insert into WMSP_INBOUND_RESULT
INBOUND_ID,
INBOUND_TYPE,
INBOUND_NUMBER,
INBOUND_DISTRIBUTE_ID,
GRID_ID,
INBOUND_GROUP_ID,
PERSONNEL_WORKSHOPID,
RESULT_NUMBER,
RESULT_STATUS,
MATERIAL_ID,
INBOUND_ISCOMPLETE,
RESULT_DELETED,
INBOUND_TIME,
INSERT_USERNAME,
INSERT_TIME,
UPDATE_USERNAME,
UPDATE_TIME,
INSERT_UPDATE_REMARK,
PERSONNEL_TEAM,
PERSONNEL_SHIFTS,
#{inboundId,jdbcType=DECIMAL},
#{inboundType,jdbcType=DECIMAL},
#{inboundNumber,jdbcType=VARCHAR},
#{inboundDistributeId,jdbcType=VARCHAR},
#{gridId,jdbcType=DECIMAL},
#{inboundGroupId,jdbcType=DECIMAL},
#{personnelWorkshopid,jdbcType=DECIMAL},
#{resultNumber,jdbcType=DECIMAL},
#{resultStatus,jdbcType=DECIMAL},
#{materialId,jdbcType=DECIMAL},
#{inboundIscomplete,jdbcType=DECIMAL},
#{resultDeleted,jdbcType=DECIMAL},
#{inboundTime,jdbcType=TIMESTAMP},
#{insertUsername,jdbcType=VARCHAR},
#{insertTime,jdbcType=TIMESTAMP},
#{updateUsername,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP},
#{insertUpdateRemark,jdbcType=VARCHAR},
#{personnelTeam,jdbcType=VARCHAR},
#{personnelShifts,jdbcType=VARCHAR},
update WMSP_INBOUND_RESULT
set INBOUND_TYPE = #{inboundType,jdbcType=DECIMAL},
INBOUND_NUMBER = #{inboundNumber,jdbcType=VARCHAR},
INBOUND_DISTRIBUTE_ID = #{inboundDistributeId,jdbcType=DECIMAL},
GRID_ID = #{gridId,jdbcType=DECIMAL},
PERSONNEL_WORKSHOPID = #{personnelWorkshopid,jdbcType=DECIMAL},
RESULT_NUMBER = #{resultNumber,jdbcType=DECIMAL},
INBOUND_GROUP_ID = #{inboundGroupId,jdbcType=DECIMAL},
RESULT_STATUS = #{resultStatus,jdbcType=DECIMAL},
MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
INBOUND_ISCOMPLETE = #{inboundIscomplete,jdbcType=DECIMAL},
RESULT_DELETED = #{resultDeleted,jdbcType=DECIMAL},
INBOUND_TIME = #{inboundTime,jdbcType=TIMESTAMP},
INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
PERSONNEL_TEAM = #{personnelTeam,jdbcType=VARCHAR},
PERSONNEL_SHIFTS = #{personnelShifts,jdbcType=VARCHAR}
where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
update WMSP_INBOUND_RESULT
INBOUND_TYPE = #{inboundType,jdbcType=DECIMAL},
INBOUND_NUMBER = #{inboundNumber,jdbcType=VARCHAR},
INBOUND_DISTRIBUTE_ID = #{inboundDistributeId,jdbcType=DECIMAL},
GRID_ID = #{gridId,jdbcType=DECIMAL},
INBOUND_GROUP_ID = #{inboundGroupId,jdbcType=DECIMAL},
PERSONNEL_WORKSHOPID = #{personnelWorkshopid,jdbcType=DECIMAL},
RESULT_NUMBER = #{resultNumber,jdbcType=DECIMAL},
RESULT_STATUS = #{resultStatus,jdbcType=DECIMAL},
MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
INBOUND_ISCOMPLETE = #{inboundIscomplete,jdbcType=DECIMAL},
RESULT_DELETED = #{resultDeleted,jdbcType=DECIMAL},
INBOUND_TIME = #{inboundTime,jdbcType=TIMESTAMP},
INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
PERSONNEL_TEAM = #{personnelTeam,jdbcType=VARCHAR},
PERSONNEL_SHIFTS = #{personnelShifts,jdbcType=VARCHAR},
where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
insert into WMSP_INBOUND_RESULT
(INBOUND_ID,
INBOUND_TYPE, INBOUND_NUMBER, GRID_ID,INBOUND_GROUP_ID,PERSONNEL_WORKSHOPID,RESULT_NUMBER,INBOUND_DISTRIBUTE_ID,
RESULT_STATUS, MATERIAL_ID, INBOUND_ISCOMPLETE,
RESULT_DELETED, INBOUND_TIME,
INSERT_USERNAME, INSERT_TIME,
UPDATE_USERNAME, UPDATE_TIME,
INSERT_UPDATE_REMARK, PERSONNEL_TEAM,
PERSONNEL_SHIFTS
)
(
select
#{item.inboundId,jdbcType=DECIMAL},
#{item.inboundType,jdbcType=DECIMAL}, #{item.inboundNumber,jdbcType=VARCHAR}, #{item.inboundGroupId,jdbcType=DECIMAL}, #{item.gridId,jdbcType=DECIMAL}, #{item.personnelWorkshopid,jdbcType=DECIMAL}, #{item.resultNumber,jdbcType=DECIMAL}, #{item.inboundDistributeId,jdbcType=DECIMAL},
#{item.resultStatus,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.inboundIscomplete,jdbcType=DECIMAL},
#{item.resultDeleted,jdbcType=DECIMAL}, #{item.inboundTime,jdbcType=TIMESTAMP},
#{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
#{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.personnelTeam,jdbcType=VARCHAR},
#{item.personnelShifts,jdbcType=VARCHAR}
from dual
)
update WMSP_INBOUND_RESULT
set
INBOUND_ID=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundId,jdbcType=DECIMAL}
,INBOUND_TYPE=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundType,jdbcType=DECIMAL}
,INBOUND_NUMBER=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundNumber,jdbcType=VARCHAR}
,INBOUND_DISTRIBUTE_ID=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundDistributeId,jdbcType=VARCHAR}
,GRID_ID=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.gridId,jdbcType=DECIMAL}
,INBOUND_GROUP_ID=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundGroupId,jdbcType=DECIMAL}
,PERSONNEL_WORKSHOPID=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.personnelWorkshopid,jdbcType=DECIMAL}
,RESULT_NUMBER=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.resultNumber,jdbcType=DECIMAL}
,RESULT_STATUS=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.resultStatus,jdbcType=DECIMAL}
,MATERIAL_ID=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
,INBOUND_ISCOMPLETE=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundIscomplete,jdbcType=DECIMAL}
,RESULT_DELETED=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.resultDeleted,jdbcType=DECIMAL}
,INBOUND_TIME=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundTime,jdbcType=TIMESTAMP}
,INSERT_USERNAME=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
,INSERT_TIME=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
,UPDATE_USERNAME=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
,UPDATE_TIME=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
,INSERT_UPDATE_REMARK=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
,PERSONNEL_TEAM=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.personnelTeam,jdbcType=VARCHAR}
,PERSONNEL_SHIFTS=
when #{item.inboundId,jdbcType=DECIMAL} then #{item.personnelShifts,jdbcType=VARCHAR}
where INBOUND_ID in
#{item.inboundId,jdbcType=DECIMAL}
delete from WMSP_INBOUND_RESULT
where INBOUND_ID in
#{id}
order by "${orderField}"
${orderType}
update WMSP_INBOUND_RESULT set RESULT_STATUS= 2 where INBOUND_DISTRIBUTE_ID = #{distributeId}
update WMSP_INBOUND_RESULT set INBOUND_ISCOMPLETE = 1 where MATERIAL_ID=#{materialId}
update wmsp_inbound_result set INBOUND_ISCOMPLETE=2 where inbound_id in
(
select * from(
select inbound_id from WMSP_INBOUND_RESULT wir
left join rms_material_steel rms
on wir.material_id = rms.material_steel_id
left join WMSP_GRID_MATERIAL wgm
on wgm.MATERIAL_ID = rms.material_steel_id
where rms.material_id=(
select distinct rms2.material_id from rms_material_steel rms2
where material_steel_id =#{materialId}
) and INBOUND_ISCOMPLETE='1' and wgm.deleted ='0' and to_char(wir.insert_time,'YYYY-MM-DD')=TO_CHAR(SYSDATE,'YYYY-MM-DD')
order by wir.insert_time desc
) where Rownum='1'
)