博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UEP-find查询
阅读量:5093 次
发布时间:2019-06-13

本文共 3179 字,大约阅读时间需要 10 分钟。

实体类:   @Entity   @Table(name = "xxxxx")   public class WzInitializeStoreInfo extends EntityBean{
private static final long serialVersionUID = 1L;     //字段都需要get、set方法 @Id @Column(name = "INCODE") private Long incode; @Column(name = "BATCH_ID") private Long batchId;      @Column(name = "VALID_DATE")      private Timestamp validDate; //其他表的字段 @Transient private String modelDesc;//无参参构造方法 public WzInitializeStoreInfo(){} //有参构造方法 public WzInitializeStoreInfo(Long incode, Long batchId, String modelDesc,Date validDate) { super(); this.incode = incode; this.batchId = batchId; this.modelDesc=modelDesc;    this.validDate = (Timestamp)validDate; } public Long getIncode() { return incode; } public void setIncode(Long incode){ this.incode = incode; } public String getModelDesc() { return modelDesc; } public void setModelDesc(String modelDesc) { this.modelDesc = modelDesc; } @Override public Record exportToRecord() { EntityMetaData metaData = EntityMetaDataUtil.getEntityMetaData(this.getClass().getName()); if (metaData == null) { new BaseRunException("Java类"+this.getClass().getName()+"没有元数据信息!不能导出为Record!").handle(); } Record record = PrintUtil.genEmptyExportRecord(metaData); record.set("INCODE", this.incode); record.set("BATCH_ID", this.batchId); return record; } } Ipml   @Component("wzInitializeStoreInfoDetailService") public class WzInitializeStoreInfoDetailServiceImpl implements WzInitializeStoreInfoDetailService { IDAO supplyDAO = JPAUtil.useJPATool("SupplyChainJPAToolDAO");//仓储用户 public List
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,c.modelDesc,w.validDate)");     jpql.append(" from WzInitializeStoreInfo w,WzCode c where w.incode=c.incode " +     "AND w.storeId in ("+StoreCommonUtil.getLowStoreStr(((AdminView)ContextUtil.getUserView()).getOrgPartyId())+")"); //查询自己仓库的数据    }    if(param.get("batchId")!=null){     jpql.append(" and w.batchId=:batchId");    }    if(param.get("modelDesc")!=null){     jpql.append(" and c.modelDesc like :modelDesc"); 76 }     jpql.append(" order by w.batchId desc");     List
list=supplyDAO.find(jpql.toString(),param, sort,pageInfo);     List
siteList=new ArrayList
();     for(int i=0;i
list=supplyDAO.find(jpql.toString(), param,sort,pageInfo);    注意 ①和②的差别,①如果传参数会报找不到相应字段的错误 

 

 查询  适用于前台下拉Integer类型报错    if (param.get("laiyuanType")!=null) {        String laiyuan=param.get("laiyuanType").getValue().toString();        param.get("laiyuanType").setValue(Integer.valueOf(laiyuan));        jpql.append("and w.laiyuanType=:laiyuanType");      }  

 

     

  

转载于:https://www.cnblogs.com/kkdf/p/8108761.html

你可能感兴趣的文章
我想知道
查看>>
android:Style and Theme
查看>>
iphone:使用NSFileManager取得目录下所有文件(遍历所有文件)
查看>>
第二十三篇 玩转数据结构——栈(Stack)
查看>>
jquery loop on Json data using $.each
查看>>
学习笔记:CentOS7学习之十八:Linux系统启动原理及故障排除
查看>>
CSMS2公共方法
查看>>
-bash: wget: command not found的两种解决方法
查看>>
将中缀表达式转化为后缀表达式
查看>>
浅谈TCP/IP网络编程中socket的行为
查看>>
向论文作者要代码的邮件怎么写
查看>>
Gdcm源码编译with python wrap详解
查看>>
git命令
查看>>
(greedy)Best Time to Buy and Sell Stock II
查看>>
朋友圈入驻360云盘?这么赤果果微信造吗?
查看>>
微信硬件平台智能家居行业解决方案
查看>>
SGU 326 Perspective
查看>>
HDU 2234 无题I
查看>>
乱七八糟 Nodejs 系列一:试水
查看>>
触摸旋转移动
查看>>