断点

每天进步一点点!
posts - 174, comments - 56, trackbacks - 0, articles - 21

项目开发中常用到的sql语句

Posted on 2010-01-14 20:57 断点 阅读(418) 评论(0)  编辑  收藏 所属分类: Java

1.

String hqlBase = " from AppBaseVO t where t.CAppNo ='" + CAppNo + "'";
                rsList = this.commonDao.find(hqlBase);
               
                for(AppBaseVO rt : rsList){//只有一条数据。
                    baseCBrkrCde = rt.getCBrkrCde();
                    String hqlCusCha = " from CusChaVO t where t.CChaCde ='" + baseCBrkrCde + "'";
                    rsCusCha = this.commonDao.find(hqlCusCha);
                    for(CusChaVO rtCusCha : rsCusCha){//一条数据。
                        name = rtCusCha.getCChaNme();
                    }
                }

--------------------------------------
2.

public Map<String, String> querySelectList(String str) throws DaoException {
        List list = new ArrayList();
        Map<String, String> map = new HashMap<String, String>();
        try {
            String sSQL = " FROM AbstractBaseVO  where  CPlyNo=?";
            list = super.find(sSQL, str);

 

      StringBuffer hql = new StringBuffer();
                hql.append(" FROM InqCreditIndivAuditVO");            
                hql.append(" WHERE CExamMark = '1' ");   // 个人客户,'1'为审核通过。
                hql.append(" AND  CInqNo = ? ");
                list2 = super.find(hql.toString(),CInqNo);


super.search语句用问号。
---------------------------------------
 3.

String CCoinsurerCde = map.get("CCoinsurerCde");
            String sql = "SELECT C_SELF_MRK FROM WEB_RI_COM WHERE C_COM_CDE=?";
            SQLPara sqlPara = new SQLPara();
            sqlPara.add(CCoinsurerCde);
            RowSet rs = this.commonDao.queryNativeSQL(sql, sqlPara, false);

            boolean selfFlag = false;
            while (rs.next()) {
                String sCSelfMrk = rs.getString(1);
                if ("1".equals(sCSelfMrk)) {
                    selfFlag = true;
                    break;
                }
            }
-----------------------------------------
4.

List<PlyBaseVO> plyNo = this.find("FROM PlyBaseVO WHERE CAppNo = '" + appNo + "'");
                    if(plyNo.size() > 0 ){
   }


posted @ 2009-11-25 14:28 断点 阅读(12) | 评论 (0)

只有注册用户登录后才能发表评论。


网站导航: