fix(watch,consultation,db): 修复达梦数据库兼容性及 SQL 脚本问题

- 将 ArchivesBodyTypeMapper.xml 中的双引号字符串 \"5\" 改为单引号 '5',修复达梦数据库语法兼容问题
- 更新 ConDoctorMapper.java(具体变更见 diff)
- 更新 consult.sql 数据库脚本
This commit is contained in:
2026-04-02 17:46:15 +08:00
parent a7a037daf9
commit 98a06d0c66
5 changed files with 455 additions and 62 deletions
@@ -11,7 +11,7 @@
SELECT
userid AS userId,
data_value AS dataValue,
"5" AS dataSource,
'5' AS dataSource,
type AS type,
last_update_time AS createDate
FROM
@@ -19,18 +19,6 @@
WHERE
userid = #{userId}
AND type = 1
UNION ALL
SELECT
user_id AS userId,
data_value AS dataValue,
data_source AS dataSource,
type AS type,
create_date AS createDate
FROM
QH_WAT_ARCHIVES_BODY_TYPE
WHERE
user_id = #{userId}
AND type = 1
) temp
ORDER BY
temp.createDate DESC
@@ -44,24 +32,13 @@
SELECT
userid AS userId,
data_value AS dataValue,
"5" AS dataSource,
'5' AS dataSource,
type AS type,
last_update_time AS createDate
FROM
QH_WAT_DATA
WHERE
userid = #{userId}
AND type = 5 UNION ALL
SELECT
user_id AS userId,
data_value AS dataValue,
data_source AS dataSource,
type AS type,
create_date AS createDate
FROM
QH_WAT_ARCHIVES_BODY_TYPE
WHERE
user_id = #{userId}
AND type = 5
) temp
WHERE ROWNUM = 1
@@ -75,7 +52,7 @@
SELECT
userid AS userId,
data_value AS dataValue,
"5" AS dataSource,
'5' AS dataSource,
type AS type,
last_update_time AS createDate
FROM
@@ -86,21 +63,6 @@
<if test="dto.startTime != null and dto.endTime != null">
AND last_update_time BETWEEN #{dto.startTime} AND #{dto.endTime}
</if>
UNION ALL
SELECT
user_id AS userId,
data_value AS dataValue,
data_source AS dataSource,
type AS type,
create_date AS createDate
FROM
QH_WAT_ARCHIVES_BODY_TYPE
WHERE
user_id = #{dto.userId}
AND type = 1
<if test="dto.startTime != null and dto.endTime != null">
AND create_date BETWEEN #{dto.startTime} AND #{dto.endTime}
</if>
) temp
ORDER BY
temp.createDate
@@ -112,7 +74,7 @@
SELECT
userid AS userId,
data_value AS dataValue,
"5" AS dataSource,
'5' AS dataSource,
type AS type,
last_update_time AS createDate
FROM
@@ -123,21 +85,7 @@
<if test="dto.startTime != null and dto.endTime != null">
AND last_update_time BETWEEN #{dto.startTime} AND #{dto.endTime}
</if>
UNION ALL
SELECT
user_id AS userId,
data_value AS dataValue,
data_source AS dataSource,
type AS type,
create_date AS createDate
FROM
QH_WAT_ARCHIVES_BODY_TYPE
WHERE
user_id = #{dto.userId}
AND type = 5
<if test="dto.startTime != null and dto.endTime != null">
AND create_date BETWEEN #{dto.startTime} AND #{dto.endTime}
</if>
) temp
ORDER BY
temp.createDate