zoukankan      html  css  js  c++  java
  • ACTION 关联表之间查询语句 SQL语句写法

    /** EquUseRecord
    * @author cll
    * @return
    * @右边菜单中的使用记录操作
    */
    public String QueryAllEquUserecordAllInfo(){
    // 快捷菜单
    Integer code = Integer.parseInt((String)get("code"));
    this.getmenu(code, this.getRequest());
    String str1 = " ea.id=uq.appId ";
    if(get("sytime") != null && !"".equals(get("sytime"))){
    str1 += " and uq.sydate like '%" + get("sytime").toString() + "%'";
    }
    if(get("text1") != null && !"".equals(get("text1"))){
    str1 += " and ea.appliname like '%" + get("text1").toString() + "%'";
    }


    //获得 设备的id
    // Integer id=Integer.parseInt(get("id").toString().trim());
    // this.getRequest().setAttribute("appId", id);
    //多表分页
    pageService.getPage("QueryAllEquUserecordAllInfo.action?code="+code, 0, this.getRequest());
    // PageEntity entity = pageService.doList("EquUserecord", "1=1");
    //返回:仪器名称0、本单位仪器编号1、使用日期2、工作内容3、使用多长时间(h)4、使用前仪器的状态5、使用后仪器的状态6、使用人7、使用记录id 8、仪器表ID外键9、使用单位10、使用部门11、
    PageEntity entity = pageService.doListbySelectwhere("uq","ea.appliname,ea.applicode,uq.sydate,uq.workcontent,uq.time,uq.startstate,uq.endstate,uq.name,uq.id,uq.appId,ea.syunit,ea.sydept",
    " EquAppliance ea,EquUserecord uq", str1, " order by uq.appId");
    this.getRequest().setAttribute("page", entity);
    this.getRequest().setAttribute("sytime", get("sytime"));
    this.getRequest().setAttribute("text1", get("text1"));
    return "success";
    }

  • 相关阅读:
    [转贴]35岁之前成功12条法则
    any type,any name
    The quick brown fox jumps over the lazy dog.
    [总结]软件工程师笔试题目(C++)
    [转]IOCP介绍
    A simple IOCP Server/Client Class
    Flash for Linux
    看看你是否需要更新SYMBOL文件了??
    [转贴]The Code Project Visual C++ Forum FAQ
    (搜集)一些少走弯路的话语+参考信息
  • 原文地址:https://www.cnblogs.com/meimao5211/p/3177346.html
Copyright © 2011-2022 走看看