<resultMap id="LayoutVo_ResultMap" extends="com.yuedu.ihome.yuegou.dao.LayoutModelMapper.BaseResultMap" type="com.yuedu.ihome.layout.vo.LayoutVo" >
<id column="rowNo" property="rowNo" jdbcType="INTEGER" />
</resultMap>
<!-- 示范性分页查询 -->
<select id="selectByExampleListPage" resultMap="LayoutVo_ResultMap" parameterType="com.yuedu.ihome.yuegou.dao.base.Page">
select
(@rowNum :=@rowNum + 1) AS rowNo,
data_layout.*
from
(
select
uname.user_name AS createUserName,
<include refid="com.yuedu.ihome.yuegou.dao.LayoutModelMapper.Base_Column_List" />
from layout
LEFT JOIN (
SELECT DISTINCT
u.user_id,
u.user_name
FROM
`user` u
LEFT JOIN layout l ON u.user_id = l.create_user_id
) uname ON uname.user_id = layout.create_user_id
<if test="_parameter != null">
<include refid="com.yuedu.ihome.yuegou.dao.LayoutModelMapper.Update_By_Example_Where_Clause" />
</if>
<if test="sort != null">
order by ${sort} ${order}
</if>
<if test="limit != null">
limit ${start} , ${limit}
</if>
) data_layout,
(SELECT(@rowNum := ${start})) b
</select>
mybatis扩展文件示范性查询
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- Spring Boot整合Mybatis基础参考文章: Spring Boot一步步整合Mybatis框架 Myb...
- There are 4 score criteria in general writing task 1 as b...