求大神指导,我这个是根据微信号查询,字符串类型,绝对是字符串类型,但是我的代码如下

求大神指导,我这个是根据微信号查询,字符串类型,绝对是字符串类型,但是我的代码如下。查什么都是全部都显示,求改正啊
action:

 public String getList() throws Exception
    {

          dingDanGuanLiList = dao.getList(weiXinHao);
         return SUCCESS;
    }

public List<DingDanGuanLi>   getList(String weixinhao)
    {
        String Where="";
        if(weixinhao!=null){
        Where = Where + " where weiXinHao='"+weixinhao+"'";
        }
            return this.findAll(Where);
    } 


 private List<DingDanGuanLi>  findAll(String where)
    {
           Session sess = this.getSessionFactory().openSession();
             try
             {
              Query query = sess.createQuery(" From  DingDanGuanLi " + where + " order by id ");
              return query.list();
             }
             finally
             {
                sess.close();
             }
    }

JSP:

微信号:<input type="text" name="weiXinHao" size="15" >&nbsp;&nbsp;
             <s:submit theme="simple" name="List" action="List" value="查询" cssClass="button_style"/>
                <s:submit theme="simple" name="Add" action="Add" value="添加" cssClass="button_style" method="add"/> 

查看全部
baidu_29643173
baidu_29643173
2015/08/12 05:41
  • java
  • where
  • 点赞
  • 收藏
  • 回答
    私信

1个回复