TpPNetworkCardStatisticMonthSMapper.xml 3.82 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.zteits.park.mapper.smapper.TpPNetworkCardStatisticMonthSMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.TpPNetworkCardStatisticMonth">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="card_no" jdbcType="VARCHAR" property="cardNo" />
    <result column="eqp_type" jdbcType="INTEGER" property="eqpType" />
    <result column="static_date" jdbcType="DATE" property="staticDate" />
    <result column="static_date_str" jdbcType="VARCHAR" property="staticDateStr" />
    <result column="statistic_begin_time" jdbcType="TIMESTAMP" property="statisticBeginTime" />
    <result column="statistic_end_time" jdbcType="TIMESTAMP" property="statisticEndTime" />
    <result column="mobile_data_total" jdbcType="BIGINT" property="mobileDataTotal" />
    <result column="mobile_data_use" jdbcType="BIGINT" property="mobileDataUse" />
    <result column="mobile_data_oxceed" jdbcType="BIGINT" property="mobileDataOxceed" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_emp_id" jdbcType="VARCHAR" property="createEmpId" />
    <result column="create_emp_name" jdbcType="VARCHAR" property="createEmpName" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modfiy_emp_id" jdbcType="VARCHAR" property="modfiyEmpId" />
    <result column="modfiy_emp_name" jdbcType="VARCHAR" property="modfiyEmpName" />
    <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </resultMap>
  <sql id="Base_Column_List">
    id, card_no, eqp_type, static_date, static_date_str, statistic_begin_time, statistic_end_time, 
    mobile_data_total, mobile_data_use, mobile_data_oxceed, org_id, data_state, create_emp_id, 
    create_emp_name, create_date, modfiy_emp_id, modfiy_emp_name, modfiy_date, remark
  </sql>

  <!-- 物联网卡分页查询 -->
  <select id="queryTpPNetworkCardStatisticMonthForPage" parameterType="com.zteits.clouds.api.dto.park.param.TpPNetworkCardStatisticMonthRequest"
          resultType="com.zteits.park.domain.TpPNetworkCardStatisticMonth">
    select
       static_date_str staticDateStr,
       eqp_type eqpType,
      --        count(1) totalNum,
       sum(mobile_data_total) mobileDataTotal,
       sum(mobile_data_use) mobileDataUse,
       sum(mobile_data_oxceed) mobileDataOxceed
    from tp_p_network_card_statistic_month
    where data_state = 1
    <if test="eqpType != null">
      and eqp_type = #{eqpType,jdbcType=INTEGER}
    </if>
    <if test="orgId != null">
      and org_id = #{orgId,jdbcType=BIGINT}
    </if>
    and static_date_str >= #{beginDateStr} and #{endDateStr} >= static_date_str
    group by static_date_str, eqp_type
    order by static_date_str desc
  </select>

  <!-- 物联网卡查询 -->
  <select id="queryTpPNetworkCardStatisticMonth" parameterType="com.zteits.clouds.api.dto.park.param.TpPNetworkCardStatisticMonthRequest"
          resultType="com.zteits.park.domain.TpPNetworkCardStatisticMonth">
    select
       eqp_type eqpType,
      --        count(1) totalNum,
       sum(mobile_data_total) mobileDataTotal,
       sum(mobile_data_use) mobileDataUse,
       sum(mobile_data_oxceed) mobileDataOxceed
    from tp_p_network_card_statistic_month
    where data_state = 1
    <if test="eqpType != null">
      and eqp_type = #{eqpType,jdbcType=INTEGER}
    </if>
    <if test="orgId != null">
      and org_id = #{orgId,jdbcType=BIGINT}
    </if>
    and static_date_str >= #{beginDateStr} and #{endDateStr} >= static_date_str
    group by eqp_type
    order by eqp_type
  </select>

</mapper>