<?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="org.springblade.estate.mapper.ArticleMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="articleResultMap" type="org.springblade.estate.entity.Article">
        <result column="id" property="id"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="content" property="content"/>
        <result column="agency_id" property="agencyId"/>
        <result column="reader" property="reader"/>
        <result column="title" property="title"/>
        <result column="image" property="image"/>
    </resultMap>


    <select id="selectArticlePage" resultMap="articleResultMap">
        select * from estate_article where is_deleted = 0
    </select>

    <select id="selectDayArticleCount" resultType="java.lang.Integer">
        select  COUNT(*) from estate_access_record where TO_DAYS(create_time) = TO_DAYS(NOW()) and is_deleted = 0
    </select>

</mapper>
