From 64e53c35351e20baa4b7dcfd5040131bbab5a20f Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Fri, 14 Oct 2022 14:57:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/device/TbDeviceDao.xml | 2 +- .../resources/mapper/resource/ResourceDao.xml | 63 ++++++++++--------- 2 files changed, 36 insertions(+), 29 deletions(-) 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 From 85d1e9eddf9afdcf48a797956ae05f1de2353d23 Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Fri, 14 Oct 2022 17:23:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=BE=E5=A4=87=E8=AF=A6=E6=83=85=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/device/service/Impl/TbDeviceApplyServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/renren-admin/src/main/java/io/renren/modules/device/service/Impl/TbDeviceApplyServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/device/service/Impl/TbDeviceApplyServiceImpl.java index 05ee2fe3..4fc7d50e 100644 --- a/renren-admin/src/main/java/io/renren/modules/device/service/Impl/TbDeviceApplyServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/device/service/Impl/TbDeviceApplyServiceImpl.java @@ -91,6 +91,10 @@ public class TbDeviceApplyServiceImpl extends CrudServiceImpl dtoList = tbDeviceApplyDao.queryList(params); List result = dtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList()); + result.stream().forEach(it -> { + it.setTbDeviceDTO(tbDeviceService.get(it.getDeviceId())); + it.setAuditorName(sysUserService.get(it.getAuditor()).getRealName()); + }); return new PageData(result, dtoList.size()); } }