Merge remote-tracking branch '备份/dev' into dev

# Conflicts:
#	renren-admin/src/main/resources/mapper/resource/ResourceDao.xml
This commit is contained in:
wangliwen 2022-10-17 13:11:30 +08:00
commit 0d44e8c81c
3 changed files with 40 additions and 30 deletions

View File

@ -91,6 +91,10 @@ public class TbDeviceApplyServiceImpl extends CrudServiceImpl<TbDeviceApplyDao,
params.put("states", stateList);
List<TbDeviceApplyDTO> dtoList = tbDeviceApplyDao.queryList(params);
List<TbDeviceApplyDTO> 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());
}
}

View File

@ -18,7 +18,7 @@
</resultMap>
<select id="getDeviceDTOList" resultMap="deviceDTO">
select td.*, IFNULL(tda.state,1) as state from tb_device td left join tb_device_apply tda on td.id=tda.device_id
select td.*, IFNULL(ANY_VALUE(tda.state),1) as state from tb_device td left join tb_device_apply tda on td.id=tda.device_id
<if test="userId != null and userId != ''">
and tda.creator = #{userId}
</if>

View File

@ -1838,8 +1838,8 @@
<select id="selectCensusResourceTable" resultType="java.util.Map">
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
@ -1849,13 +1849,16 @@
WHERE 1=1 AND tdr.dept_id=sd.id
<choose>
<when test="approveStatus != null and approveStatus == '通过'">
AND tdr.del_flag = 0
AND tdr.del_flag in (0, 5)
</when>
<when test="approveStatus != null and approveStatus == '审核中'">
AND tdr.del_flag in (2, 3)
AND tdr.del_flag not in (0, 1, 5, 6)
</when>
<when test="approveStatus != null and approveStatus == '不通过'">
AND tdr.del_flag=6
</when>
<otherwise>
AND tdr.del_flag in (0, 2, 3)
AND tdr.del_flag != 1
</otherwise>
</choose>
<if test="deptId != null and deptId != ''">
@ -1908,14 +1911,6 @@
AND su.dept_id = sd.id
AND taa.resource_id = tdr.id
AND dept.id = tdr.dept_id
<!--<choose>
<when test="approveStatus != null and approveStatus != ''">
AND taa.approve_status = #{approveStatus}
</when>
<otherwise>
AND taa.approve_status != '不通过'
</otherwise>
</choose> -->
<if test="approveStatus != null and approveStatus != ''">
AND taa.approve_status = #{approveStatus}
</if>
@ -1929,7 +1924,7 @@
AND SUBSTR(taa.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate}
</if>
<if test="type == null or type == '' or type == '会议室'">
UNION ALL
SELECT
@ -1938,14 +1933,25 @@
'青岛市大数据发展管理局' 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',
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
<choose>
<when test="approveStatus != null and approveStatus == '通过'">
AND tmb.state=2
</when>
<when test="approveStatus != null and approveStatus == '不通过'">
AND tmb.state=3
</when>
<when test="approveStatus != null and approveStatus == '审核中'">
AND tmb.state not in (2, 3)
</when>
</choose>
</if>
ORDER BY createDate DESC
</select>