ApArticleMapper.xml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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.zhaozhaonews.article.mapper.ApArticleMapper">
  4. <!-- 文章信息表结果映射 -->
  5. <resultMap id="ApArticleResultMap" type="com.zhaozhaonews.model.article.entity.ApArticle">
  6. <id column="id" property="id" jdbcType="BIGINT"/>
  7. <result column="title" property="title" jdbcType="VARCHAR"/>
  8. <result column="author_id" property="authorId" jdbcType="BIGINT"/>
  9. <result column="author_name" property="authorName" jdbcType="VARCHAR"/>
  10. <result column="channel_id" property="channelId" jdbcType="INTEGER"/>
  11. <result column="channel_name" property="channelName" jdbcType="VARCHAR"/>
  12. <result column="layout" property="layout" jdbcType="TINYINT"/>
  13. <result column="flag" property="flag" jdbcType="TINYINT"/>
  14. <result column="images" property="images" jdbcType="VARCHAR"/>
  15. <result column="labels" property="labels" jdbcType="VARCHAR"/>
  16. <result column="likes" property="likes" jdbcType="INTEGER"/>
  17. <result column="collection" property="collection" jdbcType="INTEGER"/>
  18. <result column="comment" property="comment" jdbcType="INTEGER"/>
  19. <result column="views" property="views" jdbcType="INTEGER"/>
  20. <result column="province_id" property="provinceId" jdbcType="INTEGER"/>
  21. <result column="city_id" property="cityId" jdbcType="INTEGER"/>
  22. <result column="county_id" property="countyId" jdbcType="INTEGER"/>
  23. <result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
  24. <result column="publish_time" property="publishTime" jdbcType="TIMESTAMP"/>
  25. <result column="sync_status" property="syncStatus" jdbcType="BOOLEAN"/>
  26. <result column="origin" property="origin" jdbcType="BOOLEAN"/>
  27. <result column="static_url" property="staticUrl" jdbcType="VARCHAR"/>
  28. </resultMap>
  29. <select id="loadArticleList" resultMap="ApArticleResultMap">
  30. SELECT aa.*
  31. FROM ap_article aa
  32. LEFT JOIN ap_article_config aac ON aa.id=aac.article_id
  33. <where>
  34. AND aac.is_delete=0
  35. AND aac.is_down=0
  36. <if test="type!=null and type == 1">
  37. AND aa.publish_time <![CDATA[<=]]> #{dto.minBehotTime}
  38. </if>
  39. <if test="type!=null and type == 2">
  40. AND aa.publish_time <![CDATA[>=]]> #{dto.maxBehotTime}
  41. </if>
  42. <if test="dto.tag != '__all__'">
  43. AND aa.channel_id = #{dto.tag}
  44. </if>
  45. </where>
  46. ORDER BY aa.publish_time DESC,aa.id DESC
  47. LIMIT #{dto.size}
  48. </select>
  49. </mapper>