diff --git a/renren-admin/src/main/resources/mapper/device/TbDeviceDao.xml b/renren-admin/src/main/resources/mapper/device/TbDeviceDao.xml index a82cda63..0815b9dd 100644 --- a/renren-admin/src/main/resources/mapper/device/TbDeviceDao.xml +++ b/renren-admin/src/main/resources/mapper/device/TbDeviceDao.xml @@ -18,7 +18,7 @@ SELECT sd.name AS deptName, tdr.name AS resourceName, tdr.type, tdr.create_date AS createDate, - if(tdr.del_flag=0, '审核通过', '审核中') AS approveStatus, trma.instance_id AS applyNumber - FROM (SELECT IF(d.type='组件服务', A.attr_value, d.type) AS type, d.id, d.del_flag, d.dept_id, d.create_date, + CASE WHEN (tdr.del_flag=0 OR tdr.del_flag=5) THEN '通过' WHEN tdr.del_flag=6 THEN '不通过' ELSE '审核中' END AS approveStatus, trma.instance_id AS applyNumber + FROM (SELECT IF(d.type='组件服务', a.attr_value, d.type) AS type, d.id, d.del_flag, d.dept_id, d.create_date, d.name FROM tb_data_resource d LEFT JOIN tb_data_attr a ON d.id=a.data_resource_id AND a.attr_type='组件类型' AND a.del_flag=0 @@ -1845,13 +1845,16 @@ WHERE 1=1 AND tdr.dept_id=sd.id - AND tdr.del_flag = 0 + AND tdr.del_flag in (0, 5) - AND tdr.del_flag in (2, 3) + AND tdr.del_flag not in (0, 1, 5, 6) + + + AND tdr.del_flag=6 - AND tdr.del_flag in (0, 2, 3) + AND tdr.del_flag != 1 @@ -1904,14 +1907,6 @@ AND su.dept_id = sd.id AND taa.resource_id = tdr.id AND dept.id = tdr.dept_id - AND taa.approve_status = #{approveStatus} @@ -1925,22 +1920,34 @@ AND SUBSTR(taa.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate} + + UNION ALL - UNION ALL - - SELECT - tmb.dept AS 'deptName', - tm.`name` AS 'resourceName', - '青岛市大数据发展管理局' AS 'resourceDeptName', - '会议室' AS 'type', - tm.create_date AS 'createDate', - CASE tmb.state WHEN 1 THEN '申请中' WHEN 2 THEN '通过' WHEN 3 THEN '不通过' ELSE '申请中' END AS 'approveStatus', - '' AS 'applyNumber' - FROM - t_meetingroom_book tmb, - t_meetingroom tm - WHERE - tmb.room_id = tm.id + SELECT + tmb.dept AS 'deptName', + tm.`name` AS 'resourceName', + '青岛市大数据发展管理局' AS 'resourceDeptName', + '会议室' AS 'type', + tm.create_date AS 'createDate', + CASE tmb.state WHEN 1 THEN '审核中' WHEN 2 THEN '通过' WHEN 3 THEN '不通过' ELSE '审核中' END AS 'approveStatus', + '' AS 'applyNumber' + FROM + t_meetingroom_book tmb, + t_meetingroom tm + WHERE + tmb.room_id = tm.id + + + AND tmb.state=2 + + + AND tmb.state=3 + + + AND tmb.state not in (2, 3) + + + ORDER BY createDate DESC