問題:sqlserver中的存儲時間格式為date,pojo的時間屬性也是date,直接mybatis取出的時間格式是帶英語的那種,不滿足客戶要求。
解決:將pojo的時間屬性改為string類型,在mybatis的配置sql語句文件中,將得到的date格式的時間轉換成string
直接在xml配置文件中,在收到 date 字段后面加上jdbcType="VARCHAR"
<resultMap type="com.soecode.lyf.entity.AuditPage" id="AuditPageList">
<id column="id" property="id" />
<result column="inputdate" property="date" jdbcType="VARCHAR" />
<result column="checkid" property="number" />
<result column="proceedingname" property="name" />
<result column="isapproved" property="zt" />
</resultMap>
<select id="getAllAudit" resultMap="AuditPageList" >
select top 20 id,inputdate,checkid,
proceedingname,isapproved
from exm001 order by inputdate desc
</select>
