← 返回数据库字典主页

v_钉钉员工表 视图

数据库: neuron_new  |  视图名: v_钉钉员工表  |  字段数: 23  |  生成时间: 2025-12-01 21:25:59
v_钉钉员工表 视图 · 23 字段
VIEW
视图定义
CREATE ALGORITHM=UNDEFINED DEFINER=`neuron_new`@`%` SQL SECURITY DEFINER VIEW `v_钉钉员工表` AS select `e`.`name` AS `员工姓名`,`e`.`mobile` AS `手机号`,(select substring_index(`d`.`full_path`,'/',1) from `department_mapping` `d` where ((`d`.`dept_id` = coalesce(`e`.`main_dept_id`,cast(json_extract(`e`.`dept_id_list`,'$[0]') as unsigned))) and (`d`.`is_active` = 1)) limit 1) AS `所属公司`,(select substring_index(`d`.`full_path`,'/',-(1)) from `department_mapping` `d` where ((`d`.`dept_id` = coalesce(`e`.`main_dept_id`,cast(json_extract(`e`.`dept_id_list`,'$[0]') as unsigned))) and (`d`.`is_active` = 1)) limit 1) AS `所属部门`,`e`.`userid` AS `钉钉用户ID`,`e`.`email` AS `邮箱`,`e`.`title` AS `职位`,`e`.`job_number` AS `工号`,`e`.`hired_date` AS `入职日期`,`e`.`work_place` AS `工作地点`,`e`.`remark` AS `备注`,`e`.`active` AS `是否在职`,`e`.`admin` AS `是否管理员`,`e`.`boss` AS `是否老板`,`e`.`leader` AS `是否领导`,coalesce(`e`.`main_dept_id`,cast(json_extract(`e`.`dept_id_list`,'$[0]') as unsigned)) AS `主部门ID`,(select `d`.`full_path` from `department_mapping` `d` where ((`d`.`dept_id` = coalesce(`e`.`main_dept_id`,cast(json_extract(`e`.`dept_id_list`,'$[0]') as unsigned))) and (`d`.`is_active` = 1)) limit 1) AS `部门完整路径`,(select `d`.`dept_level` from `department_mapping` `d` where ((`d`.`dept_id` = coalesce(`e`.`main_dept_id`,cast(json_extract(`e`.`dept_id_list`,'$[0]') as unsigned))) and (`d`.`is_active` = 1)) limit 1) AS `部门层级`,`e`.`dept_id_list` AS `所有部门ID列表`,`e`.`sync_source` AS `同步来源`,`e`.`sync_time` AS `同步时间`,`e`.`created_at` AS `创建时间`,`e`.`updated_at` AS `更新时间` from `dingtalk_employee_raw` `e`
字段信息
字段名 类型 必填 说明 关联关系
员工姓名 varchar(100) 员工姓名 -
手机号 varchar(20) 手机号 -
所属公司 varchar(500) - -
所属部门 varchar(500) - -
钉钉用户ID varchar(100) 钉钉用户ID-唯一标识 -
邮箱 varchar(100) 邮箱地址 -
职位 varchar(100) 职位 -
工号 varchar(50) 工号 -
入职日期 datetime 入职日期-从毫秒时间戳转换 -
工作地点 varchar(200) 工作地点 -
备注 varchar(500) 备注 -
是否在职 tinyint(1) 是否激活-0否-1是 -
是否管理员 tinyint(1) 是否管理员-0否-1是 -
是否老板 tinyint(1) 是否老板-0否-1是 -
是否领导 tinyint(1) 是否领导-0否-1是 -
主部门ID decimal(65,0) - -
部门完整路径 varchar(500) - -
部门层级 bigint(11) - -
所有部门ID列表 json 部门ID列表-JSON数组格式-如[567655024,657421344,1] -
同步来源 varchar(50) 数据来源-list=批量接口-get=详情接口-webhook=钉钉推送 -
同步时间 datetime 同步时间 -
创建时间 datetime 创建时间 -
更新时间 datetime 更新时间 -
索引信息
无索引
相关表
v_current_performance_config v_employee_with_dept v_按天业绩统计_净实收计算 v_销售业绩 v_销售业绩_快照版 conversation_sessions crm_member_orders customer_pool_proxy department_mapping dingtalk_employee_raw employee_roster n8n_html_reports notification order_salesperson_snapshot performance_verification sales_amount_manual_input star_subject weike_phone_mapping wm_order_discounts wm_order_items wm_order_rights wm_orders