update ope_use_flow set create_time=now() where reagent_code=#{code} and status=#{status}
and ors.reagent_id = #{reagentId}
and oa.user_id = #{userId}
and oa.user_id in
#{item}
and oa.reagent_code like #{reagentCode}
and oa.status = #{status}
and sr.name like concat('%',#{reagentName},'%')
and ( l.name like concat('%',#{houseName},'%') or w.name like concat('%',#{houseName},'%') )
and oa.create_time >= #{startDate}
and oa.create_time <= #{endDate}
select oa.*,
sr.*,
ors.article_number as articleNumber,
sr.id as reagentId,
su.name as userName,
ss.name as supplierName,
l.name as laboratoryName,
w.name as warehouseName,
lc.name as warehouseContainerName,
wc.name as laboratoryContainerName,
lc.container_code as warehouseContainerCode,
wc.container_code as laboratoryContainerCode,
bm1.meta_value as operatestateName
left join ope_reagent_status ors on ors.reagent_code = oa.reagent_code
left join sys_reagent sr on ors.reagent_id = sr.id
left join sys_supplier as ss on sr.supplier_id = ss.id
left join sys_user as su on oa.user_id = su.id
left join sys_warehouse_container wc on wc.id = oa.container_id
left join sys_warehouse w on w.id = wc.warehouse_id
left join sys_laboratory_container lc on lc.id = oa.container_id
left join sys_laboratory l on l.id = lc.laboratory_id
left join base_meta bm1 on bm1.id = oa.operatestate
insert into ope_use_flow(id, reagent_code, status, house_id, container_id, user_id, remainder, place, store_type, valid_flag, create_time, realstatus, operatestate)
values (#{id}, #{reagentCode}, #{status}, #{houseId}, #{containerId}, #{userId}, #{remainder}, #{place}, #{storeType}, 1, #{createTime}, #{realstatus},#{operateState})
delete from ope_use_flow
where reagent_code=#{reagentCode}
update ope_use_flow
set valid_flag = #{validFlag}
where reagent_code = #{reagentCode} and status = #{status}