• 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";
    }

  • 相关阅读:
    [Luogu 3794]签到题IV
    [JSOI 2015]最大公约数
    [BZOJ 5123][Lydsy1712月赛]线段树的匹配
    [BZOJ 5127][Lydsy1712月赛]数据校验
    [Codeforces Educational Round 71]Div. 2
    [NOIp 2018]all
    [BZOJ 2134]单选错位
    [hihoCoder 1384]Genius ACM
    [POJ 3233]Matrix Power Series
    [USACO 09FEB]Bullcow
  • 原文地址:https://www.cnblogs.com/meimao5211/p/3177346.html
Copyright © 2020-2023  润新知