ArticleMapper.xml 1.0 KB

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