/******
查询配置变化 Author:wyw  
2023-04-26
*******/

-- yyyy-MM-dd 00:00:00 为最近更新的日期
select top 100 MODIFY_TIME, * from  T_PF_FORM  order  by CREATE_TIME desc


--查询有变化的表单
select T_PF_FORM.CODE,T_PF_FORM.NAME from T_PF_EDIT_COLUMN
inner join T_PF_PAGE_EDIT on T_PF_PAGE_EDIT.ID=T_PF_EDIT_COLUMN.PAGE_EDIT_ID
inner join T_PF_FORM on T_PF_FORM.ID=T_PF_PAGE_EDIT.PAGE_FORM_ID
where T_PF_EDIT_COLUMN.MODIFY_TIME>'2023-03-20 00:00:00'
group by T_PF_FORM.CODE ,T_PF_FORM.NAME
union all
--查询有变化的列表
select T_PF_FORM.CODE ,T_PF_FORM.NAME from  T_PF_COLUMN 
inner join T_PF_PAGE_TABLE on T_PF_COLUMN.PAGE_TABLE_ID=T_PF_PAGE_TABLE.ID
inner join T_PF_FORM on T_PF_FORM.ID=T_PF_PAGE_TABLE.PAGE_FORM_ID
where T_PF_COLUMN.MODIFY_TIME>'2023-03-20 00:00:00'
group by T_PF_FORM.CODE ,T_PF_FORM.NAME
union all
--查询有变化的搜索
select  T_PF_FORM.CODE ,T_PF_FORM.NAME  from T_PF_QUERY
inner join T_PF_FORM on T_PF_FORM.ID=T_PF_QUERY.PAGE_FORM_ID
where T_PF_QUERY.MODIFY_TIME>'2023-01-20 00:00:00'
group by T_PF_FORM.CODE ,T_PF_FORM.NAME
union all
--查询有变化参数配置的表单
select  T_PF_FORM.CODE ,T_PF_FORM.NAME  from T_PF_PAGE_CUSTOM
inner join T_PF_FORM on T_PF_FORM.ID=T_PF_PAGE_CUSTOM.PAGE_FORM_ID
where T_PF_PAGE_CUSTOM.MODIFY_TIME>'2023-11-15 00:00:00'
group by T_PF_FORM.CODE ,T_PF_FORM.NAME
order by CODE

--表单重复查询
select * from  (
select count(1)as CodeCount, CODE,NAME from  T_PF_FORM 
group by CODE,NAME
) tb where tb.CodeCount>1
order  by CODE desc


