5,655
社区成员
发帖
与我相关
我的任务
分享
<resultMap id="BaseResultMap" type="com.guigu.sharecars.pojo.Uorders" >
<id column="u_oid" property="uOid" jdbcType="BIGINT" />
<result column="u_id" property="uId" jdbcType="BIGINT" />
<result column="status" property="status" jdbcType="INTEGER" />
<result column="u_from" property="uFrom" jdbcType="VARCHAR" />
<result column="u_to" property="uTo" jdbcType="VARCHAR" />
<result column="coord_from" property="coordFrom" jdbcType="VARCHAR" />
<result column="coord_to" property="coordTo" jdbcType="VARCHAR" />
<result column="plan_time" property="planTime" jdbcType="TIMESTAMP" />
<result column="go_time" property="goTime" jdbcType="TIMESTAMP" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="match_time" property="matchTime" jdbcType="TIMESTAMP" />
<result column="over_time" property="overTime" jdbcType="TIMESTAMP" />
<result column="u_num" property="uNum" jdbcType="INTEGER" />
<result column="u_description" property="uDescription" jdbcType="VARCHAR" />
<result column="distance" property="distance" jdbcType="REAL" />
<result column="c_id" property="cId" jdbcType="BIGINT" />
<result column="c_oid" property="cOid" jdbcType="BIGINT" />
<result column="c_uid" property="cUid" jdbcType="BIGINT" />
<result column="bak" property="bak" jdbcType="VARCHAR" />
<!-- 外键关联 start -->
<association column="u_id" property="user" select="getUser"/>
<!-- 外键关联 end -->
</resultMap>
<!-- 外键关联 start -->
<resultMap id="UsersResultMap" type="com.guigu.sharecars.pojo.Users" >
<id column="u_id" property="uId" jdbcType="BIGINT" />
<result column="account" property="account" jdbcType="VARCHAR" />
<result column="pwd" property="pwd" jdbcType="VARCHAR" />
<result column="u_dept" property="uDept" jdbcType="BIGINT" />
<result column="truename" property="truename" jdbcType="VARCHAR" />
<result column="tel" property="tel" jdbcType="VARCHAR" />
<result column="email" property="email" jdbcType="VARCHAR" />
<result column="u_status" property="uStatus" jdbcType="INTEGER" />
<result column="u_type" property="uType" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="last_login_time" property="lastLoginTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="update_user" property="updateUser" jdbcType="BIGINT" />
<result column="car_id" property="carId" jdbcType="BIGINT" />
<result column="usual_from" property="usualFrom" jdbcType="VARCHAR" />
<result column="usual_to" property="usualTo" jdbcType="VARCHAR" />
<result column="bak" property="bak" jdbcType="VARCHAR" />
</resultMap>
<select id="getUser" parameterType="java.lang.Long" resultType="com.guigu.sharecars.pojo.Users" resultMap="UsersResultMap">
select * from users where u_id = #{u_id}
</select>
<!-- 外键关联 end -->
<sql id="Base_Column_List" >
u_oid, u_id, status, u_from, u_to, coord_from, coord_to, plan_time, go_time, create_time,
match_time, over_time, u_num, u_description, distance, c_id, c_oid, c_uid, bak
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from u_orders
where u_oid = #{uOid,jdbcType=BIGINT}
</select>
.....
public class Uorders {
private Long uOid;
private Long uId;
private Integer status;
private String uFrom;
private String uTo;
private String coordFrom;
private String coordTo;
private Date planTime;
private Date goTime;
private Date createTime;
private Date matchTime;
private Date overTime;
private Integer uNum;
private String uDescription;
private Float distance;
private Long cId;
private Long cOid;
private Long cUid;
private String bak;
private Users user;
....getter and setter....
}
public class Users {
private Long uId;
private String account;
private String pwd;
private Long uDept;
private String truename;
private String tel;
private String email;
private Integer uStatus;
private Integer uType;
private Date createTime;
private Date lastLoginTime;
private Date updateTime;
private Long updateUser;
private Long carId;
private String usualFrom;
private String usualTo;
private String bak;
...........getter and setter..........
}
<li>
<label class="res-lab">处理时间</label>
<span class="res-info">
<fmt:formatDate value="${uo_d.user.createTime } " pattern="yyyy-MM-dd HH:mm:ss" />
</span>
</li>
javax.el.ELException: Cannot convert Mon Aug 28 11:01:36 CST 2017 of type class java.lang.String to class java.util.Date
<li>
<label class="res-lab">创建时间</label>
<span class="res-info">
<fmt:formatDate value="${uo_d.createTime }" pattern="yyyy-MM-dd HH:mm:ss" />
</span>
</li>