liujie
2023-05-22 9f2315d92cc93f8f431805a10ea9ce3f79fa7eb2
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
<?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.TQuoteMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TQuote">
        <id column="id" property="id" />
        <result column="order_id" property="orderId" />
        <result column="create_time" property="createTime" />
        <result column="state" property="state" />
        <result column="company_id" property="companyId" />
        <result column="total" property="total" />
        <result column="user_id" property="userId" />
        <result column="create_id" property="createId" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, order_id, create_time, state
    </sql>
    <select id="queryDemandList" resultType="com.stylefeng.guns.modular.system.model.DemandListVo">
        select t1.id,t2.id userId,t2.company_name companyName,
        t3.shipment_date pickupDate,
        t4.address origin,t3.e_address destination,
        t1.state,t1.total weight from t_quote t1
        left JOIN t_user t2 on t1.user_id =t2.id
        LEFT JOIN t_order t3 on t1.order_id = t3.e_zip_z
        LEFT JOIN t_port t4 on t3.`port` = t4.id
        where T1.state != 3
        <if test="sTime !=null">
            and t1.create_time between #{sTime} and #{eTime}
        </if>
        <if test="state !=null and state !=''">
            and t1.state =#{state}
        </if>
        <if test="userId !=null and userId !=''">
            and t1.user_id =#{userId}
        </if>
        <if test="account !=null and account !=''">
            and t2.account =#{account}
        </if>
    </select>
    <select id="queryDemandListExport" resultType="com.stylefeng.guns.modular.system.model.DemandListVo">
        select t1.id,t2.id userId,t2.company_name companyName,
        t3.shipment_date pickupDate,
        t4.address origin,t3.e_address destination,
        t1.state,t1.total weight from t_quote t1
        left JOIN t_user t2 on t1.user_id =t2.id
        LEFT JOIN t_order t3 on t1.order_id = t3.e_zip_z
        LEFT JOIN t_port t4 on t3.`port` = t4.id
        where T1.state != 3
        <if test="sTime !=null">
            and t1.create_time between #{sTime} and #{eTime}
        </if>
        <if test="state !=null and state !=''">
            and t1.state =#{state}
        </if>
        <if test="userId !=null and userId !=''">
            and t1.user_id =#{userId}
        </if>
        <if test="account !=null and account !=''">
            and t2.account =#{account}
        </if>
    </select>
 
</mapper>