码迷,mamicode.com
首页 > 数据库 > 详细

数据加工处理拼sql

时间:2016-11-24 14:35:19      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:sub   cat   sse   new   div   exception   ack   business   color   

  

@Override
	public void offonShareBill(Boolean fg, Map<String,String[]> map) throws BusinessException {
		System.out.println();
		BaseDAO dao = new BaseDAO();
		Set<String> set = map.keySet();
		for (String key : set) {
			String[] ids = map.get(key);
			String sql = "update hrwa_washare a set a.isdeal = ‘N‘ , a.csourcebillid = ‘‘ " +
					"where a.csourcebillid = ‘"+key+"‘";
			if(fg){
				StringBuffer aq = new StringBuffer();
				aq = aq.append("(");
				for(String abs : ids){
					abs = "‘"+abs+"‘"+",";
					aq.append(abs);					
				}
				String aq_string = aq.substring(0, aq.length()-1);
				aq_string = aq_string+")";
				sql = "update hrwa_washare a set a.isdeal = ‘Y‘ , a.csourcebillid = ‘"+key+"‘ " +
						"where a.pk_washare in "+aq_string+"";
			}
			try {
				dao.executeUpdate(sql);
			} catch (DAOException e) {
				throw new BusinessException("更新薪资分摊(人力)单据失败!");
			}
		}	
	}

 

数据加工处理拼sql

标签:sub   cat   sse   new   div   exception   ack   business   color   

原文地址:http://www.cnblogs.com/zzzzw/p/6097124.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!