fix(信创): 修复 Mapper XML 中 MySQL 特有语法与达梦数据库不兼容问题

- UserDataRecordBmiMapper.xml: DATE() → TRUNC(),LIMIT 1 → FETCH FIRST 1 ROWS ONLY
- SysVersionInfoMapper.xml: limit 1 → FETCH FIRST 1 ROWS ONLY
- SysUserMapper.xml: limit 1 → FETCH FIRST 1 ROWS ONLY,IFNULL() → NVL(),INSERT IGNORE → INSERT INTO
This commit is contained in:
wanghao
2026-03-06 11:36:19 +08:00
parent 909ccacaeb
commit 890cdfe40d
3 changed files with 7 additions and 7 deletions
@@ -32,7 +32,7 @@
</foreach> </foreach>
</if> </if>
<if test="dateStr != null"> <if test="dateStr != null">
AND DATE(data_date) = #{dateStr} AND TRUNC(data_date) = #{dateStr}
</if> </if>
</where> </where>
GROUP BY user_id ) GROUP BY user_id )
@@ -82,10 +82,10 @@
<select id="dayMinWeight" resultType="org.jeecg.bean.entity.UserDataRecordBmi"> <select id="dayMinWeight" resultType="org.jeecg.bean.entity.UserDataRecordBmi">
SELECT * SELECT *
FROM user_data_record_bmi FROM user_data_record_bmi
WHERE DATE(data_date) = (SELECT MAX(DATE(data_date)) FROM user_data_record_bmi where user_id = #{userId}) WHERE TRUNC(data_date) = (SELECT MAX(TRUNC(data_date)) FROM user_data_record_bmi where user_id = #{userId})
and user_id = #{userId} and user_id = #{userId}
ORDER BY weight ASC ORDER BY weight ASC
LIMIT 1 FETCH FIRST 1 ROWS ONLY
</select> </select>
@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.system.mapper.SysUserMapper"> <mapper namespace="org.jeecg.modules.system.mapper.SysUserMapper">
<insert id="batchInsert" parameterType="java.util.List"> <insert id="batchInsert" parameterType="java.util.List">
insert IGNORE into sys_user (id, username, realname, password, salt, avatar, birthday, id_card,person_type, sex, insert into sys_user (id, username, realname, password, salt, avatar, birthday, id_card,person_type, sex,
email, phone, org_code, work_no, post, create_time, update_time, user_identity) email, phone, org_code, work_no, post, create_time, update_time, user_identity)
values values
<foreach collection="list" item="t" index="index" separator=","> <foreach collection="list" item="t" index="index" separator=",">
@@ -437,7 +437,7 @@
<select id="selectUserIdByWorkNo" resultType="String"> <select id="selectUserIdByWorkNo" resultType="String">
select id from sys_user where del_flag = 0 and work_no = #{workNo} limit 1 select id from sys_user where del_flag = 0 and work_no = #{workNo} FETCH FIRST 1 ROWS ONLY
</select> </select>
@@ -1120,7 +1120,7 @@
<select id="userInfoMap" resultType="org.jeecg.modules.system.bean.response.UserBmiGroupInfo"> <select id="userInfoMap" resultType="org.jeecg.modules.system.bean.response.UserBmiGroupInfo">
SELECT SELECT
t1.id_card, t1.id_card,
IFNULL( t1.user_group, 'e' ) AS user_group, NVL( t1.user_group, 'e' ) AS user_group,
t2.height, t2.height,
t2.weight, t2.weight,
t2.bmi, t2.bmi,
@@ -108,7 +108,7 @@
and svi.device_type = #{deviceType} and svi.device_type = #{deviceType}
and sva.package_name = #{packageName} and sva.package_name = #{packageName}
order by svi.version_no desc order by svi.version_no desc
limit 1 FETCH FIRST 1 ROWS ONLY
</select> </select>