@RequestMapping("/searchSjgl.htm") @ResponseBody public List<IdSjgl> searchSjgl(HttpServletRequest request)throws UnsupportedEncodingException{ List<IdSjgl> list=sjglService.findAllSjgl();//查询所有数据 String stdate=request.getParameter("stdate").trim();//获取前端传来的ID值 for(IdSjgl sjgl:list){ Map<String,String> map1 = new HashMap<String,String>(); map1.put("tableName", sjgl.getSjkb()); // List<IdId_> shList=sjglService.findSjTest(map1,map2); List<IdId_> shList=sjglService.findSj(map1); //List<IdId_> shList=sjglService.findSj(sjgl.getSjkb()); if(shList.size()==0||shList.equals(null)){ sjgl.setSfwk("无数据"); sjgl.setSfsh("未审核"); sjglService.update(sjgl); // for(IdId_ id:shList){ // if(id.getSh()==0){ // } // } }else{ for(IdId_ id:shList){ if(id.getStdate().equals(stdate)){ sjgl.setSfwk("有数据"); if(id.getSh()==1){ sjgl.setSfsh("已审核"); } }else{ sjgl.setSfwk("无数据"); sjgl.setSfsh("未审核"); } sjglService.update(sjgl); } } } return sjglService.findAllSjgl(); } <select id="findSj" resultMap="Idresult" statementType="STATEMENT" > select sh,stdate from ${tableName} </select>
MyBatis动态传入表名查询数据
原创
©著作权归作者所有:来自51CTO博客作者lCarrieLiul的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:Java获取Excel单元格数据
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章