YohoProductAnalysisMapper.xml 1.8 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.search.dal.YohoProductAnalysisMapper" >

    <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.YohoProductAnalysis" >
        <id column="id" property="id" jdbcType="BIGINT" />
        <result column="product_id" property="productId" jdbcType="INTEGER" />
        <result column="click_count" property="clickCount" jdbcType="INTEGER" />
        <result column="shopcart_count" property="shopcartCount" jdbcType="INTEGER" />
        <result column="favorite_count" property="favoriteCount" jdbcType="INTEGER" />
        <result column="order_count" property="orderCount" jdbcType="INTEGER" />
        <result column="click_uv_count" property="clickUvCount" jdbcType="INTEGER" />
        <result column="expose_count" property="exposeCount" jdbcType="INTEGER" />
        <result column="day_date" property="dayDate" jdbcType="VARCHAR" />
    </resultMap>

    <sql id="Base_Column_List" >
        id, product_id, click_count, shopcart_count, favorite_count, order_count, click_uv_count, expose_count, day_date
    </sql>

    <select id="selectCount" resultType="java.lang.Integer" timeout="20000">
        SELECT count(id) FROM yoho_product_analysis where day_date = #{date,jdbcType=VARCHAR}
    </select>

    <select id="selectPageLists" resultMap="BaseResultMap" timeout="20000">
        select
        <include refid="Base_Column_List" />
        from yoho_product_analysis where day_date = #{date,jdbcType=VARCHAR} limit #{offset},#{pageSize}
    </select>

    <select id="selectMaxTowDate" resultType="java.lang.String" timeout="20000">
        select distinct day_date from yoho_product_analysis order by day_date desc limit 2;
    </select>

</mapper>