insert into allocation_storehouse(
as_id,original_stock,remark,store_id,res_id,sh_id_z,apply_id,res_name,start_user_id,sh_id_a,start_user_name,stock,times_id
) values (
#{asId},#{originalStock},#{remark},#{storeId},#{resId},#{shIdz},#{applyId},#{resName},#{startUserId},#{shIda},#{startUserName},#{stock},#{timesId}
)
update allocation_storehouse t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.original_stock= #{originalStock}
, t.remark= #{remark}
, t.res_id= #{resId}
, t.sh_id_z= #{shIdz}
, t.res_name= #{resName}
, t.start_user_id= #{startUserId}
, t.sh_id_a= #{shIda}
, t.start_user_name= #{startUserName}
, t.stock= #{stock}
and t.times_id= #{timesId}
where 1=1
and t.as_id= #{asId}
and t.times_id= #{timesId}
and t.apply_id= #{applyId}
and t.store_id= #{storeId}