一个诡异的问题

莫名奇妙 2010-01-20 02:48:27
接别人的工作不太明白他的意图,用的是ssi框架组合,前台迭代数据库字段时出现null,只有一些字段是null,给他一个初始值能够接到,但就是差数据库是是null,请问是在呢么回事?
页面: <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
<input name="lifecycle" type="hidden" class="textbox" value="<%=pclc.getLifecycle()%>">

<%
List<ProjCostType> costtypeList=pclc.getProjCostTypeList();
for(ProjCostType costtype:costtypeList){
System.out.println("_____________________________________备注"+costtype.getNote());
%>
<tr>
<td class="query_left_td03">
<a href="#" onClick="openPro(<%=proj.getProj_id() %>,<%=yearmonth %>,<%=sts%>,<%=costtype.getProj_cost_type_id()%>,<%=pclc.getLifecycle()%>)"><%=costtype.getName() %></a>
<td class="query_right_td03">
<input name="cost_value_<%=pclc.getLifecycle()%>_<%=costtype.getProj_cost_type_id()%>"
type="text" class="textbox_short" readonly value="<%=costtype.getCost_val() %>"
> 元 
<input name="proj_cost_type_id_<%=pclc.getLifecycle()%>" type="hidden" class="textbox" value="<%=costtype.getProj_cost_type_id()%>">
</td>
<td class="query_left_td03">备注:</td>
<td class="query_right_td02">
<input name="cost_note_<%=pclc.getLifecycle()%>_<%=costtype.getProj_cost_type_id()%>" type="text" class="textbox" maxlength="50" value="<%=costtype.getNote()%>" readonly >
</td>
</tr>
<%
}
%>


action:
public ActionForward getInfo(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub

log.info("ProYearBudgetAction.getInfo");
String proj_id=request.getParameter("proj_id");
String sts=request.getParameter("sts");
String yearmonth=request.getParameter("yearmonth");
log.info("proj_id"+proj_id);
log.info("sts"+sts);
log.info("yearmonth"+yearmonth);
//获得项目的信息
request.setAttribute("ProjInfo", this.getPmsDao().getProjById(proj_id));
/****************************校验项目总预算信息*************************************/
//查询项目总直接成本预算信息
request.setAttribute("projCostPlanL", this.getCostDao().getProjBudgetDirectCost(proj_id));
log.info("sts>1..查看。。。");
//查询全部项目成本类型的显示信息
ProjDirectCostBudgetDetail pd=new ProjDirectCostBudgetDetail();
pd.setProj_id(Integer.parseInt(proj_id));
pd.setYearmonth(yearmonth);
pd.setSts(sts);
List<ProjCostLifeCycle> projcostLifeCycleList=this.getCostDao().getProjCostTypeLifeCycleYearInfo(pd);
request.setAttribute("yearmonth", yearmonth);
request.setAttribute("sts", sts);
request.setAttribute("projCostTypeList", projcostLifeCycleList);
return mapping.findForward("toInfo");


}
dao:public List<ProjCostLifeCycle> getProjCostTypeLifeCycleYearInfo(
ProjDirectCostBudgetDetail pd) throws DataAccessException {
// TODO Auto-generated method stub
List<ProjCostLifeCycle> projcostLifeCycleList=this.getSqlMapClientTemplate().queryForList("getProjCostTypeLifeCycle",pd.getProj_id().toString());
for(ProjCostLifeCycle lifecycle :projcostLifeCycleList){
if(lifecycle.getLifecycle().equals("1")){
lifecycle.setLifecyclename("售中");
}else if(lifecycle.getLifecycle().equals("2")){
lifecycle.setLifecyclename("售后");
}
System.out.println("name:"+lifecycle.getLifecyclename()+"lisecycle:"+lifecycle.getLifecycle());
/**成本分类:直接成本**/
Map<String,String> paraMap=new HashMap<String,String>();
paraMap.put("proj_id", pd.getProj_id().toString());
paraMap.put("lifecycle", lifecycle.getLifecycle());
paraMap.put("type_grp", "2,3");
List<ProjCostType> pctList=this.getSqlMapClientTemplate().queryForList("getProjCostType4Type",paraMap);
for(ProjCostType pct2:pctList){
paraMap.put("proj_cost_type_id",pct2.getProj_cost_type_id().toString());
paraMap.put("yearmonth",pd.getYearmonth());
paraMap.put("sts",pd.getSts());
ProjDirectCostBudgetDetail pcp=(ProjDirectCostBudgetDetail)this.getSqlMapClientTemplate().queryForObject("getProjCostValueYearInfo",paraMap);
BigDecimal moneyVal=new BigDecimal(0);
if(pcp!=null &&pcp.getMoney()!=null ){
moneyVal=pcp.getMoney();
}
pct2.setCost_val(moneyVal);
}
lifecycle.setProjCostTypeList(pctList);
}
return projcostLifeCycleList;
sql语句:<select id="getProjCostTypeCycleInfo" parameterClass="java.util.HashMap" resultClass="cn.chinaunicom.pms.dto.ProjCostType">
<![CDATA[
select b.*,a.* from proj_cost_info a,proj_cost_type b
where a.proj_cost_type_id=b.proj_cost_type_id
and a.proj_id=#proj_id#
and a.lifecycle=#lifecycle#
and b.type_grp=#type_grp#
order by a.proj_cost_type_id asc
]]>
</select>

<select id="getProjCostTypeLifeCycle" parameterClass="java.lang.String" resultClass="cn.chinaunicom.pms.dto.ProjCostLifeCycle">
<![CDATA[
SELECT distinct(lifecycle) lifecycle FROM proj_cost_info p,proj_cost_type m
where p.proj_cost_type_id=m.proj_cost_type_id
and m.type_grp!=1
and proj_id=#value#
order by lifecycle asc
]]>
</select>

<select id="getProjCostType4LifeCycle" parameterClass="java.util.HashMap" resultClass="cn.chinaunicom.pms.dto.ProjCostType">
<![CDATA[
select distinct(b.type_grp) from proj_cost_info a,proj_cost_type b
where a.proj_cost_type_id=b.proj_cost_type_id
and a.proj_id=#proj_id#
and a.lifecycle=#lifecycle#
and b.proj_cost_type_id!=1
and b.type_grp!=1
order by b.type_grp asc
]]>
</select>

<select id="getProjCostType4Type" parameterClass="java.util.HashMap" resultClass="cn.chinaunicom.pms.dto.ProjCostType">
<![CDATA[
select b.* from proj_cost_info a,proj_cost_type b
where a.proj_cost_type_id=b.proj_cost_type_id
and a.proj_id=#proj_id#
and a.lifecycle=#lifecycle#
and b.proj_cost_type_id!=1
and find_in_set(b.type_grp,#type_grp#)
order by a.proj_cost_type_id asc
]]>
</select>
...全文
98 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,657

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧