PreparedStatementps1=ct.prepareStatement("SELECT * FROM shoptxns WHERE Convert(varchar,txntime,120) like ''+?+'%' and vouchnum=? and operator=? and salestype=8");
PreparedStatementps1=ct1.prepareStatement("SELECT * FROM shoptxns WHERE Convert(varchar,txntime,120) like ''+?+'%' and vouchnum=? and operator=? and salestype=8");
// "left join SHOPTXNS s2 on Convert(varchar,s1.txntime,23)= Convert(varchar,s2.txntime,23) AND s1.operator=s2.operator AND s1.vouchnum=s2.vouchnum AND s1.TERMINAL=s2.TERMINAL and s2.SALESTYPE = 8\n" +
// "where s1.SALESTYPE = 2 and s1.CODE IS NOT NULL and Convert(varchar,s1.txntime,120)>=?");
"INSERT INTO pur_order_header(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,org_id,order_type,bill_to_location_id,order_number,ship_to_location_id,order_date,order_currency,supplier_id,supplier_site_id,payment_terms,payment_method,delivery_terms,header_remark,buyer_id,consigned_flag,source_type,source_header_id,source_line_id,header_status,sys_org_code,source_header_number,source_line_number,attribute10) VALUES"+
"INSERT INTO pur_order_header(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,org_id,order_type,bill_to_location_id,order_number,ship_to_location_id,order_date,order_currency,supplier_id,supplier_site_id,payment_terms,payment_method,delivery_terms,header_remark,buyer_id,consigned_flag,source_type,source_header_id,source_line_id,header_status,sys_org_code,source_header_number,source_line_number,attribute10,supplier_code) VALUES"+
"INSERT INTO pur_order_header(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,org_id,order_type,bill_to_location_id,order_number,ship_to_location_id,order_date,order_currency,supplier_id,supplier_site_id,payment_terms,payment_method,delivery_terms,header_remark,buyer_id,consigned_flag,source_type,source_header_id,source_line_id,header_status,sys_org_code,source_header_number,source_line_number,attribute10) VALUES"+
"INSERT INTO pur_order_header(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,org_id,order_type,bill_to_location_id,order_number,ship_to_location_id,order_date,order_currency,supplier_id,supplier_site_id,payment_terms,payment_method,delivery_terms,header_remark,buyer_id,consigned_flag,source_type,source_header_id,source_line_id,header_status,sys_org_code,source_header_number,source_line_number,attribute10,supplier_code) VALUES"+
"INSERT INTO pur_supplier_contact(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,supplier_id,supplier_site_id,contact_type,contact_name,country,province,city,county,town,address,postal_code,telephone,fax,contact_desc,email,wechat_open_id,status) VALUES"+
"INSERT INTO pur_supplier_contact(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,supplier_id,supplier_site_id,contact_type,contact_name,country,province,city,county,town,address,postal_code,telephone,fax,contact_desc,email,wechat_open_id,status) VALUES"+
"INSERT INTO pur_supplier(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,org_id,supplier_type,supplier_code,supplier_name,supplier_short_name,organization_code,tax_registration_code,supplier_desc,status) VALUES"+
"INSERT INTO pur_supplier(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,org_id,supplier_type,supplier_code,supplier_name,supplier_short_name,organization_code,tax_registration_code,supplier_desc,status) VALUES"+
"INSERT INTO pur_supplier_site(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,org_id,supplier_id,supplier_site_type,supplier_site_code,supplier_site_name,supplier_site_short_name,country,province,city,county,town,address,postal_code,telephone,fax,location_id,supplier_site_desc,default_flag,status) VALUES"+
"INSERT INTO pur_supplier_site(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,supplier_id,supplier_site_type,supplier_site_code,supplier_site_name,supplier_site_short_name,address,postal_code,telephone,fax,status,supplier_name,supplier_code) VALUES"+
"INSERT INTO pur_supplier_site(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,org_id,supplier_id,supplier_site_type,supplier_site_code,supplier_site_name,supplier_site_short_name,country,province,city,county,town,address,postal_code,telephone,fax,location_id,supplier_site_desc,default_flag,status) VALUES"+
"INSERT INTO pur_supplier_site(id,create_by,create_time,update_by,update_time,attribute_category,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,supplier_id,supplier_site_type,supplier_site_code,supplier_site_name,supplier_site_short_name,address,postal_code,telephone,fax,status,supplier_name,supplier_code) VALUES"+
"INSERT INTO temp_sal_order_fom_pmp(id,txntime,operator,vouchnum,dptcode,code,qty,price,disc,orgamt,sequence,clscode,display,itemdisc,price2,status) VALUES"+
"INSERT INTO temp_sal_order_fom_pmp(id,txntime,operator,vouchnum,dptcode,code,qty,price,disc,orgamt,sequence,clscode,display,itemdisc,price2,status) VALUES"+
"left join SHOPTXNS s2 on Convert(varchar,s1.txntime,23)= Convert(varchar,s2.txntime,23) AND s1.operator=s2.operator AND s1.vouchnum=s2.vouchnum AND s1.TERMINAL=s2.TERMINAL and s2.SALESTYPE = 8\n"+
"where s1.SALESTYPE = 2 and s1.CODE IS NOT NULL");
// ps1=ct1.prepareStatement("SELECT DPTCODE FROM shoptxns WHERE Convert(varchar,txntime,120) like ''+?+'%' and vouchnum=? and operator=? and salestype=8");