2021与蓝度共同重构项目,服务端
liuhaonan
2022-10-21 0a30812acaa26ebe654340f7e749a6801b63b194
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
70
<?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.sandu.ximon.dao.mapper.C3mOrderMapper">
 
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.C3mOrder">
        <id property="orderId" column="order_id" jdbcType="BIGINT"/>
        <result property="poleId" column="pole_id" jdbcType="BIGINT"/>
        <result property="poleMac" column="pole_mac" jdbcType="VARCHAR"/>
        <result property="poleName" column="pole_name" jdbcType="VARCHAR"/>
        <result property="c3Mac" column="c3_mac" jdbcType="VARCHAR"/>
        <result property="c3Name" column="c3_name" jdbcType="VARCHAR"/>
        <result property="c3Udid" column="c3_udid" jdbcType="VARCHAR"/>
        <result property="outTradeNo" column="out_trade_no" jdbcType="VARCHAR"/>
        <result property="orderType" column="order_type" jdbcType="VARCHAR"/>
        <result property="totalAmount" column="total_amount" jdbcType="DECIMAL"/>
        <result property="surplusAmount" column="surplus_amount" jdbcType="DECIMAL"/>
        <result property="refundAmount" column="refund_amount" jdbcType="DECIMAL"/>
        <result property="aliBuyerLogonId" column="ali_buyer_logon_id" jdbcType="VARCHAR"/>
        <result property="subscribeChargingCapacity" column="subscribe_charging_capacity" jdbcType="INTEGER"/>
        <result property="actualChargingCapacity" column="actual_charging_capacity" jdbcType="DOUBLE"/>
        <result property="actualChargingCapacityHide" column="actual_charging_capacity_hide" jdbcType="DOUBLE"/>
        <result property="createTimestamp" column="create_timestamp" jdbcType="BIGINT"/>
        <result property="payTimestamp" column="pay_timestamp" jdbcType="BIGINT"/>
        <result property="refundTimestamp" column="refund_timestamp" jdbcType="BIGINT"/>
        <result property="refundMsg" column="refund_msg" jdbcType="VARCHAR"/>
        <result property="alreadyChargingTime" column="already_charging_time" jdbcType="VARCHAR"/>
        <result property="startChargingTimestamp" column="start_charging_timestamp" jdbcType="BIGINT"/>
        <result property="stopChargingTimestamp" column="stop_charging_timestamp" jdbcType="BIGINT"/>
        <result property="orderStatus" column="order_status" jdbcType="INTEGER"/>
        <result property="chargingStates" column="charging_states" jdbcType="INTEGER"/>
        <result property="userCode" column="user_code" jdbcType="VARCHAR"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        order_id
        ,pole_id,pole_mac,
        pole_name,c3_mac,c3_name,
        c3_udid,out_trade_no,order_type,
        total_amount,receipt_amount,refund_amount,
        ali_buyer_logon_id,subscribe_charging_capacity,actual_charging_capacity,
        actual_charging_capacity_hide,create_timestamp,pay_timestamp,
        refund_timestamp,refund_msg,start_charging_timestamp,
        stop_charging_timestamp,order_status,charging_states,
        user_code
    </sql>
    <select id="orderList" resultType="com.sandu.ximon.dao.bo.C3mOrderBo" parameterType="java.lang.Long">
        SELECT
        t1.*
        FROM
        c3_order t1
        LEFT JOIN pole t2 ON t1.pole_id = t2.id
        <where>
            1=1
            <if test="userId != null">
                AND (t1.userId = #{userId} OR t1.client_id= #{userId})
            </if>
            <if test="orderStatus != null">
                AND t1.order_status = #{orderStatus}
            </if>
            <if test="startTimeStamp != null">
                AND create_timestamp BETWEEN #{startTimeStamp} AND #{nowTimeStamp}
            </if>
            <if test="keyword != null and keyword != ''">
                AND t1.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
            </if>
        </where>
    </select>
</mapper>