Pu Zhibing
2025-03-28 8b09fbc19a96b57bf1d0e4d7c79b51a76aeca554
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<?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>
    
    
    <select id="query1" 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 != cityIds">
            and cityId in
            <foreach collection="cityIds" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        ) order by `type` desc limit 0, 1
    </select>
    
    
    <select id="queryList" 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
        <foreach collection="ids" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
        <if test="null != type">
            and type = #{type}
        </if>
    </select>
</mapper>