Commit 60610c63 authored by tangwei's avatar tangwei

修改bug

parent f04e98b3
...@@ -46,91 +46,98 @@ ...@@ -46,91 +46,98 @@
a.longitude, a.longitude,
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
AS distance, AS distance,
case when csps.person_number is null then 0 else
csps.person_number end as userNum, SUM(case when csps.person_number is null then 0 else
case when cre.vehicle_number is null then 0 else cre.vehicle_number end as csps.person_number end) as userNum,
SUM(case when cre.vehicle_number is null then 0 else cre.vehicle_number end )as
carNum carNum
FROM <!--
cb_linkage_unit a case when csps.person_number is null then 0 else
LEFT JOIN cb_special_position_staff csps ON a.sequence_nbr = csps.person_number end as userNum,
csps.company_id case when cre.vehicle_number is null then 0 else cre.vehicle_number end as
LEFT JOIN cb_rescue_equipment cre on a.sequence_nbr = cre.company_id 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 where a.is_delete=0 and a.longitude is not null and
a.latitude is not null a.latitude is not null GROUP BY a.sequence_nbr
<if test='par.distance!=null'> <if test='par.distance!=null'>
and and
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
&lt;= &lt;=
#{par.distance} #{par.distance}
</if> </if>
ORDER BY distance limit #{pageNum},#{pageSize} ORDER BY distance limit #{pageNum},#{pageSize}
</select> </select>
<select id="listLinkageUnitZhDtoCount" resultType="Integer"> <select id="listLinkageUnitZhDtoCount" resultType="Integer">
select select
COUNT(a.sequence_nbr) num COUNT(a.sequence_nbr) num
FROM cb_linkage_unit a FROM cb_linkage_unit a
where a.longitude where a.longitude
is not null and a.latitude is not null is not null and a.latitude is not null
<if test='par.distance!=null'> <if test='par.distance!=null'>
and and
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
&lt;= &lt;=
#{par.distance} #{par.distance}
</if> </if>
</select> </select>
<select id="getEmergencyLinkageUnitCodeGroupByAndCount" <select id="getEmergencyLinkageUnitCodeGroupByAndCount"
resultType="java.util.Map"> resultType="java.util.Map">
SELECT SELECT
emergency_linkage_unit_code as emergency_linkage_unit_code as
emergencyLinkageUnitCode, emergencyLinkageUnitCode,
COUNT(unit_code) AS count COUNT(unit_code) AS count
FROM FROM
cb_linkage_unit cb_linkage_unit
WHERE WHERE
is_delete = 0 is_delete = 0
GROUP BY GROUP BY
emergency_linkage_unit_code emergency_linkage_unit_code
</select> </select>
<select id="exportToExcel" <select id="exportToExcel"
resultType="com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto"> resultType="com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto">
select select
a.unit_name unitName, a.unit_name unitName,
a.linkage_unit_type a.linkage_unit_type
linkageUnitType, linkageUnitType,
a.address , a.address ,
a.latitude, a.latitude,
a.longitude, a.longitude,
a.agreement_start_date agreementStartDate, a.agreement_start_date agreementStartDate,
a.agreement_end_date a.agreement_end_date
agreementEndDate, agreementEndDate,
a.contact_user contactUser, a.contact_user contactUser,
a.contact_phone a.contact_phone
contactPhone, contactPhone,
b.* b.*
from cb_linkage_unit a LEFT JOIN from cb_linkage_unit a LEFT JOIN
(SELECT (SELECT
m.instance_id, m.instance_id,
max(case m.field_code when 'emergencyServiceContent' then max(case m.field_code when 'emergencyServiceContent' then
m.field_value end) emergencyServiceContent, m.field_value end) emergencyServiceContent,
max(case m.field_code when max(case m.field_code when
'fireRescueCapability' then m.field_value end) fireRescueCapability, 'fireRescueCapability' then m.field_value end) fireRescueCapability,
max(case m.field_code when 'responsibilitiesSituation' then max(case m.field_code when 'responsibilitiesSituation' then
m.field_value end) responsibilitiesSituation, m.field_value end) responsibilitiesSituation,
max(case m.field_code max(case m.field_code
when 'unitSituation' then m.field_value end) unitSituation when 'unitSituation' then m.field_value end) unitSituation
FROM FROM
cb_dynamic_form_instance m GROUP BY m.instance_id) b cb_dynamic_form_instance m GROUP BY m.instance_id) b
on on
b.instance_id=a.instance_id where a.unit_name is not null and a.is_delete=0 b.instance_id=a.instance_id where a.unit_name is not null and a.is_delete=0
</select> </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" <select id="getEmergencyLinkageUnitList"
resultType="java.util.Map"> resultType="java.util.Map">
SELECT SELECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment