12345678910111213141516171819202122 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.platform.dao.mapper.operate.ArticleMapper">
- <select id="selectArticleFrontInfo" parameterType="com.platform.dao.dto.operate.ArticleDTO"
- resultType="com.platform.dao.entity.operate.Article">
- select * from(
- <foreach collection="types" item="item" index="index" separator="union all">
- (select
- id, type, status, parent_id, title, introduction, picture, created_Time, update_time
- from
- t_article where type = ${item} and status = 1 order by update_time DESC limit 0,10)
- </foreach>
- )as A
- where 1=1
- <if test="keyword != null and keyword != ''">
- and A.title like concat('%',#{keyword},'%')
- </if>
- <if test="parentId != null and parentId != ''">
- and A.parent_id = #{parentId}
- </if>
- </select>
- </mapper>
|