|
@ -65,7 +65,78 @@ public class WlyyHttpLogService extends BaseJpaService<WlyyHttpLogDO, WlyyHttpL
|
|
|
"b.name as \"doctorName\"" +
|
|
|
" from wlyy_http_log t left join base_patient a on t.patient = a.id " +
|
|
|
" left join base_doctor b on t.doctor = b.id where 1=1 and (t.code like '%Check%' or t.name = '合理用药审核接口')";
|
|
|
if (StringUtils.isNotBlank(startTime)){
|
|
|
if("xm_ykyy_wx".equals(wxId)){
|
|
|
if (flag){
|
|
|
sql+=" and t.create_time > '"+startTime+"'";
|
|
|
}else {
|
|
|
sql+=" and t.create_time > to_date('" + startTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
|
|
|
}
|
|
|
}else{
|
|
|
sql+=" and t.create_time > '"+startTime+"'";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endTime)){
|
|
|
if("xm_ykyy_wx".equals(wxId)){
|
|
|
if (flag){
|
|
|
sql+=" and t.create_time<'" + endTime + "'";
|
|
|
}else {
|
|
|
sql+=" and t.create_time< to_date('" + endTime + "','yyyy-mm-dd hh24:mi:ss')";
|
|
|
}
|
|
|
}else{
|
|
|
sql+=" and t.create_time<'" + endTime + "'";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(faceName)){
|
|
|
sql+=" and t.name like '%"+faceName+"%'";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(patient)){
|
|
|
sql+=" and a.name like '%"+patient+"%'";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(doctor)){
|
|
|
sql+=" and b.name like '%"+doctor+"%'";
|
|
|
}
|
|
|
List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
|
|
|
String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql+") q";
|
|
|
Long count = 0L;
|
|
|
List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlcount);
|
|
|
if(total!=null){
|
|
|
//mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
|
|
|
count = hibenateUtils.objTransformLong(total.get(0).get("total"));
|
|
|
}
|
|
|
mixEnvelop.setTotalCount(count.intValue());
|
|
|
mixEnvelop.setDetailModelList(list);
|
|
|
mixEnvelop.setPageSize(pageSize);
|
|
|
mixEnvelop.setCurrPage(page);
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public MixEnvelop findWlyyHttpLogInBase(String startTime, String endTime, String code,String faceName, String patient, String doctor,String responeKeyWord,String requestKeyWord, Integer page, Integer pageSize){
|
|
|
MixEnvelop mixEnvelop = new MixEnvelop();
|
|
|
String sql = "select t.id as \"id\"," +
|
|
|
"t.code as \"code\"," +
|
|
|
"t.name as \"name\"," +
|
|
|
"t.patient as \"patient\"," +
|
|
|
"t.doctor as \"doctor\"," +
|
|
|
"t.request as \"request\"," +
|
|
|
"t.response as \"response\"," +
|
|
|
"t.status as \"status\",";
|
|
|
if("xm_ykyy_wx".equals(wxId)){
|
|
|
if (flag){
|
|
|
sql+="date_format(t.create_time, '%Y-%m-%d %H:%i:%s') as \"createTime\",";
|
|
|
}else {
|
|
|
sql+=" to_char(t.create_time,'yyyy-MM-dd HH24:mi:ss') as \"createTime\",";
|
|
|
}
|
|
|
}else{
|
|
|
sql+="date_format(t.create_time, '%Y-%m-%d %H:%i:%s') as \"createTime\",";
|
|
|
}
|
|
|
sql+=" a.name as \"patientName\"," +
|
|
|
"b.name as \"doctorName\"" +
|
|
|
" from wlyy_http_log t left join base_patient a on t.patient = a.id " +
|
|
|
" left join base_doctor b on t.doctor = b.id where 1=1 ";
|
|
|
if (StringUtils.isNotBlank(startTime)){
|
|
|
if("xm_ykyy_wx".equals(wxId)){
|
|
|
if (flag){
|
|
|
sql+=" and t.create_time > '"+startTime+"'";
|
|
@ -87,6 +158,9 @@ public class WlyyHttpLogService extends BaseJpaService<WlyyHttpLogDO, WlyyHttpL
|
|
|
sql+=" and t.create_time<'" + endTime + "'";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(code)){
|
|
|
sql+=" and t.code = '"+code+"'";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(faceName)){
|
|
|
sql+=" and t.name like '%"+faceName+"%'";
|
|
|
}
|
|
@ -96,6 +170,120 @@ public class WlyyHttpLogService extends BaseJpaService<WlyyHttpLogDO, WlyyHttpL
|
|
|
if (StringUtils.isNotBlank(doctor)){
|
|
|
sql+=" and b.name like '%"+doctor+"%'";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(requestKeyWord)){
|
|
|
sql+=" and t.request like '%"+requestKeyWord+"%'";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(responeKeyWord)){
|
|
|
sql+=" and t.response like '%"+responeKeyWord+"%'";
|
|
|
}
|
|
|
List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
|
|
|
String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql+") q";
|
|
|
Long count = 0L;
|
|
|
List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlcount);
|
|
|
if(total!=null){
|
|
|
//mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
|
|
|
count = hibenateUtils.objTransformLong(total.get(0).get("total"));
|
|
|
}
|
|
|
mixEnvelop.setTotalCount(count.intValue());
|
|
|
mixEnvelop.setDetailModelList(list);
|
|
|
mixEnvelop.setPageSize(pageSize);
|
|
|
mixEnvelop.setCurrPage(page);
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
public MixEnvelop findLoginLog(String startTime, String endTime, String userId,String userName, String openId, String userAgent,String loginType,String opreateStart, String opreateEnd, Integer page, Integer pageSize) {
|
|
|
MixEnvelop mixEnvelop = new MixEnvelop();
|
|
|
String sql = "select t.id as \"id\"," +
|
|
|
"t.user_id as \"userId\"," +
|
|
|
"p.name as \"patientName\"," +
|
|
|
"d.name as \"doctorName\"," +
|
|
|
"t.user_agent as \"userAgent\"," +
|
|
|
"t.login_type as \"loginType\"," +
|
|
|
"t.openid as \"openid\"," ;
|
|
|
if("xm_ykyy_wx".equals(wxId)){
|
|
|
if (flag){
|
|
|
sql+="date_format(t.create_time, '%Y-%m-%d %H:%i:%s') as \"createTime\",";
|
|
|
}else {
|
|
|
sql+=" to_char(t.create_time,'yyyy-MM-dd HH24:mi:ss') as \"createTime\",";
|
|
|
}
|
|
|
}else{
|
|
|
sql+="date_format(t.create_time, '%Y-%m-%d %H:%i:%s') as \"createTime\",";
|
|
|
}
|
|
|
if("xm_ykyy_wx".equals(wxId)){
|
|
|
if (flag){
|
|
|
sql+="date_format(t.operate_time, '%Y-%m-%d %H:%i:%s') as \"operateTime\",";
|
|
|
}else {
|
|
|
sql+=" to_char(t.operate_time,'yyyy-MM-dd HH24:mi:ss') as \"operateTime\",";
|
|
|
}
|
|
|
}else{
|
|
|
sql+="date_format(t.operate_time, '%Y-%m-%d %H:%i:%s') as \"operateTime\",";
|
|
|
}
|
|
|
sql+=" a.name as \"patientName\"," +
|
|
|
"b.name as \"doctorName\"" +
|
|
|
" from wlyy_http_log t left join base_patient p on t.user_id = p.id " +
|
|
|
" left join base_doctor d on t.user_id = d.id where 1=1 ";
|
|
|
if (StringUtils.isNotBlank(startTime)){
|
|
|
if("xm_ykyy_wx".equals(wxId)){
|
|
|
if (flag){
|
|
|
sql+=" and t.create_time > '"+startTime+"'";
|
|
|
}else {
|
|
|
sql+=" and t.create_time > to_date('" + startTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
|
|
|
}
|
|
|
}else{
|
|
|
sql+=" and t.create_time > '"+startTime+"'";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endTime)){
|
|
|
if("xm_ykyy_wx".equals(wxId)){
|
|
|
if (flag){
|
|
|
sql+=" and t.create_time<'" + endTime + "'";
|
|
|
}else {
|
|
|
sql+=" and t.create_time< to_date('" + endTime + "','yyyy-mm-dd hh24:mi:ss')";
|
|
|
}
|
|
|
}else{
|
|
|
sql+=" and t.create_time<'" + endTime + "'";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(userId)){
|
|
|
sql+=" and t.user_id = '"+userId+"'";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(userName)){
|
|
|
if ("2".equalsIgnoreCase(loginType)){
|
|
|
sql+=" and d.name like '%"+userName+"%'";
|
|
|
}else {
|
|
|
sql+=" and p.name like '%"+userName+"%'";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(loginType)){
|
|
|
sql+=" and t.login_type ='"+loginType+"'";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(openId)){
|
|
|
sql+=" and t.openId like '%"+openId+"%'";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(userAgent)){
|
|
|
sql+=" and t.user_agent like '%"+userAgent+"%'";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(opreateStart)){
|
|
|
if("xm_ykyy_wx".equals(wxId)){
|
|
|
if (flag){
|
|
|
sql+=" and t.operate_time > '"+opreateStart+"'";
|
|
|
}else {
|
|
|
sql+=" and t.operate_time > to_date('" + opreateStart + "', 'yyyy-mm-dd hh24:mi:ss') ";
|
|
|
}
|
|
|
}else{
|
|
|
sql+=" and t.operate_time > '"+opreateStart+"'";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(opreateEnd)){
|
|
|
if("xm_ykyy_wx".equals(wxId)){
|
|
|
if (flag){
|
|
|
sql+=" and t.operate_time<'" + opreateEnd + "'";
|
|
|
}else {
|
|
|
sql+=" and t.operate_time< to_date('" + opreateEnd + "','yyyy-mm-dd hh24:mi:ss')";
|
|
|
}
|
|
|
}else{
|
|
|
sql+=" and t.operate_time<'" + opreateEnd + "'";
|
|
|
}
|
|
|
}
|
|
|
List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
|
|
|
String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql+") q";
|
|
|
Long count = 0L;
|