81,122
社区成员




public class Man {
private Integer id;
private String name;
private String phone;
private String info;
private Date sTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info == null ? null : info.trim();
}
public Date getsTime() {
return sTime;
}
public void setsTime(Date sTime) {
this.sTime = sTime;
}
}
Man man = manService.getManById(1);
logger.info(JSON.toJSONString(man.getsTime()));
logger.info(man.getsTime().toString());
logger.info(JSON.toJSONStringWithDateFormat(man,"yyyy-MM-dd HH:mm:ss",
SerializerFeature.WriteDateUseDateFormat));
logger.info(manService.getAllman());
}
<mapper namespace="com.csl.main.Dao.ManMapper">
<resultMap id="BaseResultMap" type="com.csl.main.bean.Man">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="phone" property="phone" jdbcType="VARCHAR" />
<result column="info" property="info" jdbcType="VARCHAR" />
<result column="s_time" property="sTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List">
id, name, phone, info, s_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.lang.Integer">
select
<include refid="Base_Column_List" />
from man_tbl
where id = #{id,jdbcType=INTEGER}
</select>