[bxd学习java基本点]7.linkedList方法,remove移走的要显示元素

day14-08

LinkedList
其特有方法:
addFirst();
removeFirst();
removeLast();
getLast();


class LinkedListDemo{
public static void main(String[] args){
LinkedList link new LinkedList();
link.add("123");
link.add("456");
link.addFirst("123");
link.removeFirst("java02");
sop(link);
sop("size="+link.size);
sop(link.removeFirst())
}
public static void sop(Objct ojb){
System.out.print(obj);
}
}
get与remove区别
get 不会删除
remove 取还要删除
______
java04
java03
java02
java01
______

优化代码 String bmid = PubUtil.valueOf(listBXD.get("BXD_BMID")); String year = PubUtil.valueOf(listBXD.get("BXD_BXRQ")).substring(0, 4); String shsj = PubUtil.valueOf(listBXD.get("BXD_SHSJ")); String xmid = PubUtil.valueOf(listBXD.get("BXD_XMID")); String jhbh = PubUtil.valueOf(listBXD.get("BXD_XMJH_JHBH")); //部门年度发生额 String sql = "select ISNUll(sum(BXD_JE),0) as \"je\" from BXD where BXD_BMID = '"+bmid+"' " + "and BXD_SHBZ = 'Y' and DATEPART(YYYY,BXD_BXRQ) = '"+year+"'"; Double deptMoney = PubFunAction.queryForObj(sql, Double.class, 0.0); //更新部门年度发生额 sql = "update DBUDGET set DBUDGET_SJZC = '"+deptMoney+"' where DBUDGET_DEPTID = '"+bmid+"' and DBUDGET_YEAR = '"+year+"'"; PubFunAction.jt.update(sql); //项目年度发生额 sql = "select ISNULL(sum(BXD_JE),0) as \"je\" from BXD where BXD_XMID = '"+xmid+"' " + "and BXD_SHBZ = 'Y' and DATEPART(YYYY,BXD_BXRQ) = '"+year+"'"; Double projectMoney = PubFunAction.queryForObj(sql,Double.class,0.0); //更新项目年度发生额 sql = "update DBUDGETMX set DBUDGETMX_SJZC = '"+projectMoney+"' where DBUDGETMX_XMID = '"+xmid+"' and DBUDGETMX_YEAR = '"+year+"'"; PubFunAction.jt.update(sql); //经济分类年度发生额 for (Map<String, Object> bxdmx : listBXDMX) { String lbid = PubUtil.valueOf(bxdmx.get("BXDMX_BXLB_LBID")); sql = "select ISNULL(sum(BXDMX_BXJE),0) as \"je\" from BXD left join BXDMX on BXDMX_KEY=BXD_KEY " + "where BXDMX_BXLB_LBID = '"+lbid+"' and BXD_SHBZ = 'Y' and DATEPART(YYYY,BXD_BXRQ) = '"+year+"'"; Double economicClassificationMoney = PubFunAction.queryForObj(sql, Double.class, 0.0); } //更新合同计划完成标记 if (!"".equals(jhbh)){ sql = "update XMJH set XMJH_WCBZ = 'Y',XMJH_SJRQ_END = '"+shsj+"' where XMJH_JHBH = '"+jhbh+"'"; PubFunAction.jt.update(sql); }
06-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值