

SELECT
				a.id AS id,
				b.id AS dz_order_id,
				a.id AS goods_id,
				'' AS goods_no,
				a.price AS price,
				a.quantity AS total,
				a.price AS unit_price,
				'' AS optionname,
				a.unit AS unit,
				a.goods_name AS goods_name,


				b.dispatchprice AS dispatchprice,
				(a.quantity * a.price) AS total_price,

				'' AS fiscal_code,
				b.finish_time AS finish_time,
				b.create_time AS create_time,
				b.merch_name AS merch_name,
				b.order_sn AS order_sn,

				b.address_mobile AS address_mobile,
				b.invoice_account AS invoice_account,
				b.remark AS remark,

				b.tax_code AS tax_code,

				b.pay_type AS pay_type,
				b.status AS status,
				b.realname_id AS realname_id,

				b.price AS order_price,


				d.purchase_virt_name AS enterprise_name,
				d.purchase_virt_name AS company_name,

				c.enterprise_id AS enterprise_id,
				c.invoice_taxpayers_i_d_code AS invoice_taxpayers_i_d_code,

				c.accounting_order_sn AS accounting_order_sn,
				c.accounting_status AS accounting_status,

				c.invoice_type AS invoice_type,
				c.invoice_status AS invoice_status,

				d.purchase_user_name AS realname
			FROM
				unified_order_goods a
				LEFT JOIN accounting_unified_customer_order b ON a.order_sn = b.order_sn
				LEFT JOIN accounting_unified_customer c ON b.dz_id = c.id
				LEFT JOIN sys_enterprise e ON e.enterprise_id = c.enterprise_id
				LEFT JOIN unified_order d ON a.order_sn = d.order_sn





































SELECT
				a.id AS id,
				b.id AS dz_order_id,
				a.id AS good_id,
				'' AS good_no,
				a.price AS price,
				a.quantity AS total,
				a.price AS unit_price,
				'' AS optionname,
				a.goods_params AS unit,
				a.goods_name AS other_field1,


				b.dispatchprice AS dispatchprice,
				(a.quantity * a.price) AS total_price,

				'' AS fiscal_code,
				b.finish_time AS finish_time,
				b.create_time AS createtime,
				b.merch_name AS create_time,
				b.order_sn AS order_sn,

				b.address_mobile AS address_mobile,
				b.invoice_account AS invoice_account,
				b.remark AS remark,

				b.tax_code AS tax_code,
				b.pay_type AS pay_type,
				b.status AS status,
				b.realname_id AS realname_id,

				b.price AS order_price,


				d.purchase_virt_name AS enterprise_name,
				d.purchase_virt_name AS companyname,

				c.enterprise_id AS enterprise_id,
				c.invoice_taxpayers_i_d_code AS invoice_taxpayers_i_d_code,

				c.accounting_order_sn AS accounting_order_sn,
				c.accounting_status AS accounting_status,

				c.invoice_type AS invoice_type,
				c.invoice_status AS invoice_status,

				d.purchase_user_name AS realname
			FROM
				unified_order_goods a
				LEFT JOIN accounting_unified_customer_order b ON a.order_sn = b.order_sn
				LEFT JOIN accounting_unified_customer c ON b.dz_id = c.id
				LEFT JOIN sys_enterprise e ON e.enterprise_id = c.enterprise_id
				LEFT JOIN unified_order d ON a.order_sn = d.order_sn