|
@ -0,0 +1,82 @@
|
|
|
package com.yihu.jw.dict.service;
|
|
|
|
|
|
import com.yihu.jw.dict.dao.BaseExceptionDictDao;
|
|
|
import com.yihu.jw.dict.dao.BaseExceptionLogDao;
|
|
|
import com.yihu.jw.dict.dao.BaseExceptionServerDictDao;
|
|
|
import com.yihu.jw.entity.base.dict.BaseExceptionServerDictDO;
|
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Service
|
|
|
public class BaseExceptionService {
|
|
|
@Autowired
|
|
|
private BaseExceptionDictDao baseExceptionDictDao;
|
|
|
@Autowired
|
|
|
private BaseExceptionLogDao baseExceptionLogDao;
|
|
|
@Autowired
|
|
|
private BaseExceptionServerDictDao baseExceptionServerDictDao;
|
|
|
@Autowired
|
|
|
private HibenateUtils hibenateUtils;
|
|
|
public String findServiceByPath(String path){
|
|
|
BaseExceptionServerDictDO baseExceptionServerDictDO = baseExceptionServerDictDao.findServiceByPath(path);
|
|
|
String id ="";
|
|
|
if (baseExceptionServerDictDO !=null){
|
|
|
id = baseExceptionServerDictDO.getId();
|
|
|
}
|
|
|
return id;
|
|
|
}
|
|
|
public List<Map<String,Object>> findExceptionDict(String id,String code,String exceptionType,String isDel){
|
|
|
String sql = "select t.id as \"id\"," +
|
|
|
" t.code as \"code\"," +
|
|
|
" t.exception_message as \"exceptionMessage\"," +
|
|
|
" t.create_time as \"createTime\"," +
|
|
|
" t.is_del \"isDel\"," +
|
|
|
" t.model_name as \"modelName\"," +
|
|
|
" t.exception_type as \"exceptionType\"," +
|
|
|
" t.exception_type_name as \"exceptionTypeName\"," +
|
|
|
" t.remind_content as \"remindContent\"" +
|
|
|
" from base_exception_dict t ";
|
|
|
if (StringUtils.isNoneBlank(id)){
|
|
|
sql+=" t.id ='"+id+"'";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(code)){
|
|
|
sql+=" t.code ='"+code+"'";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(exceptionType)){
|
|
|
sql+=" t.exception_type ='"+exceptionType+"'";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(isDel)){
|
|
|
sql+=" t.is_del ='"+isDel+"'";
|
|
|
}
|
|
|
List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
|
|
|
return list;
|
|
|
}
|
|
|
public List<Map<String,Object>> findExceptionService(String id,String name,String isDel,String pathUrl){
|
|
|
String sql = "select t.id as \"id\"," +
|
|
|
" t.name as \"name\"," +
|
|
|
" t.create_time as \"createTime\"," +
|
|
|
" t.update_time as \"updateTime\"," +
|
|
|
" t.is_del as \"isDel\"," +
|
|
|
" t.path_url as \"pathUrl\"" +
|
|
|
" from base_exception_server_dict t ";
|
|
|
if (StringUtils.isNoneBlank(id)){
|
|
|
sql+=" and t.id ='"+id+"'";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(name)){
|
|
|
sql+=" and t.name ='"+name+"'";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(isDel)){
|
|
|
sql+=" and t.is_del ='"+isDel+"'";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(pathUrl)){
|
|
|
sql+=" and t.path_url ='"+pathUrl+"'";
|
|
|
}
|
|
|
List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
|
|
|
return list;
|
|
|
}
|
|
|
}
|