问题:sqlserver中的存储时间格式为date,pojo的时间属性也是date,直接mybatis取出的时间格式是带英语的那种,不满足客户要求。
解决:将pojo的时间属性改为string类型,在mybatis的配置sql语句文件中,将得到的date格式的时间转换成string
直接在xml配置文件中,在收到 date 字段后面加上jdbcType="VARCHAR"
<resultMap type="pojo.Student" id="stuResultMap">
<id property="id" column="s_id"/>
<result property="name" column="s_name"/>
<result property="password" column="s_password"/>
<result property="gender" column="s_gender"/>
<result property="phone" column="s_phone"/>
<result property="birthday" column="s_birthday" jdbcType="VARCHAR"/>
<result property="interest" column="s_interest"/>
<result property="intro" column="s_intro"/>
</resultMap>