中扬CRM客户关系管理系统
#
Junjie
2023-09-08 3041a7d6dba13e237c4f21d3e46b88c35d376bf3
src/main/resources/mapper/UserMapper.xml
@@ -16,6 +16,7 @@
        <result column="sex" property="sex" />
        <result column="create_time" property="createTime" />
        <result column="status" property="status" />
        <result column="target" property="target" />
    </resultMap>
@@ -38,4 +39,30 @@
        ORDER BY su.create_time DESC
    </select>
    <select id="getUserByDept" resultMap="BaseResultMap">
        SELECT
        *
        FROM sys_user
        where 1=1
        <if test="hostId != null and hostId != ''">
            and host_id = #{hostId}
        </if>
        <if test="deptId != null and deptId != ''">
            and dept_id = #{deptId}
        </if>
    </select>
    <select id="getDeptManager" resultMap="BaseResultMap">
        SELECT
        su.*
        FROM sys_user su
        left join sys_role sr on su.role_id = sr.id
        where 1=1
        <if test="hostId != null and hostId != ''">
            and su.host_id = #{hostId}
        </if>
        and su.dept_id = #{deptId}
        and sr.code = 'manager'
    </select>
</mapper>