|
|
@@ -1275,70 +1275,5 @@
|
|
1275
|
1275
|
from business_contract contract
|
|
1276
|
1276
|
</select> -->
|
|
1277
|
1277
|
|
|
1278
|
|
- <select id="getHtGjjDate" parameterType="java.lang.Integer" resultType="java.util.Map">
|
|
1279
|
|
- select
|
|
1280
|
|
- a.id id,
|
|
1281
|
|
- substr(org.kqbm, 1,18)||a.contract_number hth,
|
|
1282
|
|
- a.contract_title htmc,
|
|
1283
|
|
- substr(org.kqbm, 1,18) dwdm,
|
|
1284
|
|
- case when a.contract_type='3147' or a.contract_type='7130' then '2' when a.contract_type='3148' or a.contract_type='7131' then '1' end ywlx,
|
|
1285
|
|
- case customer.classify when '3152' then '2' when '3153' then '1' else '2' end khlx,
|
|
1286
|
|
- case customer.classify when '3152' then '' when '3153' then customer.social_credit_code end khtyshxydm,
|
|
1287
|
|
- ifnull(customer.name, '检测客户') khmc, -- 7.客户名称,--Y
|
|
1288
|
|
- case customer.classify when '3152' then customer.name when '3153' then customer.legal_person else '检测者' end fddbr,
|
|
1289
|
|
- e1.enumname || customer.address txdz,
|
|
1290
|
|
- customer.yzbm yzbm,
|
|
1291
|
|
- customer.linkman lxrxm,
|
|
1292
|
|
- case customer.classify when '3152' then customer.mobile when '3153' then customer.enterprise_phone end lxrdh,
|
|
1293
|
|
- upper(customer.lxrsfzh) sfzh,
|
|
1294
|
|
- customer.email dzyx,
|
|
1295
|
|
- DATE_FORMAT(a.signing_time, '%Y-%m-%d') qdrq,
|
|
1296
|
|
- DATE_FORMAT(a.disable_date, '%Y-%m-%d') ydwcsj,
|
|
1297
|
|
- a.qddd qddd,
|
|
1298
|
|
- e2.gbcode lspzdm,
|
|
1299
|
|
- e3.gbcode lsxzdm,
|
|
1300
|
|
- case when a.contract_type='3147' or a.contract_type='7130' then ifnull(b.in_price, '1') when a.contract_type='3148' or a.contract_type='7131' then ifnull(b.out_price, '1') else '1' end htdj,
|
|
1301
|
|
- case when a.contract_type='3147' or a.contract_type='7130' then ifnull(b.in_count,'1') when a.contract_type='3148' or a.contract_type='7131' then ifnull(b.out_count,'1') else '1' end ydgxlssl,
|
|
1302
|
|
- case when a.contract_type='3147' or a.contract_type='7130' then ifnull(b.in_detail_total_price, '1') when a.contract_type='3148' or a.contract_type='7131' then ifnull(b.out_detail_total_price, '1') else '1' end htzje,
|
|
1303
|
|
- a.lybzj lybzj,
|
|
1304
|
|
- '' sswcsj,
|
|
1305
|
|
- '' Lysl,
|
|
1306
|
|
- '' Lyl,
|
|
1307
|
|
- '' Jsjg,
|
|
1308
|
|
- '' Jszje,
|
|
1309
|
|
- '1' jsyhtyzx,
|
|
1310
|
|
- '' jsyhtbyzyy,
|
|
1311
|
|
- e4.gbcode khfkhh,
|
|
1312
|
|
- customer.account_number khfzh,
|
|
1313
|
|
- a.khqyr khqyr,
|
|
1314
|
|
- ifnull(e5.gbcode, '999') bfkhh,
|
|
1315
|
|
- ifnull(a.bfzh, '00000000000') bfzh,
|
|
1316
|
|
- a.signing_man bfqyr,
|
|
1317
|
|
- '' shr,
|
|
1318
|
|
- DATE_FORMAT(a.agree_time, '%Y-%m-%d hh:mm:ss') shsj,
|
|
1319
|
|
- case when a.in_application='2' or a.in_application='3' then ifnull(DATE_FORMAT(a.disable_date, '%Y-%m-%d'), null) else null end wcrq,
|
|
1320
|
|
- DATE_FORMAT(a.updatetime, '%Y-%m-%d hh:mm:ss') zhgxsj
|
|
1321
|
|
- from business_contract a
|
|
1322
|
|
- inner join (
|
|
1323
|
|
- select org_id,contract_number,max(create_time) createtime
|
|
1324
|
|
- from business_contract
|
|
1325
|
|
- group by org_id,contract_number
|
|
1326
|
|
- ) x on a.org_id=x.org_id and a.contract_number=x.contract_number and a.create_time=x.createtime
|
|
1327
|
|
- left join (
|
|
1328
|
|
- select zid, max(id) id from business_store_ware_detail
|
|
1329
|
|
- where type in ('contract','cblContract')
|
|
1330
|
|
- group by zid
|
|
1331
|
|
- ) b1 on b1.zid=a.id
|
|
1332
|
|
- left join business_store_ware_detail b on b.id=b1.id
|
|
1333
|
|
- left join basic_storehouse house on house.storehouse_id=b.house_id
|
|
1334
|
|
- left join basic_warehouse ware on ware.warehouse_id=b.warehouse_id
|
|
1335
|
|
- left join org_info org on org.org_id=a.org_id
|
|
1336
|
|
- left join business_customer customer on customer.id=a.customer_bid
|
|
1337
|
|
- left join basic_enum e1 on e1.enumid=customer.county
|
|
1338
|
|
- left join basic_enum e2 on e2.enumid=b.grain_kind
|
|
1339
|
|
- left join basic_enum e3 on e3.enumid=b.grain_attribute
|
|
1340
|
|
- left join basic_enum e4 on e4.enumid=customer.bank_name
|
|
1341
|
|
- left join basic_enum e5 on e5.enumname=a.bfkhh
|
|
1342
|
|
- where a.audit_state=2 and a.id = #{id}
|
|
1343
|
|
- </select>
|
|
|
1278
|
+
|
|
1344
|
1279
|
</mapper>
|