码迷,mamicode.com
首页 > 其他好文 > 详细

Uep查询语句总结

时间:2017-12-18 14:15:04      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:return   exception   read   查询   bsp   detail   grid   lis   size   

 今天没事干总结一下uep查询语句:

第一种方法:

public List<WzInitializeStoreInfo> retrieve(QueryParamList param, PageInfo pageInfo,SortParamList sort) throws BaseRunException {

StringBuffer jpql=new StringBuffer();

jpql.append("select new com.haiyisoft.entity.wz.WzInitializeStoreInfo(w.incode,w.batchId,w.wzIncode,w.storeId,w.buyPrice,w.taxRatio,w.storeSite,w.storeAdvanceNum,w.storeFactNum,w.madeDate,w.validDate,w.productIncode,"
+ "w.batchType,c.wzName,c.wzEntry,c.jlUnit)");
jpql.append(" from WzInitializeStoreInfo w,WzCode c where w.wzIncode=c.wzIncode");


if(param.get("batchId")!=null){
jpql.append(" and w.batchId="+param.get("batchId").getValue());
}
if(param.get("wzEntry")!=null){
jpql.append(" and c.wzEntry="+param.get("wzEntry").getValue());
}
if(param.get("wzName")!=null){
jpql.append(" and c.wzName like "+"‘"+param.get("wzName").getValue()+"‘");
}
if(param.get("companyId")!=null){

jpql.append(" and c.companyId="+param.get("companyId").getValue());
}

List<Object> list=supplyDAO.find(jpql.toString(), sort,pageInfo);
List<WzInitializeStoreInfo> siteList=new ArrayList<WzInitializeStoreInfo>();
for(int i=0;i<list.size();i++){
siteList.add((WzInitializeStoreInfo)list.get(i));
}
return siteList;

}

第二种方法:

public List<WzInitializeStoreInfo> retrieve(QueryParamList param, PageInfo pageInfo,SortParamList sort) throws BaseRunException {

StringBuffer jpql=new StringBuffer();

jpql.append("select new com.haiyisoft.entity.wz.WzInitializeStoreInfo(w.incode,w.batchId,w.wzIncode,w.storeId,w.buyPrice,w.taxRatio,w.storeSite,w.storeAdvanceNum,w.storeFactNum,w.madeDate,w.validDate,w.productIncode,"
+ "w.batchType,c.wzName,c.wzEntry,c.jlUnit)");  
jpql.append(" from WzInitializeStoreInfo w,WzCode c where w.wzIncode=c.wzIncode");


if(param.get("batchId")!=null){
jpql.append(" and w.batchId=  :batchId");
}
if(param.get("wzEntry")!=null){
jpql.append(" and c.wzEntry= :wzEntry");
}
if(param.get("wzName")!=null){
jpql.append(" and c.wzName like   :wzName ");
}
if(param.get("companyId")!=null){

jpql.append(" and c.companyId= :companyId");
}

List<Object> list=supplyDAO.find(jpql.toString(), param,sort,pageInfo);
List<WzInitializeStoreInfo> siteList=new ArrayList<WzInitializeStoreInfo>();
for(int i=0;i<list.size();i++){
siteList.add((WzInitializeStoreInfo)list.get(i));
}
return siteList;

}

主要是赋值和执行语句的参数有所差别。

然后是uep前台数据传入后台的俩种方式

function showDetail(cell) {
//此时要问后台要数据,要新主数据的从数据,
var data = ajaxgrid.collectData(true, "all");
var unitDate = unitGrid.collectData(true, "all");
var a =cell["storeId"];
var dataArr = [];
dataArr.push(data);
dataArr.push(unitDate);
$.request({
action : "retrieveAll",
data : dataArr,

params : {
"storeId" : cell["storeId"],  对于这种后台Action需要private String storeId;然后setter和getter方法
"property.storeId" : a    对于这种传值后台接收只需要this.getProperty("storeId);
},
success : ajax_initdb
});
}

Uep查询语句总结

标签:return   exception   read   查询   bsp   detail   grid   lis   size   

原文地址:http://www.cnblogs.com/zhangzhiqin/p/8056794.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!