AppAdSourceMonitorAnaMapper.xml 1.9 KB
<?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.yoho.unions.dal.AppAdSourceMonitorAnaMapper">
    <resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.AppAdSourceMonitorAna">
        <result column="date_id" property="dateId" jdbcType="INTEGER"/>
        <result column="hour" property="hour" jdbcType="INTEGER"/>
        <result column="union_type" property="unionType" jdbcType="VARCHAR"/>
        <result column="union_name" property="unionName" jdbcType="VARCHAR"/>
        <result column="pv" property="pv" jdbcType="INTEGER"/>
        <result column="info_pv" property="infoPv" jdbcType="INTEGER"/>
        <result column="cart_pv" property="cartPv" jdbcType="INTEGER"/>
        <result column="order_num" property="orderNum" jdbcType="INTEGER"/>
        <result column="ips" property="ips" jdbcType="LONGVARCHAR"/>
        <result column="skns" property="skns" jdbcType="LONGVARCHAR"/>
    </resultMap>
    <sql id="Blob_Column_List">
    date_id,hour,union_type,union_name,pv,info_pv,cart_pv,order_num,ips,skns
  </sql>

    <select id="selectByUnionType" resultMap="BaseResultMap">
        select
        <include refid="Blob_Column_List"/>
        from APP_AD_SOURCE_MONITOR_ANA where union_type = #{unionType}
        AND date_id = #{date_id}
        ORDER BY hour DESC limit 1
    </select>
    <select id="selectIpsById" resultType="java.lang.String">
        select
        ips
        from APP_AD_SOURCE_MONITOR_ANA where id = #{id}
    </select>
    <select id="selectSknsById" resultType="java.lang.String">
        select
        skns
        from APP_AD_SOURCE_MONITOR_ANA where id = #{id}
    </select>
    <select id="selectCount" resultType="java.lang.Integer">
        select
        COUNT(*)
        from APP_AD_SOURCE_MONITOR_ANA where union_type = #{unionType}
    </select>

</mapper>