sql小记

-- 昨日注册员工数
SELECT COUNT(0) as '昨日注册员工数' FROM wuc_user  WHERE DATE_ADD(CURDATE(),INTERVAL -1 day) = DATE(create_time) and is_del = 0;

SELECT COUNT(0) as '昨日注册员工数' FROM wuc_user WHERE TO_DAYS(NOW()) - TO_DAYS(create_time) = 1 and is_del = 0;

-- 截止昨日已注册员工数
SELECT COUNT(0) as '截止昨日已注册员工数' FROM wuc_user   WHERE DATE_ADD(CURDATE(),INTERVAL -1 day) >= DATE(create_time) and is_del = 0;

-- 项目员工总数
SELECT COUNT(0) as '项目员工总数' FROM wuc_user_project_info where is_del = 0;

-- 昨日记工人数
SELECT COUNT(0) as '昨日记工人数' FROM wuc_labourer_work_record WHERE DATE_ADD(CURDATE(),INTERVAL -1 day) = DATE(create_time) and is_del = 0;

-- 截止昨日已记工员工数
SELECT COUNT(0) as '截止昨日已记工员工数' FROM wuc_labourer_work_record WHERE DATE_ADD(CURDATE(),INTERVAL -1 day) >= DATE(create_time) and is_del = 0;


-- 记工确认数  
SELECT COUNT(0) as '记工确认数' from wuc_labourer_work_record where confirm_status = 3 and is_del = 0;
-- 记工总数
SELECT COUNT(0) as '记工总数' from wuc_labourer_work_record where is_del = 0;
-- 注册班组数 
SELECT COUNT(0) as '注册班组数' from wuc_labourer_team where is_del = 0 and header_id is null;
-- 今日注册班组数
SELECT COUNT(0) as '今日注册班组数' from wuc_labourer_team where TO_DAYS(create_time) = TO_DAYS(NOW()) and is_del = 0 and header_id is null;
-- 合同完成数
SELECT COUNT(0) as '合同完成数' from wuc_labourer_contract_check where confirm_status = 3 and is_del = 0;
-- 今日合同完成数
SELECT COUNT(0) as '今日合同完成数' from wuc_labourer_contract_check where confirm_status = 3 and TO_DAYS(employee_check_time) = TO_DAYS(NOW()) and is_del = 0;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值