export_dao
- (1)數字庫 表欄位 與類的成員變數 不一致
》》1:sql陳述句 使用as
》》2:mybatis里面使用 resultMap

辦法 1:sql別名
<select id="findAll" resultType="company">
select
id,
name ,
expiration_date as expirationDate ,
address,
license_id as licenseId ,
representative ,
phone ,
company_size as companySize ,
industry ,
remarks ,
state,
balance ,
city
from ss_company
</select>
辦法2: resultMap標簽


<resultMap id="companyMap" type="company">
<id column="id" property="id"/>
<result column="expiration_date" property="expirationDate"/>
<result column="license_id" property="licenseId"/>
<result column="company_size" property="companySize"/>
</resultMap>
<select id="findAll" resultMap="companyMap">
select
*
from ss_company
</select>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/189789.html
標籤:其他
上一篇:MySQL事務
