if exists(select 1 from sysobjects where name='pr_wxsf_get_changeprice_order')
  drop procedure pr_wxsf_get_changeprice_order
go



--微商店获取最近七天已审核的总部做的调价单
create proc pr_wxsf_get_changeprice_order
 as
 begin
     
    select a.branch_no, case when a.branch_no = 'ALL' then '所有分店' else '自定义分店' end as branch_name,
	b.oper_name as confirm_manName,
	a.memo,a.oper_date,
	b.oper_name,
	a.sheet_no,
	a.branch_flag,
	c.branch_name as flag_name,
	--a.import_flag,
	'' AS import_flag,
	a.work_date 
	from t_pc_price_flow_master a
	inner join t_sys_operator b on a.confirm_man = b.oper_id
	left join t_bd_branch_info c on a.branch_no = c.branch_no
	where a.trans_no = 'PX'
	and a.approve_flag = 1 and DateDiff(dd,work_date,getdate())<=7 
	and  (a.branch_no='00' OR a.branch_no='ALL' OR CHARINDEX('00,', a.branchlist) >0 )

 end
go