<!-- 通过多条件分页查询,返回数据集 -->
<select id="selectPageListUseDyc" parameterType="page" resultMap="articleResultMap" >
select a.article_id, a.title, a.img_url,a.article_type,a.add_time,a.like_num,a.content,a.markdown,b.user_id,
b.user_name,b.user_photo
FROM article a join user b on a.user_id = b.user_id
<where>
<if test="paramEntity.markdown!=null">and markdown like #{paramEntity.markdown}</if>
<if test="paramEntity.title!=null">and title like #{paramEntity.title}</if>
<if test="paramEntity.content!=null">and content like #{paramEntity.content}</if>
<if test="paramEntity.userId!=null">and a.user_id = #{paramEntity.userId}</if>
<if test="paramEntity.articleType!=null">and article_type = #{paramEntity.articleType}</if>
</where>
order by a.like_num DESC limit #{start},#{rows}
</select>
<select id="selectPageListUseDyc" parameterType="page" resultMap="articleResultMap" >
select a.article_id, a.title, a.img_url,a.article_type,a.add_time,a.like_num,a.content,a.markdown,b.user_id,
b.user_name,b.user_photo
FROM article a join user b on a.user_id = b.user_id
<where>
<if test="paramEntity.markdown!=null">and markdown like #{paramEntity.markdown}</if>
<if test="paramEntity.title!=null">and title like #{paramEntity.title}</if>
<if test="paramEntity.content!=null">and content like #{paramEntity.content}</if>
<if test="paramEntity.userId!=null">and a.user_id = #{paramEntity.userId}</if>
<if test="paramEntity.articleType!=null">and article_type = #{paramEntity.articleType}</if>
</where>
order by a.like_num DESC limit #{start},#{rows}
</select>