|  |  |  | 
|---|
|  |  |  | select | 
|---|
|  |  |  | so.order_no,so.order_status,sp.title pro_name,spa.attr_name pro_type,sp.attrs_values pro_attrs,sku.`NAME` pro_specification,sod.count 'count',sod.price*sod.count order_money,bu.nick_name nick_name,so.order_time | 
|---|
|  |  |  | from | 
|---|
|  |  |  | shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,biz_user bu,shop_sku sku | 
|---|
|  |  |  | shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,sys_vip_info bu,shop_sku sku | 
|---|
|  |  |  | where | 
|---|
|  |  |  | so.del_flag = 2 | 
|---|
|  |  |  | and sod.p_id = sp.id | 
|---|
|  |  |  | and sp.category_id = spa.attr_id | 
|---|
|  |  |  | and sod.order_id = so.id | 
|---|
|  |  |  | and bu.open_id = so.user_id | 
|---|
|  |  |  | and bu.id = so.user_id | 
|---|
|  |  |  | and sku.p_id = sod.p_id | 
|---|
|  |  |  | and so.company_id=#{record.companyId} | 
|---|
|  |  |  | <if test="record != null"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <select id="selectTotalRecordByQuery" resultType="java.lang.Integer"> | 
|---|
|  |  |  | select count(*) | 
|---|
|  |  |  | from | 
|---|
|  |  |  | shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,biz_user bu,shop_sku sku | 
|---|
|  |  |  | shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,sys_vip_info bu,shop_sku sku | 
|---|
|  |  |  | where | 
|---|
|  |  |  | so.del_flag = 2 | 
|---|
|  |  |  | and sod.p_id = sp.id | 
|---|
|  |  |  | and sp.category_id = spa.attr_id | 
|---|
|  |  |  | and sod.order_id = so.id | 
|---|
|  |  |  | and bu.open_id = so.user_id | 
|---|
|  |  |  | and bu.id = so.user_id | 
|---|
|  |  |  | and sku.p_id = sod.p_id | 
|---|
|  |  |  | and so.company_id=#{record.companyId} | 
|---|
|  |  |  | <if test="record != null"> | 
|---|