wangchuanfu
/**

主要讲一下ibatis中$$的使用:

 是为了传递参数;

参数一定在Action层用\'\'包裹起来:

*/



List <SysRole> userList=  systemService.getSysRoleUserByUserIdApp(userId);
        String ywcatalogName="";
        if(userList!=null){
        for(SysRole user:userList){
         ywcatalogName+="\'"+user.getRoleName().substring(user.getRoleName().lastIndexOf("-")+1)+"\'"+",";
         }
        }
        if(ywcatalogName!=null){
        //    ywcatalogName.substring(0, ywcatalogName.length()-1);
            ywcatalogName = ywcatalogName.substring(0, ywcatalogName.lastIndexOf(","));
            map.put("ywcatalogName" ,ywcatalogName);
        }
<!--   在sql中拼接 如下: --> 

trim( b.YW_CATALOG_NAME) in ($ywcatalogName$);<!-- 主要用于拼接字符串 -->

 

 

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2021-11-12
相关资源
相似解决方案