Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
f931ef1e
Commit
f931ef1e
authored
Sep 29, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
abdf4264
60610c63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
77 deletions
+84
-77
LinkageUnitMapper.xml
...ommon-api/src/main/resources/mapper/LinkageUnitMapper.xml
+84
-77
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/LinkageUnitMapper.xml
View file @
f931ef1e
...
...
@@ -46,91 +46,98 @@
a.longitude,
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
AS distance,
case when csps.person_number is null then 0 else
csps.person_number end as userNum,
case when cre.vehicle_number is null then 0 else cre.vehicle_number end as
SUM(case when csps.person_number is null then 0 else
csps.person_number end) as userNum,
SUM(case when cre.vehicle_number is null then 0 else cre.vehicle_number end )as
carNum
FROM
cb_linkage_unit a
LEFT JOIN cb_special_position_staff csps ON a.sequence_nbr =
csps.company_id
LEFT JOIN cb_rescue_equipment cre on a.sequence_nbr = cre.company_id
<!--
case when csps.person_number is null then 0 else
csps.person_number end as userNum,
case when cre.vehicle_number is null then 0 else cre.vehicle_number end as
carNum-->
FROM
cb_linkage_unit a
LEFT JOIN cb_special_position_staff csps ON a.sequence_nbr =
csps.company_id
LEFT JOIN cb_rescue_equipment cre on a.sequence_nbr = cre.company_id
where
a.longitude is not null and
a.latitude is not null
<if
test=
'par.distance!=null'
>
and
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<
=
#{par.distance}
</if>
ORDER BY distance limit #{pageNum},#{pageSize}
</select>
where a.is_delete=0 and
a.longitude is not null and
a.latitude is not null GROUP BY a.sequence_nbr
<if
test=
'par.distance!=null'
>
and
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<
=
#{par.distance}
</if>
ORDER BY distance limit #{pageNum},#{pageSize}
</select>
<select
id=
"listLinkageUnitZhDtoCount"
resultType=
"Integer"
>
select
COUNT(a.sequence_nbr) num
FROM cb_linkage_unit a
where a.longitude
is not null and a.latitude is not null
<if
test=
'par.distance!=null'
>
and
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<
=
#{par.distance}
</if>
</select>
<select
id=
"listLinkageUnitZhDtoCount"
resultType=
"Integer"
>
select
COUNT(a.sequence_nbr) num
FROM cb_linkage_unit a
where a.longitude
is not null and a.latitude is not null
<if
test=
'par.distance!=null'
>
and
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<
=
#{par.distance}
</if>
</select>
<select
id=
"getEmergencyLinkageUnitCodeGroupByAndCount"
resultType=
"java.util.Map"
>
SELECT
emergency_linkage_unit_code as
emergencyLinkageUnitCode,
COUNT(unit_code) AS count
FROM
cb_linkage_unit
WHERE
is_delete = 0
GROUP BY
emergency_linkage_unit_code
</select>
<select
id=
"getEmergencyLinkageUnitCodeGroupByAndCount"
resultType=
"java.util.Map"
>
SELECT
emergency_linkage_unit_code as
emergencyLinkageUnitCode,
COUNT(unit_code) AS count
FROM
cb_linkage_unit
WHERE
is_delete = 0
GROUP BY
emergency_linkage_unit_code
</select>
<select
id=
"exportToExcel"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto"
>
select
a.unit_name unitName,
a.linkage_unit_type
linkageUnitType,
a.address ,
a.latitude,
a.longitude,
a.agreement_start_date agreementStartDate,
a.agreement_end_date
agreementEndDate,
a.contact_user contactUser,
a.contact_phone
contactPhone,
b.*
from cb_linkage_unit a LEFT JOIN
(SELECT
m.instance_id,
max(case m.field_code when 'emergencyServiceContent' then
m.field_value end) emergencyServiceContent,
max(case m.field_code when
'fireRescueCapability' then m.field_value end) fireRescueCapability,
max(case m.field_code when 'responsibilitiesSituation' then
m.field_value end) responsibilitiesSituation,
max(case m.field_code
when 'unitSituation' then m.field_value end) unitSituation
FROM
cb_dynamic_form_instance m GROUP BY m.instance_id) b
<select
id=
"exportToExcel"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto"
>
select
a.unit_name unitName,
a.linkage_unit_type
linkageUnitType,
a.address ,
a.latitude,
a.longitude,
a.agreement_start_date agreementStartDate,
a.agreement_end_date
agreementEndDate,
a.contact_user contactUser,
a.contact_phone
contactPhone,
b.*
from cb_linkage_unit a LEFT JOIN
(SELECT
m.instance_id,
max(case m.field_code when 'emergencyServiceContent' then
m.field_value end) emergencyServiceContent,
max(case m.field_code when
'fireRescueCapability' then m.field_value end) fireRescueCapability,
max(case m.field_code when 'responsibilitiesSituation' then
m.field_value end) responsibilitiesSituation,
max(case m.field_code
when 'unitSituation' then m.field_value end) unitSituation
FROM
cb_dynamic_form_instance m GROUP BY m.instance_id) b
on
b.instance_id=a.instance_id where a.unit_name is not null and a.is_delete=0
</select>
on
b.instance_id=a.instance_id where a.unit_name is not null and a.is_delete=0
</select>
<!--联动单位列表按时间倒叙排列add order by clu.rec_date desc 同时处理单位根节点-1时查询全部数据问题 2021-09-08 by kongfm -->
<!--联动单位列表按时间倒叙排列add order by clu.rec_date desc 同时处理单位根节点-1时查询全部数据问题 2021-09-08 by kongfm -->
<select
id=
"getEmergencyLinkageUnitList"
resultType=
"java.util.Map"
>
SELECT
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment