关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、418799587 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 9940|回复: 0

[Online开发] 执行第二次的时候无法查询到数据,复制在数据库却有。

[复制链接]
发表于 2018-9-11 23:16:30 | 显示全部楼层 |阅读模式
//获取当前用户id
TSUser user = ResourceUtil.getSessionUserName();
String uid = user.getId();

int pageSize = Integer.parseInt(request.getParameter("pageSize"));//单页数量
int page = Integer.parseInt(request.getParameter("page"));//页码
String type = request.getParameter("type");//会诊状态

Map<String, Object> map = new HashMap<>();

String sql= "SELECT h.id, h.huanzid, h.xingb, h.xingm, h.nianl, z.zhuyh, CONVERT(VARCHAR(10) ,z.chuyrq ,120) chuyrq," +
        
" CONVERT(VARCHAR(10) ,z.ruyrq ,120) ruyrq, datediff(dd, z.ruyrq, z.chuyrq) tian," +
        
" (CASE z.tianxrid WHEN '"+ uid +"' THEN 'true' ELSE 'false' END) isMine,"+
        
" ISNULL(zd.zhendmc, '无') zhendmc, ISNULL(zd.bingzmc, '无') bingzmc, ISNULL(zd.fenq, '') fenq," +
        
" ISNULL(( SELECT TOP 1 wb.id FROM t_b_weibrlxx AS wb WHERE z.zhuyh = wb.zhuyh ), '' ) weib, " +
        
"ISNULL(( SELECT TOP 1 hl.id FROM t_b_hualxx AS hl WHERE z.zhuyh = hl.zhuyh ), '' ) hual, " +
        
"ISNULL(( SELECT TOP 1 ss.id FROM t_b_shouszlxx AS ss WHERE z.zhuyh = ss.zhuyh ), '' ) shous, " +
        
"ISNULL(( SELECT TOP 1 fl.id FROM t_b_fanglxx AS fl WHERE z.zhuyh = fl.zhuyh ), '' ) fangl, " +
        
"ISNULL(( SELECT TOP 1 bx.id FROM t_b_baxzlxx AS bx WHERE z.zhuyh = bx.zhuyh ), '' ) bax, " +
        
"ISNULL(( SELECT TOP 1 my.id FROM t_b_mianyzlxx AS my WHERE z.zhuyh = my.zhuyh ), '' ) miany, " +
        
"ISNULL(( SELECT TOP 1 nfm.id FROM t_b_neifmzlxx AS nfm WHERE z.zhuyh = nfm.zhuyh ), '' ) neifm, " +
        
"ISNULL(( SELECT TOP 1 rgz.id FROM t_b_regzrl AS rgz WHERE z.zhuyh = rgz.zhuyh ), '' ) regz, " +
        
"ISNULL(( SELECT TOP 1 dp.id FROM t_b_dipcsrl AS dp WHERE z.zhuyh = dp.zhuyh ), '' ) dip, " +
        
"ISNULL(( SELECT TOP 1 sb.id FROM t_b_shenbrl AS sb WHERE z.zhuyh = sb.zhuyh ), '' ) shenb, " +
        
"ISNULL(( SELECT TOP 1 tt.tengtpf FROM t_b_pingfxx AS tt WHERE z.zhuyh = tt.zhuyh ORDER BY tt.pingfrq DESC ), '') tengt ," +
        
"ISNULL(yy.id, '') yid, " +
        
"ISNULL(huizhenyj, '') huizhenyj, " +
        
"ISNULL(TIME, '') TIME, " +
        
"ISNULL(yishenid, '') yishenid, " +
        
"ISNULL(type, '') type, " +
        
"ISNULL(huanzxxid, '') huanzxxid, " +
        
"ISNULL(shenqingysid, '') shenqingysid " +
        
"FROM t_b_huanzxx AS h LEFT JOIN t_b_zhuyjbxx z ON z.huanzid = h.huanzid " +
        
"LEFT JOIN t_b_zhendxx zd ON h.huanzid = zd.huanzid LEFT JOIN t_b_yuanchenhuizhen yy ON yy.huanzxxid = h.id AND z.zhuyh = zd.zhuyh  where yishenid='"+uid+"' and type='"+type+"'";
List<Map<String, Object>> list = new ArrayList<>();

    list = systemService.findForJdbcParam(sql, page, pageSize);
    map.put("list", list);//执行第二次的时候无法查询到数据,复制sql在数据库却有。那位大佬帮看看
}

return JSONObject.fromObject(map);
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表