fix(sql):health-emergency和health-watch模块

处理sql别名
This commit is contained in:
hejiayang
2026-03-18 16:42:29 +08:00
parent 961dc7c104
commit 01982703f4
10 changed files with 163 additions and 163 deletions
@@ -59,7 +59,7 @@ public interface AedEquipmentMangerMapper extends BaseMapper<AedEquipmentManger>
* 按单位统计aed设备数量
* @return 统计数据
*/
@Select(value = "SELECT SUBSTR(depart_code,1,6) as orgCode, count(1) as aedCount FROM aed_equipment_manger where del_flag = 0 GROUP BY SUBSTR(depart_code,1,6)")
@Select(value = "SELECT SUBSTR(depart_code,1,6) AS \"orgCode\", count(1) AS \"aedCount\" FROM aed_equipment_manger where del_flag = 0 GROUP BY SUBSTR(depart_code,1,6)")
List<JSONObject> statisticAedByOrgCode();
List<AedLocationEquipment> getLocation(@Param("idList") List<Long> idList);
@@ -4,8 +4,8 @@
<select id="officerOnDutyJoinSessionInfoByOP"
resultType="com.renkang.emergency.bean.response.EmergencyUser">
select
operation_user_id userId,
count(*) num
operation_user_id AS "userId",
count(*) AS "num"
FROM
QH_EME_ORDER
WHERE operation_user_id is not null
@@ -19,8 +19,8 @@
<select id="officerOnDutyJoinSessionInfoByMajor"
resultType="com.renkang.emergency.bean.response.EmergencyUser">
select
major_user_id userId,
count(*) num
major_user_id AS "userId",
count(*) AS "num"
FROM
QH_EME_ORDER
WHERE major_user_id is not null
@@ -31,7 +31,7 @@
major_user_id
</select>
<select id="selectHelpCentor" resultType="com.renkang.emergency.entity.TblHelpCentorVo">
SELECT Initiator_type as type, COUNT(*) as count
SELECT Initiator_type AS "type", COUNT(*) AS "count"
FROM QH_EME_ORDER
<where>
<if test="sex != null and sex != '' and sex != '0'">
@@ -46,8 +46,8 @@
</select>
<select id="emergencyNum" resultType="com.renkang.emergency.archives.model.vo.EmergencyNum">
SELECT center_id as id,
count(*) num
SELECT center_id AS "id",
count(*) AS "num"
FROM QH_EME_ORDER
<where>
and del_flag = 0
@@ -3,7 +3,7 @@
<mapper namespace="com.renkang.emergency.mapper.TblBaseHospitalMapper">
<select id="getHospitalList" resultType="com.renkang.emergency.entity.TblBaseHospitalVo">
SELECT id,name,latitude lat ,longitude lon,type
SELECT id,name,latitude AS "lat" ,longitude AS "lon",type
FROM QH_EME_RESOURCE
WHERE 1 = 1 and del_flag = 0
<if test="type != null and type.length() > 0">
@@ -16,7 +16,7 @@
</select>
<select id="getHospitalListNew" resultType="com.renkang.emergency.entity.TblBaseHospitalVo">
SELECT id,name,latitude lat ,longitude lon,type
SELECT id,name,latitude AS "lat" ,longitude AS "lon",type
FROM QH_EME_RESOURCE
WHERE 1 = 1 and del_flag = 0 and type != 3
<if test="type != null and type != ''">
@@ -27,4 +27,4 @@
</if>
ORDER BY id
</select>
</mapper>
</mapper>