在线信访信件导出
问题描述:后台没有导出信件功能,那么如何导出在线信访信件?
解决方案:使用如下sql语句进行查询:
select PetitionLetterId,
ISNULL(department.DepartmentName,'') as 办理部门,
letter.Title 主题,
letterType.PetitionLetterName 信件类型,
case letter.PetitionLetterStatus
when -3 Then '退回主站群'
when -2 Then '退回给写信人'
when -4 Then '同意退回'
when -1 Then '已废弃'
when 0 Then '待审核'
when 1 Then '等待批核意见'
when 2 Then '待转发'
when 3 Then '待办理'
when 4 Then '已办理'
when 5 Then '已办结'
when 6 Then '办理中'
end as 状态,
letter.CreateTime 创建时间,
case
letter.IsPublicScoring
when 1 then '是'
when 0 then '否'
end 公开评分,
letter.Content
from PE_Petition_PetitionLetter letter
left join PE_Common_GlobalDepartment department on letter.PetitionDepartmentId=department.DepartmentId
left join PE_Petition_PetitionLetterType letterType on letter.PetitionLetterTypeId=letterType.PetitionLetterTypeId
where letter.CreateTime>'2021-12-31' and letter.CreateTime<=GETDATE() and letter.PetitionLetterBoxId=1
根据实际情况修改letter.CreateTime(信件创建时间)和letter.PetitionLetterBoxId(信箱id)