<?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.huiju.estateagents.mapper.TaNewsMapper">


    <select id="selectNewsStatistical" resultType="map" >
        select
        sum(pv_num) as pvNum,
        <if test="saveOrShare == 'save'">
            sum(save_num) as saveNum
        </if>
        <if test="saveOrShare == 'share'">
            sum(share_num) as shareNum
        </if>
        from ta_news
        where org_id = #{orgId}
    </select>

</mapper>
