From e06a9091653be33242a2840b7cef10af7b97fff4 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期五, 06 二月 2026 15:35:46 +0800
Subject: [PATCH] 【丽水】首次再次随访人数调整
---
smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml | 83 ++++++++++++++++++++++++++++++++++++-----
1 files changed, 73 insertions(+), 10 deletions(-)
diff --git a/smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml b/smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml
index 3cc633b..915cf2c 100644
--- a/smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml
@@ -15,6 +15,7 @@
<result property="deptType" column="dept_type"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
+ <result property="campusid" column="campusid"/>
</resultMap>
<resultMap id="deptResult" type="com.ruoyi.common.core.domain.entity.SysDept">
@@ -25,6 +26,7 @@
<result property="orderNum" column="order_num"/>
<result property="leader" column="leader"/>
<result property="status" column="dept_status"/>
+ <result property="campusid" column="campusid"/>
</resultMap>
<sql id="selectSysUserDeptVo">
@@ -32,6 +34,7 @@
user_id,
dept_id,
del_flag,
+ campusid,
orgid,
create_time,
update_time,
@@ -44,8 +47,9 @@
<select id="selectSysUserDeptList" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept"
resultMap="SysUserDeptResult">
<include refid="selectSysUserDeptVo"/>
- <where>
- del_flag=0
+ where 1=1
+ and del_flag = 0
+ and orgid=#{orgid}
<if test="userId != null ">
and user_id = #{userId}
</if>
@@ -67,7 +71,9 @@
<if test="deptCode != null ">
and dept_code = #{deptCode}
</if>
- </where>
+ <if test="campusid != null ">
+ and campusid = #{campusid}
+ </if>
</select>
<select id="selectSysUserDeptById" parameterType="Long"
@@ -101,8 +107,15 @@
</if>
<if test="deptName != null ">
dept_name,
- </if> <if test="orgid != null ">
- orgid,
+ </if>
+ <if test="orgid != null ">
+ orgid,
+ </if>
+ <if test="userCode != null ">
+ user_code,
+ </if>
+ <if test="campusid != null ">
+ campusid,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -127,8 +140,15 @@
</if>
<if test="deptName != null ">
#{deptName},
- </if><if test="orgid != null ">
+ </if>
+ <if test="orgid != null ">
#{orgid},
+ </if>
+ <if test="userCode != null ">
+ #{userCode},
+ </if>
+ <if test="campusid != null ">
+ #{campusid},
</if>
</trim>
</insert>
@@ -159,8 +179,12 @@
</if>
<if test="deptName != null ">
dept_name = #{deptName},
- </if> <if test="orgid != null ">
- orgid = #{orgid},
+ </if>
+ <if test="orgid != null ">
+ orgid = #{orgid},
+ </if>
+ <if test="campusid != null ">
+ campusid = #{campusid},
</if>
</trim>
where id = #{id}
@@ -181,11 +205,12 @@
d.ancestors,
d.dept_name,
d.order_num,
+ d.campusid,
d.leader,
d.orgid,
d.status as dept_status
from sys_dept d
- left join sys_user_dept ud on d.dept_id = ud.dept_id
+ left join sys_user_dept ud on d.dept_code = ud.dept_code
where ud.user_id = #{userId}
and ud.del_flag = 0
and d.del_flag = 0
@@ -212,5 +237,43 @@
where user_id =#{userId} and dept_code=#{deptCode}
</update>
-
+ <update id="updateSysUserDeptForSync" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept">
+ update sys_user_dept
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="deptId != null">dept_id =
+ #{deptId},
+ </if>
+ <if test="delFlag != null ">
+ del_flag = #{delFlag},
+ </if>
+ <if test="createTime != null ">
+ create_time = #{createTime},
+ </if>
+ <if test="updateTime != null ">
+ update_time = #{updateTime},
+ </if>
+ <if test="deptType != null ">
+ dept_type = #{deptType},
+ </if>
+ <if test="deptCode != null ">
+ dept_code = #{deptCode},
+ </if>
+ <if test="deptName != null ">
+ dept_name = #{deptName},
+ </if>
+ <if test="orgid != null ">
+ orgid = #{orgid},
+ </if>
+ <if test="campusid != null ">
+ campusid = #{campusid},
+ </if>
+ </trim>
+ where user_id =#{userId}
+ <if test="orgid != null and orgid != ''">
+ and orgid = #{orgid}
+ </if>
+ <if test="campusid != null and campusid != ''">
+ and campusid = #{campusid}
+ </if>
+ </update>
</mapper>
--
Gitblit v1.9.3