/* 生成插入sys_dict表的语句的语句 */
SELECT
CONCAT("INSERT INTO sys_dict ( DICT_TYPE_ID, DICT_NAME, DICT_VALUE, DICT_DISP_ORDER, DICT_STATUS, DICT_DESCRIPTION, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME) (SELECT (SELECT max(dict_type_id) FROM sys_dict_type WHERE dict_type_code='",dict_type_code,"'),"
,"'",DICT_NAME,"','",DICT_VALUE,"','",IFNULL(DICT_DISP_ORDER,1),"','",DICT_STATUS,"','",IFNULL(DICT_DESCRIPTION,''),"','1',now(),'1',now() FROM DUAL);") AS dictsql
 FROM sys_dict_misc
WHERE dict_type_id IN(
SELECT  dict_type_id FROM sys_dict_type WHERE dict_type_id>=298 AND dict_type_id<>313
)
ORDER BY dict_type_code;


/* 生成插入sys_dict表的语句的语句 */
SELECT
CONCAT("INSERT INTO sys_dict ( DICT_TYPE_ID, DICT_NAME, DICT_VALUE, DICT_DISP_ORDER, DICT_STATUS, DICT_DESCRIPTION, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME) (SELECT (SELECT max(dict_type_id) FROM sys_dict_type WHERE dict_type_code='",dict_type_code,"'),"
,"'",DICT_NAME,"','",DICT_VALUE,"','",IFNULL(DICT_DISP_ORDER,1),"','",DICT_STATUS,"','",IFNULL(DICT_DESCRIPTION,''),"','1',now(),'1',now() FROM DUAL);") AS dictsql
 FROM sys_dict_misc
WHERE dict_type_id IN(
SELECT  dict_type_id FROM sys_dict_type WHERE dict_type_id in(366,365)
)
ORDER BY dict_type_code;


/* 生成插入sys_dict表的语句的语句 */
SELECT
CONCAT("INSERT INTO sys_dict ( DICT_TYPE_ID, DICT_NAME, DICT_VALUE, DICT_DISP_ORDER, DICT_STATUS, DICT_DESCRIPTION, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME) (SELECT (SELECT max(dict_type_id) FROM sys_dict_type WHERE dict_type_code='",dict_type_code,"'),"
,"'",DICT_NAME,"','",DICT_VALUE,"','",IFNULL(DICT_DISP_ORDER,1),"','",DICT_STATUS,"','",IFNULL(DICT_DESCRIPTION,''),"','1',now(),'1',now() FROM DUAL);") AS dictsql
 FROM sys_dict_misc
WHERE dict_type_id IN(
SELECT  dict_type_id FROM sys_dict_type WHERE dict_type_code in('WORK_TASK_TYPE_DICT','WORK_TASK_TYPE_TWO_DICT','WORK_TASK_TYPE_HANDLE_DICT')
)
ORDER BY dict_type_code;


DELETE FROM sys_dict WHERE dict_type_id=(SELECT MAX(dict_type_id) FROM sys_dict_type WHERE dict_type_code='FILE_FUNCTION_TYPE_DICT');

SELECT * FROM `sys_dict_misc` WHERE dict_type_code='ETIME_AUDIT_STATUS_DICT'

SELECT * FROM sys_dict_type WHERE dict_type_code='ETIME_AUDIT_STATUS_DICT'

SELECT * FROM sys_dict WHERE dict_type_id=424;