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

转载于:https://www.cnblogs.com/meimao5211/p/3177346.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值