and sr.name like #{reagentName} and oa.deadline >= #{startDeadline} and #{endDeadline} >= oa.deadline and oa.status = #{status} and oa.apply_user_id = #{applyUserId} and (oa.approve_user_id = #{approveUserId} or oa.before_approve_user_id = #{approveUserId}) and (oa.approve_user_id = #{searchApproval} or oa.before_approve_user_id = #{searchApproval}) and su.name like #{applyUserName} and (suApprove.name like #{approvaUserName} or sys.name like #{approvaUserName}) and oa.id != #{editId} and sr.cas like #{cas} and oa.apply_code like concat('%',#{applyCode},'%') and su.name like concat('%',#{applyUserName},'%') insert into ope_apply(id, apply_code, reagent_id, num, deadline, apply_user_id, objective, status, approve_user_id, memo, valid_flag, create_time, update_time) values (#{id}, #{applyCode}, #{reagent.id}, #{num}, #{deadline}, #{applyUserId}, #{objective}, #{status}, #{approveUserId}, #{memo}, 1, now(), now()) insert into ope_apply (id, apply_code, reagent_id, num, deadline, apply_user_id, objective, status, approve_user_id, memo, valid_flag, create_time, update_time,apply_goal,apply_price,first_user) values (#{opeApply.id}, #{opeApply.applyCode}, #{opeApply.reagent.id}, #{opeApply.num}, #{opeApply.deadline}, #{opeApply.applyUserId}, #{opeApply.objective}, #{opeApply.status}, #{opeApply.approveUserId}, #{opeApply.memo}, 1, now(), now(),#{opeApply.applyGoal},#{opeApply.reagent.price},#{opeApply.approveUserId}) update ope_apply set first_user=approve_user_id where id=#{id} update ope_apply set first_user=before_approve_user_id where id=#{id} update ope_apply set apply_code=#{applyCode}, reagent_id=#{reagent.id}, num=#{num}, deadline=#{deadline}, apply_user_id=#{applyUserId}, objective=#{objective}, status=#{status}, approve_user_id=#{approveUserId}, memo=#{memo}, update_time=now(),start_reagent_code=#{startReagentCode},end_reagent_code=#{endReagentCode}, arrival_num=#{arrivalNum}, house_id=#{houseId}, place=#{placeId}, container_id=#{containerId}, article_number=#{articleNumber} where id=#{id} update ope_apply set status=#{status}, memo=#{memo}, update_time=now() where id in #{item} update ope_apply set objective =#{newObjective} where objective=#{oldObjective} update ope_apply set status=#{status} where id=#{id} update ope_apply set used=#{used} where id=#{id} update ope_apply set before_memo=#{memo}, before_approve_user_id=approve_user_id, approve_user_id=#{userId}, update_time=now() where id in #{item} update ope_apply set before_memo=#{memo}, before_approve_user_id=#{beforeUserId}, approve_user_id=#{userId}, update_time=now() where id =#{id} update ope_apply set valid_flag=0, update_time=now() where id in #{item} select oa.id, oa.apply_code, sr.id reagent_id, oa.status, sr.product_sn reagentProductSn, sr.`name` reagentName, bm2.meta_value controlProducts, bm3.meta_value reagentFormat, sr.main_metering reagentMainMetering, sr.price reagentPrice, sr.cas reagentCas, oa.article_number articleNumber, bm4.meta_value reagentCharacter, bm1.meta_value productHome, sr.dangerous_flag, oa.num, oa.used, su.`name` apply_user_id left JOIN sys_reagent sr on sr.id = oa.reagent_id left JOIN sys_user su on su.id = oa.apply_user_id left join base_meta as bm2 on sr.control_products = bm2.id left join base_meta as bm3 on sr.reagent_format = bm3.id left join base_meta as bm4 on sr.reagent_character = bm4.id left join base_meta as bm1 on sr.product_home = bm1.id and sr.name like concat('%',#{reagentName},'%') and su.name like concat('%',#{personName},'%') and oa.apply_user_id =#{userId} and oa.status =#{status} update ope_apply set apply_price=#{applyPrice} where id=#{id} update ope_apply set stock_flag=#{stockFlag} where id=#{id} update ope_apply set reagent_id=#{newReId} where reagent_id=#{oldReId}