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 (suApprove.name like concat('%',#{approvaUserName},'%') or sys.name like concat('%',#{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( apply_code, reagent_id, num, deadline, apply_user_id, project_id, status, approve_user_id, memo, valid_flag, create_time, update_time) values ( #{applyCode}, #{reagent.id}, #{num}, #{deadline}, #{applyUserId}, #{projectId}, #{status}, #{approveUserId}, #{memo}, 1, now(), now()) insert into ope_apply (apply_code, reagent_id, num, deadline, apply_user_id, project_id, status, approve_user_id, memo, valid_flag, create_time, update_time,apply_goal,apply_price,first_user) values ( #{opeApply.applyCode}, #{opeApply.reagent.id}, #{opeApply.num}, #{opeApply.deadline}, #{opeApply.applyUserId}, #{opeApply.projectId}, #{opeApply.status}, #{opeApply.approveUserId}, #{opeApply.memo}, 1, now(), now(),#{opeApply.applyGoal},#{opeApply.reagent.price},#{opeApply.approveUserId}) insert into ope_apply (apply_code, reagent_id, num, deadline, apply_user_id, project_id, status, approve_user_id, memo, valid_flag, create_time, update_time,apply_goal,apply_price,first_user) values ( #{opeApply.applyCode}, #{opeApply.reagent.id}, #{opeApply.num}, #{opeApply.deadline}, #{opeApply.applyUserId}, #{opeApply.projectId}, #{opeApply.status}, #{opeApply.approveUserId}, #{opeApply.memo}, 1, #{opeApply.createTime}, #{opeApply.updateTime},#{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 apply_code=#{applyCode}, reagent_id=#{reagent.id}, num=#{num}, deadline=#{deadline}, apply_user_id=#{applyUserId}, project_id=#{projectId}, 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=#{place}, 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 status=#{status},update_time=now() where id =#{id} update ope_apply set project_id =#{newObjective} where project_id=#{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 reagent_product_sn, sr.`name` reagent_name, sr.control_products, sr.reagent_format, sr.main_metering reagent_main_metering, sr.price reagent_price, sr.cas reagent_cas, oa.article_number article_number, sr.reagentCharacter, sr.product_home, 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 and sr.name like concat('%',#{reagentName},'%') and su.name like concat('%',#{personName},'%') and oa.apply_user_id =#{userId} and oa.status =#{status} and sr.product_sn like concat('%',#{productSn},'%') and oa.apply_code = #{applyCode} 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} update ope_apply set status = #{status} ,arrival_time = #{arrivalTime} ,consignee_id = #{consigneeId} ,arrival_num = #{arrivalNum} where valid_flag = 1 and id = #{applyId}