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
delete from t_order_new
where order_no = #{orderNo,jdbcType=VARCHAR}
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)
values (#{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})
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,
#{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},
update t_order_new
order_type = #{orderType,jdbcType=INTEGER},
creater = #{creater,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
buyer_id = #{buyerId,jdbcType=VARCHAR},
first_amount = #{firstAmount,jdbcType=DECIMAL},
total_amount = #{totalAmount,jdbcType=DECIMAL},
settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
refund_amount = #{refundAmount,jdbcType=DECIMAL},
order_status = #{orderStatus,jdbcType=INTEGER},
liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
process_status = #{processStatus,jdbcType=INTEGER},
project_status = #{projectStatus,jdbcType=INTEGER},
approval = #{approval,jdbcType=INTEGER},
order_remarks = #{orderRemarks,jdbcType=VARCHAR},
delete_sign = #{deleteSign,jdbcType=INTEGER},
salesman_id = #{salesmanId,jdbcType=VARCHAR},
finance_id = #{financeId,jdbcType=VARCHAR},
technician_id = #{technicianId,jdbcType=VARCHAR},
sign_time = #{signTime,jdbcType=DATE},
settlement_time = #{settlementTime,jdbcType=DATE},
contract_picture_url = #{contractPictureUrl,jdbcType=VARCHAR},
contract_no = #{contractNo,jdbcType=VARCHAR},
contract_type = #{contractType,jdbcType=VARCHAR},
contacts = #{contacts,jdbcType=VARCHAR},
contact_mobile = #{contactMobile,jdbcType=VARCHAR},
legal_person = #{legalPerson,jdbcType=VARCHAR},
legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
proof_count = #{proofCount,jdbcType=FLOAT},
proof_aid = #{proofAid,jdbcType=VARCHAR},
proof_time = #{proofTime,jdbcType=TIMESTAMP},
proof_status = #{proofStatus,jdbcType=INTEGER},
order_dep = #{orderDep,jdbcType=VARCHAR},
outsource = #{outsource,jdbcType=INTEGER},
additional_order = #{additionalOrder,jdbcType=VARCHAR},
primary_order = #{primaryOrder,jdbcType=VARCHAR},
old_salesman_id = #{oldSalesmanId,jdbcType=VARCHAR},
back_status = #{backStatus,jdbcType=INTEGER},
agreement_url = #{agreementUrl,jdbcType=VARCHAR},
new_user = #{newUser,jdbcType=INTEGER},
service_content = #{serviceContent,jdbcType=VARCHAR},
sales_type = #{salesType,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=VARCHAR},
other = #{other,jdbcType=VARCHAR},
user_type = #{userType,jdbcType=INTEGER},
examine_name = #{examineName,jdbcType=VARCHAR},
tag = #{tag,jdbcType=INTEGER},
patent_status = #{patentStatus,jdbcType=INTEGER},
where order_no = #{orderNo,jdbcType=VARCHAR}
update t_order_new
set order_type = #{orderType,jdbcType=INTEGER},
creater = #{creater,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
buyer_id = #{buyerId,jdbcType=VARCHAR},
first_amount = #{firstAmount,jdbcType=DECIMAL},
total_amount = #{totalAmount,jdbcType=DECIMAL},
settlement_amount = #{settlementAmount,jdbcType=DECIMAL},
refund_amount = #{refundAmount,jdbcType=DECIMAL},
order_status = #{orderStatus,jdbcType=INTEGER},
liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
process_status = #{processStatus,jdbcType=INTEGER},
project_status = #{projectStatus,jdbcType=INTEGER},
approval = #{approval,jdbcType=INTEGER},
order_remarks = #{orderRemarks,jdbcType=VARCHAR},
delete_sign = #{deleteSign,jdbcType=INTEGER},
salesman_id = #{salesmanId,jdbcType=VARCHAR},
finance_id = #{financeId,jdbcType=VARCHAR},
technician_id = #{technicianId,jdbcType=VARCHAR},
sign_time = #{signTime,jdbcType=DATE},
settlement_time = #{settlementTime,jdbcType=DATE},
contract_picture_url = #{contractPictureUrl,jdbcType=VARCHAR},
contract_no = #{contractNo,jdbcType=VARCHAR},
contract_type = #{contractType,jdbcType=VARCHAR},
contacts = #{contacts,jdbcType=VARCHAR},
contact_mobile = #{contactMobile,jdbcType=VARCHAR},
legal_person = #{legalPerson,jdbcType=VARCHAR},
legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
proof_count = #{proofCount,jdbcType=FLOAT},
proof_aid = #{proofAid,jdbcType=VARCHAR},
proof_time = #{proofTime,jdbcType=TIMESTAMP},
proof_status = #{proofStatus,jdbcType=INTEGER},
order_dep = #{orderDep,jdbcType=VARCHAR},
outsource = #{outsource,jdbcType=INTEGER},
additional_order = #{additionalOrder,jdbcType=VARCHAR},
primary_order = #{primaryOrder,jdbcType=VARCHAR},
old_salesman_id = #{oldSalesmanId,jdbcType=VARCHAR},
back_status = #{backStatus,jdbcType=INTEGER},
agreement_url = #{agreementUrl,jdbcType=VARCHAR},
new_user = #{newUser,jdbcType=INTEGER},
service_content = #{serviceContent,jdbcType=VARCHAR},
sales_type = #{salesType,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=VARCHAR},
other = #{other,jdbcType=VARCHAR},
user_type = #{userType,jdbcType=INTEGER},
examine_name = #{examineName,jdbcType=VARCHAR},
tag = #{tag,jdbcType=INTEGER},
patent_status = #{patentStatus,jdbcType=INTEGER}
where order_no = #{orderNo,jdbcType=VARCHAR}
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 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 in
(1)
(5)
and a.approval in
(2,3)
(6,7)
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,5,6,7,99)
and a.order_status in(1,2,3,4,6)
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