select a.sid,o.name as orgName,a.name, IFNULL(a.`status`,"") as status ,l.g as level ,o.linkman,o.phone,a.create_date,a.record_no
from dj_system_apply a, dj_system_level l ,zk_test_org o
where a.sid=l.system_sid and a.org_sid=o.sid and a.`status`="通过"
and o.name LIKE "%${orgName}%"
order by create_date
select count(*)
from dj_system_apply a, dj_system_level l ,zk_test_org o
where a.sid=l.system_sid and a.org_sid=o.sid and a.`status`="通过"
and o.name LIKE "%${orgName}%"
SELECT w.* from
(select ss.sid ,MAX(pp.report_date) as report_date from zk_system ss LEFT JOIN zk_project pp ON ss.sid=pp.system_sid GROUP BY ss.sid) u ,
(select s.sid as ssid, p.sag_level,p.report_date,a.sid,o.name as orgName,a.name, IFNULL(a.`status`,"") as status ,l.g as level ,o.linkman,o.phone,a.create_date,a.record_no
from dj_system_apply a, dj_system_level l ,zk_test_org o ,zk_system s LEFT JOIN zk_project p ON s.sid=p.system_sid
where a.sid=l.system_sid and a.org_sid=o.sid and a.record_no=s.record_no) w
WHERE u.sid=w.ssid AND u.report_date=w.report_date AND
((w.sag_level="d02" AND YEAR(u.report_date)=YEAR(NOW()))OR
(w.sag_level="d03" AND u.report_date between date_sub(now(),interval 2 year) and now()))
AND w.orgName LIKE "%${orgName}%"
and w.`status`="通过"
order by w.create_date DESC
SELECT count(*) from
(select ss.sid ,MAX(pp.report_date) as report_date from zk_system ss LEFT JOIN zk_project pp ON ss.sid=pp.system_sid GROUP BY ss.sid) u ,
(select s.sid as ssid, p.sag_level,p.report_date,a.sid,o.name as orgName,a.name, IFNULL(a.`status`,"") as status ,l.g as level ,o.linkman,o.phone,a.create_date,a.record_no
from dj_system_apply a, dj_system_level l ,zk_test_org o ,zk_system s LEFT JOIN zk_project p ON s.sid=p.system_sid
where a.sid=l.system_sid and a.org_sid=o.sid and a.record_no=s.record_no) w
WHERE u.sid=w.ssid AND u.report_date=w.report_date AND
((w.sag_level="d02" AND YEAR(u.report_date)=YEAR(NOW()))OR
(w.sag_level="d03" AND u.report_date between date_sub(now(),interval 2 year) and now()))
AND w.orgName LIKE "%${orgName}%"
and w.`status`="通过"
SELECT w.* from
(select ss.sid ,MAX(pp.report_date) as report_date from zk_system ss LEFT JOIN zk_project pp ON ss.sid=pp.system_sid GROUP BY ss.sid) u ,
(select s.sid as ssid, p.sag_level,p.report_date,a.sid,o.name as orgName,a.name, IFNULL(a.`status`,"") as status ,l.g as level ,o.linkman,o.phone,a.create_date,a.record_no
from dj_system_apply a, dj_system_level l ,zk_test_org o ,zk_system s LEFT JOIN zk_project p ON s.sid=p.system_sid
where a.sid=l.system_sid and a.org_sid=o.sid and a.record_no=s.record_no) w
WHERE u.sid=w.ssid AND u.report_date=w.report_date AND
((w.sag_level="d02" AND DATE_SUB(CURDATE(), INTERVAL 1 year) > date(u.report_date))OR
(w.sag_level="d03" AND DATE_SUB(CURDATE(), INTERVAL 2 year) > date(u.report_date)) )
AND w.orgName LIKE "%${orgName}%"
and w.`status`="通过"
order by w.create_date DESC
SELECT count(*) from
(select ss.sid ,MAX(pp.report_date) as report_date from zk_system ss LEFT JOIN zk_project pp ON ss.sid=pp.system_sid GROUP BY ss.sid) u ,
(select s.sid as ssid, p.sag_level,p.report_date,a.sid,o.name as orgName,a.name, IFNULL(a.`status`,"") as status ,l.g as level ,o.linkman,o.phone,a.create_date,a.record_no
from dj_system_apply a, dj_system_level l ,zk_test_org o ,zk_system s LEFT JOIN zk_project p ON s.sid=p.system_sid
where a.sid=l.system_sid and a.org_sid=o.sid and a.record_no=s.record_no) w
WHERE u.sid=w.ssid AND u.report_date=w.report_date AND
((w.sag_level="d02" AND DATE_SUB(CURDATE(), INTERVAL 1 year) > date(u.report_date))OR
(w.sag_level="d03" AND DATE_SUB(CURDATE(), INTERVAL 2 year) > date(u.report_date)) )
AND w.orgName LIKE "%${orgName}%"
and w.`status`="通过"
select a.sid,o.name as orgName,a.name, IFNULL(a.`status`,"") as status ,l.g as level ,o.linkman,o.phone,a.create_date,a.record_no
from dj_system_apply a, dj_system_level l ,zk_test_org o
where a.sid=l.system_sid and a.org_sid=o.sid and( a.record_no='' or a.record_no is NULL or 0=(select count(*) from zk_system s where a.record_no=s.record_no))
AND o.name LIKE "%${orgName}%"
and a.`status`="通过"
order by a.create_date DESC
SELECT count(*) from dj_system_apply a, dj_system_level l ,zk_test_org o
where a.sid=l.system_sid and a.org_sid=o.sid and( a.record_no='' or a.record_no is NULL or 0=(select count(*) from zk_system s where a.record_no=s.record_no))
and a.`status`="通过"
AND o.name LIKE "%${orgName}%"
select DATE_FORMAT(create_date,'%Y-%m') AS date_key,count(*) as num from dj_system_apply where `status`="通过"
GROUP BY DATE_FORMAT(create_date,'%Y-%m') ORDER BY DATE_FORMAT(create_date,'%Y-%m') DESC LIMIT 6
select year(create_date) year,count(*) as num from dj_system_apply where `status`="通过" GROUP BY year(create_date) ORDER BY year(create_date) desc
SELECT count(*) from
(select ss.sid ,MAX(pp.report_date) as report_date from zk_system ss LEFT JOIN zk_project pp ON ss.sid=pp.system_sid GROUP BY ss.sid) u ,
(select s.sid as ssid, p.sag_level,p.report_date,a.sid,o.name as orgName,a.name, IFNULL(a.`status`,"") as status ,l.g as level ,o.linkman,o.phone,a.create_date,a.record_no
from dj_system_apply a, dj_system_level l ,zk_test_org o ,zk_system s LEFT JOIN zk_project p ON s.sid=p.system_sid
where a.sid=l.system_sid and a.org_sid=o.sid and a.record_no=s.record_no and o.city =#{city}) w
WHERE u.sid=w.ssid AND u.report_date=w.report_date AND
((w.sag_level="d02" AND YEAR(u.report_date)=YEAR(NOW()))OR
(w.sag_level="d03" AND u.report_date between date_sub(now(),interval 2 year) and now()))
and w.`status`="通过"
SELECT count(*) from
(select ss.sid ,MAX(pp.report_date) as report_date from zk_system ss LEFT JOIN zk_project pp ON ss.sid=pp.system_sid GROUP BY ss.sid) u ,
(select s.sid as ssid, p.sag_level,p.report_date,a.sid,o.name as orgName,a.name, IFNULL(a.`status`,"") as status ,l.g as level ,o.linkman,o.phone,a.create_date,a.record_no
from dj_system_apply a, dj_system_level l ,zk_test_org o ,zk_system s LEFT JOIN zk_project p ON s.sid=p.system_sid
where a.sid=l.system_sid and a.org_sid=o.sid and a.record_no=s.record_no and o.city =#{city}) w
WHERE u.sid=w.ssid AND u.report_date=w.report_date AND
((w.sag_level="d02" AND DATE_SUB(CURDATE(), INTERVAL 1 year) > date(u.report_date))OR
(w.sag_level="d03" AND DATE_SUB(CURDATE(), INTERVAL 2 year) > date(u.report_date)) )
and w.`status`="通过"
SELECT count(*) from dj_system_apply a, dj_system_level l ,zk_test_org o
where a.sid=l.system_sid and a.org_sid=o.sid and( a.record_no='' or a.record_no is NULL or 0=(select count(*) from zk_system s where a.record_no=s.record_no))
and a.`status`="通过" and o.city =#{city}