resultType 返回的是一个实体对象
直接使用resultType="map" 返回的是数据库表字段
resultMap 返回的是一个Map(建值对的形式)
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.cedar.manage.modular.game.gamemgr.entity.Email">
<id column="id" property="id"/>
<result column="state" property="state"/>
<result column="content" property="content"/>
<result column="title" property="title"/>
<result column="create_date" property="createDate"/>
<result column="expire_date" property="expireDate"/>
</resultMap>
type: 实体类路径
column:数据库表字段
property: 实体类字段
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, game_type AS gameType, room_type AS roomType,
hall_type AS
hallType, max_num AS maxNum, gold_limit AS goldLimit,
gold_base AS
goldBase, glc.`name` AS glcName, state AS state, glc_desc
AS glcDesc,
rate AS rate, rate_desc AS rateDesc, banker_limit AS
bankerLimit
</sql>
使用时,使用: <include refid="Base_Column_List" />
<where>
<if test="condition != null and condition != ''">
AND vrc.`name` LIKE CONCAT('%',#{condition},'%')
</if>
</where>
模糊查询时,可以使用 LIKE CONCAT('%',#{name},'%')