zoukankan      html  css  js  c++  java
  • ACTION 中 单表查询语句 SQL写法

    JSP页面

    <tr>
    <td class="STYLE1">
    <div align="center">

    // 单击事件 调用方法

    <input type="image" id="imageField22222" name="imageField22222" src="../btn/btn_cx.gif" id="sub" onclick="queryAllEqu();"/>
    </div>
    </td>
    </tr>

    <script language="javascript">

    // 用于提交 ACTION 
    function queryAllEqu(){
    document.form.submit();
    }
    </script>

    // 这里写出调用的ACTION 及传送方式

    <form action="QueryEquApplianceAllInfo.action" name="form" method="post">

    // 这里是写出隐藏域 用来传递code的参数
    <input type="hidden" name="code" value="${code }"/>

    /** EquAppliance 方法开始
    * @author MGX
    * @return
    * @ 查看设备所有信息
    */

    public String QueryEquApplianceAllInfo(){

    Integer code=Integer.parseInt(this.get("code").toString().trim());
    this.getmenu(code, this.getRequest());

    String str1 = "";
    if(get("text1") != null && !"".equals(get("text1"))){
    str1 = " appliname like '%" + get("text1").toString() + "%'";
    }
    if(get("text2") != null && !"".equals(get("text2"))){
    if("".equals(str1)){
    str1 += " applicode like '%" + get("text2").toString() + "%'";
    }else{
    str1 += " and applicode like '%" + get("text2").toString() + "%'";
    }

    }

    pageService.getPage("QueryEquApplianceAllInfo.action?code="+code, 0, this.getRequest());
    PageEntity entity = pageService.doList("EquAppliance", "".equals(str1) ? "1=1" : str1);
    this.getRequest().setAttribute("page", entity);
    this.getRequest().setAttribute("text1", get("text1"));
    this.getRequest().setAttribute("text2", get("text2"));
    return "success";


    // Integer code=Integer.parseInt(this.get("code").toString().trim());
    // this.getmenu(code, this.getRequest());
    // pageService.getPage("QueryEquApplianceAllInfo.action?code="+code, 0, this.getRequest());
    // PageEntity entity = pageService.doList("EquAppliance", "1=1");
    // this.getRequest().setAttribute("page", entity);
    // return "success";
    }

  • 相关阅读:
    VS批处理命令使用
    python实现域账号登陆
    Sql Server 优化技巧
    Windows 2012 R2 安装net4.6.1
    Resharper报“Possible multiple enumeration of IEnumerable”
    京东模拟点击
    使用常规方法爬取猫眼电影
    关于断点调试
    看网络开发实战书笔记
    scrapy的request的meta参数是什么意思?
  • 原文地址:https://www.cnblogs.com/meimao5211/p/3177350.html
Copyright © 2011-2022 走看看