实体类 和 xml (这里用了几个典型的数据类型,都是其他表的字段)
private String marriage;//图片 remarks
private Date createtime;//公告创建日期
private String updatetimeStr;//虚拟字段接收修改日期
private long popuday;//今日人气
private String names;//动态显示创建博文人的名字
select t.id,t.name,(select p.marriage from pt_userinfo p where p.ids=t.CREATE_USER) as marriage,
(select i.remarks from IM_TEACHER i where i.userid=t.create_user)as remarks,
(select i.createtime from IM_TEACHER i where i.userid=t.create_user)as createtime,
(select i.popularity from IM_TEACHER i where i.userid=t.create_user)as popularity,
(select i.popuday from IM_TEACHER i where i.userid=t.create_user)as popuday,
(select p.NAMES from PT_USERINFO p where p.IDS=t.CREATE_USER) as names,
t.ssid as ssid from table_name t where t.ID = #{id}
弄完这些可以直接在前台调用了,有些字段比如日期 需要后台转换才能调用,如有需要请关注我,在我博文里面有专门的赋值、转换
html
$('#aa').html(data[2].nickName);
element.src ="http://666.66.66.6/images/userphoto/xmname/"+data[2].marriage;//图片, 由服务器地址 + 图片名称组成