xuhy
2025-01-09 c16f3bf0b16707214c3ad8acadbe5b77d35d4ccf
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?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.CompanyMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.Company">
        <id column="id" property="id"/>
        <result column="isSpe" property="isSpe"/>
        <result column="isTaxi" property="isTaxi"/>
        <result column="isCross" property="isCross"/>
        <result column="isCrossLogistics" property="isCrossLogistics"/>
        <result column="isSameLogistics" property="isSameLogistics"/>
        <result column="isCharter" property="isCharter"/>
        <result column="isSpeFixedOrProportional" property="isSpeFixedOrProportional"/>
        <result column="isTaxiFixedOrProportional" property="isTaxiFixedOrProportional"/>
        <result column="isCrossLogisticsFixedOrProportional" property="isCrossLogisticsFixedOrProportional"/>
        <result column="isSameLogisticsFixedOrProportional" property="isSameLogisticsFixedOrProportional"/>
        <result column="speMoney" property="speMoney"/>
        <result column="taxiMoney" property="taxiMoney"/>
        <result column="crossLogisticsMoney" property="crossLogisticsMoney"/>
        <result column="sameLogisticsMoney" property="sameLogisticsMoney"/>
        <result column="isNeedFerry" property="isNeedFerry"/>
        <result column="name" property="name"/>
        <result column="type" property="type"/>
        <result column="superiorId" property="superiorId"/>
        <result column="principalName" property="principalName"/>
        <result column="principalPhone" property="principalPhone"/>
        <result column="adminName" property="adminName"/>
        <result column="adminPhone" property="adminPhone"/>
        <result column="urgentPhoen" property="urgentPhoen"/>
        <result column="setupTime" property="setupTime"/>
        <result column="identifier" property="identifier"/>
        <result column="addressCode" property="addressCode"/>
        <result column="businessScope" property="businessScope"/>
        <result column="contactAddress" property="contactAddress"/>
        <result column="documentAddress" property="documentAddress"/>
        <result column="economicType" property="economicType"/>
        <result column="regCapital" property="regCapital"/>
        <result column="legalName" property="legalName"/>
        <result column="legalId" property="legalId"/>
        <result column="legalPhone" property="legalPhone"/>
        <result column="legalPhotoUrl" property="legalPhotoUrl"/>
        <result column="licensingAgency" property="licensingAgency"/>
        <result column="licenseTime" property="licenseTime"/>
        <result column="licenseStartTime" property="licenseStartTime"/>
        <result column="licenseEndTime" property="licenseEndTime"/>
        <result column="licenseNumber" property="licenseNumber"/>
        <result column="carNum" property="carNum"/>
        <result column="driverNum" property="driverNum"/>
        <result column="mac" property="mac"/>
        <result column="state" property="state"/>
        <result column="flag" property="flag"/>
        <result column="upload" property="upload"/>
        <result column="insertTime" property="insertTime"/>
    </resultMap>
 
 
    <select id="query" resultType="Company">
        select
        id as id,
        isSpe as isSpe,
        isTaxi as isTaxi,
        isCross as isCross,
        isCrossLogistics as isCrossLogistics,
        isSameLogistics as isSameLogistics,
        isCharter as isCharter,
        isSpeFixedOrProportional as isSpeFixedOrProportional,
        isTaxiFixedOrProportional as isTaxiFixedOrProportional,
        isCrossLogisticsFixedOrProportional as isCrossLogisticsFixedOrProportional,
        isSameLogisticsFixedOrProportional as isSameLogisticsFixedOrProportional,
        speMoney as speMoney,
        taxiMoney as taxiMoney,
        crossLogisticsMoney as crossLogisticsMoney,
        sameLogisticsMoney as sameLogisticsMoney,
        isNeedFerry as isNeedFerry,
        name as name,
        type as type,
        superiorId as superiorId,
        principalName as principalName,
        principalPhone as principalPhone,
        adminName as adminName,
        adminPhone as adminPhone,
        urgentPhoen as urgentPhoen,
        setupTime as setupTime,
        identifier as identifier,
        addressCode as addressCode,
        businessScope as businessScope,
        contactAddress as contactAddress,
        documentAddress as documentAddress,
        economicType as economicType,
        regCapital as regCapital,
        legalName as legalName,
        legalId as legalId,
        legalPhone as legalPhone,
        legalPhotoUrl as legalPhotoUrl,
        licensingAgency as licensingAgency,
        licenseTime as licenseTime,
        licenseStartTime as licenseStartTime,
        licenseEndTime as licenseEndTime,
        licenseNumber as licenseNumber,
        carNum as carNum,
        driverNum as driverNum,
        mac as mac,
        state as state,
        flag as flag,
        upload as upload,
        insertTime as insertTime
        from t_company where flag != 3 and state = 0 and id in (
        select companyId from t_company_city where state = 1
        <if test="null != province and null != city and null != code">
            and provinceCode = #{province} and cityCode = #{city} and areaCode = #{code}
        </if>
        <if test="null != province and null != city and null == code">
            and provinceCode = #{province} and cityCode = #{city} and (areaCode = '' or areaCode is null)
        </if>
        <if test="null != province and null == city and null == code">
            and provinceCode = #{province} and (cityCode = '' or cityCode is null) and (areaCode = '' or areaCode is null)
        </if>
        )
    </select>
</mapper>