第一種:在java里面寫。@Select("select bureau_code from drt_opr_area")List<String> getAllAreas();第二種:在xml里面寫。<select id="selectList" resultMap="BaseResultMap" parameterType="com.csg.intshop.entity.DrtShopConfig"> select
<include refid="BaseColumnList" /> from drt_shop_config where 1=1
<include refid="BaseCustomQueryCondition" />
</select>想問問:在什么情況下寫java代碼好,在什么情況下選中寫xml好?如果是全表查詢,這兩種寫法在性能有沒有區別?比如:當表字段比較多的時候,全表查詢寫xml看起來比較簡潔,可讀性強。### 問題描述
Mybatis的寫法
開心每一天1111
2018-07-22 08:39:12