主要是配置文件sql的参数问题
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
where
"ID" = #{ID}
</select>
//修改
function edit(Id){
top.jzts();
var diag = new top.Dialog();
diag.Drag=true;
diag.Title ="编辑";
diag.URL = '<%=basePath%>tzjgconfig/goEdit.do?ID='+Id;
diag.Width = 450;
diag.Height = 355;
diag.Modal = true; //有无遮罩窗口
diag. ShowMaxButton = true; //最大化按钮
diag.ShowMinButton = true; //最小化按钮
diag.CancelEvent = function(){ //关闭事件
if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
tosearch();
}
diag.close();
};
diag.show();
}
/**去修改页面
* @param
* @throws Exception
*/
@RequestMapping(value="/goEdit")
public ModelAndView goEdit()throws Exception{
ModelAndView mv = this.getModelAndView();
PageData pd = new PageData();
pd = this.getPageData();
pd = tzjgconfigService.findById(pd); //根据ID读取
mv.setViewName("agent/tzjgconfig/tzjgconfig_edit");
mv.addObject("msg", "edit");
mv.addObject("pd", pd);
return mv;
}
/**通过id获取数据
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception{
return (PageData)dao.findForObject("TzjgconfigMapper.findById", pd);
}