/** * 根据类型,得到数据字典表INDIVIDUALTREE里的数据, * * @return */ public List queryIndividualtree(String type) { String sql = "SELECT T.CATEGORYNAME FROM INDIVIDUALTREE T WHERE T.PARENTCATEGORYID = ?"; String[] strs = new String[1]; strs[0] = type; List list = publicDao.queryForList(sql, strs); return list; }
/** * 根据类型,得到数据字典表DIC_APP_ASSET_STATE里的数据 * * @return */ public List queryDicAppAssetState(String type) { String sql = "SELECT T.NAME FROM DIC_APP_ASSET_STATE T WHERE T.TYPE = ?"; String[] strs = new String[1]; strs[0] = type; List list = publicDao.queryForList(sql, strs); return list; }
/** * 卡片调配,通过资产id查找资产信息 * * @return */ public JyzcXx findJyzcXxByZcId(String zcId) { String[] strs = new String[1]; strs[0] = zcId; JyzcXx xx = (JyzcXx) publicDao.findSingleResult( "from JyzcXx x where x.id = ?", strs); // publicDao.findById(JyzcXx.class, zcId); return xx; }
public Cardinfo findCardinfoByCardCode(String cardcode) { String hql = "from Cardinfo x where x.cardcode = ?"; List params = new ArrayList(); params.add(cardcode); Cardinfo xx = new Cardinfo(); List cardinfoList = publicDao.find(hql, params); if (cardinfoList != null && cardinfoList.size() > 0) { xx = (Cardinfo) cardinfoList.get(0); } return xx; }
/** * 保存新增卡片表头 * * @param caShead */ public void save(CaShead caShead) { publicDao.save(caShead); }
/** * 更新新增卡片表体 * * @param LcCardtemp */ public void update(LcCardtemp lcCardtemp) { publicDao.update(lcCardtemp); }
/** 保存办理依据 */ public void saveCA(CommonAccording ca) { publicDao.save(ca); }
/** * 根据ID查询新增卡片表头信息 * * @param id */ public CaShead findCaSheadById(String id) { Long[] strs = new Long[1]; strs[0] = Long.valueOf(id); return (CaShead) publicDao.findSingleResult("from CaShead o where o.id = ?", strs); }
/** * 删除新增卡片表头 * * @param CaShead */ public void delete(CaShead caShead) { publicDao.delete(caShead); }
/** * 删除合并前的卡片,合并后的连同一起删掉 * * @param bodyId */ public void deleteMerge(String bodyId) { String sql = "delete from lc_cardtemp where id = '" + bodyId + "'"; publicDao.getJdbcTemplate().execute(sql); }
/** * 根据处理单ID查询该处理单下所有卡片信息 * * @param id */ public List findLcCardtempsBySheadId(String id) { Long[] strs = new Long[1]; strs[0] = Long.valueOf(id); return publicDao.find("from LcCardtemp o where o.kpxzid = ?", strs); }
/** * 根据ID查询新增卡片表体信息 * * @param id */ public LcCardtemp findLcCardtempById(String id) { Long[] strs = new Long[1]; strs[0] = Long.valueOf(id); return (LcCardtemp) publicDao.findSingleResult("from LcCardtemp o where o.id = ?", strs); }
/** * 通过headId 删除body * * @param headId */ public void deleteBodys(String headId) { String sql = "delete from lc_cardtemp where kpxzid = " + Long.parseLong(headId); publicDao.getJdbcTemplate().execute(sql); }
/** * 删除一条新增卡片表体 * * @param LcCardtemp */ public void delete(LcCardtemp lcCardtemp) { publicDao.delete(lcCardtemp); }
/** * 更新新增卡片表头 * * @param CaShead */ public void update(CaShead caShead) { publicDao.update(caShead); }
/** * 删除卡片拆分后的body * * @param boxId */ public void deleteSplits(String[] boxId) { for (int i = 0; i < boxId.length; i++) { String sql = "delete from lc_cardtemp where boxid = '" + boxId[i] + "'"; publicDao.getJdbcTemplate().execute(sql); } }
/** 根据卡片id查询卡片信息 */ public Cardinfo findCardinfoByCardId(String cardId) { Long[] strs = new Long[1]; strs[0] = Long.valueOf("null".equals(cardId) ? "0" : cardId); return (Cardinfo) publicDao.findSingleResult("from Cardinfo ci where ci.id = ?", strs); }
/** * 根据id,得到数据字典表INDIVIDUALTREE里的数据, * * @return */ public Individualtree getIndividualtreeById(String id) { String sql = "from Individualtree t where t.categoryid = ?"; String[] strs = new String[1]; strs[0] = id; return (Individualtree) publicDao.findSingleResult(sql, strs); }
/** 删除多条变动记录 */ public void deleteRecord(String[] bodyId) { for (int i = 0; i < bodyId.length; i++) { String sql = "delete from recordhistory where zc_id = '" + bodyId[i] + "'"; publicDao.getJdbcTemplate().execute(sql); } }
/** * 根据临时表id,处理单id 查询变动表数据集合 * * @param bodyId * @param headId * @return */ public List findRecordsBybodyId(String bodyId, String headId) { List list = new ArrayList(); String sql = "from Recordhistory re where re.zcId = ? and re.pkId = ?"; list = publicDao.find(sql, new Object[] {bodyId, headId}); return list; }
/** 添加变动记录信息 */ public void saveRecord(Recordhistory record) { publicDao.save(record); }
/** * 保存新增卡片表体 * * @param KpCardtemp */ public void save(LcCardtemp lcCardtemp) { publicDao.save(lcCardtemp); }
/** 修改变动记录信息 */ public void updateRecord(Recordhistory record) { publicDao.update(record); }
/** * 通过办理依据的id查找办理依据 * * @param id * @return */ public CommonAccording findAccordingById(String id) { CommonAccording ca = publicDao.findById(CommonAccording.class, id); return ca; }
/** 根据bodyId查找record记录 */ public Recordhistory findRecordBybodyId(String bodyId) { String[] strs = new String[1]; strs[0] = bodyId; return (Recordhistory) publicDao.findSingleResult("from Recordhistory re where re.zcId = ?", strs); }
/** * 保存新增卡片表体并返回id * * @param KpCardtemp */ public String saveBody(LcCardtemp lcCardtemp) { return publicDao.save(lcCardtemp).toString(); }
public static void QuerySpState( PublicDao dao, PTTodoBS ptBs, WorkflowBS workflowBS, IERPCommonUCC erpCommonUCC, ICardQueryUCC cardQueryUCCImpl, String erpNotice) { try { String sql = "select t.fbyz ,t.erpcode ,t.eamcode from erp_cardcfsend t where t.sfcode is null"; List list = dao.queryForList(sql, new ArrayList()); if (list.size() > 0) { for (int i = 0; i < list.size(); i++) { Map erp = (Map) list.get(i); StringBuffer erpxml = new StringBuffer(); String billid = (String) erp.get("fbyz"); String billcode = (String) erp.get("erpcode"); String eamcode = (String) erp.get("eamcode"); erpxml.append(Comment_SplitSpd.CardReduceHead()); erpxml.append(Comment_SplitSpd.ufdQueryhead()); erpxml.append(Comment_SplitSpd.QuerybillHead(billid, billcode)); // 得到发送xml的头信息 erpxml.append(Comment_SplitSpd.geterpcode(billid, billcode, dao)); // 得到erpcode erpxml.append(Comment_SplitSpd.Querybillend()); erpxml.append(Comment_SplitSpd.esbend()); String input = new Comment().sender(erpxml); // 拼装xml后返回信息 CaShead pojo1 = (CaShead) dao.findSingleResult( "from CaShead t where t.id = ?", new Object[] { Long.parseLong(eamcode) }); // add by lantianbo 2010-12-01根据表单号,得到表单信息, // 插入erp_history表,备份发送记录 if (pojo1 != null) { new OA_Database() .insertClob( pojo1.getId().toString(), String.valueOf(pojo1.getId()), pojo1.getNgrmc(), pojo1.getBdlx() // TODO 这个需要确认 , String.valueOf(erpxml), String.valueOf(input), dao); } Comment_SplitSpd.Queryspstate( Comment.geterp(input, "<ufinterface", "</ufinterface>"), dao, ptBs, workflowBS, erpCommonUCC, cardQueryUCCImpl, erpNotice); // 返回信息操作主方法 } } // session.close(); } catch (Exception ex) { ex.printStackTrace(); } }