d86303cfbe369dc72387b615530ce6c965cb5b34.svn-base 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package xin.glue.ui.B.B01;
  2. import com.posdata.glue.biz.activity.PosActivity;
  3. import com.posdata.glue.biz.constants.PosBizControlConstants;
  4. import com.posdata.glue.context.PosContext;
  5. import com.posdata.glue.dao.PosDaoException;
  6. import com.posdata.glue.dao.PosGenericDao;
  7. import com.posdata.glue.dao.vo.PosParameter;
  8. import com.posdata.glue.dao.vo.PosRowSet;
  9. public class FindCommon extends PosActivity
  10. {
  11. public String runActivity(PosContext context)
  12. {
  13. try
  14. {
  15. //PosGenericDao dao = this.getDao("mesdao");
  16. //PosRowSet result = null;
  17. String[] dao = (String[])context.get("dao");
  18. String[] sqlkey = (String[])context.get("sqlkey");
  19. String[] param = (String[])context.get("param");
  20. PosGenericDao pgdao = this.getDao(dao[0]);
  21. PosRowSet result = null;
  22. PosParameter posParam = null;
  23. System.out.println(param.length);
  24. //ÉèÖòéѯ²ÎÊý
  25. if(param.length > 0)
  26. {
  27. posParam = new PosParameter();
  28. String[] paramList = param[0].split(",");
  29. for(int i = 0;i<paramList.length;i++)
  30. {
  31. if(" ".equals(paramList[i]))
  32. {
  33. posParam.setWhereClauseParameter(i,"");
  34. }
  35. else
  36. {
  37. posParam.setWhereClauseParameter(i, paramList[i]);
  38. }
  39. }
  40. }
  41. //²éѯ½á¹û
  42. if(null != posParam)
  43. {
  44. result = pgdao.find(sqlkey[0],posParam);
  45. }
  46. else
  47. {
  48. result = pgdao.find(sqlkey[0]);
  49. }
  50. context.put("result", result);
  51. }
  52. catch(Exception e)
  53. {
  54. throw new PosDaoException((new StringBuffer(400).append("Parameters initialize failed. detailMessage = ")).append(e.toString()).toString() , e);
  55. }
  56. return PosBizControlConstants.SUCCESS;
  57. }
  58. }