a.id,
a.warning_id,
a.bus_dept_id,
a.bus_dept_code,
a.bus_dept_name,
a.emp_name,
a.emp_idcard,
a.emp_phone,
a.send_date,
a.CREATE_USER,
a.send_status,
a.remark,
a.Biz_Id,
a.update_status,
a.message,
a.BUSINESS_TELECOM_NUMBER,
a.cert_type,
a.NOT_USED_VACATION_DURATION
AND a.id = #{tBusWarningEmployee.id}
AND a.warning_id = #{tBusWarningEmployee.warningId}
AND a.bus_dept_id = #{tBusWarningEmployee.busDeptId}
AND a.bus_dept_code = #{tBusWarningEmployee.busDeptCode}
AND a.bus_dept_name = #{tBusWarningEmployee.busDeptName}
AND a.emp_name = #{tBusWarningEmployee.empName}
AND a.emp_idcard = #{tBusWarningEmployee.empIdcard}
AND a.emp_phone = #{tBusWarningEmployee.empPhone}
AND a.send_date = #{tBusWarningEmployee.sendDate}
AND a.CREATE_USER = #{tBusWarningEmployee.createUser}
AND a.send_status = #{tBusWarningEmployee.sendStatus}
AND a.remark = #{tBusWarningEmployee.remark}
AND a.Biz_Id = #{tBusWarningEmployee.bizId}
AND a.update_status = #{tBusWarningEmployee.updateStatus}
AND a.message = #{tBusWarningEmployee.message}
AND a.send_date >= concat(#{tBusWarningEmployee.sendDateStart},' 00:00:00')
AND a.send_date concat(#{tBusWarningEmployee.sendDateEnd},' 23:59:59')
AND a.BUSINESS_TELECOM_NUMBER like concat('%', #{tBusWarningEmployee.businessTelecomNumber}, '%')
update t_bus_warning_employee e set e.send_status = #{sendStatus},e.update_status = #{updateStatus} where e.Biz_Id = #{bizId}
INSERT into
t_bus_warning_employee
set warning_id = #{se.warningId},bus_dept_id = #{se.busDeptId},bus_dept_code = #{se.busDeptCode},bus_dept_name = #{se.busDeptName}
,emp_name = #{se.empName},EMP_IDCARD = #{se.empIdcard},EMP_PHONE = #{se.empPhone},send_date = #{se.sendDate}
,CREATE_USER = #{se.createUser},send_status = #{se.sendStatus},Biz_Id = #{se.bizId},update_status = #{se.updateStatus}
,BUSINESS_TELECOM_NUMBER = #{se.businessTelecomNumber},cert_type = #{se.certType},NOT_USED_VACATION_DURATION = #{se.notUsedVacationDuration}
update t_bus_warning_employee e set e.Biz_Id = #{newBizId} where e.Biz_Id = #{oldBizId}
INSERT into t_bus_warning_employee
(warning_id,bus_dept_id,bus_dept_code,bus_dept_name,emp_name,EMP_IDCARD,EMP_PHONE,send_date,CREATE_USER,send_status,Biz_Id,update_status,business_telecom_number,cert_type)
SELECT #{warningId} warning_id,d.id bus_dept_id,d.tree_logo bus_dept_code,d.name bus_dept_name,c.emp_name,c.EMP_IDCARD,e.phone EMP_PHONE
,now() send_date, #{userId} CREATE_USER,'1' send_status,#{bizId} Biz_Id,'0' update_status,c.business_telecom_number,sd.label cert_type
FROM t_cert_info c
left join t_bus_dept d on d.id=c.organ_id
left join sys_bus_dict sd on sd.value=c.cert_type and sd.item_type = 'cert_type'
join view_employee_phone e on e.dx_no = c.business_telecom_number
where datediff(c.review_date,now()) = #{days} and c.delete_flag ='0'
and not exists (
select 1 from t_bus_leave l where l.tele_no = c.business_telecom_number
)
GROUP BY c.id
INSERT into t_bus_warning_employee
(warning_id,bus_dept_id,bus_dept_code,bus_dept_name,emp_name,EMP_IDCARD,EMP_PHONE,send_date,CREATE_USER,send_status,Biz_Id,update_status,business_telecom_number,cert_type)
SELECT #{warningId} warning_id,d.id bus_dept_id,d.tree_logo bus_dept_code,d.name bus_dept_name,c.emp_name,c.EMP_IDCARD,e.phone EMP_PHONE
,now() send_date, #{userId} CREATE_USER,'1' send_status,#{bizId} Biz_Id,'0' update_status,c.business_telecom_number,sd.label cert_type
FROM t_cert_info c
left join sys_bus_dict sd on sd.value=c.cert_type and sd.item_type = 'cert_type'
left join t_bus_dept d on d.id=c.organ_id
join view_employee_phone e on e.dx_no = c.business_telecom_number
where datediff(c.term_validity_end,now()) = #{days} and c.delete_flag ='0'
and not exists (
select 1 from t_bus_leave l where l.tele_no = c.business_telecom_number
)
GROUP BY c.id
INSERT into t_bus_warning_employee
(warning_id,bus_dept_id,bus_dept_code,bus_dept_name,emp_name,EMP_IDCARD,EMP_PHONE,send_date,CREATE_USER,send_status,Biz_Id,update_status,business_telecom_number,NOT_USED_VACATION_DURATION)
SELECT #{warningId} warning_id,d.id bus_dept_id,d.tree_logo bus_dept_code,d.name bus_dept_name,c.emp_name,c.EMP_IDCARD,e.phone EMP_PHONE
,now() send_date, #{userId} CREATE_USER,'1' send_status,#{bizId} Biz_Id,'0' update_status,c.business_telecom_number,concat(c.NOT_USED_VACATION_DURATION,'小时')
FROM t_vacation_monitor c
left join t_bus_dept d on d.id=c.DEPART_ID
join view_employee_phone e on e.dx_no = c.business_telecom_number
where c.NOT_USED_VACATION_DURATION>0 and DATE_FORMAT(now(),'%Y') = c.VACATION_YEAR
and not exists (
select 1 from t_bus_leave l where l.tele_no = c.business_telecom_number
)
GROUP BY c.id