Blame view

parking-module-business/src/main/resources/mybatis/smapper/TdCBusinessAcctSourceSMapper.xml 4.43 KB
55f68655   王彪总   新项目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
  <?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.business.mapper.smapper.TdCBusinessAcctSourceSMapper">
    <resultMap id="BaseResultMap" type="com.zteits.business.domain.TdCBusinessAcctSource">
      <id column="id" jdbcType="BIGINT" property="id" />
      <result column="source_bill_id" jdbcType="VARCHAR" property="sourceBillId" />
      <result column="acct_id" jdbcType="VARCHAR" property="acctId" />
      <result column="business_id" jdbcType="VARCHAR" property="businessId" />
      <result column="business_name" jdbcType="VARCHAR" property="businessName" />
      <result column="user_phone" jdbcType="VARCHAR" property="userPhone" />
      <result column="acount_name" jdbcType="VARCHAR" property="acountName" />
      <result column="legal_person_name" jdbcType="VARCHAR" property="legalPersonName" />
      <result column="acct_type" jdbcType="INTEGER" property="acctType" />
      <result column="terminal_source" jdbcType="INTEGER" property="terminalSource" />
      <result column="recharge_type" jdbcType="INTEGER" property="rechargeType" />
      <result column="recharge_remark" jdbcType="VARCHAR" property="rechargeRemark" />
      <result column="recharge_fee" jdbcType="DECIMAL" property="rechargeFee" />
      <result column="recharge_balance" jdbcType="DECIMAL" property="rechargeBalance" />
      <result column="recharge_ID" jdbcType="VARCHAR" property="rechargeId" />
      <result column="recharge_name" jdbcType="VARCHAR" property="rechargeName" />
      <result column="recharge_time" jdbcType="TIMESTAMP" property="rechargeTime" />
      <result column="rlt_order_id" jdbcType="VARCHAR" property="rltOrderId" />
      <result column="rlt_payorder_id" jdbcType="VARCHAR" property="rltPayorderId" />
      <result column="pic_path" jdbcType="VARCHAR" property="picPath" />
      <result column="qeual_type" jdbcType="INTEGER" property="qeualType" />
      <result column="examine_state" jdbcType="INTEGER" property="examineState" />
      <result column="examine_date" jdbcType="TIMESTAMP" property="examineDate" />
      <result column="examine_remark" jdbcType="VARCHAR" property="examineRemark" />
      <result column="org_id" jdbcType="BIGINT" property="orgId" />
      <result column="data_state" jdbcType="INTEGER" property="dataState" />
      <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
      <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
      <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
      <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
      <result column="org_name" jdbcType="VARCHAR" property="orgName" />
      <result column="group_no" jdbcType="VARCHAR" property="groupNo" />
    </resultMap>
    <!-- 统计商户端充值记录 -->
    <select id="queryBusinessRechargeFeeStatic" resultType="com.zteits.clouds.api.dto.business.dto.BusinessAcctSourceRechargeStaticDTO"
            parameterType="com.zteits.clouds.api.dto.business.param.TdCBusinessAcctSourceRequest">
      SELECT
      IFNULL( count( CASE WHEN recharge_type IN ( 1, 2, 3 ) THEN recharge_fee END ), 0 ) totalNum,
      IFNULL( sum( CASE WHEN recharge_type IN ( 1, 2, 3 ) THEN recharge_fee END ), 0 ) total,
      IFNULL( count( CASE WHEN recharge_type = 1 THEN recharge_fee END ), 0 ) zfbNum,
      IFNULL( sum( CASE WHEN recharge_type = 1 THEN recharge_fee END ), 0 ) zfb,
      IFNULL( count( CASE WHEN recharge_type = 2 THEN recharge_fee END ), 0 ) wxNum,
      IFNULL( sum( CASE WHEN recharge_type = 2 THEN recharge_fee END ), 0 ) wx,
      IFNULL( count( CASE WHEN recharge_type = 3 THEN recharge_fee END ), 0 ) cashNum,
      IFNULL( sum( CASE WHEN recharge_type = 3 THEN recharge_fee END ), 0 ) cash,
      IFNULL( count( CASE WHEN recharge_type NOT IN ( 1, 2, 3 ) THEN recharge_fee END ), 0 ) otherNum,
      IFNULL( sum( CASE WHEN recharge_type NOT IN ( 1, 2, 3 ) THEN recharge_fee END ), 0 ) other
      FROM
      td_c_business_acct_source
      WHERE
      acct_type = 1 and  data_state=1
      <if test="userPhone != null and userPhone != ''">
        and user_phone = #{userPhone}
      </if>
      <if test="rechargeType != null and rechargeType != ''">
        and recharge_type = #{rechargeType}
      </if>
      <if test="businessName != null and businessName != ''">
        and business_name = #{businessName}
      </if>
      and examine_state = 2
      and org_id=#{orgId}
      and recharge_time &gt;= #{beginDate} AND recharge_time &lt;=#{endDate}
    </select>
  </mapper>