order_no, order_type, creater, create_time, update_time, buyer_id, first_amount, total_amount, settlement_amount, refund_amount, order_status, liquidation_status, process_status, project_status, approval, order_remarks, delete_sign, salesman_id, finance_id, technician_id, sign_time, settlement_time, contract_picture_url, contract_no, contract_type, contacts, contact_mobile, legal_person, legal_person_tel, proof_count, proof_aid, proof_time, proof_status, order_dep, outsource, additional_order, primary_order, old_salesman_id, back_status, agreement_url, new_user, service_content, sales_type, channel_id, other, user_type, examine_name, tag, patent_status, score_status, new_sign_user, nda, nda_url, breach_clause, breach_clause_url insert into t_order_new(order_type, creater, create_time, update_time, buyer_id, first_amount, total_amount, settlement_amount, refund_amount, order_status, liquidation_status, process_status, project_status, approval, order_remarks, delete_sign, salesman_id, finance_id, technician_id, sign_time, settlement_time, contract_picture_url, contract_no, contract_type, contacts, contact_mobile, legal_person, legal_person_tel, proof_count, proof_aid, proof_time, proof_status, order_dep, outsource, additional_order, primary_order, old_salesman_id, back_status, agreement_url, new_user, service_content, sales_type, channel_id, other, user_type, examine_name, tag, patent_status, score_status, new_sign_user, nda, nda_url, breach_clause, breach_clause_url) values (#{orderType}, #{creater}, #{createTime}, #{updateTime}, #{buyerId}, #{firstAmount}, #{totalAmount}, #{settlementAmount}, #{refundAmount}, #{orderStatus}, #{liquidationStatus}, #{processStatus}, #{projectStatus}, #{approval}, #{orderRemarks}, #{deleteSign}, #{salesmanId}, #{financeId}, #{technicianId}, #{signTime}, #{settlementTime}, #{contractPictureUrl}, #{contractNo}, #{contractType}, #{contacts}, #{contactMobile}, #{legalPerson}, #{legalPersonTel}, #{proofCount}, #{proofAid}, #{proofTime}, #{proofStatus}, #{orderDep}, #{outsource}, #{additionalOrder}, #{primaryOrder}, #{oldSalesmanId}, #{backStatus}, #{agreementUrl}, #{newUser}, #{serviceContent}, #{salesType}, #{channelId}, #{other}, #{userType}, #{examineName}, #{tag}, #{patentStatus}, #{scoreStatus}, #{newSignUser}, #{nda}, #{ndaUrl}, #{breachClause}, #{breachClauseUrl}) insert into t_order_new(order_type, creater, create_time, update_time, buyer_id, first_amount, total_amount, settlement_amount, refund_amount, order_status, liquidation_status, process_status, project_status, approval, order_remarks, delete_sign, salesman_id, finance_id, technician_id, sign_time, settlement_time, contract_picture_url, contract_no, contract_type, contacts, contact_mobile, legal_person, legal_person_tel, proof_count, proof_aid, proof_time, proof_status, order_dep, outsource, additional_order, primary_order, old_salesman_id, back_status, agreement_url, new_user, service_content, sales_type, channel_id, other, user_type, examine_name, tag, patent_status, score_status, new_sign_user, nda, nda_url, breach_clause, breach_clause_url) values (#{entity.orderType}, #{entity.creater}, #{entity.createTime}, #{entity.updateTime}, #{entity.buyerId}, #{entity.firstAmount}, #{entity.totalAmount}, #{entity.settlementAmount}, #{entity.refundAmount}, #{entity.orderStatus}, #{entity.liquidationStatus}, #{entity.processStatus}, #{entity.projectStatus}, #{entity.approval}, #{entity.orderRemarks}, #{entity.deleteSign}, #{entity.salesmanId}, #{entity.financeId}, #{entity.technicianId}, #{entity.signTime}, #{entity.settlementTime}, #{entity.contractPictureUrl}, #{entity.contractNo}, #{entity.contractType}, #{entity.contacts}, #{entity.contactMobile}, #{entity.legalPerson}, #{entity.legalPersonTel}, #{entity.proofCount}, #{entity.proofAid}, #{entity.proofTime}, #{entity.proofStatus}, #{entity.orderDep}, #{entity.outsource}, #{entity.additionalOrder}, #{entity.primaryOrder}, #{entity.oldSalesmanId}, #{entity.backStatus}, #{entity.agreementUrl}, #{entity.newUser}, #{entity.serviceContent}, #{entity.salesType}, #{entity.channelId}, #{entity.other}, #{entity.userType}, #{entity.examineName}, #{entity.tag}, #{entity.patentStatus}, #{entity.scoreStatus}, #{entity.newSignUser}, #{entity.nda}, #{entity.ndaUrl}, #{entity.breachClause}, #{entity.breachClauseUrl}) insert into t_order_new(order_type, creater, create_time, update_time, buyer_id, first_amount, total_amount, settlement_amount, refund_amount, order_status, liquidation_status, process_status, project_status, approval, order_remarks, delete_sign, salesman_id, finance_id, technician_id, sign_time, settlement_time, contract_picture_url, contract_no, contract_type, contacts, contact_mobile, legal_person, legal_person_tel, proof_count, proof_aid, proof_time, proof_status, order_dep, outsource, additional_order, primary_order, old_salesman_id, back_status, agreement_url, new_user, service_content, sales_type, channel_id, other, user_type, examine_name, tag, patent_status, score_status, new_sign_user, nda, nda_url, breach_clause, breach_clause_url) values (#{entity.orderType}, #{entity.creater}, #{entity.createTime}, #{entity.updateTime}, #{entity.buyerId}, #{entity.firstAmount}, #{entity.totalAmount}, #{entity.settlementAmount}, #{entity.refundAmount}, #{entity.orderStatus}, #{entity.liquidationStatus}, #{entity.processStatus}, #{entity.projectStatus}, #{entity.approval}, #{entity.orderRemarks}, #{entity.deleteSign}, #{entity.salesmanId}, #{entity.financeId}, #{entity.technicianId}, #{entity.signTime}, #{entity.settlementTime}, #{entity.contractPictureUrl}, #{entity.contractNo}, #{entity.contractType}, #{entity.contacts}, #{entity.contactMobile}, #{entity.legalPerson}, #{entity.legalPersonTel}, #{entity.proofCount}, #{entity.proofAid}, #{entity.proofTime}, #{entity.proofStatus}, #{entity.orderDep}, #{entity.outsource}, #{entity.additionalOrder}, #{entity.primaryOrder}, #{entity.oldSalesmanId}, #{entity.backStatus}, #{entity.agreementUrl}, #{entity.newUser}, #{entity.serviceContent}, #{entity.salesType}, #{entity.channelId}, #{entity.other}, #{entity.userType}, #{entity.examineName}, #{entity.tag}, #{entity.patentStatus}, #{entity.scoreStatus}, #{entity.newSignUser}, #{entity.nda}, #{entity.ndaUrl}, #{entity.breachClause}, #{entity.breachClauseUrl}) on duplicate key update order_type = values(order_type), creater = values(creater), create_time = values(create_time), update_time = values(update_time), buyer_id = values(buyer_id), first_amount = values(first_amount), total_amount = values(total_amount), settlement_amount = values(settlement_amount), refund_amount = values(refund_amount), order_status = values(order_status), liquidation_status = values(liquidation_status), process_status = values(process_status), project_status = values(project_status), approval = values(approval), order_remarks = values(order_remarks), delete_sign = values(delete_sign), salesman_id = values(salesman_id), finance_id = values(finance_id), technician_id = values(technician_id), sign_time = values(sign_time), settlement_time = values(settlement_time), contract_picture_url = values(contract_picture_url), contract_no = values(contract_no), contract_type = values(contract_type), contacts = values(contacts), contact_mobile = values(contact_mobile), legal_person = values(legal_person), legal_person_tel = values(legal_person_tel), proof_count = values(proof_count), proof_aid = values(proof_aid), proof_time = values(proof_time), proof_status = values(proof_status), order_dep = values(order_dep), outsource = values(outsource), additional_order = values(additional_order), primary_order = values(primary_order), old_salesman_id = values(old_salesman_id), back_status = values(back_status), agreement_url = values(agreement_url), new_user = values(new_user), service_content = values(service_content), sales_type = values(sales_type), channel_id = values(channel_id), other = values(other), user_type = values(user_type), examine_name = values(examine_name), tag = values(tag), patent_status = values(patent_status), score_status = values(score_status), new_sign_user = values(new_sign_user), nda = values(nda), nda_url = values(nda_url), breach_clause = values(breach_clause), breach_clause_url = values(breach_clause_url) update t_order_new order_type = #{orderType}, creater = #{creater}, create_time = #{createTime}, update_time = #{updateTime}, buyer_id = #{buyerId}, first_amount = #{firstAmount}, total_amount = #{totalAmount}, settlement_amount = #{settlementAmount}, refund_amount = #{refundAmount}, order_status = #{orderStatus}, liquidation_status = #{liquidationStatus}, process_status = #{processStatus}, project_status = #{projectStatus}, approval = #{approval}, order_remarks = #{orderRemarks}, delete_sign = #{deleteSign}, salesman_id = #{salesmanId}, finance_id = #{financeId}, technician_id = #{technicianId}, sign_time = #{signTime}, settlement_time = #{settlementTime}, contract_picture_url = #{contractPictureUrl}, contract_no = #{contractNo}, contract_type = #{contractType}, contacts = #{contacts}, contact_mobile = #{contactMobile}, legal_person = #{legalPerson}, legal_person_tel = #{legalPersonTel}, proof_count = #{proofCount}, proof_aid = #{proofAid}, proof_time = #{proofTime}, proof_status = #{proofStatus}, order_dep = #{orderDep}, outsource = #{outsource}, additional_order = #{additionalOrder}, primary_order = #{primaryOrder}, old_salesman_id = #{oldSalesmanId}, back_status = #{backStatus}, agreement_url = #{agreementUrl}, new_user = #{newUser}, service_content = #{serviceContent}, sales_type = #{salesType}, channel_id = #{channelId}, other = #{other}, user_type = #{userType}, examine_name = #{examineName}, tag = #{tag}, patent_status = #{patentStatus}, score_status = #{scoreStatus}, new_sign_user = #{newSignUser}, nda = #{nda}, nda_url = #{ndaUrl}, breach_clause = #{breachClause}, breach_clause_url = #{breachClauseUrl}, where order_no = #{orderNo} delete from t_order_new where order_no = #{orderNo} insert into t_order_new order_no, order_type, creater, create_time, update_time, buyer_id, first_amount, total_amount, settlement_amount, refund_amount, order_status, liquidation_status, process_status, project_status, approval, order_remarks, delete_sign, salesman_id, finance_id, technician_id, sign_time, settlement_time, contract_picture_url, contract_no, contract_type, contacts, contact_mobile, legal_person, legal_person_tel, proof_count, proof_aid, proof_time, proof_status, order_dep, outsource, additional_order, primary_order, old_salesman_id, back_status, agreement_url, new_user, service_content, sales_type, channel_id, other, user_type, examine_name, tag, patent_status, score_status, #{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR}, #{firstAmount,jdbcType=DECIMAL}, #{totalAmount,jdbcType=DECIMAL}, #{settlementAmount,jdbcType=DECIMAL}, #{refundAmount,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER}, #{processStatus,jdbcType=INTEGER}, #{projectStatus,jdbcType=INTEGER}, #{approval,jdbcType=INTEGER}, #{orderRemarks,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}, #{salesmanId,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR}, #{technicianId,jdbcType=VARCHAR}, #{signTime,jdbcType=DATE}, #{settlementTime,jdbcType=DATE}, #{contractPictureUrl,jdbcType=VARCHAR}, #{contractNo,jdbcType=VARCHAR}, #{contractType,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{legalPerson,jdbcType=VARCHAR}, #{legalPersonTel,jdbcType=VARCHAR}, #{proofCount,jdbcType=FLOAT}, #{proofAid,jdbcType=VARCHAR}, #{proofTime,jdbcType=TIMESTAMP}, #{proofStatus,jdbcType=INTEGER}, #{orderDep,jdbcType=VARCHAR}, #{outsource,jdbcType=INTEGER}, #{additionalOrder,jdbcType=VARCHAR}, #{primaryOrder,jdbcType=VARCHAR}, #{oldSalesmanId,jdbcType=VARCHAR}, #{backStatus,jdbcType=INTEGER}, #{agreementUrl,jdbcType=VARCHAR}, #{newUser,jdbcType=INTEGER}, #{serviceContent,jdbcType=VARCHAR}, #{salesType,jdbcType=INTEGER}, #{channelId,jdbcType=VARCHAR}, #{other,jdbcType=VARCHAR}, #{userType,jdbcType=INTEGER}, #{examineName,jdbcType=VARCHAR}, #{tag,jdbcType=INTEGER}, #{patentStatus,jdbcType=INTEGER}, #{scoreStatus}, inner join (select distinct order_no from t_order_approval where `type` in #{item} group by order_no) toa2 on o.order_no=toa2.order_no where delete_sign in(0,2) and o.approval in(0,1,2,4,5,7,8) and outsource= #{o.outsource,jdbcType=INTEGER} and o.process_status = #{o.processStatus,jdbcType=INTEGER} and o.process_status >= #{o.processStatus,jdbcType=INTEGER} and o.back_status = 3 and (d.finance_id in #{item} or d.retrial_finance_id in #{item} ) and (o.order_status >= #{o.orderStatus,jdbcType=INTEGER} or o.back_status=3) and o.order_dep in #{depId} and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%') and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER} and o.total_amount < 10 and o.total_amount between 10 and 20 and o.total_amount between 20 and 30 and o.total_amount between 30 and 40 and o.total_amount > 40 and o.order_no = #{o.orderNo,jdbcType=VARCHAR} and a.project_type = #{o.projectType} and o.approval in (1,4,7) and o.approval in (2,5,8) and o.approval in (1,2,4,5,7,8) and u.nickname like #{n,jdbcType=VARCHAR} and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR} and a.final_Receivables_time between #{c,jdbcType=VARCHAR} and #{d,jdbcType=VARCHAR} and o.sign_time between #{e,jdbcType=VARCHAR} and #{f,jdbcType=VARCHAR} and toprc.max_status = #{maxStatus} and toprc.max_process >= #{configType} and toprc.max_process= #{configType} and toprc.max_process > #{configType} and toprc.max_process in (1,2,3,5) and toprc.max_process =4 and toprc.max_process in (1,2,3,4,5) and toprc.max_process in (1,2,3) and toprc.max_process in (5) and toprc.max_process in (4) and a.process_status > 5 and a.salesman_id = #{aid,jdbcType=VARCHAR} and a.process_status > 5 and a.buyer_id = #{uid} and a.process_status > 5 and bp.type=5 and a.salesman_id = #{aid,jdbcType=VARCHAR} and a.outsource= #{outsource,jdbcType=INTEGER} and toprc.max_status = #{maxStatus} and a.score_status = #{scoreStatus} and a.approval in(0,1,2,4,5,7,8) and a.order_status in(0,1,2,4) and a.salesman_id = #{aid,jdbcType=VARCHAR} and a.process_status = 1 and a.order_status in (0,1,2) and mg.manager_id= #{aid} and a.process_status = 4 and a.approval >0 and dep.operation_guarantee_id =#{aid} and a.process_status = 2 and a.order_status in (0,1,2) and a.order_status in(3,5) and a.salesman_id = #{aid,jdbcType=VARCHAR} and a.order_status=2 and dep.approval_aid= #{aid,jdbcType=VARCHAR} and a.process_status =5 and a.approval = 0 and a.process_status =5 and a.approval =1 and a.approval =4 and a.approval in (2,3) and a.approval in (5,6) and a.approval = 0 and a.approval in (1,4) and a.approval in (2,4) and a.approval in (1,2,4,5) and a.process_status in(3,6,7,8,99) and a.order_status in(1,2,3,4,6) and e.main =1 and e.split_status in (0,1) and a.order_dep in #{dep} and a.process_status = 3 and a.process_status = 6 and a.process_status = 7 and a.process_status = 8 and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%') and c.project_type = #{projectType} and a.process_status = #{processStatus} and a.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%') and a.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%') and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER} and a.tag= #{tag} and fina.approval_type = #{approvalType,jdbcType=INTEGER} and a.total_amount < 10 and a.total_amount between 10 and 20 and a.total_amount between 20 and 30 and a.total_amount between 30 and 40 and a.total_amount > 40 and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR} and a.sign_time between #{contractStart,jdbcType=VARCHAR} and #{contractEnd,jdbcType=VARCHAR} update t_order_new set finance_id= #{newFinance,jdbcType=VARCHAR} where order_no in #{orderNo} and finance_id= #{aid,jdbcType=VARCHAR} update t_order_new set salesman_id= #{transferId},old_salesman_id= #{aid} where delete_sign in(0,2,3) and salesman_id= #{aid} update t_order_new set settlement_amount=settlement_amount-#{refundAmount,jdbcType=DECIMAL}, refund_amount=#{refundAmount,jdbcType=DECIMAL} where order_no=#{orderNo} update t_order_new a ,(select a.department_id depId,group_concat(a.name) name from admin a left join user_role b on a.id=b.uid left join `role` c on b.rid =c.id where c.role_type ='9996' and a.status ='0' and a.department_id = #{departmentId} group by a.department_id ) b set a.examine_name =b.name where a.order_dep = #{departmentId} and a.order_dep =b.depId update t_order_new a left join admin b on a.salesman_id =b.id left join admin c on b.manager_id =c.id set a.examine_name =c.name where a.process_status =1 and c.id= #{id} left join (select a.department_id depId,group_concat(a.name) name from admin a left join admin b on a.department_id =b.department_id left join user_role c on a.id=c.uid left join `role` d on c.rid =d.id where b.id= #{id} and d.role_type ='9996' and a.status ='0' group by b.department_id )x on a.order_dep=x.depId set a.examine_name=x.name where a.process_status =2 left join department b on a.order_dep =b.id left join admin c on b.finance_id =c.id set a.examine_name =c.name where a.process_status =3 and c.id =#{id} update t_order_new a left join (select group_concat(a.name) name from admin a left join user_role b on a.id=b.uid left join `role` c on b.rid =c.id where c.role_type in ('9998') and a.status ='0' )b on 1=1 set a.examine_name =b.name where a.process_status =5 update t_order_new set tag = #{param2} where order_no in #{e} update t_order_new x ,(select order_no ,group_concat(aname)name from t_order_examine where order_no in #{e} and status =0 group by order_no) y set x.examine_name =y.name where x.order_no in #{e} and x.order_no =y.order_no and x.process_status= #{processStatus}