-- 1.严重违法失信名单（自然人）详细信息 E_ANP_ILLDISDETAIL
SELECT
	t.ILLEGALLISTID AS ILLID,
	e.LEREP AS INV,
	e.CERTYPE AS CERTYPE,
	e.CERTYPE AS CERTYPE_CN,
	e.CERNO AS CERNO,
	t.SERILLREA AS SERILLREA,
	t.LOSTCREDITEXPLAIN AS SERILLREA_CN,
	t.ABNTIME AS ABNTIME,
	t.DECORG AS DECORG,
	t.DECORGCN AS DECORG_CN,
	d.WRITSNO AS DEDOCNUM,
	d.WRITSNAME AS NOTICETITLE,
	d.CONTENT AS NOTICECONTENT,
	t.REMEXCPRES AS REMEXCPRES,
	t.LOSTCREDITEXPLAINREM AS REMEXCPRES_CN,
	t.remdate AS REMDATE,
	t.REMDECORG AS RECORG,
	t.REMDECORGCN AS RECORG_CN,
	t.REMWRITID AS REDOCNUM,
	'440101' AS S_EXT_FROMNODE,
	t.LAUPTIME AS S_EXT_DATATIME 
FROM
	tsserillegallist t
	LEFT JOIN tswrit d ON d.WRITSID = t.INTOWRITID 
	LEFT JOIN e_baseinfo e ON t.pripid = e.pripid limit 10;

-- 2.列入决定书信息 E_LI_INDEMATION
SELECT
	t.WRITSID AS ILLBOOKID,
	t.PRIPID AS PRIPID,
	e.ENTNAME AS ENTNAME,
	e.UNISCID AS UNISCID,
	t.WRITSNAME AS NOTICETITLE,
	t.CONTENT AS NOTICECONTENT,
	'440101' AS S_EXT_FROMNODE,
	t.LAUPTIME AS S_EXT_DATATIME 
FROM
	tswrit t
	LEFT JOIN e_baseinfo e ON t.PRIPID = e.PRIPID 
WHERE
	t.WRITSTYPE = '21' limit 100;
	
	
-- 3.列入严重违法失信名单的具体情况 E_LI_SPEDETAIL
SELECT
	t.ILLEGALLISTID AS ILLID,
	t.PRIPID AS PRIPID,
	t.ENTNAME AS ENTNAME,
	t.UNISCID AS UNISCID,
	t.ISREV AS ISREV,
	t.REVOP AS REVOP,
	t.ISHEA AS ISHEA,
	t.HEAOP AS HEAOP,
	t.lostcreditexplain AS SERILLFACT,
	t.lostcreditexplain AS SERILLBASISNAME,
	t.JUDDOCTITLE AS JUDDOCTITLE,
	t.JUDDOCNO AS JUDDOCNO,
IF
	( t.operationStatus = '3', t.REMDATE, NULL ) AS REVDATE,
	r.applyTime AS REPAIRDATE,
	t.remdate AS REPAIRDECDATE,
	'440101' AS S_EXT_FROMNODE,
	t.LAUPTIME AS S_EXT_DATATIME 
FROM
	tsserillegallist t
	LEFT JOIN tsbizserillegalrem r ON t.illegalListID = r.illegalListID;


-- 4.公示公告信息 AFFICHE_BASE
SELECT
	WRITSID AS NOTICEID,
	WRITSNAME AS NoticeTitle,
	WRITSNO AS NoticeNO,
	CONTENT AS NoticeContent,
	l.DECORG AS JudAuth,
	l.DECORGCN AS JudAuth_CN,
	l.abntime AS JudDate,
	l.abntime AS NoticeDate,
	'21' AS NoticeType,
	'440101' AS S_EXT_FROMNODE,
	t.LAUPTIME AS S_EXT_DATATIME 
FROM
	tswrit t
	LEFT JOIN tsserillegallist l ON t.WRITSID = l.INTOWRITID 
WHERE
	t.WRITSTYPE = '21' 	LIMIT 10;