| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?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.zhaozhaonews.article.mapper.ApArticleMapper">
- <!-- 文章信息表结果映射 -->
- <resultMap id="ApArticleResultMap" type="com.zhaozhaonews.model.article.entity.ApArticle">
- <id column="id" property="id" jdbcType="BIGINT"/>
- <result column="title" property="title" jdbcType="VARCHAR"/>
- <result column="author_id" property="authorId" jdbcType="BIGINT"/>
- <result column="author_name" property="authorName" jdbcType="VARCHAR"/>
- <result column="channel_id" property="channelId" jdbcType="INTEGER"/>
- <result column="channel_name" property="channelName" jdbcType="VARCHAR"/>
- <result column="layout" property="layout" jdbcType="TINYINT"/>
- <result column="flag" property="flag" jdbcType="TINYINT"/>
- <result column="images" property="images" jdbcType="VARCHAR"/>
- <result column="labels" property="labels" jdbcType="VARCHAR"/>
- <result column="likes" property="likes" jdbcType="INTEGER"/>
- <result column="collection" property="collection" jdbcType="INTEGER"/>
- <result column="comment" property="comment" jdbcType="INTEGER"/>
- <result column="views" property="views" jdbcType="INTEGER"/>
- <result column="province_id" property="provinceId" jdbcType="INTEGER"/>
- <result column="city_id" property="cityId" jdbcType="INTEGER"/>
- <result column="county_id" property="countyId" jdbcType="INTEGER"/>
- <result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
- <result column="publish_time" property="publishTime" jdbcType="TIMESTAMP"/>
- <result column="sync_status" property="syncStatus" jdbcType="BOOLEAN"/>
- <result column="origin" property="origin" jdbcType="BOOLEAN"/>
- <result column="static_url" property="staticUrl" jdbcType="VARCHAR"/>
- </resultMap>
- <select id="loadArticleList" resultMap="ApArticleResultMap">
- SELECT aa.*
- FROM ap_article aa
- LEFT JOIN ap_article_config aac ON aa.id=aac.article_id
- <where>
- AND aac.is_delete=0
- AND aac.is_down=0
- <if test="type!=null and type == 1">
- AND aa.publish_time <![CDATA[<=]]> #{dto.minBehotTime}
- </if>
- <if test="type!=null and type == 2">
- AND aa.publish_time <![CDATA[>=]]> #{dto.maxBehotTime}
- </if>
- <if test="dto.tag != '__all__'">
- AND aa.channel_id = #{dto.tag}
- </if>
- </where>
- ORDER BY aa.publish_time DESC,aa.id DESC
- LIMIT #{dto.size}
- </select>
- </mapper>
|