且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

(case when length(p.name)>25 then concat(substring(p.name,1,12),'...') else p.name end) as projectName

更新时间:2022-08-21 17:36:11

SELECT DISTINCT
pw.project_id as projectId ,
(case when length(p.name)>25 then concat(substring(p.name,1,12),'...') else p.name end) as projectName
FROM project_warning pw
join warning_detail wd on pw.id = wd.warning_id
join project p on p.id = pw.project_id
join department d on d.dept_no = p.deparmtent_id
where d.dept_name like concat('信息平台事业部-',ifnull(
(select reverse(substring_index(reverse(substring_index((select dept_name from department where dept_no=:deptNo), '-', 2)), '-', 1)))
,''),'%')
and date(pw.create_date) = date(now())
order by pw.id asc limit 5