????
/**
?????*?根據commutype,epId查詢分期項目下拉列框的值(LabelValueEx對象)按indexNo升序排列,lable對應typeName,value對應commTypeId
?????*?? @param ??epId
?????*?????????????開發商Id
?????*? @param ??commutype?
?????*?????????????通訊方法String類型,分別為tysms,tyemail,tyfax
?????*? @return ?List
?????*? @throws ?BusinessProcessException
????? */
??????如果在查詢的SQL中,用到left join fetch 查詢出來的只能是一個對象,而不能是某些列?
???? 否則會出現沒有取到延遲加載的列的錯誤?
???? public ?List?getCrmCommuInfoTyFms(String?epId,String?commutype)? throws ?BusinessProcessException?{
????????List?dicList? = ? new ?ArrayList();
???????? if ( ! BlankUtil.isBlank(commutype))
????????{????????
???????? try ?{
????????????String?query = " select?info.constValueId?from?SysConstValue?info "
???????????????? + " ?where?info.constValue=' " + commutype + " ' " ;
????????????Long?scv = (Long)cDao.execute(query);
????????????String?sql? = ? " from?CrmCommInfoType?info?left?join?fetch?info.communicationTy "
???????????????? + ? " ?where?info.epId=' " + epId + " ' " ?
???????????????? + " ?and?info.communicationTy.constValueId= " + Long.parseLong(scv.toString());
????????????dicList? = ?cDao.queryObjects(sql);
?????????}? catch ?(Exception?ex)?{
???????????? throw ? new ?BusinessProcessException( " getDictData_search_001 " );
?????????}
????????}
???????? return ?dicList;
????}
?????*?根據commutype,epId查詢分期項目下拉列框的值(LabelValueEx對象)按indexNo升序排列,lable對應typeName,value對應commTypeId
?????*?? @param ??epId
?????*?????????????開發商Id
?????*? @param ??commutype?
?????*?????????????通訊方法String類型,分別為tysms,tyemail,tyfax
?????*? @return ?List
?????*? @throws ?BusinessProcessException
????? */
??????如果在查詢的SQL中,用到left join fetch 查詢出來的只能是一個對象,而不能是某些列?
???? 否則會出現沒有取到延遲加載的列的錯誤?
???? public ?List?getCrmCommuInfoTyFms(String?epId,String?commutype)? throws ?BusinessProcessException?{
????????List?dicList? = ? new ?ArrayList();
???????? if ( ! BlankUtil.isBlank(commutype))
????????{????????
???????? try ?{
????????????String?query = " select?info.constValueId?from?SysConstValue?info "
???????????????? + " ?where?info.constValue=' " + commutype + " ' " ;
????????????Long?scv = (Long)cDao.execute(query);
????????????String?sql? = ? " from?CrmCommInfoType?info?left?join?fetch?info.communicationTy "
???????????????? + ? " ?where?info.epId=' " + epId + " ' " ?
???????????????? + " ?and?info.communicationTy.constValueId= " + Long.parseLong(scv.toString());
????????????dicList? = ?cDao.queryObjects(sql);
?????????}? catch ?(Exception?ex)?{
???????????? throw ? new ?BusinessProcessException( " getDictData_search_001 " );
?????????}
????????}
???????? return ?dicList;
????}
/**
?????*?根據commutype,epId查詢分期項目下拉列框的值(LabelValueEx對象),lable對應typeName,value對應commTypeId
?????*?
?????*? @param ?epId
?????*????????????開發商Id
?????*? @param ?commutype
?????*????????????通訊方法String類型,分別為tysms,tyemail,tyfax
?????*? @return ?List
?????*? @throws ?BusinessProcessException
????? */
????@SuppressWarnings( " unchecked " )
???? public ?DicSelectionModel?getCrmCommuInfoTyFms(String?epId,?String?commutype)
???????????? throws ?BusinessProcessException?{
???????? try ?{
???????????? if ?(DictionaryServ? == ? null )?{
????????????????System.out.println( " DictionaryServ?is?null. " );
????????????}
????????????System.out.println( " get?dicList:------>begin " );
????????????List?dicList? = ?DictionaryServ.getCrmCommuInfoTyFms(epId,?commutype);
????????????System.out.println( " get?dicList:------>end " );
????????????List < LabelValueEx > ?labelValueList? = ? new ?ArrayList();
????????????Iterator?it? = ?dicList.iterator();
???????????? // ?System.out.println("***************?Iterator?begin");
????????????labelValueList.add( new ?LabelValueEx( " 請選擇
"
,?
0
));
???????????? while ?(it.hasNext())?{
????????????????CrmCommInfoType?result? = ?(CrmCommInfoType)?it.next();
????????????????String?label? = ?result.getTypeName();???????????????????????????????????? ?//根據對象取到響應的列的值
???????????????? long ?value? = ?result.getCommTypeId();
????????????????LabelValueEx?labelValue? = ? new ?LabelValueEx(label,?value);
????????????????labelValueList.add(labelValue);
????????????}
????????????DicSelectionModel?dicSelectionModel? = ? new ?DicSelectionModel(
????????????????????labelValueList);
???????????? return ?dicSelectionModel;
????????}? catch ?(Exception?ex)?{
???????????? throw ? new ?BusinessProcessException( " getCrmCommuInfoTyFms() " );
????????}
????}
?????*?根據commutype,epId查詢分期項目下拉列框的值(LabelValueEx對象),lable對應typeName,value對應commTypeId
?????*?
?????*? @param ?epId
?????*????????????開發商Id
?????*? @param ?commutype
?????*????????????通訊方法String類型,分別為tysms,tyemail,tyfax
?????*? @return ?List
?????*? @throws ?BusinessProcessException
????? */
????@SuppressWarnings( " unchecked " )
???? public ?DicSelectionModel?getCrmCommuInfoTyFms(String?epId,?String?commutype)
???????????? throws ?BusinessProcessException?{
???????? try ?{
???????????? if ?(DictionaryServ? == ? null )?{
????????????????System.out.println( " DictionaryServ?is?null. " );
????????????}
????????????System.out.println( " get?dicList:------>begin " );
????????????List?dicList? = ?DictionaryServ.getCrmCommuInfoTyFms(epId,?commutype);
????????????System.out.println( " get?dicList:------>end " );
????????????List < LabelValueEx > ?labelValueList? = ? new ?ArrayList();
????????????Iterator?it? = ?dicList.iterator();
???????????? // ?System.out.println("***************?Iterator?begin");
????????????labelValueList.add( new ?LabelValueEx( " 請選擇

???????????? while ?(it.hasNext())?{
????????????????CrmCommInfoType?result? = ?(CrmCommInfoType)?it.next();
????????????????String?label? = ?result.getTypeName();???????????????????????????????????? ?//根據對象取到響應的列的值
???????????????? long ?value? = ?result.getCommTypeId();
????????????????LabelValueEx?labelValue? = ? new ?LabelValueEx(label,?value);
????????????????labelValueList.add(labelValue);
????????????}
????????????DicSelectionModel?dicSelectionModel? = ? new ?DicSelectionModel(
????????????????????labelValueList);
???????????? return ?dicSelectionModel;
????????}? catch ?(Exception?ex)?{
???????????? throw ? new ?BusinessProcessException( " getCrmCommuInfoTyFms() " );
????????}
????}
?
如果沒有用到延遲加載 可以返回 已知的列
????
????/**
?????*?根據epId查詢分析項下拉列框的值(LabelValue對象),lable對應constNameChs,value對應constName
?????*??@param??epId
?????*?????????????開發商Id
?????*?@return?List
?????*?@throws?BusinessProcessException
?????*/
????public?List?getAnalyseItem(String?epId)?throws?BusinessProcessException?{
????????String?sql?=?"select?info.constNameChs,info.constName?from?SysConst?info"
????????????+?"?where?info.epId='"+epId+"'"
????????????+?"?and?flag='2'";
????????List?dicList?=?new?ArrayList();
????????try?{
????????????dicList?=?cDao.queryObjects(sql);
????????}?catch?(Exception?ex)?{
????????????throw?new?BusinessProcessException("getAnalyseItem()");
????????}
????????return?dicList;
????}
????/**
?????*?根據epId查詢分析項下拉列框的值(LabelValue對象),lable對應constNameChs,value對應constName
?????*??@param??epId
?????*?????????????開發商Id
?????*?@return?List
?????*?@throws?BusinessProcessException
?????*/
????public?List?getAnalyseItem(String?epId)?throws?BusinessProcessException?{
????????String?sql?=?"select?info.constNameChs,info.constName?from?SysConst?info"
????????????+?"?where?info.epId='"+epId+"'"
????????????+?"?and?flag='2'";
????????List?dicList?=?new?ArrayList();
????????try?{
????????????dicList?=?cDao.queryObjects(sql);
????????}?catch?(Exception?ex)?{
????????????throw?new?BusinessProcessException("getAnalyseItem()");
????????}
????????return?dicList;
????}