xuhy
昨天 8c1cf98149c48f3ccc6db8574d6bdb76ff541772
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
71
72
<?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.stylefeng.guns.modular.system.dao.ReassignMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.Reassign">
        <id column="id" property="id"/>
        <result column="orderType" property="orderType"/>
        <result column="orderId" property="orderId"/>
        <result column="originalDriverId" property="originalDriverId"/>
        <result column="originalCarId" property="originalCarId"/>
        <result column="insertTime" property="insertTime"/>
        <result column="nowDriverId" property="nowDriverId"/>
        <result column="nowCarId" property="nowCarId"/>
        <result column="money" property="money"/>
        <result column="payType" property="payType"/>
        <result column="payTime" property="payTime"/>
        <result column="payOrder" property="payOrder"/>
        <result column="state" property="state"/>
        <result column="reason" property="reason"/>
        <result column="remark" property="remark"/>
        <result column="completeTime" property="completeTime"/>
    </resultMap>
 
 
    <select id="query" resultType="Reassign">
        select
        id as id,
        orderType as orderType,
        orderId as orderId,
        originalDriverId as originalDriverId,
        originalCarId as originalCarId,
        insertTime as insertTime,
        nowDriverId as nowDriverId,
        nowCarId as nowCarId,
        money as money,
        payType as payType,
        payTime as payTime,
        payOrder as payOrder,
        state as state,
        reason as reason,
        remark as remark,
        completeTime as completeTime
        from t_reassign where 1 = 1
        <if test="null != originalDriverId">
            and originalDriverId = #{originalDriverId}
        </if>
        <if test="null != nowDriverId">
            and nowDriverId = #{nowDriverId}
        </if>
        <if test="null != orderId">
            and orderId = #{orderId}
        </if>
        <if test="null != orderType">
            and orderType = #{orderType}
        </if>
        <if test="null != state">
            and state in
            <foreach collection="state" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
    </select>
 
    <select id="queryList" resultType="map">
        select
        money as amount,
        DATE_FORMAT(insertTime, '%Y-%m-%d% %H:%i') as `day`,
        ('改派处罚') as name
        from t_reassign where payTime is not null and originalDriverId = #{uid} order by insertTime desc limit #{pageNum}, #{size}
    </select>
</mapper>