Merge remote-tracking branch 'origin/xc' into xc

This commit is contained in:
hejiayang
2026-03-04 18:01:49 +08:00
9 changed files with 53 additions and 48 deletions
@@ -116,22 +116,22 @@
<select id="selectWrapper" resultType="org.jeecg.modules.system.entity.DetailVO"> <select id="selectWrapper" resultType="org.jeecg.modules.system.entity.DetailVO">
SELECT * FROM `remote_weight_manufacturer_one` one LEFT JOIN sys_user user ON one.card_number = user.id_card SELECT * FROM remote_weight_manufacturer_one one LEFT JOIN sys_user su ON one.card_number = su.id_card
<where> <where>
<if test="dto.code != null and dto.code != ''"> <if test="dto.code != null and dto.code != ''">
AND one.device_code = #{dto.code} AND one.device_code = #{dto.code}
</if> </if>
<if test="dto.orgCode != null and dto.orgCode != ''"> <if test="dto.orgCode != null and dto.orgCode != ''">
AND user.org_code like CONCAT(#{dto.orgCode},'%') AND su.org_code like CONCAT(#{dto.orgCode},'%')
</if> </if>
<if test="dto.realName != null and dto.realName != ''"> <if test="dto.realName != null and dto.realName != ''">
AND user.realname like CONCAT('%', #{dto.realName}, '%') AND su.realname like CONCAT('%', #{dto.realName}, '%')
</if> </if>
<if test="dto.workNo != null and dto.workNo != ''"> <if test="dto.workNo != null and dto.workNo != ''">
AND user.work_no like CONCAT('%', #{dto.workNo}, '%') AND su.work_no like CONCAT('%', #{dto.workNo}, '%')
</if> </if>
<if test="dto.sex != null and dto.sex != ''"> <if test="dto.sex != null and dto.sex != ''">
AND user.sex = #{dto.sex} AND su.sex = #{dto.sex}
</if> </if>
<if test="dto.startDate != null and dto.startDate != '' and dto.endDate != null and dto.endDate != ''"> <if test="dto.startDate != null and dto.startDate != '' and dto.endDate != null and dto.endDate != ''">
AND exam_time between #{dto.startDate} and #{dto.endDate} AND exam_time between #{dto.startDate} and #{dto.endDate}
@@ -44,7 +44,7 @@
<where> <where>
and a.del_flag = '0' and a.del_flag = '0'
<if test="healthUserDoctorEx.id != null and healthUserDoctorEx.id != ''"> <if test="healthUserDoctorEx.id != null and healthUserDoctorEx.id != ''">
and FIND_IN_SET(a.id,#{#{healthUserDoctorEx.id}}) and INSTR(',' || #{healthUserDoctorEx.id} || ',', ',' || a.id || ',') > 0
</if> </if>
<if test="healthUserDoctorEx.hospitalId != null and healthUserDoctorEx.hospitalId != ''"> <if test="healthUserDoctorEx.hospitalId != null and healthUserDoctorEx.hospitalId != ''">
and a.hospital_id = #{healthUserDoctorEx.hospitalId} and a.hospital_id = #{healthUserDoctorEx.hospitalId}
@@ -2,10 +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.HealthUserEmployeeExMapper"> <mapper namespace="org.jeecg.modules.system.mapper.HealthUserEmployeeExMapper">
<sql id="UserEmployeeCols"> <sql id="UserEmployeeCols">
a a.id,
.
id
,
emp_id, emp_id,
emp_no, emp_no,
emp_sysno, emp_sysno,
@@ -66,7 +63,7 @@
medical_work_type_other, medical_work_type_other,
username, username,
realname, realname,
`password`, password,
salt, salt,
avatar, avatar,
birthday, birthday,
@@ -87,7 +84,7 @@
client_id, client_id,
login_tenant_id, login_tenant_id,
bpm_status, bpm_status,
`status`, status,
b.del_flag, b.del_flag,
create_by, create_by,
create_time, create_time,
@@ -315,9 +312,11 @@
<choose> <choose>
<when test="filter.idList != null and !filter.idList.isEmpty()"> <when test="filter.idList != null and !filter.idList.isEmpty()">
order by order by
FIELD(b.id, <foreach collection="filter.idList" item="id" separator="," open="" close=""> CASE b.id
#{id} <foreach collection="filter.idList" item="id" index="idx" separator=" ">
</foreach>) ASC, b.create_time DESC WHEN #{id} THEN #{idx}
</foreach>
ELSE 99999 END ASC, b.create_time DESC
</when> </when>
<otherwise> <otherwise>
order by b.create_time DESC order by b.create_time DESC
@@ -616,7 +615,7 @@
t2.org_code, t2.org_code,
t2.sex, t2.sex,
t2.id_card, t2.id_card,
IF(t2.user_group IS NULL OR t2.user_group = '', 'e', t2.user_group) AS userGroup, CASE WHEN t2.user_group IS NULL OR t2.user_group = '' THEN 'e' ELSE t2.user_group END AS userGroup,
t2.user_group, t2.user_group,
t2.user_group_update_time, t2.user_group_update_time,
t2.avatar, t2.avatar,
@@ -1101,15 +1100,21 @@
<update id="updateAge"> <update id="updateAge">
UPDATE health_user_employee_ex he UPDATE health_user_employee_ex he
JOIN sys_user su SET he.current_age = (
ON he.id = su.id SELECT FLOOR((CURRENT_DATE - TO_DATE(SUBSTRING(REPLACE(su.id_card, ' ', ''), 7, 8), 'YYYYMMDD')) / 365)
SET he.current_age = FLOOR(DATEDIFF(CURDATE(), STR_TO_DATE(SUBSTRING (REPLACE(su.id_card, ' ', ''), 7, 8), '%Y%m%d')) / 365) FROM sys_user su
WHERE WHERE he.id = su.id
LENGTH (REPLACE(su.id_card AND LENGTH(REPLACE(su.id_card, ' ', '')) = 18
, ' ' AND su.person_type = '1'
, '')) = 18 AND su.del_flag = 0
and su.person_type = '1' )
and su.del_flag = 0; WHERE EXISTS (
SELECT 1 FROM sys_user su
WHERE he.id = su.id
AND LENGTH(REPLACE(su.id_card, ' ', '')) = 18
AND su.person_type = '1'
AND su.del_flag = 0
)
</update> </update>
</mapper> </mapper>
@@ -46,7 +46,7 @@
<where> <where>
and a.del_flag = '0' and a.del_flag = '0'
<if test="healthUserOperatorEx.userId != null and healthUserOperatorEx.userId != ''"> <if test="healthUserOperatorEx.userId != null and healthUserOperatorEx.userId != ''">
and FIND_IN_SET(a.user_id,#{healthUserOperatorEx.userId}) and INSTR(',' || #{healthUserOperatorEx.userId} || ',', ',' || a.user_id || ',') > 0
</if> </if>
<if test="healthUserOperatorEx.userType != null and healthUserOperatorEx.userType != ''"> <if test="healthUserOperatorEx.userType != null and healthUserOperatorEx.userType != ''">
and a.user_type = #{healthUserOperatorEx.userType} and a.user_type = #{healthUserOperatorEx.userType}
@@ -9,7 +9,7 @@
t2.work_no, t2.work_no,
t2.org_code as userOrgCode t2.org_code as userOrgCode
FROM FROM
`scale_personal` t1 scale_personal t1
LEFT JOIN sys_user t2 on t1.bind_user_id = t2.id LEFT JOIN sys_user t2 on t1.bind_user_id = t2.id
<where> <where>
<if test="managedCodes != null and managedCodes.size() > 0"> <if test="managedCodes != null and managedCodes.size() > 0">
@@ -74,7 +74,7 @@
AND t2.org_code like CONCAT(#{filter.userOrgCode}, '%') AND t2.org_code like CONCAT(#{filter.userOrgCode}, '%')
</if> </if>
</where> </where>
ORDER BY IF(t1.bind_user_id IS NOT NULL AND t1.bind_user_id != '', 0, 1) ORDER BY CASE WHEN t1.bind_user_id IS NOT NULL AND t1.bind_user_id != '' THEN 0 ELSE 1 END
</select> </select>
<select id="getUserInfoBySnCode" resultType="org.jeecg.modules.system.bean.response.ScalePersonalUserInfo"> <select id="getUserInfoBySnCode" resultType="org.jeecg.modules.system.bean.response.ScalePersonalUserInfo">
@@ -107,7 +107,7 @@
and status = 1 and status = 1
and depart_ids is not null and depart_ids is not null
and depart_ids != '' and depart_ids != ''
and FIND_IN_SET(#{departId}, depart_ids) > 0 and INSTR(',' || depart_ids || ',', ',' || #{departId} || ',') > 0
<if test="name != null and name != '' "> <if test="name != null and name != '' ">
and realname like CONCAT('%',#{name},'%') and realname like CONCAT('%',#{name},'%')
</if> </if>
@@ -136,10 +136,10 @@
where sd.del_flag = '0' and sd.status = '1' where sd.del_flag = '0' and sd.status = '1'
</select> </select>
<select id="queryDepartIdsByCodes" resultType="java.lang.String" parameterType="java.lang.String"> <select id="queryDepartIdsByCodes" resultType="java.lang.String" parameterType="java.lang.String">
select GROUP_CONCAT(id) from sys_depart where FIND_IN_SET(org_code,#{orgCodes})>0 select LISTAGG(id, ',') WITHIN GROUP (ORDER BY id) from sys_depart where INSTR(',' || #{orgCodes} || ',', ',' || org_code || ',') > 0
</select> </select>
<select id="queryCodesByDepartIds" resultType="java.lang.String" parameterType="java.lang.String"> <select id="queryCodesByDepartIds" resultType="java.lang.String" parameterType="java.lang.String">
select GROUP_CONCAT(org_code) from sys_depart where FIND_IN_SET(id,#{departIds})>0 select LISTAGG(org_code, ',') WITHIN GROUP (ORDER BY org_code) from sys_depart where INSTR(',' || #{departIds} || ',', ',' || id || ',') > 0
</select> </select>
<insert id="insertGps"> <insert id="insertGps">
insert into sys_depart_gps (id, depart_id, lng, lat) insert into sys_depart_gps (id, depart_id, lng, lat)
@@ -165,7 +165,7 @@
b.lng, b.lng,
b.lat b.lat
from sys_depart a left join sys_depart_gps b on a.id = b.depart_id from sys_depart a left join sys_depart_gps b on a.id = b.depart_id
where FIND_IN_SET(a.id,#{departId}) where INSTR(',' || #{departId} || ',', ',' || a.id || ',') > 0
</select> </select>
@@ -12,6 +12,6 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, app_package, redeem_code, `status`, use_time id, app_package, redeem_code, status, use_time
</sql> </sql>
</mapper> </mapper>
@@ -55,7 +55,7 @@
t3.realname AS applyUserName, t3.realname AS applyUserName,
t5.realname AS opUserName, t5.realname AS opUserName,
t4.current_age AS age t4.current_age AS age
FROM `sys_user_depart_change_apply` t1 FROM sys_user_depart_change_apply t1
LEFT JOIN sys_user t2 ON t1.user_id = t2.id LEFT JOIN sys_user t2 ON t1.user_id = t2.id
LEFT JOIN sys_user t3 ON t1.apply_user_id = t3.id LEFT JOIN sys_user t3 ON t1.apply_user_id = t3.id
LEFT JOIN health_user_employee_ex t4 ON t1.user_id = t4.id LEFT JOIN health_user_employee_ex t4 ON t1.user_id = t4.id
@@ -137,7 +137,7 @@
user_id, user_id,
create_time create_time
FROM FROM
`sys_user_depart_change_apply` sys_user_depart_change_apply
</sql> </sql>
<sql id="statWhereSql"> <sql id="statWhereSql">
and create_time between #{beginOfYear} and #{endOfYear} and create_time between #{beginOfYear} and #{endOfYear}
@@ -275,7 +275,7 @@
<select id="selectGroupIdByName" resultType="String"> <select id="selectGroupIdByName" resultType="String">
select select
GROUP_CONCAT(id) LISTAGG(id, ',') WITHIN GROUP (ORDER BY id)
from sys_user from sys_user
where realname LIKE concat(concat('%',#{realName}),'%') where realname LIKE concat(concat('%',#{realName}),'%')
</select> </select>
@@ -400,11 +400,11 @@
select id as "userId", select id as "userId",
org_code as "orgCode" org_code as "orgCode"
from sys_user from sys_user
where FIND_IN_SET(id,#{userIds}) where INSTR(',' || #{userIds} || ',', ',' || id || ',') > 0
</select> </select>
<select id="getUserNumByOrgCodeList" resultType="java.util.HashMap"> <select id="getUserNumByOrgCodeList" resultType="java.util.HashMap">
SELECT org_code as orgCode, count(org_code) as num SELECT org_code as orgCode, count(org_code) as num
FROM `sys_user` FROM sys_user
WHERE org_code LIKE WHERE org_code LIKE
<foreach collection="orgCodeList" item="orgCode" separator=" OR " open="(" close=")"> <foreach collection="orgCodeList" item="orgCode" separator=" OR " open="(" close=")">
CONCAT('', #{orgCode}, '%') CONCAT('', #{orgCode}, '%')
@@ -582,24 +582,24 @@
</select> </select>
<select id="checkExistUser" resultType="org.jeecg.bean.response.CheckExistUserRes"> <select id="checkExistUser" resultType="org.jeecg.bean.response.CheckExistUserRes">
SELECT 'account' ,1 as count SELECT 'account' as account, 1 as count
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
UNION ALL UNION ALL
select 'userName', count(1) as count FROM sys_user WHERE username = #{userName} and del_flag = 0 select 'userName' as account, CAST(count(1) AS INT) as count FROM sys_user WHERE username = #{userName} and del_flag = 0
<if test="existUserId != null and existUserId != ''"> <if test="existUserId != null and existUserId != ''">
and id != #{existUserId} and id != #{existUserId}
</if> </if>
</if> </if>
<if test="mobile != null and mobile != ''"> <if test="mobile != null and mobile != ''">
UNION ALL UNION ALL
select 'mobile', count(1) as count FROM sys_user WHERE phone = #{mobile} and del_flag = 0 select 'mobile' as account, CAST(count(1) AS INT) as count FROM sys_user WHERE phone = #{mobile} and del_flag = 0
<if test="existUserId != null and existUserId != ''"> <if test="existUserId != null and existUserId != ''">
and id != #{existUserId} and id != #{existUserId}
</if> </if>
</if> </if>
<if test="idCard != null and idCard != ''"> <if test="idCard != null and idCard != ''">
UNION ALL UNION ALL
select 'idCard', count(1) as count FROM sys_user WHERE id_card = #{idCard} and del_flag = 0 select 'idCard' as account, CAST(count(1) AS INT) as count FROM sys_user WHERE id_card = #{idCard} and del_flag = 0
<if test="existUserId != null and existUserId != ''"> <if test="existUserId != null and existUserId != ''">
and id != #{existUserId} and id != #{existUserId}
</if> </if>
@@ -1016,7 +1016,7 @@
LEFT JOIN health_user_employee_ex e on u.id = e.id LEFT JOIN health_user_employee_ex e on u.id = e.id
WHERE 1=1 WHERE 1=1
<if test="ex.sex != null and ex.sex != ''"> <if test="ex.sex != null and ex.sex != ''">
AND FIND_IN_SET(u.sex, #{ex.sex}) AND INSTR(',' || #{ex.sex} || ',', ',' || u.sex || ',') > 0
</if> </if>
<if test="ex.dataAgeAnalysis != null and ex.dataAgeAnalysis != ''"> <if test="ex.dataAgeAnalysis != null and ex.dataAgeAnalysis != ''">
AND ( AND (
@@ -1029,19 +1029,19 @@
) )
</if> </if>
<if test="ex.empNation != null and ex.empNation != ''"> <if test="ex.empNation != null and ex.empNation != ''">
AND FIND_IN_SET(e.emp_nation, #{ex.empNation}) AND INSTR(',' || #{ex.empNation} || ',', ',' || e.emp_nation || ',') > 0
</if> </if>
<if test="ex.empPolitical != null and ex.empPolitical != ''"> <if test="ex.empPolitical != null and ex.empPolitical != ''">
AND FIND_IN_SET(e.emp_political, #{ex.empPolitical}) AND INSTR(',' || #{ex.empPolitical} || ',', ',' || e.emp_political || ',') > 0
</if> </if>
<if test="ex.jobLevel != null and ex.jobLevel != ''"> <if test="ex.jobLevel != null and ex.jobLevel != ''">
AND FIND_IN_SET(e.job_level, #{ex.jobLevel}) AND INSTR(',' || #{ex.jobLevel} || ',', ',' || e.job_level || ',') > 0
</if> </if>
<if test="ex.empMarriage != null and ex.empMarriage != ''"> <if test="ex.empMarriage != null and ex.empMarriage != ''">
AND FIND_IN_SET(e.emp_marriage, #{ex.empMarriage}) AND INSTR(',' || #{ex.empMarriage} || ',', ',' || e.emp_marriage || ',') > 0
</if> </if>
<if test="ex.userGroup != null and ex.userGroup != ''"> <if test="ex.userGroup != null and ex.userGroup != ''">
AND FIND_IN_SET(u.user_group, #{ex.userGroup}) AND INSTR(',' || #{ex.userGroup} || ',', ',' || u.user_group || ',') > 0
</if> </if>
<if test="ex.orgCodeList != null and ex.orgCodeList.size() > 0"> <if test="ex.orgCodeList != null and ex.orgCodeList.size() > 0">
AND ( AND (