zoukankan      html  css  js  c++  java
  • mySql查询-系统公告发布接收人情况

    -- display_name NZ分部所有用户
    SELECT user_code,display_name FROM scy_user WHERE ou_id=1627 AND is_deleted=0

    -- NZ第二分部下用户
    SELECT user_code,display_name FROM scy_user WHERE ou_id=1629 AND is_deleted=0

    -- NZ分部下所有店铺关联职员及关联用户 d.display_name,c.employee_name,a.shop_name,a.shop_code

    SELECT d.`user_code`,d.`display_name`,d.`employee_name`,a.`shop_name` FROM bas_shop a
    LEFT JOIN
    bas_employee_shop b ON a.id = b.shop_id
    LEFT JOIN
    bas_employee c ON b.employee_id =c.id
    LEFT JOIN
    scy_user d ON c.id = d.employee_id
    WHERE
    a.ou_id=1627 AND a.is_deleted=0 AND b.is_deleted=0 AND c.is_deleted=0


    SELECT * FROM bas_shop WHERE ou_id=1627 AND is_deleted=0
    SELECT * FROM bas_employee_shop WHERE ou_id=1627 AND is_deleted=0
    SELECT * FROM bas_employee WHERE is_deleted=0 AND group_id=61
    SELECT employee_id FROM scy_user WHERE ou_id=1627 AND is_deleted=0

    -- NZ第二分部下所有店铺关联职员及关联用户
    SELECT * FROM bas_shop a
    LEFT JOIN
    bas_employee_shop b ON a.id = b.shop_id
    LEFT JOIN
    bas_employee c ON b.employee_id =c.id
    LEFT JOIN
    scy_user d ON c.id = d.employee_id
    WHERE
    a.ou_id=1629 AND a.is_deleted=0 AND b.is_deleted=0 AND c.is_deleted=0


    -- NZ分部下单个店铺关联职员及关联用户
    SELECT * FROM bas_shop a
    LEFT JOIN
    bas_employee_shop b ON a.id = b.shop_id
    LEFT JOIN
    bas_employee c ON b.employee_id =c.id
    LEFT JOIN
    scy_user d ON c.id = d.employee_id
    WHERE
    a.ou_id=1627 AND a.is_deleted=0 AND b.is_deleted=0 AND c.is_deleted=0 AND shop_name='华西总店'

    -- NZ分部下所有部门关联职员及关联用户
    SELECT a.user_code,a.display_name,a.employee_name,d.dept_name FROM scy_user a
    LEFT JOIN
    bas_employee b ON a.employee_id = b.id
    LEFT JOIN
    bas_employee_dept c ON b.id=c.employee_id
    LEFT JOIN
    bas_dept d ON c.dept_id = d.id
    WHERE
    a.ou_id=1627 AND a.is_deleted=0


    -- NZ第二分部下所有部门关联职员及关联用户
    SELECT a.display_name,a.employee_name,d.dept_name FROM scy_user a
    LEFT JOIN
    bas_employee b ON a.employee_id = b.id
    LEFT JOIN
    bas_employee_dept c ON b.id=c.employee_id
    LEFT JOIN
    bas_dept d ON c.dept_id = d.id
    WHERE
    a.group_id=1629 AND a.is_deleted=0

  • 相关阅读:
    Shiro自定义密码匹配认证
    logback 发送邮件和自定义发送邮件;java类发送邮件
    webVR全景图多种方案实现(pannellum,aframe,Krpano,three,jquery-vrview)
    前端接受后端文件流并下载的几种方法
    回流(reflow)与重绘(repaint)
    JS数组去重的几种常见方法
    React 生命周期
    浅谈React工作原理
    如何在Vue项目中使用vw实现移动端适配
    移动端web整理 移动端问题总结,移动web遇到的那些坑
  • 原文地址:https://www.cnblogs.com/wenna-sblog/p/12737764.html
Copyright © 2011-2022 走看看