PURPLAN_PLAN_MATERIAL_ID, PLAN_ID, MATERIAL_ID, PURPLAN_MATERIAL_NUMBER, MATERIAL_ALLOCATED_WEIGHT,
MATERIAL_UNALLOCATED_WEIGHT, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
INSERT_UPDATE_REMARK
t.PURPLAN_PLAN_MATERIAL_ID, t.PLAN_ID, t.MATERIAL_ID, t.PURPLAN_MATERIAL_NUMBER,
t.MATERIAL_ALLOCATED_WEIGHT, t.MATERIAL_UNALLOCATED_WEIGHT, t.INSERT_USERNAME, t.INSERT_TIME,
t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
SELECT
FROM AMSTRUCK_PURPLAN_MATERIAL
SELECT
FROM AMSTRUCK_PURPLAN_MATERIAL t
and PURPLAN_PLAN_MATERIAL_ID = #{purplanPlanMaterialId}
and PLAN_ID = #{planId}
and MATERIAL_ID = #{materialId}
and PURPLAN_MATERIAL_NUMBER = #{purplanMaterialNumber}
and MATERIAL_ALLOCATED_WEIGHT = #{materialAllocatedWeight}
and MATERIAL_UNALLOCATED_WEIGHT = #{materialUnallocatedWeight}
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 PURPLAN_PLAN_MATERIAL_ID = #{purplanPlanMaterialId}
and PLAN_ID = #{planId}
and MATERIAL_ID = #{materialId}
and PURPLAN_MATERIAL_NUMBER = #{purplanMaterialNumber}
and MATERIAL_ALLOCATED_WEIGHT = #{materialAllocatedWeight}
and MATERIAL_UNALLOCATED_WEIGHT = #{materialUnallocatedWeight}
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}%'
delete
from AMSTRUCK_PURPLAN_MATERIAL
where PURPLAN_PLAN_MATERIAL_ID = #{purplanPlanMaterialId,jdbcType=DECIMAL}
delete from AMSTRUCK_PURPLAN_MATERIAL
where 1!=1
or PLAN_ID = #{planId}
or MATERIAL_ID = #{materialId}
or PURPLAN_MATERIAL_NUMBER = #{purplanMaterialNumber}
or MATERIAL_ALLOCATED_WEIGHT = #{materialAllocatedWeight}
or MATERIAL_UNALLOCATED_WEIGHT = #{materialUnallocatedWeight}
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}
insert into AMSTRUCK_PURPLAN_MATERIAL (PURPLAN_PLAN_MATERIAL_ID, PLAN_ID, MATERIAL_ID,
PURPLAN_MATERIAL_NUMBER, MATERIAL_ALLOCATED_WEIGHT,
MATERIAL_UNALLOCATED_WEIGHT, INSERT_USERNAME,
INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
INSERT_UPDATE_REMARK)
values (#{purplanPlanMaterialId,jdbcType=DECIMAL}, #{planId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL},
#{purplanMaterialNumber,jdbcType=DECIMAL}, #{materialAllocatedWeight,jdbcType=DECIMAL},
#{materialUnallocatedWeight,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR},
#{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{insertUpdateRemark,jdbcType=VARCHAR})
insert into AMSTRUCK_PURPLAN_MATERIAL
PURPLAN_PLAN_MATERIAL_ID,
PLAN_ID,
MATERIAL_ID,
PURPLAN_MATERIAL_NUMBER,
MATERIAL_ALLOCATED_WEIGHT,
MATERIAL_UNALLOCATED_WEIGHT,
INSERT_USERNAME,
INSERT_TIME,
UPDATE_USERNAME,
UPDATE_TIME,
INSERT_UPDATE_REMARK,
#{purplanPlanMaterialId,jdbcType=DECIMAL},
#{planId,jdbcType=DECIMAL},
#{materialId,jdbcType=DECIMAL},
#{purplanMaterialNumber,jdbcType=DECIMAL},
#{materialAllocatedWeight,jdbcType=DECIMAL},
#{materialUnallocatedWeight,jdbcType=DECIMAL},
#{insertUsername,jdbcType=VARCHAR},
#{insertTime,jdbcType=TIMESTAMP},
#{updateUsername,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP},
#{insertUpdateRemark,jdbcType=VARCHAR},
update AMSTRUCK_PURPLAN_MATERIAL
set PLAN_ID = #{planId,jdbcType=DECIMAL},
MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
PURPLAN_MATERIAL_NUMBER = #{purplanMaterialNumber,jdbcType=DECIMAL},
MATERIAL_ALLOCATED_WEIGHT = #{materialAllocatedWeight,jdbcType=DECIMAL},
MATERIAL_UNALLOCATED_WEIGHT = #{materialUnallocatedWeight,jdbcType=DECIMAL},
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}
where PURPLAN_PLAN_MATERIAL_ID = #{purplanPlanMaterialId,jdbcType=DECIMAL}
update AMSTRUCK_PURPLAN_MATERIAL
PLAN_ID = #{planId,jdbcType=DECIMAL},
MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
PURPLAN_MATERIAL_NUMBER = #{purplanMaterialNumber,jdbcType=DECIMAL},
MATERIAL_ALLOCATED_WEIGHT = #{materialAllocatedWeight,jdbcType=DECIMAL},
MATERIAL_UNALLOCATED_WEIGHT = #{materialUnallocatedWeight,jdbcType=DECIMAL},
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},
where PURPLAN_PLAN_MATERIAL_ID = #{purplanPlanMaterialId,jdbcType=DECIMAL}
insert into AMSTRUCK_PURPLAN_MATERIAL
(PURPLAN_PLAN_MATERIAL_ID,
PLAN_ID, MATERIAL_ID, PURPLAN_MATERIAL_NUMBER,
MATERIAL_ALLOCATED_WEIGHT, MATERIAL_UNALLOCATED_WEIGHT,
INSERT_USERNAME, INSERT_TIME,
UPDATE_USERNAME, UPDATE_TIME,
INSERT_UPDATE_REMARK)
(
select
#{item.purplanPlanMaterialId,jdbcType=DECIMAL},
#{item.planId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL},
#{item.purplanMaterialNumber,jdbcType=DECIMAL},
#{item.materialAllocatedWeight,jdbcType=DECIMAL}, #{item.materialUnallocatedWeight,jdbcType=DECIMAL},
#{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
#{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
)
update AMSTRUCK_PURPLAN_MATERIAL
set
PURPLAN_PLAN_MATERIAL_ID=
when #{item.purplanPlanMaterialId,jdbcType=DECIMAL} then #{item.purplanPlanMaterialId,jdbcType=DECIMAL}
,PLAN_ID=
when #{item.purplanPlanMaterialId,jdbcType=DECIMAL} then #{item.planId,jdbcType=DECIMAL}
,MATERIAL_ID=
when #{item.purplanPlanMaterialId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
,PURPLAN_MATERIAL_NUMBER=
when #{item.purplanPlanMaterialId,jdbcType=DECIMAL} then #{item.purplanMaterialNumber,jdbcType=DECIMAL}
,MATERIAL_ALLOCATED_WEIGHT=
when #{item.purplanPlanMaterialId,jdbcType=DECIMAL} then #{item.materialAllocatedWeight,jdbcType=DECIMAL}
,MATERIAL_UNALLOCATED_WEIGHT=
when #{item.purplanPlanMaterialId,jdbcType=DECIMAL} then #{item.materialUnallocatedWeight,jdbcType=DECIMAL}
,INSERT_USERNAME=
when #{item.purplanPlanMaterialId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
,INSERT_TIME=
when #{item.purplanPlanMaterialId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
,UPDATE_USERNAME=
when #{item.purplanPlanMaterialId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
,UPDATE_TIME=
when #{item.purplanPlanMaterialId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
,INSERT_UPDATE_REMARK=
when #{item.purplanPlanMaterialId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
where PURPLAN_PLAN_MATERIAL_ID in
#{item.purplanPlanMaterialId,jdbcType=DECIMAL}
delete from AMSTRUCK_PURPLAN_MATERIAL
where PURPLAN_PLAN_MATERIAL_ID in
#{id}
order by "${orderField}"
${orderType}
order by "insertTime" desc